Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
azakai
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
24 ms
·
271.
▲
by
azakai
4y ago
It does enforce spatial memory safety, at least, which is a large improvement over C (and to some extent C++). It does not enforce temporal memory safety, which is the harder one. Rust does have that (but it has unsafe blocks due to the lim
272.
▲
by
azakai
4y ago
Firefox is porting or replacing entire libraries. (The idea with Carbon is you could replace specific C++ classes or headers.)
273.
▲
by
azakai
4y ago
Wasm is smaller and faster than JavaScript and asm.js. It is both faster on average, it has far better predictability (far fewer performance cliffs or pitfalls), and it starts up faster (faster to decode + no need to warm up the JIT with ty
274.
▲
by
azakai
4y ago
That 2x figure is something that shows up consistently over the years, since asm.js in fact. The 10x cases are rare, like they found. Still, 2x is enough to justify using a different language in some cases. Separately, though, on very large
275.
▲
by
azakai
4y ago
In both cases the idea was to start simple in wasm 1.0 and leave those things for later. Both are being discussed now. For the first see e.g. https://github.com/WebAssembly/design/issues/1397 For the second,
276.
▲
by
azakai
4y ago
> When you said I was wrong I knew right away you either never actually tested or you're talking about outside of the browser. No, I actually was talking about the browser. And I have actually tested. You'll find my name on a b
277.
▲
by
azakai
4y ago
SQLite is one of the many benchmarks covered in one of my 2 links. The slowdown there is just under 50%. (SQLite stresses not just wasm but also other Web APIs, like storage, which might explain different results in different types of bench
278.
▲
by
azakai
4y ago
(As I said in another comment, those are 4 microbenchmarks. The links I provided contain both real-world codebases and also large sets of varied benchmarks.)
279.
▲
by
azakai
4y ago
Those are 4 microbenchmarks. There are much larger and more realistic workloads benchmarked in other places (see https://news.ycombinator.com/item?id=32084768 for links), with very different results.
280.
▲
by
azakai
4y ago
That estimate is way off. Wasm overhead is somewhere in the range of 50% (1.5x slower) to 14% (1.14x slower). Sources: * https://www.usenix.org/system/files/atc19-jangda.pdf * https://kripken.github.io&
281.
▲
by
azakai
4y ago
wasm32-unknown-emscripten is useful if you want to build a Rust program using SDL2 and GL for the Web, for example. But yes, as you said, it's much less used. Most Rust code on the Web is not a port of existing applications (which is w
282.
▲
by
azakai
4y ago
Partial list of companies using wasm, in addition to Figma: * Adobe * Microsoft * Google * Unity * AutoDesk * Zoom * Snapchat (PlayCanvas) * Twitch and many others, and that's just on the C/C++ side, and just on the Web.
283.
▲
by
azakai
4y ago
Estimates vary (because benchmarks and use cases vary), but it's generally faster than 50%. That number was seen here, https://www.usenix.org/system/files/atc19-jangda.pdf (I assume that's what you refer
284.
▲
by
azakai
4y ago
It isn't one or the other. Work on Wasm GC is ongoing and separate from this.
285.
▲
by
azakai
4y ago
GC is making a lot of progress. There are VM and toolchain prototypes. You can compile Java and Dart to wasm on those today and it generally works and is pretty fast. (There is also a Kotlin prototype but I have less information about it.)
286.
▲
by
azakai
4y ago
True, but I don't think Zig is committed to that particular idea and nothing else. Yeah, quarantining forever is going to have much more memory overhead. It might be fine for some use cases, but not a browser or anything else complex +
287.
▲
by
azakai
4y ago
> quarantining allocations forever [..] is insufficient for production In most cases that's true, but not all. ARM MTE + quarantine has just 1-2% overhead as tested on Chrome: https://security.googleblog.com/2022
288.
▲
by
azakai
4y ago
> It seems to me that the more sophisticated the safety a language provides is the more complex its error messages/code are. It would be so nice if we could solve both problems at the same time... That is incredibly hard, yes. But a
289.
▲
by
azakai
4y ago
Zig's safety is lower than Rust's, that's true, but it is still a very big improvement over C, so a case could be made for it in principle. But of course in practice Zig is not stable enough to consider that yet. Anyhow, this
290.
▲
by
azakai
4y ago
Btw, while you're here, another suggestion: Perhaps include Node.js as a runtime option? It's not a pure wasm VM, obviously, but it may be a common way to run wasm on the server simply because npm packages can include wasm. (OTOH,
291.
▲
by
azakai
4y ago
True, but there is an unfortunate amount of bugs in that area. We (I'm an Emscripten dev) would like to look more into improving Rust's Emscripten support, but there have just been higher priority items for us (and I guess others)
292.
▲
by
azakai
4y ago
They are good for different things, atm. Rust is focused on people writing new code for the Web, and does well there. C++ is focused on porting existing applications, which works well for things like Unity, Photoshop, Google Earth, etc. The
293.
▲
by
azakai
4y ago
Whenever you use Zoom or Meet in a browser you're using WebAssembly. Lots of other sites do too, but you just need to open the devtools to notice it. Other big examples: Unity games, Photoshop, Figma, Google Earth, etc.
294.
▲
by
azakai
4y ago
> It's always the same thing, when a post is about the environment the vegans come in and start telling everyone to stop eating meat to save the planet. In both of my comments above I didn't ask people to stop eating meat. Just
295.
▲
by
azakai
4y ago
For example, animal cruelty. Over time people have been choosing to abuse animals less and less, and today many societies have an increasing number of laws protecting animals. There are lots of other examples. Domestic violence against a sp
296.
▲
by
azakai
4y ago
It's not simple, you're right, but history has shown again and again that it can be viable. Society has made a lot of progress. In the end people can just choose. If someone reading this right now eats meat, then you can make the
297.
▲
by
azakai
4y ago
I wouldn't say it causes UB. It causes the problem to halt, deterministically, and safely - but maybe annoyingly. Yes, it's not as good as a static guarantee. But there are tradeoffs where it makes sense. Again, RefCell in Rust do
298.
▲
by
azakai
4y ago
Rust with RefCell will have such runtime errors, though. (Likewise, Rust using the indexes-in-an-array pattern can have use-after-free, but the harm is limited.) Also, IIUC this is not actually UB in Vale: it's a guaranteed error.
299.
▲
by
azakai
4y ago
They are very different in those respects, correct. But I think the point here is that both are ways of achieving memory safety.
300.
▲
by
azakai
4y ago
> A generational reference can include an offset to the parent's generation I see, thanks for the clarification. Then interior pointers will be larger than normal pointers, like all generational pointers? While the interior object i
More ›