7,639 karma · joined February 4, 2011
https://bun.com
jobs@bun.sh
[0]: https://twitter.com/jarredsumner/status/1736741811039899871
Will check once I get to my computer
Edit: was not fixed. We made other changes to fs.readSync to improve Node compatibility, but missed this. It will get fixed though
We’ve been so busy with adding Windows support that it’s been hard to prioritize much else
Threads could also work but the problem is you have to re parse & evaluate all the code. That’s a lot of duplicate work. It’s probably still worth it for large enough apps
Note that Bun v1.1 is still compiling at the time of writing (probably for another 20 minutes)
zx uses the system-provided shell, which means it isn't cross-platform
For the commands Bun Shell implements as builtins, they typically run something like 10x - 20x faster than in zx on mac/linux because spawning processes is expensive (even more expensive on Windows)
Bun is an incredibly fast JavaScript runtime, package manager, test runner, and bundler. Our 2024 goal is to replace Node.js as the default server-side JavaScript runtime. We launched Bun 1.0 back in September: https://www.youtube.com/watch?v=BsnCpESUEqM, and it's been a really exciting 6-ish months seeing developers use Bun at companies like X (Twitter), Midjourney and Brex.
Today we have over 2,000 issues open in our GitHub repo https://github.com/oven-sh/bun/issues, and while we love seeing people use Bun, it's clear that we need to grow the team to help make Bun more reliable and implement missing features blocking companies from switching to Bun.
We are hiring systems engineers in San Francisco to help make Bun more reliable and implement new runtime APIs and services. Bun is written in a mix of Zig and C++, but experience with Zig is not required (People with a C/C++ background tend to pick up Zig quickly). Working on Bun often involves reading WebKit/JavaScriptCore source code, Zig standard library source code, Darwin XNU source code, and sometimes Linux kernel source code. We are a well-funded early-stage startup (9 people currently). Our office is in the financial district in San Francisco
Please apply here: https://apply.workable.com/oven/j/A7A1388873/
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.
Unlike zx/execa, we have our own shell instead of relying on a system-installed one.
I have no idea when Lambda would add an official runtime layer. But if you work at Lambda and are interested, feel free to email me - jarred@bun.sh
A neat thing about tail calls in JavaScriptCore: there’s an explicit bytecode intrinsic for it.
return @tailCallForwardArguments(MyConstructor, this);
To use this in Bun, you’d have to start Bun with the environment variable “BUN_JSC_useDollarVM=1” and then $vm.createBuiltin(mySourceCodeString)When using this intrinsic, if any of the arguments are incorrect or it cannot otherwise enable it, the entire process will probably crash. In debug builds of JSC it will have a nicer assertion failure but that is not enabled in release builds
Example code: https://github.com/WebKit/WebKit/blob/17351231b4dedb62d81721...
also happy to answer any questions about Bun