For context, in case any reader is not aware: Andrew Kelley, the author of this blog post, is also the creator and main developer of language Zig. And Bun was written in Zig.
When Jarred announced the Rust rewrite, we were ecstatic. It seemed too good to be true. I have to admit, I didn't think the technology was there, to pull off this stunt. But he did it, and now I'm metaphorically sipping delicious tea from a mug that says "It Tastes Like It's Not My Problem Anymore".
The best victory comes from a fight you don't need to fight, as Sun Tzu said.
Zig compiler project is about 600,000 lines of code - roughly the same size as Bun before the rewrite, and I'm clocking 16s to build from scratch with a clean cache, followed by 90ms for each subsequent edit with incremental compilation enabled.
That's impressive compilation performance. And so most certainly when contrasting it to Rust.
"Oven is going to be a grind, especially the first nine months or so. If work-life balance means a lot of time spent not working, it's probably not a good fit."
Oh man, someone here recently shared a blog post on startup culture in software companies, which likened software to an oven, where you'd add a specific button for a customer and that fucks up your whole architecture for years to come etc..
For just a moment, I thought this was a direct quote from that blog post.
Oh, Rust and Zig. Two languages, continually compared and pit against each other, even though they are both such nice and innovative projects in their own right.
Deno is pretty interesting because it has built in sandboxing. By default, no code can even access the network. Everything must be explicitly allowed, including network access and environment variables: https://docs.deno.com/runtime/fundamentals/security/
Access can be scoped pretty granularly as well, only allowing access to specific websites or env variables.
I really like this model since it offers a strong protection against secrets stealers, which have hit NPM extremely frequently. No more of malicious NPM packages scraping the whole system to find secrets.
It does have a performance tradeoff compared to Bun. Bun is (was?) the fastest, Node was the slowest, Deno was in the middle.
18 Comments
thingsiplay@lemmy.ml · 38 pts · 45d
For context, in case any reader is not aware: Andrew Kelley, the author of this blog post, is also the creator and main developer of language Zig. And Bun was written in Zig.
tracyspcy@lemmy.ml · 29 pts · 45d
Moment I learned that it is for profit company behind bun, I got feeing that something stupid is coming
tracyspcy@lemmy.ml · 6 pts · 45d
Btw folks, it is a good enough trigger to start thinking of supporting Lemmy.
ICastFist@programming.dev · 22 pts · 45d
The best victory comes from a fight you don't need to fight, as Sun Tzu said.
Kissaki@programming.dev · 15 pts · 45d
That's impressive compilation performance. And so most certainly when contrasting it to Rust.
Brb, I am rewriting everything in Zig.
Ephera@lemmy.ml · 13 pts · 45d
Oh man, someone here recently shared a blog post on startup culture in software companies, which likened software to an oven, where you'd add a specific button for a customer and that fucks up your whole architecture for years to come etc..
For just a moment, I thought this was a direct quote from that blog post.
vanillama@programming.dev · 3 pts · 45d
That oven thing was a painful read, too real
muzzle@lemmy.zip · 2 pts · 44d
I too wondered whether the first blog post was tongue-in-cheek referencing the latest news with bun.
ExperimentalGuy@programming.dev · 11 pts · 45d
I always support the underdog. Jarred sounds like an ass.
aoidenpa@lemmy.world · 7 pts · 45d
I started learning zig after this post and learning about Mr.Kelley's views on AI.
craftrabbit@lemmy.zip · 6 pts · 44d
Oh, Rust and Zig. Two languages, continually compared and pit against each other, even though they are both such nice and innovative projects in their own right.
fizzle@quokk.au · 2 pts · 45d
Is there another nodejs alternative that supports typescript in a similar way?
Kissaki@programming.dev · 10 pts · 45d
Does Deno fit your needs? It is also a drop-in replacement to a large degree, but is somewhat focused on improving the related tooling environment.
I'm not very involved in the (non-browser) JS ecosystem, but it's my tool of choice.
moonpiedumplings@programming.dev · 6 pts · 45d
Deno is pretty interesting because it has built in sandboxing. By default, no code can even access the network. Everything must be explicitly allowed, including network access and environment variables: https://docs.deno.com/runtime/fundamentals/security/
Access can be scoped pretty granularly as well, only allowing access to specific websites or env variables.
I really like this model since it offers a strong protection against secrets stealers, which have hit NPM extremely frequently. No more of malicious NPM packages scraping the whole system to find secrets.
It does have a performance tradeoff compared to Bun. Bun is (was?) the fastest, Node was the slowest, Deno was in the middle.
lorty@lemmy.ml · 5 pts · 45d
I second Deno. Did a few small projects with it and I have no complaints.
fizzle@quokk.au · 1 pts · 45d
This looks nice actually. I can't remember but I think there was some disadvantage compared to bun.
moonpiedumplings@programming.dev · 7 pts · 45d
Performance, it's slightly slower compared to Bun, but it is faster than Node. But it has sandboxing, which is neat.
bitfucker@programming.dev · 1 pts · 45d
Not to the degree where bun support it. But NodeJS itself has now supported running typescript for a while