HNHacker News
TopNewBestAskShowJobs

tjalfi

3,487 karma · joined May 5, 2016

Technologist at a law firm; I don't speak for them.

Topics of Interest:

  Compilers
  Programming Languages
  Functional Programming
  Optimal Lambda Reduction
submissionscomments
tjalfi··on I wrote an bash enumerator because I was sick of xargs
This one doesn't need xargs.

  find . -name '*.log' -delete
tjalfi··on Migrating the main Zig repository from GitHub to Codeberg
You might try emailing them, they've renamed other accounts before.
tjalfi··on Pyrefly vs. Ty: Comparing Python's two new Rust-based type checkers
Facebook acquired Monoidics in 2013; they were the startup that created Infer[0].

[0] https://en.wikipedia.org/wiki/Infer_Static_Analyzer

tjalfi··on Former Supreme Court justice David Souter has died
That reminds me of Isaac Asimov's[0] story in Asimov Laughs Again about being confused with Arthur C. Clarke[1]. They had similar writing styles, so it was quite common for Isaac's books to be attributed to Arthur and vice versa. Childhood's End[2] was Arthur's most popular and well-known novel at the time.

At a science fiction convention, a woman said to me, "Dr. Asimov, I have just finished your book Childhood's End. I liked it, but I didn't think it was as good as your other books."

Maintaining a straight and solemn face (with an enormous effort), I said, "Yes, ma'am. I was frightfully disappointed in that book, which I thought was quite inferior. I therefore insisted it appear under the pseudonym of Arthur C. Clarke, Jr."

[0] https://en.wikipedia.org/wiki/Isaac_Asimov

[1] https://en.wikipedia.org/wiki/Arthur_C._Clarke

[2] https://en.wikipedia.org/wiki/Childhood%27s_End

tjalfi··on Make Ubuntu packages 90% faster by rebuilding them
Kaze Emanuar[0] is the YouTuber you're thinking of.

[0] https://www.youtube.com/@KazeN64

tjalfi··on 1/4 of startups in YC current cohort have almost entirely AI-generated codebases
Are you referring to Jevon's Paradox[0]?

[0] https://en.wikipedia.org/wiki/Jevons_paradox

tjalfi··on There Was a Texas Lottery Arbitrage
You're thinking of Stefan Mandel's International Lotto Fund[0]. They tried to buy every ticket in the Virginia state lottery in 1992. They won the money, but IIRC there were years of litigation.

[0] http://investpost.org/mutual-funds/group-invests-5-million-t...

tjalfi··on The Lottery Problem: Tracing Stefan Mandel's Combinatorial Condensation
(submitter)

Here's the abstract.

Stefan Mandel is the man who won the lottery 14 times. He never disclosed the recipe he called combinatorial condensation, which enabled him to hit the Romanian lottery jackpot in the early phase of his betting career. Combinatorial condensation is frequently mixed up with another strategy known as buying the pot, which Stefan Mandel was pursuing later on. On occasion, he dropped a few hints on combinatorial condensation. The hints are applied in this work to narrow down and assess his initial recipe. The underlying theory resembles what a weekend mathematician, as he once referred to himself, may have encountered in the 1960s. Calculations indicate that he took residual risks that his method might fail. Residual risks explain why he changed his strategy from combinatorial condensation to buying the pot. The cardinality of the (15, 6, 6, 5)- and (49, 6, 6, 5)-lottery schemes shows that Stefan Mandel probably wasn't aware of lottery designs. First concepts on such topics had been available at that time, but coherent theories on combinatorial designs took off only in later decades, triggered by growing computing power, and eventually triggered by Stefan Mandel's publicity and successes in the field. But, as the comparison with actual covering designs reveals, Stefan Mandel most likely pioneered in constructing a (15, 6, 5)-covering design many years before others published about it, which he applied in the Romanian lottery.

tjalfi··on Ask HN: What less-popular systems programming language are you using?
These days, we have many better options, but back in the day, Fortran was also used for compilers (e.g., IBM's Fortran H), operating systems (such as PRIMOS[0] and LTSS[1]), symbolic computation (e.g., early Prolog implementations), and real-time control systems[2].

[0] https://en.wikipedia.org/wiki/PRIMOS

[1] https://en.wikipedia.org/wiki/Livermore_Time_Sharing_System

[2] https://webhome.weizmann.ac.il/home/fhlevins/RTF/RTF-TOC.htm...

tjalfi··on Dozens of U.S. academics lose grants from Minerva Research Initiative
It's a short story and not a novel, but there's the short story August Heat[0]; it's available at [1].

[0] https://en.wikipedia.org/wiki/August_Heat_(short_story)

[1] https://www.scaryforkids.com/august-heat/

tjalfi··on When your last name is Null, nothing works
Esperanto is probably the most widely spoken international auxiliary language[0].

[0] https://en.wikipedia.org/wiki/International_auxiliary_langua...

tjalfi··on Rust Is Eating JavaScript (2023)
TypeScript definitely won't add checked exceptions, because Anders Hejlsberg considers them a mistake[0].

[0] https://www.artima.com/articles/the-trouble-with-checked-exc...

tjalfi··on A Libertarian Island Dream in Honduras Is Now an $11B Nightmare
> That's why Uncle Sam is nice to have on your side. A libertarian utopia or corporate controlled trading zone doesn't stand a chance without the backing of a sovereign with a military.

The Republic of Minerva[0] is a good example of this. Some libertarians built an artificial island on a reef and the neighboring country of Tonga annexed it.

[0] https://en.wikipedia.org/wiki/Republic_of_Minerva

tjalfi··on Fun with C++26 reflection: Keyword Arguments
C++20 added designated initializers, so they're also an option.

    my_func({.arg1 = val1, .arg2 = val2});
tjalfi··on Don't "optimize" conditional moves in shaders with mix()+step()
clang has the __builtin_unpredictable() intrinsic[0] for this purpose.

[0] https://clang.llvm.org/docs/LanguageExtensions.html#builtin-...

tjalfi··on Proposed bill to make it a crime to download DeepSeek in the US
My guess is it was stored in a document management system[0] and then checked out locally to that path.

[0] https://en.wikipedia.org/wiki/Document_management_system

tjalfi··on Working with Files Is Hard (2019)
Jeremy Allison tracked down why POSIX standardized this behavior[0].

The reason is historical and reflects a flaw in the POSIX standards process, in my opinion, one that hopefully won't be repeated in the future. I finally tracked down why this insane behavior was standardized by the POSIX committee by talking to long-time BSD hacker and POSIX standards committee member Kirk McKusick (he of the BSD daemon artwork). As he recalls, AT&T brought the current behavior to the standards committee as a proposal for byte-range locking, as this was how their current code implementation worked. The committee asked other ISVs if this was how locking should be done. The ISVs who cared about byte range locking were the large database vendors such as Oracle, Sybase and Informix (at the time). All of these companies did their own byte range locking within their own applications, none of them depended on or needed the underlying operating system to provide locking services for them. So their unanimous answer was "we don't care". In the absence of any strong negative feedback on a proposal, the committee added it "as-is", and took as the desired behavior the specifics of the first implementation, the brain-dead one from AT&T.

[0] https://www.samba.org/samba/news/articles/low_point/tale_two...

tjalfi··on Why is hash(-1) == hash(-2) in Python?
BCPL[0], BLISS[1], and Forth[2] are all untyped.

[0] https://en.wikipedia.org/wiki/BCPL

[1] https://en.wikipedia.org/wiki/BLISS

[2] https://en.wikipedia.org/wiki/Forth_(programming_language)

tjalfi··on Some programming language ideas
If you're interested in prior art, Ian Currie's NewSpeak was an attempt at a non-Turing complete language for safety critical systems. Most of the search results are for a different language with the same name, but "RSRE currie newspeak" should find relevant links.
tjalfi··on Size Optimization Tricks (2022)
As a concrete example, Carlos Bueno's Mature Optimization Handbook[0] describes how the HHVM team got substantial performance wins by reducing instruction cache misses in rarely executed code.

[0] https://carlos.bueno.org/optimization/

tjalfi··on Size Optimization Tricks (2022)
At my last job, I had to patch a binary for one of our internal .NET applications. The application was hardcoded to connect to a specific database, but we needed it to work with a different one. Since the original developer was unavailable, I disassembled the application, updated the configuration, and then reassembled it.
tjalfi··on The Alder Lake SHLX Anomaly
GCC will generate the shlx instruction if you add the -mbmi2 flag to your build options. For example, you can see this in action here: https://godbolt.org/z/asb1fxos5.
tjalfi··on Systems ideas that sound good but almost never work
We had a similar rule for application support at my last job. Anyone who introduced an application was assigned as the support lead.
tjalfi··on Just: Just a Command Runner
Julia Evans has a Ninja introduction[0] with simple examples. I tried it for awhile, but ended up going back to GNU Make.

[0] https://jvns.ca/blog/2020/10/26/ninja--a-simple-way-to-do-bu...

tjalfi··on Nightclub stickers over smartphone rule divides the dancefloor
That reminds me of a great Dara Ó Briain routine[0] about pseudoscience.

[0] https://youtu.be/YKZN-hBTBUE

tjalfi··on Rust for tokenising and parsing
> I was going to say that maybe the initial lack of generics helped keep compile times low for go, but OCaml manages to have good compile times and generics, so maybe that depends on the implementation of generics (would love to hear from someone with a better understanding of this).

OCaml types are complex enough that monomorphization like Rust or C++ is impossible, so everything is boxed.

tjalfi··on Perhaps Rust Needs "Defer"
I wish I didn't know this, but it could be SunOS4[0] which went out of support in 2003. It's probably the most well-known OS where free(NULL) wasn't supported. I would like to think that people aren't writing new code for it.

[0] https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg001...

tjalfi··on What do you visualize while programming?
I usually see a control flow graph with blocks of three-address code instructions.
tjalfi··on World conker champion found with steel chestnut, cleared of cheating
The memoir Where Did You Go? Out. What Did You Do? Nothing describes using a heated icepick.

You take a chestnut, and you hook the ice pick. You wait until nobody is in the kitchen, and then one kid presses down on the pilot-light button so that a long delicate blue finger of flame comes out, and the other kid puts the ice pick in the flame until it is red-hot. When it is, he bores a hole in the chestnut. You do as many as you can until somebody comes and asks you what you are doing, and then, according to your standing in the family, that day, you either plead, argue, or say, “Oh, jeez,” and slink away.

tjalfi··on Playing with BOLT and Postgres
I wouldn't want to support it, but similar things have been done before.

Alexia Massalin's Synthesis[0] (pdf) operating system did JIT-like optimizations for system calls. Here's a LWN article[1] with a summary. Anyone who's interested in operating systems should read this thesis.

HP's Dynamo[2] runtime optimizer did JIT-like optimizations on PA-RISC binaries; it was released in 2000. DynamoRIO[3] is an open source descendant. Also, DEC had a similar tool for the Alpha, but I've forgotten the name.

[0] https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&d...

[1] https://lwn.net/Articles/270081/

[2] https://dl.acm.org/doi/pdf/10.1145/349299.349303

[3] https://dynamorio.org/

Page 1 of 22Next →