Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
azakai
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
151.
▲
by
azakai
2y ago
Thanks, I think I see now. So `y` is the bytecode, in the analogy. Makes sense. (For me at least a concrete example would have helped, something like showing the specialized output of running on the bytecode for `power` with that interprete
152.
▲
by
azakai
2y ago
But can you only do that when you know what the inputs are? That is, if x and y are determined only at runtime for power(x, y) then I don't see what can be optimized. But that seems like the common case to me. Likely I'm missing s
153.
▲
by
azakai
2y ago
I understand that by making the bytecode constant a lot of optimization become possible. But I can't see how you can unroll the interpreter loop past unknown inputs to the program? That is, if the program is a pure function like power(
154.
▲
by
azakai
2y ago
Yes, Wuffs can do better than WasmBoxC because it does more than sandboxing of the code. It also checks things like integer overflows which can lead to exploits that are technically not memory safety issues, but still potentially dangerous.
155.
▲
by
azakai
3y ago
Usually around 2x slower execution. Load times would be even worse.
156.
▲
by
azakai
3y ago
Lockdown mode disables WebAssembly, which this uses. (But it could be built with the Emscripten flag to translate the wasm to JS, which would work, but would be slower.)
157.
▲
by
azakai
3y ago
> Whereas most works seem to have a thesis and then explore them on different levels, Lynch seems to just throw out ideas in different scenes. Many interpretations come to the exact opposite conclusion: that Lynch starts with a specific
158.
▲
by
azakai
3y ago
> If your language’s compiler toolchain can manage to produce useful Wasm in a file that is less than a handful of over-the-wire kilobytes, you can win. I agree that tiny binaries will open up new use cases for wasm! And WasmGC definitel
159.
▲
by
azakai
3y ago
They have a bunch of nice blogposts about that: https://www.figma.com/blog/webassembly-cut-figmas-load-time-... The main part of the app is in wasm, I believe (it's in C++ that they compile).
160.
▲
by
azakai
3y ago
> Perhaps from a C++ perspective, say a monolith with kilobytes of bindings driving a canvas. I get the desire for something more "elegant/clean" in this space, but JS is just very hard to beat on the bindings/glue si
161.
▲
by
azakai
3y ago
Sure, many major sites use it, such as Zoom, Google Sheets, and Photoshop. As the article mentions, you wouldn't know they are using Wasm under the hood unless you open the devtools and inspect the details. Many more examples, such as
162.
▲
by
azakai
3y ago
The good news in that area is that WasmGC (shipping in Chrome and Firefox today) has allowed very good Wasm support to be shipped for many more languages, including Java, Kotlin, Dart, Scheme, OCaml, and more.
163.
▲
by
azakai
3y ago
This quote from the end of the article is good: > With this in mind, maybe Wasm is mainstream. Spencer notes, for instance, that anyone who browses the web is likely to be interacting with WebAssembly on a daily basis. I think that
164.
▲
by
azakai
3y ago
If you used Zoom on the Web then you have used WebAssembly without knowing it. The same for a long list of other stuff, big and small, from parts of Wikipedia to games to many other things. When you use something like the Video element on t
165.
▲
by
azakai
3y ago
> wouldn’t the V8 example code be just as safe as the equivalent JS if it used the JS array’s own semantics? Yes, but imagine that the code we are talking about here is JIT code that the compiler emitted. If the compiler JITed code that
166.
▲
by
azakai
3y ago
The 1.5-10x overhead part is not talking about Rust, but about disabling JITs.
167.
▲
by
azakai
3y ago
No, this very much does help protect against JIT exploits. JIT code contains code that accesses the data structures they are sandboxing. By sandboxing those objects, the JIT code is limited in what it can do. This might help you understand:
168.
▲
by
azakai
3y ago
The technique here keeps a large set of objects from escaping the sandbox. Those objects are accessed both by C++ and JIT code. You are right that using Rust instead of C++ would help on the C++ side, but it would not help at all on the JIT
169.
▲
by
azakai
3y ago
If you mean testing the "disable Landlock if the headers and syscalls are out of sync" functionality then I agree, workarounds for such corner cases are often not fully tested. But it would have been enough here to have a test jus
170.
▲
by
azakai
3y ago
I have always been told that LLVM doesn't parallelize codegen because the right place for that is in the build system: just do make -j N (or use ninja, which parallelizes automatically). And when you're building lots of source fil
171.
▲
by
azakai
3y ago
Note that phase 4 is the final stage of the standard process. Tail calls are at phase 4, which means that is a finalized and complete standard. All that is left after that is for VMs to implement the standard, which is tracked here: https:
172.
▲
by
azakai
3y ago
I wouldn't say that predictable performance was abandoned, but you are right that it is less of a strict guarantee these days: 1. Baseline compilers are generally 2x slower than optimizing ones. That's noticeable, but it is still
173.
▲
by
azakai
3y ago
I think most web pages do not need such features. WebAssembly has seen lots of adoption on the websites that do, like Figma and Photoshop for design, Zoom and Meet for interactive video, Unity for games, etc. etc. But most web pages are jus
174.
▲
by
azakai
3y ago
> Wasm doesn't make any memory safety guarantees about the usage of memory within the Wasm runtime fyi, that was true for Wasm 1.0, but WasmGC defines managed memory structures (structs with typed fields, arrays with bounds checking
175.
▲
by
azakai
3y ago
In general you'd have a map between string names and functions, yes. But for static calls you don't need a map lookup of course.
176.
▲
by
azakai
3y ago
There is no reason I can think of why a Wasm interpreter would have higher overhead for arguments in and out. Maybe I'm missing something? Wasm was designed to have very fast calls, both internally and externally. That's why the b
177.
▲
by
azakai
3y ago
No, it says that that latency of calling into the VM can be lower in a simple interpreter compared to an optimizing VM (which might need to do things on the call boundary).
178.
▲
by
azakai
3y ago
The project explains that the reason is latency. It is indeed true that most VMs, including JavaScript, WebAssembly, the JVM, etc., have significant latency on the boundary. For example, many wasm VMs will install a signal handler, and that
179.
▲
by
azakai
3y ago
It is for now, but as both Ladybird and Jakt are SerenityOS projects, eventually parts of Ladybird might get written in Jakt. Jakt compiles to C++ and plans to have features like "inline C++" to allow easy interop between the two,
180.
▲
by
azakai
3y ago
Yes, that is exactly how production Wasm VMs optimize heap accesses. Bounds checks cause no overhead as a result. That's the case in all modern browsers, as well as in wasm2c.
More ›