News for hackers. Stuff that matters.
Re:Bun v0.2.0 by Jarred on Thursday October 13, 2022 @09:31PM (#33198646)
Happy to answer any questions about Bun
Re:Bun v0.2.0 by wener on Thursday October 13, 2022 @09:41PM (#33198692)
Any plan to support musl ?
Re:Bun v0.2.0 by Jarred on Thursday October 13, 2022 @09:57PM (#33198790)
There have been musl builds of Bun before but there were a couple subtle bugs regarding thread spawning. I’m also not sure about posix_spawn implementation - would need to read up on that
Re:Bun v0.2.0 by sergiotapia on Thursday October 13, 2022 @09:35PM (#33198667)
New to Bun. Bun is about ~4x faster than Node.

How much of this is due to Zig, vs using Webkit instead of v8?

Re:Bun v0.2.0 by ec965 on Thursday October 13, 2022 @09:43PM (#33198705)
Have you experienced any pain points from using zig? I've heard a lot of good things about the language and am curious about it's down sides.
Re:Bun v0.2.0 by Jarred on Thursday October 13, 2022 @10:00PM (#33198800)
Zig is great. The editor tooling could use some more work but I think after their new stage2 compiler is more ready, it sounds like they’ll invest more into that.
Re:Bun v0.2.0 by threatofrain on Thursday October 13, 2022 @09:45PM (#33198721)
Any plans on a Bun competitor to Deno's edge functions?
Re:Bun v0.2.0 by Jarred on Thursday October 13, 2022 @10:02PM (#33198811)
I wouldn’t phrase it as a competitor but Bun will ship hosting & deployment

https://oven.sh

Re:Bun v0.2.0 by icy on Thursday October 13, 2022 @09:56PM (#33198788)
It appears to be in the works: https://oven.sh
Re:Bun v0.2.0 by tiffanyh on Thursday October 13, 2022 @09:53PM (#33198773)
What do you think just-js does well, and doesn’t do well?
Re:Bun v0.2.0 by Jarred on Thursday October 13, 2022 @10:00PM (#33198807)
I don’t really have opinions about just-js. I enjoyed their blog post about optimizing Postgres though
Re:Bun v0.2.0 by losvedir on Thursday October 13, 2022 @10:10PM (#33198851)
Do you have any stats or profiling info on the binary lockfile? JSON gets parsed so fast (GBs in a second?) that intuitively it doesn't seem to me like it would be a bottleneck, especially if you have the flexibility to change the representation. I know `package-lock.json` is especially verbose, but e.g., Elixir's `mix.lock` is pretty trim, and still human-readable.

If it really is a problem, then a binary lockfile might be worth it, but it's a pretty substantial hit to developer experience, I think. At least, I'm accustomed to checking the lockfile diff on PRs, and it's a shame to lose that.

Re:Bun v0.2.0 by Jarred on Thursday October 13, 2022 @10:31PM (#33198985)
Haven't experimented enough with text-based lockfile formats. It's worth trying.

To make serialization fast though, it would still need to do structure of arrays instead of an array of structures. Instead of each package being an object in the lockfile, arrays of package names, of version numbers, etc. it would need a tool to understand it

Re:Bun v0.2.0 by jbeduya on Thursday October 13, 2022 @10:52PM (#33199110)
When is "child_process" implementation expected to be released?
Re:Bun v0.2.0 by Jarred on Thursday October 13, 2022 @10:57PM (#33199135)
next week
Re:Bun v0.2.0 by cercatrova on Thursday October 13, 2022 @11:08PM (#33199196)
Just curious why Zig was chosen compared to the other languages out there for high performance computing like Go, Rust, Nim etc. Was it just because you were familiar with Zig or were there deeper reasons related to the programming language?
Re:Bun v0.2.0 by com2kid on Friday October 14, 2022 @12:14AM (#33199554)
Of the languages you mentioned, Go and Nim both have runtimes, for a product focused on performance above all else, that is just asking to leave performance on the table.

As for Rust and Zig, IMHO, programming in Zig is more fun, so if I was OP, I'd also have gone for Zig.

Re:Bun v0.2.0 by winrid on Friday October 14, 2022 @03:48AM (#33200712)
The nim runtime overhead is very small. In my tests it was very easy to out perform the latest Node and Java runtimes with shorter, and still type safe, code.
Re:Bun v0.2.0 by generichuman on Friday October 14, 2022 @05:24AM (#33201356)
It is _really_ small, especially if you're using the ARC.

I have some criticism for the language itself around personal preferences, such as "concepts need to be finished ASAP", "don't depend on libc" (Zig is doing a much better job here) and some syntax pet-peeves.

Nim needs to be more popular IMO. Well, the same goes for D too. Sigh.

Re:Bun v0.2.0 by himujjal on Friday October 14, 2022 @10:16AM (#33203809)
I would have used Nim for just about everything, had there been:

1. Support for cyclic imports 2. Official WASM support. I know nlvm exists. But those are two separate runtimes to be managed for long time.

Re:Bun v0.2.0 by sekao on Friday October 14, 2022 @01:37PM (#33206558)
I believe cyclic imports are coming. And Nim does supports wasm...you can target it with `--cpu:wasm32`. You most likely want to pair that with emscripten as in https://github.com/treeform/nim_emscripten_tutorial
Re:Bun v0.2.0 by himujjal on Friday October 21, 2022 @07:15AM (#33286793)
Yeah. checked out wasm part. But man. I am not going to go into Nim without cyclic imports.

I was writing a compiler I remember where I hit the 5k LOC mark in Nim. And then the errors and stuff. It was a terrible experience putting all the types into one file, the functions into others etc etc. The DevExp is bad that way.

Other than that, I don't see much issues with Nim to be fair. Its quite a good language that ticks all boxes

Re:Bun v0.2.0 by winrid on Friday October 14, 2022 @12:37PM (#33205789)
I want to use D for a new company idea I have. The library situation just isn't there though, which is always the problem.
Re:Bun v0.2.0 by generichuman on Friday October 14, 2022 @02:02PM (#33206787)
Its interoperability with C and C++ is top notch, if you're willing to work with libraries in those languages.
Re:Bun v0.2.0 by winrid on Friday October 14, 2022 @04:12PM (#33208303)
That's what I've been hearing.

Some problems are - vibe.d does not look nearly as performant or supported as, say, Drogon, which is what I was seriously considering using (I love the idea of using C++ with modern move semantics and coroutines to make async code easy).

I know and love Java and Node a lot - just want to try not using a VM for a bit :)

Re:Bun v0.2.0 by socialdemocrat on Friday October 14, 2022 @12:26AM (#33199619)
I have seen several others remark that when you really need to squeeze performance Zig does better.

Currently writing a small Zig project, I can totally see that. Although frankly I will probably stick to Go. Zig is a lot more work in my view as it os very low level. However that is also what helps you squeeze out performance.

With Zig you really get a fine grained control of memory management and it is a lot easier to push anything you can to be computed at compile time rather than runtime.

Re:Bun v0.2.0 by Jarred on Friday October 14, 2022 @04:16AM (#33200911)
I’m very productive in Zig. I had trouble being productive in other languages while also writing performant code
Re:Bun v0.2.0 by yewenjie on Thursday October 13, 2022 @11:47PM (#33199431)
Is there any plans for simplifying the build process (currently it is a 1700 soc big makefile) so that it is easier to package in different formats/platforms?
Re:Bun v0.2.0 by pmayrgundter on Friday October 14, 2022 @12:14AM (#33199552)
Heya, love the project and was very excited when I first tried it for the speed and simplicity. Glad you got funded!

Please take a look at #1169. This stopped me, and the issue got a couple agreements. Also asked around on Discord to no avail. I see you have #156, which seems to indicate you're able to bundle, just not optimally for prod. But it's not clear to me how to generate a bundle.js for a main entrypoint.

Maybe just a doc issue? Running ./node_modules.bun gets a loadable module, but unclear where to go from there and it's not drop-in compatible with my esbuild process.

Re:Bun v0.2.0 by pmayrgundter on Friday October 14, 2022 @06:54PM (#33209749)
Heard back from Jared on their Discord.. indeed, it's not bundling yet.

https://github.com/oven-sh/bun/issues/1169

Re:Bun v0.2.0 by mark_and_sweep on Friday October 14, 2022 @02:08AM (#33200154)
Are there any plans for releasing a native Windows executable?
Re:Bun v0.2.0 by Jarred on Friday October 14, 2022 @04:14AM (#33200897)
Yes, though timeline not clear right now. We (https://oven.sh) are hiring engineers and this is one of the first large projects