Live data from Hacker News

The Bun Shell

bun.sh

81–90 of 239 posts

Re: The Bun Shell

#82

"JavaScript is the world's most popular scripting language." Perhaps, based on usage. But shell must be the world's most ubiquitous scripting language. Not every computer has a Javascript engine but most have a shell. Many, many computers have no browser, let alone a GUI. Some small form factor computers might have embedded Javascript engine but that's a minority. No browser on the router.

I'd argue the opposite: more computers have an end-user accessible JavaScript engine (a browser) than an end-user accessible shell.

It really depends on how you define "computer".

Re: The Bun Shell

#84

"JavaScript is the world's most popular scripting language." Perhaps, based on usage. But shell must be the world's most ubiquitous scripting language. Not every computer has a Javascript engine but most have a shell. Many, many computers have no browser, let alone a GUI. Some small form factor computers might have embedded Javascript engine but that's a minority. No browser on the router.

Lots and lots of IoT devices running node…you might be shocked

"Lots and lots" sounds like a guess.

Re: The Bun Shell

#86

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

Great point! According to https://github.com/oven-sh/bun/blob/b433beb016470b87850f3c01..., Bun Shell took inspiration from zx[0], dax[1] and bnx[2]

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

[1]: https://github.com/dsherret/dax

[2]: https://github.com/wobsoriano/bnx

Re: The Bun Shell

#87

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

One thing that surprised me about Node was how slow the default way to shelling out (child_process) could be (probably https://github.com/nodejs/node/issues/14917 ). Although according to the linked issue, it has been "fixed", I still ran into a problem during a batch script that was calling imagemagick through a shell for each file in a massive directory; profiling was telling me that starting (not completing) (yes,…

I worked on that Node.js issue. If you can share a repro, I'd love to take a look: https://github.com/nodejs/node/issues/new?assignees=&labels=...

Re: The Bun Shell

#88
JS everything. No thanks. Show me a one-liner in Bun which comes anywhere near your average bread & butter bash + Linux utils pipeline. Async my have its uses but shell scripts ain't one of them. Shell scripts are impreative/procedural for a reason - sequential processing.

Re: The Bun Shell

#90

if you're writing "await" before every function call maybe that should be the default.

Or maybe a wake-up call that something is off. Shell scripting is a domain where impertive/procedural code shines.
Post reply on HN