Hacker Newsnew | past | comments | ask | show | jobs | submit | kazinator's commentslogin

https://www.kylheku.com/cgit/lisp-snippets/tree/monads.lisp

[Content Warning: Lisp]

We define a small OOP framework for monads, plus macros which then can succinctly define different kinds of monads, including generating a comprehension macro for each one.


If you put a child size doll right under the rear wheel, can you see that in the camera? Or under a front wheel, for that matter?

Solve the problem completely or else admit that it's just for twits who can't parallel park.


Repeating decimal fractions are just rationals with 9s in the denominator: .123123123... = 123/999. Fourth grade long division.

I'm not sure what you mean? 1/7 repeats, as well. As does 1/14. As do... a lot of fractions. https://projecteuler.net/problem=26 was a fun problem to explore for some that I remember. Pretty sure there were other problems on this general theme, as well.

My point was strictly that we have "bar notation" in writing to show that 1.3 is not the same as 1.33 or 1.333 or 4/3. No matter how many 3s you put at the end. I don't know of any similar scheme in computers. I'm assuming it has been tried.


1/7 is 142857/999999 from which representation you can readily infer that it is 0.142857 with a bar over it. The 9s are verbose but mean the same thing as a bar over as many fractional digits.

Ah, I see your point, I think. You are just pointing out that any repeating decimal is a ratio. Which, fair, but my question was if a bar representation was ever tried. The idea being that you don't need to have infinite storage to represent a ratio in positional digits any more than you have to use infinite paper to write a ratio's value out.

That is, yes, I know that 1/6 can be used to represent 0.1(6), but if you are already storing something in positional digits, there may have been a benefit to keeping it in positional digits? I'm assuming there was not, in fact, any benefit?


I don't know of a bar representation in a programming or data language. It requires either digit characters that have a bar, or the effect somehow produced via combining characters. Or else a multiline syntax where the coder has to prepare underscores over the digits in the previous line, and this is checked for alignment by the parser.

(We could think of other representations like 0.12'34 or something where the '34 indicates repeating digits. I've not seen that anywhere either, but it would be easy to implement.)


I was assuming a BCD scheme to do something like this, at the binary level. At the text level, I'd assume parens to indicate the group would be common. Is what that Euler problem did, though; so I'm probably just biased on that.

Actually getting the overbar, I wasn't too concerned with. Just noting that we have a way to do it on paper that doesn't require using ratios directly. Or infinite paper. :D

At any rate, this also got me thinking about how to do operations on repeated digits. I'm assuming I would have learned something like this years ago, but I don't remember it. At all. I vaguely remember it was awkward to realize that 0.(9) == 1. But, I don't recall playing with that too much. Is neat to see you should be able to make the general ideas work out just fine after you account for that? Just widen any repeating groups so that they are the same size, and then add. Reduce using the 9 rule.


Working on tail calls for TXR Lisp. Current release provides self tail calls only; and certain cases don't work, like applying in tail position. Plus there is a shadowing bug. These issues are addressed already.

Tail calls between different VM functions are the next challenge. I'm going to somehow have it allocate the VM instance in the same space (if the frame size of the target is larger than the source, "alloca" the difference). The arguments have to be smuggled somehow while we are reinitializing the frame in-place.

I might have a prefix instruction called tail which immediately precedes a call, apply, gcall or gapply. The vm dispatch loop will terminate when it encounters tail similarly to the end instructions. The caller will notice that a tail instruction had been executed, and then precipitate into the tail call logic which will interpret the prefixed instruction in a special way. The calling instruction has to pull out the argument values from whatever registers it refers to. They have to survive the in-place execution somehow.


Badly editorialized headline. The article doesn't actually say C/C++, which would be wrong, since copy constructors are not something common to both C and C++.

I suspect the benefit is greater when the second language is from a completely different family, and has a different writing system.

This is mainly resolved by context. "Penultimate" is a harder word than "pen". Now that could also mean "penitentiary" in North American vernacular, or a box in which a pig is kept, but not in a sentence like "Can I borrow your pen?"

What makes comprehensible input comprehensible? Is that a trick question?

Avoiding unknown vocabulary, or including just a small amount that can be inferred from context; avoiding rare grammatical rules; avoiding stuffing too many clauses into sentences, keeping them short.

Just like a language has a large vocabulary of words of which only a subset is common, a similar observation holds for the grammar rules. Some are used only in very formal/erudite speech or writing. Also, just like your active vocab is not as large as the vocab you understand, the same goes for grammar: you don't wield as many constructs as you grow.

Semantically, avoiding obscure cultural references, culturally rooted unstraightforward metaphors, figures of speech or idioms.

Avoiding difficult topics. E.g. "I have a pen" vs. explaining Karl Popper's logical positivism.

It's much easier to acquire the "household" dialect of a language than to be able to understand news about politics, scientific papers, or literary essays.


Naproxen works like acetaminophen, ibuprofen and others. Yet, it lasts several times longer thanks to its long half life. One naproxen replaces three or four acetaminophens.

I suspect that is because people's moral responsibility has a large component of "who is on the hook for this". Nothing stirs moral sensibility better than being solely responsible and easily identified.

Those whose moral sense is dulled when they follow orders arguably don't actually have a genuine sense of moral responsibility beyond evading blame.


There is more than one way to come to the same moral conclusion

https://en.wikipedia.org/wiki/Lawrence_Kohlberg's_stages_of_...

Recently somebody asked "What do you think about the ethics of lying on your resume?" and my answer was "You'll get fired if you get caught" which I think is a good answer which should be convincing to most people even if it doesn't represent the highest level of ethics.


How shall we steelman the idea that monarchism (as argued by de Maistre) is the best foil for syndicalo-technocratism ?

>Despite his preference for monarchy, Maistre acknowledged that republics could be the superior form of government, depending on the situation and the people. Maistre also defended the government of the United States because its people were heirs to the democratic spirit of Great Britain, which he felt France lacked.

https://en.wikipedia.org/wiki/Louis_Claude_de_Saint-Martin#W...

>Saint-Martin taught that humanity possesses a faculty that is superior to the rational sense of morality, and that it is by this faculty that we receive knowledge of God.

(I oughta have declared it was a brotherhood[0] of functional Sz that S-M was part of-- that would exclude full blown ScZs)

[0] if I had to guess, it's related to mitochondrial DNA, like autism


That guy’s ideal form of government seems like it would lead to

https://en.wikipedia.org/wiki/Children%27s_Crusade

My take is that solar economy monarchies had poor state capacity although it’s hard to make categorical statements because they cover such a wide range of times and times. There was not a formalized conception of individual rights for the masses so the state did not enforce that. Various sorts of kayfabe were in effect, such as the Japanese emperor, allegedly descended from the gods, being under the thumb of the Tokugawa shogunate. The Tokogawas made shows of ruthlessness which, in the long term, turned into a bluff. Behind the mask of absolutism that kind of state may actually require the consent of the daimyo class, who mainly want impunity over their own domains. Servants of the emperor in China would need to work with illegal folk religionists in the hinterland if they wanted to get anything done. We think of Rome as a pinnacle of state capacity but it evolved that capacity as a republic.


Placeholder for later, more considered reply:

>Servants of the emperor in China would need to work with illegal folk religionists in the hinterland if they wanted to get anything done

https://en.wikipedia.org/wiki/Barefoot_doctor

Shallow take is that Children's Crusade were led by peasantry, haven't examined the role of aristocrats (like S-M or M : property insurance can only lead to functionality :), were they only there to rubberstamp the populism

State capacity is very quantitative I like it


Nobles don't feel a lot of need to seek power through claims of spiritual experience. If you're in the hinterland, however, you might find being possessed by a fox as a way to move up in the world.

My son had a friend whose parents came from China, his dad had a big job, his mom felt like might have been a mistake to immigrate because she had a medical certificate (barefoot doctor?) of some sort which wasn't accepted in the US.

Now my son's friend was mentally ill, I believed, and his mother believed he was mentally ill because he was possessed by a demon. She went to an evangelical church where I wouldn't expect her to be encouraged that belief. Some people have said, "it's a good thing she isn't practicing medicine in the US if she believes stuff like that"

It's kinda no surprise that a person from a rural village in China would believe that or, really, that anyone from a rural village in the developing world would believe that -- it's what they do.

My son's friend gave him an expose about witch doctors in Africa written by a missionary that, based on what I know now, was probably motivated by his experience with his mom. In particular, I was later to learn that the fox cult in China is pretty similar in how it works, I mean, you might have hundreds of fox shrines in your area and if you have some problem you can't work out the fox (through a medium) will tell you how it will be. If you fail to comply, the fox doesn't need a lot of help haunting you (you'll bump into fox shrines every day) but you can rest assured the fox can call in a favor from someone if it needs help haunting you and if the fox is just starting in its career it has connections it met at the fox academy that will help it because it will then be indebted to them.

As it is an alternative route to status, fox mediumship is a career path for lower-status men or women of a wider range of SES who might find it's a job they can do out of the house.


Nurture probably plays a stronger role than nature here, yep. For CCP cadres, signaling rationality is probably a no-brainer against the ever-present threat of populism, but they are also not going to do anything that are going to make peasants wonder about the mandate of heaven at an inconvenient time (e.g. demolishing shrines)

>being possessed by a fox as a way to move up in the world.

Pretending to be possessed, this is a populist, and should I say, traditional move, agreed

(Ntheless, you might be surprised how (privately) superstitious the urban elite (of the SES, not the intellect) in the Greater Bay of China are, just as how publicly superstitious many stay-at-home moms are in the US?)

But let's move on the idea of property insurance, generalized to the intellectual sort :) good patch for Szilards idea of the Bund, imho.

(Whose nemesis was another technocrat, blueblooded Vannevar. Not sure of the latter's condition,he was too high SES to tell)

Poor Grothendieck could have had some! That pays out in, if not friends, careful non-fans to play math with him in the shed. (Here informalism would be crucial)

However, I'm still a bit mindfogged so maybe next round..

but I did look up the finer details of Tokugawa & the Prussian influence on the Meiji effort to soften absolutism with social democracy. There's even a dissertation calling it "corporatism" (Graeber's term for Trump's ideology)

https://evanlaksmana.com/dissertation

I haven't checked if they meant the same thing..

("Laksmana" is the Indonesian word for "Admiral", things like nominative determinism are perhaps also more common in the 3rd world [transplants])

Oh.. music seems to be the best therapy for Sz.. (think Helfgott-- he credits his father) if your son's friend was not past tensed, they could make a band


Mostly, you will be caught only because of some issues in your work which casts into doubt what you claimed on the resume.

People get caught before getting the job. "25 years of systems programming experience; cannot diagram a linked list insertion with just boxes and arrows (no code).


Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: