HNHacker News
TopNewBestAskShowJobs

jacobmartin

1 karma · joined February 21, 2025

submissionscomments
jacobmartin··on The friendship between Haskell and C
fascinating! Does vendor cc link to a different libc? I wonder if that is the problem and the docs are for glibc.

And testing just now, I can't even trigger SIGFPE with division by zero (integer or float). I guess all of these exceptions are "caught" now.

jacobmartin··on The friendship between Haskell and C
You should be able to see the floating point exception by testing fetestexcept(FE_INVALID) (if it returns nonzero/true then you have a domain error). errno is also set as a side effect.

(edit), for instance this gives me output of "1":

  #include <math.h>
  #include <fenv.h>
  #include <stdio.h>

  int main(void)
  {
    double a = sin(INFINITY);
  
    printf("%d\n", fetestexcept(FE_INVALID));
    return 0;
  }
jacobmartin··on Ask HN: Are a lot of books just useless?
Books are frequently useless. I only buy used (thrift books, local book stores) or get them from the library. If I dont have a compelling reason to finish it after about 20-50pages, I just re-sell/give away/throw it in the nearest gutter.
jacobmartin··on The Quest for Netflix on Asahi Linux
> Or rather, that was all true at the time when I first investigated Widevine-on-Asahi, several months ago. A few weeks ago, Google decided to enter the 21st century and started shipping aarch64 userspaces on certain Chromebook models. This means that "Widevine-in-Chrome-on-Linux-on-aarch64" does exist. The ChromeOS blob extraction process works as before, and the Pi Foundation conveniently packages it as a .deb for Pi users.

Not the point of the article but this is great news that I learned just now. I can finally upgrade to aarch64 chrome on my Raspberry Pis.

jacobmartin··on Catholic group spent millions on app data that tracked gay priests
For sure. In this specific case, I'd add that because of Catholic belief on martyrdom (directly to heaven, no purgatory, no baptism required even), the standards are a lot lower to canonize a martyr. For instance they can (but don't always) skip directly to "blessed" status, skipping over the declaration that they were "heroic in virtue." Which makes sense--historically speaking the first saints that were involved in worship were martyrs. And many of those "converted" right before they were killed, not having led lives that were Christian at all. There is a sense one gets that martyrs are the ur-Saints and that other saints were only canonized "by popular demand."

(Former Catholic but not a theologian or anything. See discussion here on how canonization is not a declaration of virtue: https://www.newadvent.org/cathen/02364b.htm)

jacobmartin··on The Blunders of a 16th-Century Physician-Astrologer
I would agree, but as DoreenMichele pointed out, they were treated the same in ancient Greece. And it's not like the Greeks had extremely sophisticated climate models able to predict the harvest seasons in advance. As far as I know, even today these sorts of models are hit-and-miss. I think we should call it astrology in English in this circumstance.

(Edit) even so if you look at an untranslated version of the Politics (https://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext...), you can see that he is using the word ἀστρολογίας (astrologias).

jacobmartin··on The Blunders of a 16th-Century Physician-Astrologer
Tangentially related but one of my favorite stories is that the earliest derivatives contract we have recorded was based on astrology:

> A story, with different versions, recounts how Thales achieved riches from an olive harvest by prediction of the weather. In one version, he bought all the olive presses in Miletus after predicting the weather and a good harvest for a particular year. Another version of the story has Aristotle explain that Thales had reserved presses in advance, at a discount, and could rent them out at a high price when demand peaked, following his prediction of a particularly good harvest. This first version of the story would constitute the first historically known creation and use of futures, whereas the second version would be the first historically known creation and use of options.

https://en.m.wikipedia.org/wiki/Thales_of_Miletus

Aristotle clarifies that Thales supposedly predicted the weather by using astrology:

> Thales, so the story goes, because of his poverty was taunted with the uselessness of philosophy; but from his knowledge of astronomy he had observed while it was still winter that there was going to be a large crop of olives....

https://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:1...

jacobmartin··on Proposal to Merge Pyston with Cpython
I'm no expert, but you might be interested in: https://llvm.org/docs/tutorial/

There's also a Haskell version if you'd prefer: https://www.stephendiehl.com/llvm/

Idk how to do this in python as I'm not really good with it, but in C, to make your compiler a JIT, you would `mmap` a region as writeable, write the machine code to it that you already know how to generate, `mprotect` it as PROT_EXEC instead of PROC_WRITE, cast the pointer to the region to a function pointer, and then call it. These functions may be available in the python sys package but I don't really know.

I've implemented a "JIT" that takes machine code as hex and does this. Warning: it's complete garbage with no error checking but is a good proof of concept. https://gist.github.com/martinjacobd/3ee56f3c7b7ce621034ec3e...

jacobmartin··on Forth: The programming language that writes itself
For sure. Additionally, the syntax of lisp also makes these AST macros ergonomic and, in many cases, beautiful. Rust has AST-transforming macros, but they're harder to use because the syntax is more complex. They're also quite ugly.
jacobmartin··on Why does 0.1 and 0.2 = 0.30000000000000004?
I didn't downvote you. (In fact, I don't have access to the downvote button lol, but I wouldn't have used it here in any case.) But a comment above yours already discussed this possibility, and there were replies as to why this is not the problem here. C and Python are giving the same fp result just printed to different precisions. Ftr I was using the defaults, whatever those may be:

  gcc fp.c -o fp
jacobmartin··on Why does 0.1 and 0.2 = 0.30000000000000004?
Yes, thank you for this. I just ran it with the floor() function actually called and it did give 56.000000. I didn't think to check the precision. Rookie mistake!
jacobmartin··on Why does 0.1 and 0.2 = 0.30000000000000004?
Thank you!
jacobmartin··on Why does 0.1 and 0.2 = 0.30000000000000004?
This is great!

There was a post on /r/softwaregore recently where someone showed a progress bar on Steam that said "57/100 achievements! Game 56% complete" or something like that. I snarkily commented something about naively using floor() on floating point and then moved on.

But then I thought that that may not have been the problem, fired up emacs and wrote a C program basically just saying

  printf("%f\n", 57.0 / 100.0 * 100.0);
To my surprise this correctly gave 57.000000, but in python,

  57 / 100 * 100
Gave 56.999... anybody know what was up here? Different algorithms for printing fp?
jacobmartin··on Want anonymity? Make a persona not a mystery
Yes, precisely. Sorry I wasn't clear about that.
jacobmartin··on Want anonymity? Make a persona not a mystery
The deontologist believes lying is against the universal maxim. If everybody lied all the time, we wouldn't have a functioning society.

The virtue ethicist believes it is bad to be in a habit to lie because being predisposed to lying is opposed to the virtue of the truth. We've all known people who lie by habit and they are unpleasant and vicious to be around. I don't know if most virtue ethicists (who don't also fall into the natural lawyer camp, below) would say it is per se bad to lie, but most would say it is vicious.

The natural lawyer believes that speech has as its natural end telling the truth and therefore it is contra naturam to lie. See the almost-impossibly-extended discussion here, for that: https://www.newadvent.org/cathen/09469a.htm

For all of these groups, there has variously been admitted something like an "equivocal statement"---a statement which has some interpretation that is technically true, but not the interpretation that the speaker knows will be taken by the listener as a falsehood. For example, my friend invites me out on Friday and rather than saying I'd rather be at home, I say, "I have something going on that night." He takes it to mean that I have other plans, but I don't. But technically, breathing is "something going on" so I haven't lied. (Whether your social relationships will stand your doing this is another matter ;))

I'm personally fall in something like the virtue ethicist camp, but I do believe sometimes, in justice, a lie must be said, and not all of those situations can be covered by an equivocation.

jacobmartin··on Japanese explained to programmers
The rhetorical device here is called polyptoton.

It have noticed it usually sounds clunky in English, though it was a favorite of Latin and Greek authors. For instance, "Et lux perpetua luceat eis," is usually translated, "And may perpetual light shine upon them." But in Latin, the same root is in the subject and the verb. "And may perpetual light light them," is grammatical and (mostly) semantically equivalent in English. But it sounds clunky and looks like a typo :P

My uninformed supposition would be that it sounds clunky in English because English has less variation in word morphology, so the words are too similar when they have the same root.

jacobmartin··on Visualizing “The Art of Fugue”
Found this guy's YouTube channel when I was a kid learning to play the piano, googling my pieces to hear how they sounded. He introduced me to Bach, and I've loved him ever since :)
jacobmartin··on An intutive counterexample to the axiom of choice
This is an interesting question that gets to the heart of the constructivism debate, which I won't touch on here.

As for the integer example, the integers are all easily (finitely) constructed (successors to 0 and their additive opposites), so it isn't a consistent concept to say "This is an unconstructable integer." Sets, on the other hand, are not necessarily always constructable, unless you only take the constructivist axioms.

jacobmartin··on An intutive counterexample to the axiom of choice
No, usually the cardinalities of infinite sets are represented by things called aleph numbers: https://en.m.wikipedia.org/wiki/Aleph_number.

But it isn't, in any case, an integer.

jacobmartin··on An intutive counterexample to the axiom of choice
> If I can accept that there are more reals than reals with finite descriptions, why can't there be integers without finite descriptions/positions?

Because the integers are defined as the finite successors to the number 0 and their additive opposites. See, for instance, the construction section of: https://en.m.wikipedia.org/wiki/Integer

You can start talking about numbers that can't be constructed in this way, but then you've ceased to be talking about the integers.

jacobmartin··on An intutive counterexample to the axiom of choice
Where is 1⁄3? Is it before or after (pi - 3)?
jacobmartin··on 🥺: the best sudo replacement
Yeah, I always read this as "bottom emoji" in my internal monologue, and that is how I search for it if I need to copy & paste it on a laptop or desktop lol.
jacobmartin··on Eggs are 60% more expensive than last year in the US
Here is a less anecdotal source to support what you are saying: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6024687/

There is about 10x more unesterified (absorbable) cholesterol secreted into bile than one typically eats in a normal day.

> Eating cholesterol has very little impact on the cholesterol levels in your body. This is a fact, not my opinion. Anyone who tells you different is, at best, ignorant of this topic. At worst, they are a deliberate charlatan. Years ago the Canadian Guidelines removed the limitation of dietary cholesterol. The rest of the world, especially the United States, needs to catch up.

https://peterattiamd.com/the-straight-dope-on-cholesterol-pa...

The only caveat I would is that there is weak evidence for a "dietary cholesterol hyperresponder" phenotype that is more sensitive to dietary cholesterol than the general population.

I probably have (heterozygous) familial hypercholesterolemia, so my diet (even saturated fat) unfortunately doesn't influence the (very high) levels I have anyways. I'm envious of people like you, for sure.

jacobmartin··on The organ as a wind instrument
Triply so if the choir is a professional choir. It's a job. They don't ask you the Creed before you audition.
jacobmartin··on Tail Call Optimization: The Musical (2019) [video]
I appreciate your nit, but I have one myself: Can you curse the throne itself? Afaik you can only curse items, not dungeon features, and the NethackWiki doesn't list anything about a throne having B/U/C status. I don't see any way to capture it as an item. So I don't think recursing can happen to a throne in nethack.
jacobmartin··on Americans duped into losing $10B by illegal Indian call centres in 2022: report
I have two kids, am self-employed (tutoring) in my community, and have many friends and acquaintances are over 40 (from church, for instance). Sending unknown numbers to voicemail has been completely fine in every case. I've never missed an urgent call that I couldn't call right back after I read the voicemail transcription.
jacobmartin··on Operation Charlie: Hacking the MBTA CharlieCard from 2008 to Present
I've noticed that the further you get away from downtown, the more likely the bus driver is just going to tell you not to bother with it and wave you back if you reach for some dollar bills. But like you said, it'd be nice if it was just official policy for all bus rides rather than an ad hoc lottery based on the driver.
jacobmartin··on Julius: An open source re-implementation of Caesar III
I recently downloaded this and got it to work. I loved it. So much nostalgia.
jacobmartin··on Octopuses caught on camera throwing things at each other
apparatus is first/second as a past participle. I suppose it could be used as a substantive, but there is also a fourth declension noun with the same lemma meaning implements, tools, etc.: https://logeion.uchicago.edu/apparatus
jacobmartin··on Octopuses caught on camera throwing things at each other
Maddeningly, it doesn't even apply to all Latin -us nouns. For instance, the plural of apparatus should be apparatūs if we're applying the Latin rules. Apparati, as it might seem, makes no sense! So even when the pattern match correctly identifies the language, it can be misleading.

--fellow Latin nerd

Page 1 of 3Next →