8 ms·
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-
by akagusu 4y ago
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
- sedatk 4y agoWhat do you have against Rust?
- deleted 4y ago[deleted]
- k__ 4y agoHaha, good question. Should have used Nim, to make it interesting :D
- aidaman 4y agotoo complicated
- mr90210 4y agoThe whole rewrite everything in Rust.
- crabbygrabby 4y agoThat'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.
- jokethrowaway 4y agoRewriting into a safe language actually has some benefits - namely safety compile time guarantees. Only RAM manufacturers like memory leaks.
- Cthulhu_ 4y agoWhile 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.
- conaclos 4y agoAgreed. Some project attract attention just because it is written in Rust. Although Rust is well-designed, the language does not make everything.
- krona 4y agoMemory 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.
- crabbygrabby 4y agoYou literally cannot get them period in rust. Like it is not possible. That's the point of rust.
- 3836293648 4y agoLeaks 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
- voorwerpjes 4y agoLeaks can happen in rust. The guarantee safe rust makes is that memory leaks cannot result in undefined behavior.
- sedatk 4y agoHow is that worse than Zig in that context?
- Existenceblinks 4y agoThe bible is too thick!
- avgcorrection 4y agoIt 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.
- jalino23 4y agothis 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
- skavi 4y agoSafari consistently performs better than Chrome in JS benchmarks (on Macs).
- easrng 4y agoAlso 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.
- chrisseaton 4y ago> 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?
- jokethrowaway 4y agoThe entire marketing for Chrome was that V8 was faster. Since 2019, it seems like JSC is actually faster (they even beat V8 benchmarks).
- mi_lk 4y agosource please?
- conaclos 4y agoEvery 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. [1] https://v8.dev/blog https://v8.dev/blog
- speed_spread 4y agoCareful, 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...
- kekkidy 4y ago
- Shadonototra 4y agothat can't happen with Zig, since you can just drop your C/C++ headers and call it a day ;)
- deepstack 4y agohowever 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.
- 3836293648 4y agoTo be fair they only said it starts faster than V8, nothing was said on runtime performance
- speed_spread 4y agoThis 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)
- stolsvik 4y agoThat’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.
- the_duke 4y agoTo 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.
- pverghese 4y agoKind of unfair if that's your concern since rust has segfault issues as well.
- deleted 4y ago[deleted]
- CJefferson 4y agoDoes it? I've never seen safe Rust segfault.
- crabbygrabby 4y agoIt can't people are shilling zig aimlessly.
- 3836293648 4y agoThe segfault can happen in safe rust, it just can't be caused by it. Segfaults don't happen immediately
- the_duke 4y agoOnly with unsafe Rust , and the ecosystem is generally very good about keeping unsafe code tightly scoped and correct.
- amelius 4y ago> it uses JavaScriptCore and not V8 Isn't JavaScriptCore available only in Apple's ecosystem?
- wootest 4y agoJavaScriptCore 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 https://developer.apple.com/documentation/javascriptcore
- ksec 4y agoAs much as I wholeheartedly agree, please dont spell it out. Zig is not perfect, Zig is full of sin, in a world full of righteousness, using Zig should be closely guarded.
- doe88 4y agoUnrelated 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.