hardwaresofton 4 hours ago

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 but incredibly robust -- really the present/future of "modern" WebAssembly across languages.

  • euroderf 4 hours ago

    +1 on Component Model. AFAICT it's not planned for wasip3.

    • hardwaresofton 4 hours ago

      Just to point out, even a P2 implementation is still very useful! P3 is necessarily more complex than P2, but P2 also contains very useful features that are worth implementing. Most language toolchains are centered around p2 today and that will take a while to change.

      Also, there is an adapter for automatically taking p1 components to p2, and a p2 to p3 adapter may exist in time, if desire is great enough! IIRC it doesn't exist right now.

shevy-java 3 hours ago

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 and CSS simply because there is a bigger pool of people interested in that, rather than in WebAssembly), but still - documentation appears to become really worse in general on the internet. Finding it too.

So in this regard, having more implementations may be useful (more opportunity to improve documentation) - thus while I am in general skeptical, this is good news here, even if I do not use Go myself.

  • liampulles 43 minutes ago

    WASM development is really for a "level lower" than HTML, CSS, and JavaScript development. I know this because, being curious about it myself, I tried a year ago to make use of a WASM runtime in Go to run a piece of WASM code (I think I wrote something in V and compiled it to WASM).

    It becomes a huge pain in the bum as soon as you have to deal with moving anything more than trivial types around, because you have to manually allocate memory for the WASM runtime and move bytes around. The byte representation needs to be understandable by the source language for your WASM code (the v language in my case). This is why these WASM runtimes use ints in their README examples, it would look and be horrendously complex otherwise.

    If one is looking to use WASM for something for plugin development in the backend, I would try and look for something that is not WASM generic, but works with the source language, and where the WASM aspect is an under-the-hood detail.

    • discreteevent 12 minutes ago

      This is the same in any system where you have two different runtimes/programming languages. The source values need to be serialized to bytes and then deserialized by the target. You could use json for this or flatbuffers. WASI has its own serialization mechanism but I don't know what langugages it supports.

  • sestep 39 minutes ago

    Interesting; I've been using WebAssembly as a compilation target for various projects for the past four years, and have been fairly happy with the state of documentation. I've never heard of that book you mentioned (I should check it out!), and instead I just read the spec directly: https://webassembly.github.io/spec/core/

    Or occasionally I Google specific Wasm instructions and find .wat examples for them on MDN.

    I'm sure you're right that the documentation is years behind that of HTML and CSS, but is there some specific aspect of Wasm documentation that you find lacking that isn't covered by the spec?

  • bastawhiz 2 hours ago

    WASM is also like two decades younger than HTML and CSS and generally useful to a small fraction of the audience.

  • wyldfire 3 hours ago

    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.

simonw 5 hours ago

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/main/epsilon-python-... )

  • ilikepi63 2 minutes ago

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

  • trj 3 hours ago

    I'm working on an embeddable mini VM (RISC-V rather than WASM) and am considering this. In my model, there's something akin to a hardware watchdog where the VM is considered hung if it executes too many instructions without calling a yield() function in the host, then there's the ability to set a maximum number of instructions to execute before returning to the caller.

    This lets it be handled asynchronously at the pace the host code chooses https://github.com/ringtailsoftware/uvm32

    • usrnm 2 hours ago

      Lua has hooks, which are callbacks that can be registered for a variety of different events, including every N instructions, and every call can decide to terminate the whole thing with an error. This mechanism can be used for different purposes, including tracing, some kind of performance stats and, of course, cancellation. I always found it to be a nice general solution.

  • embedding-shape an hour ago

    Limiting the CPU vs protecting against an infinite loop are two different problems. The former is usually solved by sandboxing and using the limiters exposed by it, while the latter can be easily solved by just adding a cancellation timeout, when the function call/process/API call/whatever takes longer than X seconds, cancel it and return an error.

  • ziggy42 2 hours ago

    Yes, I am considering using something like https://pkg.go.dev/context for this very purpose, though I need to read a bit more into it first.

    Funny that you built a Python wrapper as I originally started this implementation in Python, which was...not a good idea. Claude hallucinated the acknowledgments section though :D

praveen9920 an hour ago

Nice project.!

Is there anything akin to file sockets api for wasm? I see a lot of potential in using them with go channels for ipc between multiple wasm modules.

Gys 6 hours ago

This could have been a Show HN?

Also: would be nice to see wazero (https://github.com/wazero/wazero) mentioned. What was the reason to create Epsilon as an alternative?

  • ziggy42 5 hours ago

    > What was the reason to create Epsilon as an alternative?

    I wanted to build something fun, I did not check for existing implementations on purpose. I ended up putting more effort than I originally expected into this and now it's starting to look like it could be actually useful, almost by accident.

  • gjvc 5 hours ago

    why so critical? why divert attention? why bother about the title prefix?

    • lionkor 3 hours ago

      Because people filter by it

donatj 3 hours ago

Nice! I started building a toy Go WASM VM myself but a few hours in realized I was in way over my head. Seems very readable, I'm going to want to go to school on this!

karel-3d 6 hours ago

How does this compare with wazero?

  • ncruces 6 hours ago

    So far, seems interpreter only, lots simpler, etc.

    I'd be interested to understand the goal behind it better.

    • Imustaskforhelp 5 hours ago

      I knew I remember your name working with something of sqlite and golang

      https://github.com/ncruces/go-sqlite3

      Man I really enjoy golang and cross portability and wazero + sqlite could still be cross portable which is super fascinating

      What are your thoughts on https://github.com/electric-sql/pglite (postgres in wasm)?

      Also what were the goal behind a pure golang solution via wazero + wasm sqlite as you had made?

      Was it cross platform support, if so, what are your thoughts on zig, I have seen a project use zig + golang to create cross platform C language support but I think that adding zig into the picture complicates the build process so there are tradeoffs and I am interested to hear your opinions about it!

      • ncruces 4 hours ago

        Started as fun "what if" side project, but kept me interested for 3 years now. Turns out it's actually useful.

        It's pretty portable: with some caveats, it works pretty much everywhere Go does. Performance is bad outside amd64/arm64, but for most popular OS/platforms it's fine. See this for an overall picture (these are the platforms I test): https://github.com/ncruces/go-sqlite3/wiki/Support-matrix

        I bet you could do the similar with pglite, but this (and helping out with wazero) already consumes all my spare time.

        • Imustaskforhelp 2 hours ago

          I love sqlite a lot but there is always this idea in my head that maybe some day I might out grow sqlite and require postgres which in my opinion can be just "enough"

          Starting out with postgres if done via pglite and similars with golang's sqlite-ish approach can be brilliant I guess and I had this what if idea sort of inspired by yours actually but I don't think I can do that project basically right now but yea

          Idk maybe its offtopic and I really love golang but I am interested in converting cli golang awesome applications into android apps but they seem like a nightmare to create android apps in golang, do you know if there is some easier way to create golang android apps (sorry if its offtopic but I am interested to learn sooo much more about golang :p)?

aeve890 25 minutes ago

>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?