![]() |
|
![]() |
|
Tagged templates[0], the language feature that enables this, were introduced in ECMAScript 2015 apparently – arguably at least somewhat new in the lifespan of JavaScript. :) Java is getting a similar feature with template processors[1]. It would be nice to have it in Python as well – i.e. not just f-strings, but something that (like tagged templates) allows a template function process the interpolated values to properly encode them for whatever language is appropriate (e.g. shell, SQL, HTML, etc.). [0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... |
![]() |
|
Seems like a good release.
I watched their video, and some charts were a bit unclear, as in, I didn't know if they were comparing with the previous Bun version or Node.js. My experience with using Bun in side projects has been good. The built-in APIs work well in my experience, and I hope popular runtimes adopt at least a subset of them. The hashing and the SQLite bindings come to mind as APIs that I wish were available in Deno and Node.js as well. They collect some telemetry by default. I don't think the install script tells you that. The only mention of it that I've found is in the Bunfile documentation: https://bun.sh/docs/runtime/bunfig#telemetry I'd prefer if it was opt-in, and that users were given instructions for disabling it if they want to during installation. They offer an option to create a dependency-free executable for your project, which bundles the runtime with your .js entrypoint. That works great if you want a single binary to distribute to users, but at the moment, the file size is still pretty big (above 90MB on GNU/Linux for a small project). Not terrible, but nothing comparable to Go or QuickJS yet. I wonder if in the future, Bun would offer an option to compile itself with certain features disabled, so we'd get a smaller binary. I have been playing with using Bun as a Haxe target. It works pretty well and IMO it's a choice to consider if you like Haxe more than TypeScript, or if you want to add a web server to an existing Haxe project without adding another programming language. You can also to do things like generating validation code at compile time, which seems hard to do with just TypeScript. |
![]() |
|
I find it hilarious that we now present runtimes and other programming stuff like it was Apple presenting a new iPhone. This would be satire 15 years ago. No disrespect to Bun tho, I love Bun.
|
![]() |
|
The audience for these types of announcement is bigger. My intuition is that there are many more consumers of node-like environments today than any runtimes 15 years ago. |
![]() |
|
I work on Bun and happy to answer any questions. Note that Bun v1.1 is still compiling at the time of writing (probably for another 20 minutes) |
![]() |
|
Now that Discord will start showing ads, is there any chance Bun will support a communication platform that is open & ad-free like IRC, XMPP, or Matrix?
|
![]() |
|
What kind of question is this? He is working on a JavaScript/TypeScript runtime not building a communication product. Why would you run to him to solve your pet grievance with Discord?
|
![]() |
|
I think they used the word "support" to mean "use", rather than "build". That is - they weren't asking Bun developers to _build_ an alternative to Discord, but rather to stop _using_ Discord.
|
![]() |
|
Isn't there some way of cloning a loaded vm after loading a module? I would imagine that should be possible some how, that way you could parse once then execute in multiple threads.
|
![]() |
|
love it, even `bun upgrade` is fast: On my rpi 4 that I capped to 600mhz for performance testing: Bun v1.1.0 is out! You're on 1.0.36 [3.93s] Upgraded. |
![]() |
|
What prisma issues are you running into? For us we just installed node alongside bun in our docker container and then ran prisma with node… was there something else?
|
![]() |
|
Python is among the most popular languages and it doesn't require a compile step. TypeScript is entirely metadata, so it just doesn't make sense to need to compile it. |
![]() |
|
Also with Deno, it become very easy to write typed cli. .ts file can be run as script very easily with permission access defined on top of the script such as: #!/usr/bin/env -S deno run --allow-net Then one can just run ./test.ts if the script has +x permission. Also project such as https://cliffy.io has made writing cli way more enjoyable than node. It is a good idea to beware of the VC. So it is good idea to support project such as Hono (projects conform to modern web standard, and is runtime agnostic for JS). |
![]() |
|
> Also with Deno, it become very easy to write typed cli. .ts file can be run as script very easily with permission access defined on top of the script such as: I do this all the time. I used to use `npx tsx` in my hashbang line to run TS scripts with Node, but I've started using Deno more because of the permissions. Another great package for shell scripting with Deno is Dax, which is like the Deno version of Bun shell: https://github.com/dsherret/dax > Also project such as https://cliffy.io has made writing cli way more enjoyable than node. This looks cool. I've always used the npm package Inquirer (which also works with Deno), but I'll have to compare Cliffy to that and see how it stacks up in comparison. > Hono (projects conform to modern web standard, and is runtime agnostic for JS) Hono is awesome. It's fast, very well typed, runs on all JS runtimes, and has zero dependencies. |
![]() |
|
Enforcing permissions at dependency boundaries would be the ultimate goal, but trying to separate first-party code from third-party code within the same thread is a herculean task (if I pass a callback to a dependency, which permissions does it run with for example), and you can't really lean on JS engines to do the heavy lifting, because they weren't designed with that threat model in mind. The best you can do currently is run your dependencies in a Worker, and enforce permissions programmatically for the worker [1]: For example:
This isn't perfect by any means, and you shouldn't rely on it like a silver bullet, but if given the choice I'd rather have permissions in my security toolbox.[1] https://docs.deno.com/runtime/manual/runtime/workers#specify... |
![]() |
|
It also helps avoid a node/v8 monoculture, just like with web browsers. I'm sure the ecosystem as a whole will get better because of it, even if you decide not to use it.
|
![]() |
|
How is the Bun test runner’s compatibility with Jest’s methods? Can a mature test suite be easily ported? We are currently looking at vite and vitest to run 1600 jest tests. |
![]() |
|
One of things that makes me more bullish on bun rather than Deno is that bun is intentionally aiming for compatibility with node and the npm ecosystem while Deno doesn't seem to be.
|
![]() |
|
I found Bun to be faster. Monorepo support is a bit kludgy though. Once you know of the workarounds, it's ok. See my comment on https://github.com/oven-sh/bun/issues/5413#issuecomment-1956... AFAIK, Pnpm monorepos do not follow standard npm. Bun does follow standard npm monorepos. Pnpm's feature to override dependency versions is nice for legacy projects with many 3rd party dependencies. Not sure if Bun has the same feature. I mostly use it on greenfield projects with dependencies that I control. |
![]() |
|
Ack, I ran into a similar issue when writing a github webhook. It might be related to JWT handling if it's the same issue. If you recall that exact issue, definitely feel free to file an issue. |
![]() |
|
I don't know how you're using Node and not thinking "I wish there was a better option than this". I can't wait to jump ship but Bun/Deno aren't quite there yet, for my needs.
|
![]() |
|
Bun and Vite are not analogous. Bun is a runtime with a standard library, bundler, test runner. Vite is a bundler. You can run Vite through Bun.
|
![]() |
|
"...Bun on Windows passes 98% of our own test suite for Bun on macOS and Linux." Does this mean the release was made with failing tests, or am I misunderstanding? |
![]() |
|
At some point it becomes infeasible to 100% the test suite for all configurations. At some point further away it becomes infeasible to 100% the test suite for any configuration. |
![]() |
|
Hooray for Windows support! That was keeping me from using Bun since I'm on Windows a fair bit. My experience with Bun has been excellent so far and I'm looking forward to using it more.
|
![]() |
|
Is Bun executing TS or is it also compiling down to JS and executing that? Edit: The docs mention: > Because Bun can directly execute TypeScript, you may not need to transpile your TypeScript to run in production. Bun internally transpiles every file it executes (both .js and .ts), so the additional overhead of directly executing your .ts/.tsx source files is negligible. https://bun.sh/docs/runtime/typescript The idea I'm getting from this is that both JS and TS are transpiled to something else. Are types preserved in this bytecode, AST, or whatever it is? |
![]() |
|
Why would doing work at run time that can be done at build time be a good idea? I have a CI, I'd rather have it so the build work rather than delegating that to my production servers.
|
![]() |
|
You can also ask why every node server traverses the file system to load dependencies at runtime instead of build time. Packaging your server with bun build can be the answer to both.
|
![]() |
|
Lots of good changes here, Bun shell + windows support solves a real problem. Is `remix run dev` fully working now with the additional node API support? |
![]() |
|
Faster this, faster that. Is it finally segfault free?
I've tried it like 3 times in span of last year with different projects only to find out it segfaults at runtime or when installing package.
|
![]() |
|
It's realy nice when I need to do shell stuff - much nicer to be able to use js to write a shell script than either go look up shell syntax again or use js with child_process.spawn()
|
![]() |
|
On one hand I like the work Bun is doing, on the other hand the Bun module is starting to look like a messy "utils" module, aka random junk drawer. All of them useful of course, just... incoherent.
|
![]() |
|
I was quite curious about the .bunx file format. I think this could be a quite a useful thing, a universal binary format. Then I see the shim DLL: https://github.com/oven-sh/bun/blob/801e475c72b3573a91e0fb4c... Even before this past week's XZ backdoor revelation, checking binaries into source control rather than building from source seems quite questionable. In fairness to the Bun developer's, they have a comment in their build.zig file acknowledging that this shim should be built more normally rather than being checked in. Then I look into the source for it: https://github.com/oven-sh/bun/blob/801e475c72b3573a91e0fb4c... For no discernible reason, it is using a bunch of undocumented Windows APIs. The source cites this Zig issue as one reason for why they think it is OK to use undocumented APIs: https://github.com/ziglang/zig/issues/1840 I don't see any good reasons here cited for using undocumented, unstable interfaces. For Zig's part, there seems to be some poorly-explained interest in linking against "lower level" libraries without any motivating use case (just some hand waving about security and drivers, neither of which makes much sense. Onecore.lib is a thing if you wanted a documented way of linking an executable that run on a diverse set of Windows form factors. And compiling drivers may as well be treated as a seperate target, since function names are different). For Bun, I assume they are trying to have low binary size. But targeting NTDLL vs. Kernel32 should not make a big difference, especially when the shim is just doing basic file IO. For an example of making small executable with standard API, you can make hello world 4kb using MSVC just by using /NODEFAULTLIB and /ENTRY:main with link.exe and this program :
So it should be possible to make a .bunx shim of small size without having to resort to undocumented API. (Current exe is 12kb). But even if the shim exe was 100kb, that would be still be an acceptable tradeoff for me than having to debug any problem that results from using non-standard APIs.
|
![]() |
|
Bun churning out the good stuff, yet again. So often I read the release notes and think “what a great idea, why wasn’t this already a thing” e.g. syntax highlighted errors |
For example, in Python you could easily do this:
But the Bun API doesn't separate quoting from executing the command, so you can't make that kind of mistake: