HNHacker News
TopNewBestAskShowJobs

jffhn

397 karma · joined May 23, 2019

submissionscomments
jffhn··on My favourite colour is Chuck Norris red
'shiny' gives pitch black, and 'obscure' gives blue sky color.
jffhn··on Ultra-low-latency, batching and concurrent queue for IPC in Java
>any recommendations for a low latency work queue (with in a jvm)?

I toyed around the ring buffer pattern a decade ago, creating a unicast one (using CAS on entries, and eventually a logarithmic scan for next readable entry, not to brute-force-scan them all), but I'm not sure that its latency is much better than that of a regular ThreadPoolExecutor (the throughput could be better though).

Latency also depends on whether it spins or blocks when waiting for a slot to read or write.

If you want to give it a try: https://github.com/jeffhain/jodk/blob/master/src/net/jodk/th...

jffhn··on Computing Industry Doesn't Care about Performance: how I made things faster
>Performance isn’t a luxury—it’s foundational.

Reasons to always try to be nearly optimal on performance from the start, that I rarely saw stated:

1) What you can specify depends on what can be done, and to know what can be done you need to have tried your best. In particular, it allows to see early whether or not performance expectations are reallistic.

2) It's more difficult or impossible to upgrade performance later if it requires to break an API. It causes a development process in O(n^2) in number of layers, instead of O(n).

3) Better lower level performance makes higher level code and architecture simpler, as you can just brute force in more places for a same overall performance.

jffhn··on Writes Large Correct Programs (2008)
Some people learned to be fearful.

At some point I was working on a piece of software we knew inside out, had good tests for and often ran through hand curated stress tests for benches, analysis or just exploratory testing, so we had a high confidence in it and in our ability to modify it quickly and successfully.

Some day executives were visiting and we had to do a demo of our system interacting with another one. Until the last minutes we were happily modifying our code to make the demo better. A guy from other system's team saw that, freaked out, and went straight to our boss, who then laughed with us at how scared the guy was. It turned out his team was not at all that confident in their system.

jffhn··on Writes Large Correct Programs (2008)
>"it seems to work and we don't dare change it"

What they mean is: "we don't understand it and we don't have good tests, so there is a high probability that it doesn't work and that doing even the most trivial and seemingly harmless modification would cause an issue to surface, so we don't dare to change it else we wouldn't be able to pretend that it works anymore and might have to fix a lot of issues that we would have a hard time to even understand"

jffhn··on Don’t look down on print debugging
>I appended (...) traces into (...) memory. (...) An unrelated process would read (...) at opportune time and hand over to the developer.

I did something similar to debug concurrent treatments in Java, that allows to accumulate log statements in thread-local or instance-local collections and then publish them with possibly just a lazySet():

https://github.com/jeffhain/jolikit/blob/master/src/main/jav...

jffhn··on What made Dostoevsky's work immortal
Reminds me of an interview with Fields Medalist Laurent Lafforgue, where he mentioned that at one point, he had only been interested in literature, particularly Dostoevsky, and couldn't understand how anyone could bother with mathematics, but that he later realized that mathematics could also convey profound truths.
jffhn··on Choose Boring Technology and LLMs
>I worry overall that this could signal the complete end of new programming languages

Programming often involves creating new languages (or APIs) (like domain specific languages) on top of lower level languages (like the base programming language you use).

Future AIs should be able to learn new languages, else they would remain pretty limited.

jffhn··on Trump wins presidency for second time
>those are like two major emotions most people feel

"The oldest and strongest emotion of mankind is fear, and the oldest and strongest kind of fear is fear of the unknown." (H. P. Lovecraft)

jffhn··on Trump wins presidency for second time
>The limbic system won.

The limbic system always wins.

"The mind is always the dupe of the heart." (La Rochefoucauld)

jffhn··on Blog Writing for Developers (2023)
>each blog post helps me think more deeply

The most on point quote I know about this idea: "I don't write to say what I think, but to know what I think." (E. Berl)

Writing can help to become less confused, but being confused can incite to write a lot (J. Joubert: "The supremely false mind is the one that never senses when it goes astray.").

jffhn··on Pretty.c
For IEEE 754, and in Java for example, they are. Only NaN is not equal to itself (and different from itself).
jffhn··on Pretty.c
If both terms are infinites and of same sign, subtraction will give NaN and it will fail.
jffhn··on setBigTimeout
>Fast reliable unit tests are difficult

Not difficult if you build your code (not just the test suite) around scheduling APIs (and queues implementations, etc.) that can be implemented using virtual time instead of CPU/wall clock time (I call that soft vs hard time).

Actually I find it a breeze to create such fast and deterministic unit tests.

jffhn··on The sorry state of Java deserialization
>With Java, you have to go out of your way to maintain good cache locality because you give up control over memory layout for automatic memory management.

There is a shadowy cult in a hidden corner of the Java community, an heresy to many, only followed by a handful of obnoxious zealots inspired by the dark ages of Ada 83, C, or even assembly, who take pride in creating Java programs that only allocate a finite amount of objects regardless of how long you run them for, and to which the "new" keyword is a taboo which avoidable use is assimilated to blasphemy.

As a member of this sect, in a few cases of presenting some of our programs on some laptop, I've had dumbfounded observers looking around the laptop for the network cable linking it to the server they thought it must have been running on.

jffhn··on OpenAI is good at unminifying code
You can put these comments into the name of a function, getting rid of the redundancy and having them read by whoever would just be reading the code not to be distracted by the comments.
jffhn··on Faster CRDTs (2021)
"Plato had defined Man as an animal, biped and featherless, and was applauded. Diogenes plucked a fowl and brought it into the lecture room with the words, "Here is Plato's man."" (Diogenes Laertius, Lives of Eminent Philosophers)
jffhn··on JPlag – Detecting Software Plagiarism
exam: implement add.

"return a + b": plagiarism, disqualified.

"return a + 1 + b - 1": A+

jffhn··on Where does the name "algebraic data type" come from?
Thanks, I also recall he was talking about G. Kahn as in the second pdf, so both must originate from this colloquium:

https://ercim-news.ercim.eu/en68/in-brief/colloquium-in-memo...

jffhn··on Where does the name "algebraic data type" come from?
15 or 20 years ago there was an online video of Milner giving a talk at Inria, about building the "tower of digital computing" (I recall this expression), but since I never managed to find it again.
jffhn··on Human Life
>It is not necessarily even a goal to maximize happiness, because being too happy for too long causes problems.

Reminds me of the experiment with rodents pushing the morphine button until death, and of the recent opioid crisis.

jffhn··on Human Life
>I don't agree that "chasing" happiness is pointless

Considering that chasing happiness is the complement to contemplation, is considering that contemplation excludes happiness.

>We haven't managed to find any quote which would touch on that

The complement to contemplation is not chasing happiness, it is participating in the creation of what can be contemplated, and you can find plenty of quotes about that, like: "The desire to create is one of the deepest yearnings of the human soul." (Dieter F. Uchtdorf), or: "Creativity is intelligence having fun." (Albert Einstein). That can be whatever kind of creation: procreation, pieces of art, etc.

jffhn··on Programming Is Mostly Thinking (2014)
>I don’t really know what “think algorithmically means,”

I would say thinking about algorithms and data structures for algorithmic complexity not to explode.

>Nothing clever

A lot of devs use nested loops and List.remove()/indexOf() instead of maps, etc., the terrible performance gets accepted as the state of the art, and then you have to do complex workarounds not to call some treatments too often, etc., increasing the complexity.

Performance yields simplicity: a small increase in cleverness in some code can allow for a large reduction in complexity in all the code that uses it.

Whenever I do a library, I make it as fast as I can, for user code to be able to use it as carelessly as possible, and to avoid another library popping up when someone wants better performances.

jffhn··on The Wi-Fi only works when it's raining
The mystery didn't last long, and no problem to admit it, I maybe even contacted them. I guess they put safeguards after that, but I didn't try again to check ;)
jffhn··on The Wi-Fi only works when it's raining
Here is mine.

The admins could connect to their machines, but not to any user machine.

It was winter and we had some heating issues, so I made a script "warmup_the_office.sh" that was meant to launch a "while(true){}" on each core of each PC of the office, but instead launched itself indefinitely on each and all reachable machines, exhausting all pids and preventing distant logging. We had to reboot everything by hand, after some nice warmup.

jffhn··on The window for great-grandmothers is closing
>I see a lot of people who absolutely want kids but feel they can't have them, for a number of reasons

I remember thinking about that in the street, and then be overtaken by a rom family, the father pushing the kids in a shopping cart and the mother walking alongside.

jffhn··on Juvenile great apes love to tease and annoy their elders, study finds
Kafka's costume, obviously.
jffhn··on Juvenile great apes love to tease and annoy their elders, study finds
>when their brain actually fires up when they are 25 or 30

Their brain fires up at about 14, and soon starts to figure out that life is actually a costume party, so they spend the next decade in their cave pondering about it while making up their costume, naturally grunting at you while you annoy them with your mundane down-to-earth already-costumed person considerations. Then at 25 or 30 their costume is ready and they start playing with you childishly again.

"I was ashamed of myself when I realized life was a costume party, and I attended with my real face." (Kafka)

"Parents who expect gratitude from their children (there are even some who require it) are like those usurers who willingly risk the capital to receive interest." (Kafka)

jffhn··on From engineer to manager: what I love, what I hate
>IMO the best thing about being a manager is that you get to spend a lot of your time thinking about the future

In some places it's the opposite: domain-specific codebases far outlive the separate projects they are used for, and the devs are the ones thinking about what their product should be. Kind of like how Linux is a long-lived product made by devs, used in many short(er)-lived C-level projects.

jffhn··on Interview: The Threat of Self-Censorship in Science
>certain topics being taboo

Reminds me of this lecture by R. B. Laughlin, where he talks about topics for which laws can get classified: https://www.youtube.com/watch?v=0qCSpWjsAiE&t=3895

← PreviousPage 2 of 6Next →