HN user

chubot

16,331 karma

Working on https://oils.pub/

andy@oils.pub

Posts104
Comments4,391
View on HN
www.broune.com 7mo ago

Testing and Benchmarking of AI Compilers

chubot
1pts0
sailor.li 12mo ago

Asyncio: A library with too many sharp corners

chubot
121pts99
github.com 1y ago

Tilck: A tiny Linux-compatible kernel

chubot
286pts58
github.com 1y ago

Corkami/pics: File format dissections and more

chubot
12pts1
www.modular.com 1y ago

What about the MLIR compiler infrastructure? (Democratizing AI Compute, Part 8)

chubot
5pts0
ipv6.hanazo.no 1y ago

Is the Transition to IPv6 Inevitable?

chubot
3pts1
learn.microsoft.com 1y ago

Everyone quotes command line arguments the wrong way (on Windows)

chubot
4pts0
world.hey.com 1y ago

The Premise Trap

chubot
1pts0
nicholas.carlini.com 1y ago

A ChatGPT clone, in 3000 bytes of C, backed by GPT-2 (2023)

chubot
350pts118
www.oilshell.org 1y ago

Garbage Collection Makes YSH Different

chubot
4pts0
github.com 1y ago

Bootstrap a Linux system from a 512 byte binary seed with 170 steps

chubot
53pts9
www.microsoft.com 1y ago

Fast Arithmetic with Tagged Integers – A Plea for Hardware Support (2022)

chubot
2pts0
cwe.mitre.org 1y ago

Stubborn Weaknesses in the Top 25 Most Dangerous Software Weaknesses

chubot
2pts0
www.oilshell.org 2y ago

Comments on Scripting, CGI, and FastCGI

chubot
3pts0
randomascii.wordpress.com 2y ago

Float Precision Revisited: Nine Digit Float Portability (2013)

chubot
2pts0
www.rozmichelle.com 2y ago

Pipes, Forks, & Dups: Understanding Command Execution and Input/Output Data Flow

chubot
2pts0
bjoern.hoehrmann.de 2y ago

Flexible and Economical UTF-8 Decoder

chubot
3pts0
research.swtch.com 2y ago

UTF-8: Bits, Bytes, and Benefits

chubot
3pts0
justinpombrio.net 2y ago

A Twist on Wadler's Printer

chubot
65pts7
lukasatkinson.de 2y ago

Interface Dispatch in C++, Java, C#, Go, and Rust

chubot
2pts0
lukasatkinson.de 2y ago

Building a Simple Metaobject Protocol

chubot
3pts0
www.oilshell.org 2y ago

Oils Winter Status Update

chubot
2pts0
www.oilshell.org 2y ago

Oils 0.18.0 – Progress on All Fronts

chubot
2pts1
www.oilshell.org 2y ago

Oils 0.17.0 – YSH Is Becoming Real

chubot
66pts20
www.oilshell.org 3y ago

Narrow Waists Can Be Interior or Exterior: PyObject vs. Unix Files

chubot
1pts0
www.oilshell.org 3y ago

How to Create a UTF-16 Surrogate Pair by Hand, with Python

chubot
23pts9
www.oilshell.org 3y ago

Oils 0.15.0 – Big Contributions and More Concessions

chubot
2pts2
ericlippert.com 3y ago

The last three years of my work will be permanently abandoned

chubot
707pts460
github.com 3y ago

Survey of Config Languages

chubot
3pts0
www.oilshell.org 3y ago

Oil 0.11.0 – Big Features and Project Changes

chubot
1pts0

all code possible to run on a computer already exists. It's some permutation of all the bits of available memory. It's in there somewhere

This seems either mathematically impossible or vacuous, depending on what you mean ...

I think that is basically the approach modernish uses: https://github.com/modernish/modernish

But it does feel complex to me.

Personally I just write in the common subset of bash and OSH, which is very large. I never need to support say dash, since every machine that has dash also has bash, which is less broken in terms of 'echo' and so forth.

bash has its own broken-ness, but running under OSH solves that.

And OSH also supports some busybox idioms -- we learned last year that bash cannot run busybox ash scripts on Alpine

e.g. 'chdir' is an alias for 'cd' in busybox, but not in bash. And Alpine scripts use it, so bash can't run Alpine scripts, but OSH can (as of last year).

OK interesting, I knew about the -e -n flags issue, which means that any portable shell script has to use printf, not echo. Didn't quite realize that the use of backslash also forces printf ... what a mess

OK interesting, yeah I think dash is just plain broken ...

    $ dash -c 'echo "c:\\new"'
    c:
    ew
    $ busybox ash -c 'echo "c:\\new"'
    c:\new
It requires 4 backslashes:
    $ dash -c 'echo "c:\\\\new"'
    c:\new
    $ busybox ash -c 'echo "c:\\\\new"'
    c:\\new
I am not sure this is a matter of "undefined behavior in POSIX" -- I think it might just be dash being wildly unconformant, which I have seen in other cases.

It's one of the least POSIX compliant shells. It is derived from the same codebase as busybox ash, but busybox receives more maintenance.

---

In any case, it is pretty sad that sh is in such poor shape than the default /bin/sh on Debian has different behavior in this basic case.

I built OSH to be a set of semantics agreed upon by many shells. I don't think any cross-shell test suites like our spec tests had existed in the past - https://oils.pub/release/0.37.0/quality.html

But there is little coordination among shell authors, and no real motivation to fix the gaps. In contrast, there is A LOT of coordination among JavaScript engine authors, mostly because there are people paid to work on them.

FWIW Oils has an option to prevent the ambiguity:

    osh-0.37$ echo "c:\new"
    c:\new

    osh-0.37$ shopt --set no_parse_backslash
    osh-0.37$ echo "c:\new"
      echo "c:\new"
              ^
    [ interactive ]:6: Invalid char escape in double quoted string (OILS-ERR-12)
It really should be
    echo "c:\\new"  # with two backslashes 
That is an unambiguous program that works in every shell. In a well-written shell program, the only things that should follow a single backslash in a double quoted string are
    \ " ` $

(Although I found that this option is only on in ysh, not in shopt --set strict:all ... arguably that should be changed)

Nine Reasons to Use OSH - https://oils.pub/osh.html

BTW Chuck Klosterman discussed this at length in this 2022 book on the 90's: https://en.wikipedia.org/wiki/The_Nineties_(book)

I think it's a pretty deep point -- your memory and consciousness are shaped by the media environment (media being the thing that Klosterman thinks about obsessively)

And the media environment drastically changed after the 90's -- because of the Internet

I think his main point was about access to media in different eras, but it's worth reading directly if you feel like that

I liked this story, thanks for sharing

I have to admit I feel similarly conflicted after a few recent REAL WORLD experiences. The first is that Gemini and Claude taught me a whole bunch of things about beer that I feel like I should have known, or a friend should have told me in the last few decades :-) (I'm in my mid 40's)

As background, I am a simple man, and I like one type of beer (pale ale), and drink 1 beer a day. But it has to be fresh, crisp, bitter, and not make me want to fall asleep (lower alcohol)

So here is some color on what I learned:

- I worked in SF / the bay area for nearly 2 decades, and I'm now in Philly. I have been wondering for like FOUR YEARS why when I buy pale ale, it is somehow OFF. Well Claude told me that east coast pale ale is actually more like "English Ale" (e.g. Yards brewing), and west coast pale ale is its own thing (e.g. Lagunitas)

Apparently west coast is what I developed a taste for -- it is more bitter. And this totally tracks for me. So the same term is used for 2 slightly different things, and AI cleared that up for me

- I walked into a beer store today in Philly, and there are 5 IPAs for every Pale Ale, which annoys me because I prefer the latter. (That happened in San Francisco too, and I'm sure many people here have had that experience)

And Gemini taught me that "session IPA" is actually a marketing term for Pale Ale. I always choose things labeled "pale ale", but many people want something labeled "IPA". So they came up with the term "session IPA" -- an IPA with lower alcohol, aka Pale Ale.

I use Gemini anonymously, so it doesn't remember things about me. And after I described my beer preferences and the fact that I'm in Philly, it specifically brought up Tonewood Brewing in NJ, which is in fact the beer I've drank the most in the last 3 years!

---

So yeah I find it eerie that the LLMs are helping me with words versus reality.

- the same term "pale ale" referring to slightly different things on the east coast and west coast -- this was tripping me up for years

- the term "session IPA" being a marketing term for Pale Ale -- also something I didn't know for years

- based on simple verbal descriptions, they are able to recommend the beers that I actually drank and liked (even though I use Gemini anonymously, and that was my first time asking Claude about beer)

I've been drinking something slightly "wrong" quite often, because of a confusion over words on the label. I guess I simply don't know anyone who I can ask dumb questions about beer to.

Yup totally, how you breathe during the day is a habit that basically persists at night

So breathing better during the day can be trained, even at an old age, and it improves sleep

Not everyone breathes suboptimally of course, but I think more do than realize it. There’s a reason that breath work is in the traditions of many different cultures, and why it survived

But things like this aren’t necessarily profitable or worth a doctor’s time, so you have to do them yourself, or see therapists, etc

I had a good experience with a myofunctional therapist and posture therapist

Ha, that’s the thing that gets me too. Also people watching mashed up YouTube clip compilations - these seem obviously designed for addiction.

The other thing is watching the videos in public with the tinny speakers blaring. Judging by reactions on the trains, this is socially acceptable to most people now ???

Just Use Go 3 months ago

If Go interfaced with C as well as Python, I’d use it a lot more.

But I’m using the slower language because it still integrates with more things

For example, one reason AI is all in Python is because CUDA is basically part of the C ecosystem (ie build system)

They tell me I don't have a real job because I just tell the computer what to do, and I don't do the thing myself (to which I can't help but respond that they're absolutely right)

Hm interesting

So they are making the distinction between regular "human brain" coding and AI-assisted coding?

Regular coding could be described as "not doing the thing yourself, but telling the computer what to do"

(FWIW I do think there is a huge difference; however I am not sure the general public has a very good idea of what "programming" is. I remember having some code up on my screen and my educated family was confused, even at the concept)

Wow a few years ago I wanted to resurrect some of my old code, to do essentially what ncdu does

Then I found ncdu, and haven’t looked back since. So it saved me a lot of time

Thank you and RIP

Building a Shell 4 months ago

FWIW here is another piece of trivia about job control: the API means you can't spawn a child process "safely" in POSIX -- you have to trust that that the executable you're spawning is well-behaved (or use more advanced Linux process isolation)

In this case it was the Zed editor spawning the zsh shell:

How to Lose Control of your Shell - https://registerspill.thorstenball.com/p/how-to-lose-control...

zsh has a bug where it doesn't do the job control cleanup properly in some cases -- when fork-exec() optimizations happen.

This can mess up the calling process. For example, here you could no longer kill Zed by hitting Ctrl-C, even after zsh is done.

My comment: https://lobste.rs/s/hru0ib/how_lose_control_your_shell#c_dfl...

Building a Shell 4 months ago

A common problem I noticed is that if you took certain courses in computer science, you may have a pre-conceived notion of how to parse programming languages, and the shell language doesn't quite fit that model

I have seen this misconception many times

In Oils, we have some pretty minor elaborations of the standard model, and it makes things a lot easier

How to Parse Shell Like a Programming Language - https://www.oilshell.org/blog/2019/02/07.html

Everything I wrote there still holds, although that post could use some minor updates (and OSH is the most bash-compatible shell, and more POSIX-compatible than /bin/sh on Debian - e.g. https://pages.oils.pub/spec-compat/2025-11-02/renamed-tmp/sp... )

---

To summarize that, I'd say that doing as much work as possible in the lexer, with regular languages and "lexer modes", drastically reduces the complexity of writing a shell parser

And it's not just one parser -- shell actually has 5 to 15 different parsers, depending on how you count

I often show this file to make that point: https://oils.pub/release/0.37.0/pub/src-tree.wwz/_gen/_tmp/m...

(linked from https://oils.pub/release/0.37.0/quality.html)

Fine-grained heterogenous algebraic data types also help. Shells in C tend to use a homogeneous command* and word* kind of representation

https://oils.pub/release/0.37.0/pub/src-tree.wwz/frontend/sy... (~700 lines of type definitions)

Building a Shell 4 months ago

Yup, job control is a huge mess. I think Bill Joy was able to modify the shell, the syscall interface, and the terminal driver at the same time to implement the hacky mechanism of job control. But a few years later that kind of crosscutting change would have been harder

One thing we learned from implementing job control in https://oils.pub is that the differing pipeline semantics of bash and zsh makes a difference

In bash, the last part of the pipeline is forked (unless shopt -s lastpipe)

In zsh, it isn't

    $ bash -c 'echo hi | read x; echo $x'  # no output
          
    $ zsh -c 'echo hi | read x; echo $x'
    hi
And then that affects this case:
    bash$ sleep 5 | read
    ^Z
    [1]+  Stopped                 sleep 5 | read


    zsh$ sleep 5 | read    # job control doesn't apply to this case in zsh
    ^Zzsh: job can't be suspended

So yeah the semantics of shell are not very well specified (which is one reason for OSH and YSH). I recall a bug running an Alpine Linux shell script where this difference matters -- if the last part is NOT forked, then the script doesn't run

I think there was almost a "double bug" -- the script relied on the `read` output being "lost", even though that was likely not the intended behavior

The Jeff Dean Facts 7 months ago

Side note: I used this query to test LLM recall: Do jeff dean and russ cox know each other?

Interesting results:

1. Gemini pointed me back at MY OWN comment, above, an hour after I wrote it. So Google is crawling the web FAST. It also pointed to: https://learning.acm.org/bytecast/ep78-russ-cox

This matches my recent experience -- Gemini is enhanced for many use cases by superior recall

2. Claude also knows this, pointing to pages like: https://usesthis.com/interviews/jeff.dean/ - https://goodlisten.co/clip/the-unlikely-friendship-that-shap... (never seen this)

3. ChatGPT did the worst. It said

... they have likely crossed paths professionally given their roles at Google and other tech circles. ...

While I can't confirm if they know each other personally or have worked directly together on projects, they both would have had substantial overlap in their careers at Google.

(edit: I should add I pay for Claude but not Gemini or ChatGPT; this was not a very scientific test)

The Jeff Dean Facts 7 months ago

This is overstating it by a lot. Jeff was the AI lead at the time, and there was a big conflict between management and the ethics team

And I actually think Google needs to pay more attention to AI ethics ... but it's a publically traded company and the incentives are all wrong -- i.e. it's going to do whatever it needs to do keep up with the competition, similar to what happened with Google+ (perceived competition from Facebook)

The Jeff Dean Facts 7 months ago

Ha, I also recall this fact about the protobuf DB after all these years

Another Jeff Dean fact should be "Russ Cox was Jeff Dean's intern"

This was either 2006 or 2007, whenever Russ started. I remember when Jeff and Sanjay wrote "gsearch", a distributed grep over google3 that ran on 40-80 machines [1].

There was a series of talks called "Nooglers and the PDB" I think, and I remember Jeff explained gsearch to maybe 20-40 of us in a small conference room in building 43.

It was a tiny and elegant piece of code -- something like ~2000 total lines of C++, with "indexer" (I think it just catted all the files, which were later mapped into memory), replicated server, client, and Borg config.

The auth for the indexer lived in Jeff's home dir, perhaps similar to the protobuf DB.

That was some of the first "real Google C++ distributed system" code I read, and it was eye opening.

---

After that talk, I submitted a small CL to that directory (which I think Sanjay balked at slightly, but Jeff accepted). And then I put a Perforce watch on it to see what other changes were being submitted.

I think the code was dormant for awhile, but later I saw someone named Russ Cox started submitting a ton of changes to it. That became the public Google Code Search product [2]. My memory is that Russ wrote something like 30K lines of google3 C++ in a single summer, and then went on to write RE2 (which I later used in Bigtable, etc.)

Much of that work is described here: https://swtch.com/~rsc/regexp/

I remember someone telling him on a mailing list something like "you can't just write your own regex engine; there are too many corner cases in PCRE"

And many people know that Russ Cox went on to be one of the main contributors to the Go language. After the Code Search internship, he worked on Go, which was open sourced in 2009.

---

[1] Actually I wonder if today if this could perform well enough a single machine with 64 or 128 cores. Back then I think the prod machines were something like 2, 4, or 8 cores.

[2] This was the trigram regex search over open source code on the web. Later, there was also the structured search with compiler front ends, led by Steve Yegge.

The big regression 7 months ago

Visiting my dad in a hospital now - I can also confirm that low quality software made many things worse

In particular communication between doctors and nurses is worse, because it’s all mediated by software

AI sycophancy panic 7 months ago

They will push back against obvious stuff like that

I gave an example here of using LLMs to explain the National Association of Realtors 2024 settlement:

https://news.ycombinator.com/item?id=46040967

Buyers agents often say "you don't pay; the seller pays"

And LLMs will repeat that. That idea is all over the training data

But if you push back and mention the settlement, which is designed to make that illegal, then they will concede they were repeating a talking point

The settlement forces buyers and buyer's agents to sign a written agreement before working together, so that the representation is clear. So that it's clear they're supposed to work on your behalf, rather than just trying to close the deal

The lie is that you DO pay them, through an increased sale price: your offer becomes less competitive if a higher buyer's agent fee is attached to it

AI sycophancy panic 7 months ago

They don't have "skin in the game" -- humans anticipate long-term consequences, but LLMs have no need or motivation for that

They can flip-flop on any given issue, and it's of no consequence

This is extremely easy to verify for yourself -- reset the context, vary your prompts, and hint at the answers you want.

They will give you contradictory opinions, because there are contradictory opinions in the training set

---

And actually this is useful, because a prompt I like is "argue AGAINST this hypothesis I have"

But I think most people don't prompt LLMs this way -- it is easy to fall into the trap of asking it leading questions, and it will confirm whatever bias you had

I like this framing!

One analogy I'd make is alternating periods of

    - "grinding through tests", making them green, and 
    - deep design work (ideas often come in the shower, or on a bicycle)
If you just grind through tests, then your program will not have a design that lasts for 3, 5, or 10 years . It may fall apart through a zillion special cases, or paper cuts

On the other hand, you can't just dream up a great design and implement it. You need to grind through the tests to know what the constraints are, and what your goal is! (it often changes)

---

So one way I'd picture programming is "alternating golfing and rowing" ... golfing is like looking 100 yards away, and trying your best to predict how to hit that spot. If you can hit it accurately, then you can save yourself a lot of rowing !!

Rowing is doing all the work to actually get there, and to do it well

Yeah that's basically what was discussed here: https://lobste.rs/s/xz6fwz/unix_find_expressions_compiled_by...

And then I pointed to this article on databases: https://notes.eatonphil.com/2023-09-21-how-do-databases-exec...

Even MySQL, Duck DB, and Cockroach DB apparently use tree-walking to evaluate expressions, not bytecode!

Probably for the same reason - many parts are dominated by I/O, so the work on optimization goes elsewhere

And MySQL is a super-mature codebase

Yeah I've seen that, but it looks like the inference-side only?

Maybe that is a hint that he does use off-the-shelf models as a coding aid?

There may be no need to train your own, on your own code, but it's fun to think about