5 ms·
Hey I am on the dev team if someone has questions :)
by evacchi 3y ago
Hey I am on the dev team if someone has questions :)
- dilyevsky 3y agoProbably dumb q - are there security implications of using aot for untrusted workloads? Are there plans to do jit?
- evacchi 3y agoIt depends on what you mean for JIT. wazero is load-time AoT; i.e. we compile the module in-memory on load, for efficient execution later, when you instantiate, it is not AoT in the sense that we produce a stand-alone executable, the runtime is always hosting that executable code that is generated, and we go back-and-forth between translated wasm and "Go space" at run-time in many cases. It is AoT in the sense that we do not tune the generated code depending on tracing or profiling information, because we don't track it for compilation. The Wasm model itself gives a certain degree of safety: e.g. you do not have complete control over the host OS, because you have to explicitly expose functions to the gues module; we also provide a certain degree of control over e.g. execution time (you can instantiate a module in such a way that executions can be cancelled or set a timeout) and memory space. We also provide an interpreter for all platforms where Go runs, and Takeshi (the founder of the project) is also working on bootstrapping an optimizing compiler that should soon land on main, and more work will happen in that space.
- circuit10 3y agoJIT/AOT just refers to the time that compilation is done, it doesn’t necessarily have anything to do with security.
- dilyevsky 3y agoIt does when you hadn’t built the .wasm yourself. Example: https://github.com/WasmEdge/WasmEdge/issues/1631 https://github.com/WasmEdge/WasmEdge/issues/1631
- circuit10 3y agoThat’s a bug/oversight in a specific VM implementation. A JIT with a code cache (like V8) could have the same type of bug. It says nothing about about the inherent security of JIT vs AOT
- kouteiheika 3y agoHow does the performance compare to wasmtime or wasmer?
- evacchi 3y agowasmtime and wasmer are basically state-of-the-art. Our compilation backend is a fast, but straightforward translator from wasm to binary (think v8 liftoff vs turbofan), so it's faster than interpreting, but still slower than a well-crafted optimizing compiler. However depending on your use case, that kind of performance may not be everything: e.g. when I/O dominates . The good news is an optimizing backend is being worked on as we speak and should be available very soon :)
- kouteiheika 3y agoI don't suppose you have any concrete benchmark numbers, e.g. coremark? (: Also, how do you sandbox the guest program? Just bounds checks on memory accesses? Do you use the same trick as wasmtime does where they map a ton of inaccessible address space and depend on a SIGSEGV to catch violations? What about potential stack overflows - how do you protect against those?
- evacchi 3y agoso as for the first question, I'll refer to Adrian's reply on an older thread https://news.ycombinator.com/item?id=31415317 https://news.ycombinator.com/item?id=31415317 as for the second, that's an excellent question but I'll have to be honest and tell you that I am the n00b of the team and I don't know the answer :D I can refer you to these possibly related docs - https://github.com/tetratelabs/wazero/blob/main/RATIONALE.md#background-on-moduleconfig-design https://github.com/tetratelabs/wazero/blob/main/RATIONALE.md... - https://wazero.io/docs/how_do_compiler_functions_work/ https://wazero.io/docs/how_do_compiler_functions_work/ (e.g. traps are handled on the Go side) ...and then my awesome team mates might get back to you with a proper answer later when they wake up :^)
- ncruces 3y agoThis is coremark for wazero: https://github.com/ncruces/wazero-coremark https://github.com/ncruces/wazero-coremark Also, there's been some progress since this was published, but results are still mostly valid: https://00f.net/2023/01/04/webassembly-benchmark-2023/ https://00f.net/2023/01/04/webassembly-benchmark-2023/ An optimizing compiler is being worked on; the current single pass compiler compiles fast, but generated code quality is hard to improve.
- verst 3y agoI'm one of the Dapr (Distributed Application Runtime) maintainers which has a wazero based wasm integration. The wazero team contributed this integration. I just wanted to say that the wazero team has done a great job keeping the integration up to date and have been very responsive. For example, our project also supports Linux Arm32 and wazero was initially not testing against that architecture which led to a compile issue for us. Once we pointed this out they fixed this and added this architecture to their CI tests as well. EDIT: Also because our project can be compiled for any common O/S and architecture combination the pure Go implementation is critical. We do not accept use of CGO.
- segphault 3y agoAny plans to support the WebAssembly GC proposal? Binaryen supports GC structs and arrays now, but there aren’t a lot of runtimes that have it yet. It would be cool if Wazero could do it in a way where managed structs can be seamlessly shared across the Wasm/Go boundary using the native Go GC.
- evacchi 3y agoWe are tracking the evolution of most proposals but we are a tiny team so we try to concentrate our efforts on those that have a higher degree of maturity, but I am sure we will at some point :)