HackerTrans
TopNewTrendsCommentsPastAskShowJobs

chubot

no profile record

Submissions

Testing and Benchmarking of AI Compilers

broune.com
1 points·by chubot·7 bulan yang lalu·0 comments

comments

chubot
·11 hari yang lalu·discuss
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).
chubot
·12 hari yang lalu·discuss
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
chubot
·12 hari yang lalu·discuss
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.
chubot
·12 hari yang lalu·discuss
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
chubot
·23 hari yang lalu·discuss
In this case, it's not a new thing ... back in 2005 (yes 21 years ago), people talked about the achievements of Noam Shazeer at Google (and Jeff Dean and Sanjay, etc)

I always appreciated Jeff having a level head ... which this article seems to confirm:

https://www.yahoo.com/news/articles/google-cracks-down-posts...
chubot
·2 bulan yang lalu·discuss
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
chubot
·2 bulan yang lalu·discuss
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.
chubot
·2 bulan yang lalu·discuss
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
chubot
·2 bulan yang lalu·discuss
I came around to it a few weeks late, but Zef and this article by Filip are also great work!

https://zef-lang.dev/implementation

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

It has list of more than 20 optimizations for interpreters, with measured speedups. I'm pretty sure I was looking for something like this 3-5 years ago, but it didn't exist
chubot
·2 bulan yang lalu·discuss
These days, video evidence can be called into doubt pretty easily
chubot
·2 bulan yang lalu·discuss
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 ???
chubot
·2 bulan yang lalu·discuss
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)
chubot
·2 bulan yang lalu·discuss
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)
chubot
·4 bulan yang lalu·discuss
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
chubot
·4 bulan yang lalu·discuss
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...
chubot
·4 bulan yang lalu·discuss
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)
chubot
·4 bulan yang lalu·discuss
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
chubot
·6 bulan yang lalu·discuss
Yeah, I think that when writing code becomes cheap, then all the COMPLEMENTS become more valuable:

    - testing
    - reviewing, and reading/understanding/explaining
    - operations / SRE
chubot
·6 bulan yang lalu·discuss
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)
chubot
·6 bulan yang lalu·discuss
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)