Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by akagusu on Tuesday July 05, 2022 @07:20PM
(#31994953)
Bun won my heart because:
- it uses Zig and not Rust
- it uses JavaScriptCore and not V8
- it has built-in support for my favorite database: sqlite
- it is all-in-one
[ Parent
| on HN ]
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by speed_spread on Tuesday July 05, 2022 @11:34PM
(#31996382)
Careful, enough comments like that might just make Zig the new Rust. Rewrite It In Zig! Zig Uber Alles!
OTOH, that could at last free Rust from being the shiniest kid on the block. Carry on...
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by deepstack on Wednesday July 06, 2022 @06:33AM
(#31999036)
however that fact that it is NOT using V8 is quite refreshing change. We need diversity in the JS eco system other than google v8. Didn't realize JavascriptCore is faster than v8.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by 3836293648 on Wednesday July 06, 2022 @09:20AM
(#32000426)
To be fair they only said it starts faster than V8, nothing was said on runtime performance
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by speed_spread on Wednesday July 06, 2022 @10:36AM
(#32001645)
This is the same weak argument that's being used to sell native compilation on Java. Tons of graphics showing startup time improvement, never a word on what happens after. But the only cases where this metric makes a real difference are CLI utilities and Serverless (if you know others, please tell me)
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by stolsvik on Wednesday July 06, 2022 @05:18PM
(#32006947)
That’s not true, as far as I've read. I feel it is spelled out pretty thoroughly: Startup time and memory footprint are way lower, but peak performance is also lower: JIT outperforms static compilation due to it having more information. There are some tools to gather such information by running the program for a while, gathering stats, but JIT still outperforms.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by abraxas on Thursday July 07, 2022 @01:45AM
(#32010343)
Careful there. The JavaScript ecosystem is nothing if not diverse...
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by crabbygrabby on Wednesday July 06, 2022 @08:55AM
(#32000141)
You do realize people write rust for a reason right? Not because it's new and shiny...
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by seanw444 on Wednesday July 06, 2022 @09:54AM
(#32000911)
Well obviously. It's not going to shine when it's rusty.
[dead]
[dead]
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by macintux on Wednesday July 06, 2022 @12:24PM
(#32003207)
I’ve found that any humor here is downvoted unless it is both very creative and very short (basically no longer than a sentence).
Or maybe that’s just my criteria. Has nothing to do with the subject, and everything to do with what HN is for.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by speed_spread on Wednesday July 06, 2022 @01:08PM
(#32003853)
True. I do allow myself some leeway when I get deeper in the conversation tree but it's still noise I'm adding since HN is much flatter than other forums. I really need an outlet that will fulfill my need for expression but without going full Reddit.
Or maybe I just need physical colleagues and coffee break humor.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by Shadonototra on Wednesday July 06, 2022 @04:58AM
(#31998435)
that can't happen with Zig, since you can just drop your C/C++ headers and call it a day ;)
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by the_duke on Wednesday July 06, 2022 @04:59AM
(#31998443)
To be fair: there have been several SEGFAULT issues opened already on the repo.
The only time I've seen a SEGFAULT in Rust was when using a really badly implemented C library wrapper.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by pverghese on Wednesday July 06, 2022 @06:41AM
(#31999093)
Kind of unfair if that's your concern since rust has segfault issues as well.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by the_duke on Wednesday July 06, 2022 @07:49AM
(#31999527)
Only with unsafe Rust , and the ecosystem is generally very good about keeping unsafe code tightly scoped and correct.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by CJefferson on Wednesday July 06, 2022 @07:40AM
(#31999464)
Does it? I've never seen safe Rust segfault.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by crabbygrabby on Wednesday July 06, 2022 @08:49AM
(#32000074)
It can't people are shilling zig aimlessly.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by 3836293648 on Wednesday July 06, 2022 @09:21AM
(#32000442)
The segfault can happen in safe rust, it just can't be caused by it. Segfaults don't happen immediately
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by sedatk on Tuesday July 05, 2022 @08:02PM
(#31995225)
What do you have against Rust?
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by mr90210 on Wednesday July 06, 2022 @04:28AM
(#31998236)
The whole rewrite everything in Rust.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by jokethrowaway on Wednesday July 06, 2022 @06:25AM
(#31998985)
Rewriting into a safe language actually has some benefits - namely safety compile time guarantees.
Only RAM manufacturers like memory leaks.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by Cthulhu_ on Wednesday July 06, 2022 @07:28AM
(#31999398)
While true, I think there's a lot of "this is better because it's been written in Rust" software around these days. The emphasis is on the language, not the problem being solved.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by conaclos on Wednesday July 06, 2022 @07:42AM
(#31999478)
Agreed. Some project attract attention just because it is written in Rust. Although Rust is well-designed, the language does not make everything.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by krona on Wednesday July 06, 2022 @07:40AM
(#31999470)
Memory leaks in rust might be less common than a fully GC'ed language but saying rust prevents or makes them less common than e.g. zig/c++ seems like a stretch.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by crabbygrabby on Wednesday July 06, 2022 @08:50AM
(#32000086)
You literally cannot get them period in rust. Like it is not possible. That's the point of rust.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by 3836293648 on Wednesday July 06, 2022 @09:23AM
(#32000478)
Leaks are absolutely considered safe by rust. Just look at Box::leak. And if we're comparing it to GC'd "leaks", those are typically hashmaps growning out of control and that can also happen
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by voorwerpjes on Wednesday July 06, 2022 @11:38AM
(#32002549)
Leaks can happen in rust. The guarantee safe rust makes is that memory leaks cannot result in undefined behavior.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by crabbygrabby on Wednesday July 06, 2022 @08:53AM
(#32000128)
That's mostly a thing teenagers are doing to learn CS, when it's not it's because the software is vulnerable or slow and benefits from a rewrite in a safe language.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by sedatk on Wednesday July 06, 2022 @05:02PM
(#32006785)
How is that worse than Zig in that context?
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by avgcorrection on Wednesday July 06, 2022 @10:24AM
(#32001458)
It is effectively bait, irrespective of intent. Why would you say that “this pastry is great: it’s blueberry and not chocolate”. Is the implication that 50% of the enjoyment is on account of what it is not? Just weird.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by k__ on Tuesday July 05, 2022 @08:54PM
(#31995569)
Haha, good question.
Should have used Nim, to make it interesting :D
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by aidaman on Tuesday July 05, 2022 @11:32PM
(#31996372)
too complicated
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by Existenceblinks on Wednesday July 06, 2022 @05:37AM
(#31998682)
The bible is too thick!
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by jalino23 on Tuesday July 05, 2022 @08:40PM
(#31995483)
this is very interesting difference too! can you please tell me what you like more about zig over rust and JavascriptCore over v8. very interesting cause I've always thought v8 is superior to JC cause v8 is chrome and JC = safari and zig is very interesting too
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by skavi on Tuesday July 05, 2022 @11:23PM
(#31996333)
Safari consistently performs better than Chrome in JS benchmarks (on Macs).
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by easrng on Tuesday July 05, 2022 @11:57PM
(#31996542)
Also some things are wayyy slower on v8 compared to other engines. (I've only checked spidermonkey.) In my experience v8 is faster at running WASM and spidermonkey is faster at running optimized js (not quite asm.js but using some tricks like |0) and starting workers.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by chrisseaton on Wednesday July 06, 2022 @05:47AM
(#31998746)
> I've always thought v8 is superior to JC cause v8 is chrome and JC = safari
I have never in my life heard anyone say they thought V8 was superior to JSC - what are you basing that on?
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by jokethrowaway on Wednesday July 06, 2022 @06:29AM
(#31999007)
The entire marketing for Chrome was that V8 was faster.
Since 2019, it seems like JSC is actually faster (they even beat V8 benchmarks).
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by mi_lk on Wednesday July 06, 2022 @07:01AM
(#31999228)
source please?
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by conaclos on Wednesday July 06, 2022 @07:46AM
(#31999506)
Every JS engine has interesting design choices. V8 has more documentation than other (the v8 blog is great resource [1]). This ism ore easy to have an overview of V8 internals. It could be nice to have more internal overview from other engine, in particular SpiderMonkey. It is hard to find up-to-date info.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by doe88 on Wednesday July 06, 2022 @12:19PM
(#32003150)
Unrelated question, maybe someone knows, each time I opened a JavaScriptCore or Webkit source file, i've almost never seen any comments. Is it me and my bad sampling or these codes have almost no documentation at all? That's really uncanny.
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by amelius on Wednesday July 06, 2022 @07:39AM
(#31999462)
> it uses JavaScriptCore and not V8
Isn't JavaScriptCore available only in Apple's ecosystem?
Re:Bun: Fast JavaScript runtime, transpiler, and NPM client ...
by wootest on Wednesday July 06, 2022 @08:23AM
(#31999789)
JavaScriptCore is a constituent part of WebKit, which is pretty much available on washer-dryers these days. But the macOS/iOS/etcOS framework part of JavaScriptCore that adds Objective-C/Swift layers is only available for those platforms, yes: https://developer.apple.com/documentation/javascriptcore