Live data from Hacker News

The Bun Shell

bun.sh

1–10 of 239 posts

Re: The Bun Shell

#3
For something which works across all JS runtimes (Deno, Node) and achieves basically the same, check out the popular JS library Execa[1]. Works like a charm!

Another alternative is the ZX shell[2] JS library. Tho haven't tested it.

[1]: https://github.com/sindresorhus/execa

[2]: https://github.com/google/zx

Re: The Bun Shell

#4

Can somebody explain why they’re attributing ZSH to macOS? It’s clearly cross platform

The only guess I have is because it's the default interactive shell on macOS, while bash is probably more common on GNU systems.

But that also doesn't make much sense given that this is about non interactive scripts.

To be honest it's kind of crazy that for all the work that's gone into nodejs, it either doesn't have, or people don't know about, basic functionality that these examples are running a shell for.

Re: The Bun Shell

#5
post #4

Can somebody explain why they’re attributing ZSH to macOS? It’s clearly cross platform

The only guess I have is because it's the default interactive shell on macOS, while bash is probably more common on GNU systems. But that also doesn't make much sense given that this is about non interactive scripts. To be honest it's kind of crazy that for all the work that's gone into nodejs, it either doesn't have, or people don't know about, basic functionality that these examples are running a shell for.

> default interactive shell

Is that fairly new? I thought the default shell was bash.

Re: The Bun Shell

#6
post #4

Earlier quoted context omitted.

The only guess I have is because it's the default interactive shell on macOS, while bash is probably more common on GNU systems. But that also doesn't make much sense given that this is about non interactive scripts. To be honest it's kind of crazy that for all the work that's gone into nodejs, it either doesn't have, or people don't know about, basic functionality that these examples are running a shell for.

> default interactive shell Is that fairly new? I thought the default shell was bash.

Since Catalina, released in 2019.

Re: The Bun Shell

#7
I didn't know, but apparently you can execute a function in JS without parentheses using upticks (`), e.g:

  functionName`param`
and whatever is inside of the upticks get sent to the function as an array. It's also what Bun is doing with it's $ (dollar sign) function for executing shell commands. There's so much weird syntax magic in JS.

Re: The Bun Shell

#8
post #7

I didn't know, but apparently you can execute a function in JS without parentheses using upticks (`), e.g: functionName`param` and whatever is inside of the upticks get sent to the function as an array. It's also what Bun is doing with it's $ (dollar sign) function for executing shell commands. There's so much weird syntax magic in JS.

These are called "tagged templates": https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re: The Bun Shell

#9
post #8
post #7

I didn't know, but apparently you can execute a function in JS without parentheses using upticks (`), e.g: functionName`param` and whatever is inside of the upticks get sent to the function as an array. It's also what Bun is doing with it's $ (dollar sign) function for executing shell commands. There's so much weird syntax magic in JS.

These are called "tagged templates": https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Ah! There's a lot more to this than just executing a mere function it seems. Consider me educated!
Post reply on HN