Live data from Hacker News

The Bun Shell

bun.sh

21–30 of 239 posts

Re: The Bun Shell

#22
post #16

I work on Bun - happy to answer any questions/feedback

How do you ensure cross platform compatibility under the hood?

We implement a handful of the most common commands like cd, rm, ls, which, pwd, mv. Instead of using the system-provided ones, it uses ours.

Unlike zx/execa, we have our own shell instead of relying on a system-installed one.

Re: The Bun Shell

#23
post #22

Earlier quoted context omitted.

How do you ensure cross platform compatibility under the hood?

We implement a handful of the most common commands like cd, rm, ls, which, pwd, mv. Instead of using the system-provided ones, it uses ours. Unlike zx/execa, we have our own shell instead of relying on a system-installed one.

Is this done in zig in the core bun runtime or is it implemented as part of the standard bun lib? How much perf is there? Small commands like cd or ls I'm less interested in. You say you provide your own shell... bsh, zigsh, what?

Re: The Bun Shell

#24
post #22

Earlier quoted context omitted.

We implement a handful of the most common commands like cd, rm, ls, which, pwd, mv. Instead of using the system-provided ones, it uses ours. Unlike zx/execa, we have our own shell instead of relying on a system-installed one.

Is this done in zig in the core bun runtime or is it implemented as part of the standard bun lib? How much perf is there? Small commands like cd or ls I'm less interested in. You say you provide your own shell... bsh, zigsh, what?

It’s nearly all in Zig.

The parser, lexer, interpreter, process execution and builtin commands are all implemented in Zig.

There’s a JS wrapper that extends Promise but JS doesn’t do much else.

The performance of the interpreter probably isn’t as good as bash, but the builtin commands should be competitive with GNU coreutils. We have spent a lot of time optimizing our node:fs implementation and this code is implemented similarly. We expect most scripts to be simple one-liners since you can use JS for anything more complicated.

Re: The Bun Shell

#25
Using Windows for development feels like using Linux for anything but server-side work or Macos for gaming, it'll probably work if you have light requirements and don't use the shell that often, but when I think about the last time I tried it, it almost makes me feel fine paying $500 for a ram upgrade on my next mac

Re: The Bun Shell

#26
I like this, and I like Bun, and I’m going to use this, but I’m nervous about whether Bun’s ultimate share of the server-side cloud Javascript will be big enough to sustain the maintenance surface area they are carving out for themselves.

Hope they succeed though!

Re: The Bun Shell

#27
Their info about "rm -rf" not working in Windows is slightly misleading. In PowerShell, you can accomplish this by running:

rm -r -fo my-folder-name

Re: The Bun Shell

#30

I guess this is too new for there to be any language documentation yet? Or perhaps I missed it. I'm wondering if it's picked up any ideas from oil shell [1]. [1] https://www.oilshell.org/

There's a short doc here https://bun.sh/docs/runtime/shell but it notes that the shell is not yet feature-stable.
Post reply on HN