10 ms·
I work on Bun. Happy to answer any questions also: there is a bug in `bun build --compile` I am currently working on fixing. Expect a v0.6.1 in a bit
by Jarred 3y ago
I work on Bun. Happy to answer any questions
also: there is a bug in `bun build --compile` I am currently working on fixing. Expect a v0.6.1 in a bit
- samwillis 3y ago> I work on Bun Understatement.
- intelVISA 3y agoLocal hacker seasons v8 Bun with io_urings; woulda been a cool proj if the Js runtime was organic like Bellard's qjs Still, in the native-starved web space this sorta meal will be considered haute cuisine.
- Signez 3y agoReally impressed to see that bun is now faster than esbuild, that was in my mind one of the fastest bundler/minifier in town. How did you achieve that? Are there some shortcuts you took, or some feature you deemed not in scope (yet)?
- eatonphil 3y agoI really hate to talk about software based on the language they're written in and I don't mean to imply one language is better or worse but the upper bound of performance on Zig is likely easier to reach and likely higher than the upper bound of performance in Go. Though it may depend on the workload. (esbuild being written in Go.)
- conradev 3y agoThis is a fantastic talk on some of the optimizations that Zig makes easy to implement: https://vimeo.com/649009599 https://vimeo.com/649009599 Bun is written in Zig, but it takes the same approach that esbuild took to make things fast: a linear, synchronous pipeline fitting as much as possible in the CPU cache with as little allocation and other overhead as possible. Zig has more knobs to turn than Go. Bun goes one step further and does a great job of offloading work to the kernel when possible, too (i.e. the large file I/O improvement with the Linux kernel)
- f311a 3y agoZig is cool, but Bun heavily relies on JSC which is written in C++
- brundolf 3y agoBut bundling doesn't
- conradev 3y agoJSC is a multi-tier JIT with the last stage ultimately being LLVM, so if you want to be pedantic, Bun relies on LLVM’s optimizer which is written in C++. The transpiling itself is written in Zig, which is the part that has the performance improvement. If Bun relied on JavaScript and JSC for the heavy lifting, it would be no faster than the other JS bundlers. edit: no longer LLVM: https://webkit.org/blog/5852/introducing-the-b3-jit-compiler/ https://webkit.org/blog/5852/introducing-the-b3-jit-compiler...
- kitd 3y agoCongrats on the release! How standalone are the standalone executables produced by `bun build`? Is a libc or equivalent expected to be present?
- Jarred 3y agoBun does need glibc, but older glibc versions should work okay because of this: https://github.com/oven-sh/bun/blob/78229da76048e72aa4d92516e296a57484450a30/src/bun.js/bindings/workaround-missing-symbols.cpp#L27 https://github.com/oven-sh/bun/blob/78229da76048e72aa4d92516... We haven't implemented polyfills for everything yet though, like Bun uses posix_spawn and doesn't have an exec + fork fallback Bun's dependencies otherwise are statically linked
- codethief 3y ago> Bun does need glibc Wait, are we talking about what Bun needs to run or what standalone executables produced by bun build need in order to run?
- hiccuphippo 3y agoBoth, the executables produced by bun are the bun binary concatenated to your script at the end. Try building a hello world and run `tail -c200 hello | xxd` to see your script at the end of the file.
- codethief 3y agoThanks!
- 10000truths 3y agoIs there any plan to allow for statically linking with musl to get completely shared-lib-dependency-free executables?
- tazeg95 3y agoHello, it seems very interesting. I am using esbuild to build my apps and it has a developper live server. How would you compare bun to esbuild ? what can one do that the other can't ? do you have a compare page ?
- meekaaku 3y agoJust wanted to say thank you for starting and leading the one of the most exciting projects in js landscape.
- drschwabe 3y agoNot a question, cause you already mention this here, but just wanted to give you extra props for supporting CommonJS out of the box; keep up the great work. https://twitter.com/jarredsumner/status/1475238259127058433?lang=en https://twitter.com/jarredsumner/status/1475238259127058433?... have been doing this (using ES and CommonJS modules in the same file) in clientside code via Browserify or Rollup ever since ESM got popular but it's a bit more nuanced and annoying to do in NodeJS
- alberth 3y agoRevenue/monetization model? Given that Oven has taken $7m in VC funding, how do you plan to monetize Bun, etc?
- whimsicalism 3y agomy understanding was an edge environment similar to CF workers
- Jarred 3y agoThe plan is JavaScript edge hosting focused on fast cold starts and being extremely inexpensive, using lots of custom infrastructure
- internetter 3y agoHi Jarred. Super excited to see bun coming along. I've been loving it ever since the invitation release. As I watch from the sidelines, I've been mesmerized by your productivity. I have a couple questions, if you don't mind. The first – I'm curious about Vite in bun. You have a bundler, you have a typescript transpiler, and you have a HTTP server. Does this mean eventually Vite (or at least some of it's functionality) will be "native" inside of bun, or will Vite continue to be it's own thing? (eg. Vite plugins for <framework>) The second is more related to Oven. I'm curious what the value proposition of Oven's edge is, compared to other serverless providers? It's hard to imagine the runtime being the main selling point, with it's node compatibility and packages like hono being able to run everywhere. What will set Oven's edge hosting apart from the pack?
- icemelt8 3y agoThis reply is news itself. Nice!
- pastacacioepepe 3y agoIs Windows support planned?
- yobuko 3y agoFirst, thank you for all of your hard efforts. I have seen some desire and works expressed towards using Bun with Electron or Electron alternatives; this interests me greatly. Do you have any plans or aspirations to make any strong push in this direction?
- sroussey 3y agoThis would be awesome. Use bun as the main process (replacing node) and have the front end use the system webview. The system webviews are good these days.
- HorizonXP 3y agoCalifornia Ave Lockitron crew represent!! Glad to see you leading this, incredible work and nice to see the positive reception.
- raphaelrk 3y agoCongrats on the launch!! Any plans on adding "in-memory" / "virtual" file support to Bun.build? I'd be interested in using it for notebook-style use cases -- Also, ways to do "on-the-fly" "mixed client/server" components (ala hyperfiddle/electric) + sandboxing (ala Deno) would be extremely exciting Some projects in this vein - https://github.com/jhmaster2000/bun-repl https://github.com/jhmaster2000/bun-repl and https://www.val.town/ https://www.val.town/ Also, bun macros are very cool -- they let you write code that writes over itself with GPT-4. Just mentioning as a thing to keep on your radar as you keep pushing the boundaries of what's possible in javascript :) making it more lispy and preserving eval-ability is great
- sroussey 3y agoBun is awesome! Need debug support and console fixes. Please!!!
- networked 3y ago1. It seems the Bun.file API (https://bun.sh/docs/api/file-io https://bun.sh/docs/api/file-io) doesn't provide a way to distinguish between a zero-size file and a file that doesn't exist. Is this right? If it is, it would be nice to have one. It doesn't have to interfere with the lazy loading. 2. Do you cross-compile Bun? If you do, how has your experience been cross-compiling with Zig when you have a C++ dependency?
- Jarred 3y ago> 1. It seems the Bun.file API (https://bun.sh/docs/api/file-io https://bun.sh/docs/api/file-io) doesn't provide a way to distinguish between a zero-size file and a file that doesn't exist. Is this right? If it is, it would be nice to have one. It doesn't have to interfere with the lazy loading. Yes that is correct and not good. Pedantically, files which don't exist can be created between the call to check if it exists and after. In practice though, it is pretty annoying > 2. Do you cross-compile Bun? If you do, how has your experience been cross-compiling with Zig when you have a C++ dependency? We cross-compile the Zig part but not the C++ dependencies. zig c++ was too opinionated for us the last time we gave it a try. I'm optimistic this will improve in the future though.
- toastal 3y agoWhen will Bun open up communications to something open source/decentralized instead of relying on users to give up their online security to Discord?