Live data from Hacker News

The Bun Shell

bun.sh

101–110 of 239 posts

Re: The Bun Shell

#101
I’m increasingly fed up with all shell scripts.

Sure shell scripts are great when they’re small. Except then they become not small. But they don’t get rewritten.

Piping strings of instructed text between programs is an error prone nightmare.

I want full debugger support, strong typing, cross platform support, and libraries not programs.

Python isn’t my favorite language. But I’ll take a debugable Python script over bash hell 100% of the time.

Re: The Bun Shell

#102
post #13

> We've implemented many common commands and features like globbing, environment variables, redirection, piping, and more. Of course on paper that sounds fine. However, something that is missing from here is some assurances of how compatible it actually is with existing shells and coreutils implementations. Is it aiming to be POSIX-compliant/compatible with Bourne shell? I am going to assume that not all GNU extensio…

I have recently switched to using Nushell as my default shell. They were also writing their own but recently decided instead to begin incorporating github.com/uutils/coreutils (Rust rewrite of GNU coreutils). They target uutils to be a drop-in replacement for the GNU utils. Differences with GNU are treated as bugs.

Re: The Bun Shell

#103
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.

Think this should be highlighted in the article, because that's actually pretty cool but the article gave me impression that it's a simple sugar over child_process only.

Re: The Bun Shell

#104
post #13

> We've implemented many common commands and features like globbing, environment variables, redirection, piping, and more. Of course on paper that sounds fine. However, something that is missing from here is some assurances of how compatible it actually is with existing shells and coreutils implementations. Is it aiming to be POSIX-compliant/compatible with Bourne shell? I am going to assume that not all GNU extensio…

Wait but find isn't a builtin command right? What do you mean by the odds and ends of GNU find not being there? That doesn't depend on the shell, it's an external program being called.

Re: The Bun Shell

#105

This is like... eval? I thought eval was bad?

Nope - there's at least one layer of safety:

>For security, all template variables are escaped:

>// This will run `ls 'foo.js; rm -rf /'` >const results = await $`ls ${filename}`; >console.log(results.stderr.toString()); // ls: cannot access 'foo.js; rm -rf /': No such file or directory

Re: The Bun Shell

#106
post #45

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

Plenty of people use Windows for development, Linux for development and gaming, and macOS for everything including servers. It’s all about preference.

Want to use a cool dev tool on Windows boils down to, can you host a Linux VM?

E.g. How do you profile Rust programs on Windows in RustRover/Clion? How do you run Coz on Windows? Basically WSL or a full VM.

Re: The Bun Shell

#109

This looks exactly like zx by Google. And that's probably a good thing. https://github.com/google/zx

Being in the Google GitHub org doesn't mean "by Google", it means "by someone who works at Google."

Re: The Bun Shell

#110

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

If you want bash like syntax, you can always run msys2 / Cygwin / WSL on Windows. But 99% of the time I just need to run basic commands like git and maybe pipe them to ripgrep or fzf, and frankly the PowerShell is fine for that. For anything more complicated, I'll write a script in Python or maybe JavaScript anyway, so I don't really care what shell I use as long as I can customize it and it can run basic commands. And if you don't like PowerShell, there's Nushell.
Post reply on HN