Live data from Hacker News

Makepad-stitch: WASM interpreter in Rust, 15kloc, 0 deps, faster than wasm3

github.com

1–10 of 18 posts

Re: Makepad-stitch: WASM interpreter in Rust, 15kloc, 0 deps, faster than wasm3

#2
For use in makepad (our Rust IDE/UI framework) as our extension-system Eddy Bruël built a new experimental spec compliant wasm interpreter that relies on sibling call optimisation to get within 4x of a wasm JIT. It has no dependencies and compiles in 2 seconds. Can ship on iOS and is very useful for low weight app extension systems

Re: Makepad-stitch: WASM interpreter in Rust, 15kloc, 0 deps, faster than wasm3

#3

For use in makepad (our Rust IDE/UI framework) as our extension-system Eddy Bruël built a new experimental spec compliant wasm interpreter that relies on sibling call optimisation to get within 4x of a wasm JIT. It has no dependencies and compiles in 2 seconds. Can ship on iOS and is very useful for low weight app extension systems

I'm the author of Stitch. Rik is somewhat overpromising: Stitch is only faster than Wasm3 on Windows (by about 15%). On Mac and Linux, it is about as fast. It does get within 4x of Wasmtime (which is the JIT I've compared it against), but only on Mac. On Linux and Windows, it gets within 8x.

Re: Makepad-stitch: WASM interpreter in Rust, 15kloc, 0 deps, faster than wasm3

#4
post #3

For use in makepad (our Rust IDE/UI framework) as our extension-system Eddy Bruël built a new experimental spec compliant wasm interpreter that relies on sibling call optimisation to get within 4x of a wasm JIT. It has no dependencies and compiles in 2 seconds. Can ship on iOS and is very useful for low weight app extension systems

I'm the author of Stitch. Rik is somewhat overpromising: Stitch is only faster than Wasm3 on Windows (by about 15%). On Mac and Linux, it is about as fast. It does get within 4x of Wasmtime (which is the JIT I've compared it against), but only on Mac. On Linux and Windows, it gets within 8x.

You should test it on a fast CPU tho on linux, its likely faster there. As you have said its likely an instruction cache issue.

Re: Makepad-stitch: WASM interpreter in Rust, 15kloc, 0 deps, faster than wasm3

#5
Are the requirements for fast rust compilation written down somewhere? Is that something you'd consider sharing, possibly with all of the tricks you've learned about how to get around various situations that would otherwise lead to slow compilations?

Re: Makepad-stitch: WASM interpreter in Rust, 15kloc, 0 deps, faster than wasm3

#6
post #5

Are the requirements for fast rust compilation written down somewhere? Is that something you'd consider sharing, possibly with all of the tricks you've learned about how to get around various situations that would otherwise lead to slow compilations?

In this specific case the fast compilation is down to having 0 dependencies.

Rust is usually only rivalled by npm in terms of number of dependencies that a typical project pulls. This project is a refreshing take!

Re: Makepad-stitch: WASM interpreter in Rust, 15kloc, 0 deps, faster than wasm3

#8
post #7

How well does it perform when evaluating itself? Can it bootstrap?

I haven’t tried this, but Stitch should technically be able to run itself if we gave it a C-like API that you could export from a Wasm module. Would be fun to try at some point :-)

Re: Makepad-stitch: WASM interpreter in Rust, 15kloc, 0 deps, faster than wasm3

#9
post #5

Are the requirements for fast rust compilation written down somewhere? Is that something you'd consider sharing, possibly with all of the tricks you've learned about how to get around various situations that would otherwise lead to slow compilations?

Essentially it is: avoid all dependencies, and if you take them on, like platform libs strip them down to only what you use

Re: Makepad-stitch: WASM interpreter in Rust, 15kloc, 0 deps, faster than wasm3

#10
post #6
post #5

Are the requirements for fast rust compilation written down somewhere? Is that something you'd consider sharing, possibly with all of the tricks you've learned about how to get around various situations that would otherwise lead to slow compilations?

In this specific case the fast compilation is down to having 0 dependencies. Rust is usually only rivalled by npm in terms of number of dependencies that a typical project pulls. This project is a refreshing take!

people using deps for trivial things and those trivial things pulling 100s more deps for more trivial things is not really a rust or npm issue. its an issue of people becoming really lazy in light of amazing package management tools. its weird how good pkg mgmt has this totally shit side effect for compilation, but it sure makes buildong things faster. (which in rusts case i guess can go a long way as coding stuff can also take alot of time, not familiar with js land there)
Post reply on HN