Live data from Hacker News

Epsilon: A WASM virtual machine written in Go

github.com

31–40 of 47 posts

Re: Epsilon: A WASM virtual machine written in Go

#31
post #6

Do you have any plans to add timeouts or some other mechanism for limiting the amount of CPU a webassembly call can use? I'm always interested in options for using WebAssembly as a sandbox to run untrusted code, but one of the things I need to protect against is an infinite loop. (I had Claude knock up an experimental Python binding to try Epsilon out, notes from that here: https://github.com/simonw/research/tree/mai…

I believe that wasmtime has some sort of mechanism for this called Gas if I'm not mistaken.

Re: Epsilon: A WASM virtual machine written in Go

#33
post #6

Do you have any plans to add timeouts or some other mechanism for limiting the amount of CPU a webassembly call can use? I'm always interested in options for using WebAssembly as a sandbox to run untrusted code, but one of the things I need to protect against is an infinite loop. (I had Claude knock up an experimental Python binding to try Epsilon out, notes from that here: https://github.com/simonw/research/tree/mai…

wazero has supported context cancellation for a long time :) https://github.com/wazero/wazero/blob/9286448974219ab3be0931...

Re: Epsilon: A WASM virtual machine written in Go

#34

WASM seems to be rather poorly documented in general. I used to think it is only badly documented in Ruby (which it is), but I have been slowly reading "WebAssembly The Definitive Guide" and when comparing this to information on the internet, it seems WebAssembly is years behind e. g. HTML, CSS, or JavaScript in regards to documentation. Granted, it is not the same user base (more people will be interested in HTML an…

I wonder if your question relates to WASM or things in the WASM-sphere like WASI et al? I'm not sure if it's right but I think of WASM as just an ISA and I guess the documentation seems to cover instruction encodings and semantics.

Right. I was able to write custom wasm generation for browsers just going off the binary encoding spec. Started with using wasm as target IL for a Befunge JIT

Re: Epsilon: A WASM virtual machine written in Go

#35

Congratulations on the progress and getting the engine out there! One nice thing about interpreters versus JIT compilers is that they can be used in places like iOS without too much fuss (AFAIK you have to bundle all the WASM you will run though, or something like that). I'm biased since I work on it, but any considerations around adding support for the Component Model? It's more complex than the base spec of course…

You can download the WASM, it just can't materially change the purpose or scope of your app.

Re: Epsilon: A WASM virtual machine written in Go

#36
Only tangentially related, asking out of curiosity.

If one wanted to have a JIT compiler from what I understand it would essentially need to be able to get a chunk of memory, generate instructions into it and then jmp there.

Is creating such a thing possible in just Go?

Re: Epsilon: A WASM virtual machine written in Go

#37

Only tangentially related, asking out of curiosity. If one wanted to have a JIT compiler from what I understand it would essentially need to be able to get a chunk of memory, generate instructions into it and then jmp there. Is creating such a thing possible in just Go?

Yes. You need some syscalls and unsafe, but it's possible.

wazero does this, on amd64 and arm64: https://github.com/wazero/wazero

You can read more about the approach - from the creator - here: https://mathetake.github.io/posts/runtime-code-generation-in...

Re: Epsilon: A WASM virtual machine written in Go

#38
post #37

Only tangentially related, asking out of curiosity. If one wanted to have a JIT compiler from what I understand it would essentially need to be able to get a chunk of memory, generate instructions into it and then jmp there. Is creating such a thing possible in just Go?

Yes. You need some syscalls and unsafe, but it's possible. wazero does this, on amd64 and arm64: https://github.com/wazero/wazero You can read more about the approach - from the creator - here: https://mathetake.github.io/posts/runtime-code-generation-in...

Okay wow. I could not have gotten a better reply. This one feels like an early Christmas gift, my sincere thanks!

Re: Epsilon: A WASM virtual machine written in Go

#40
post #29

>with 0 dependencies >Looks inside >0 dependencies Wow. Amazing. Was that a planned feature or did you just manage to write the entire project without stepping out the go std lib?

It was very much the point to build everything from scratch.

Though to be fair, for tests I am relying on https://github.com/WebAssembly/wabt

Post reply on HN