Unless by high performance you mean something more specific.
With wasm-gc you get the GC "for free" (from the host), you can still write your own if you want but you loose the interoperability that wasm-gc solves.
1,131 karma · joined January 12, 2010
Writing https://wasmgroundup.com/
http://marianoguerra.org
Previously https://instadeq.com and https://event-fabric.com/
Me on the internet:
https://github.com/marianoguerra
http://marianoguerra.github.io/
https://twitter.com/warianoguerra
https://hachyderm.io/@marianoguerra
[ my public key: https://keybase.io/marianoguerra; my proof: https://keybase.io/marianoguerra/sigs/GHx0pQDbASzQQ6dXmsgwwlX2c-WTe3qwVHdZvamGdsU ]
Unless by high performance you mean something more specific.
With wasm-gc you get the GC "for free" (from the host), you can still write your own if you want but you loose the interoperability that wasm-gc solves.
More specifically for command line tools:
if you are interested in tail calls you just need to understand the call instruction which we cover in the book and then replace it with either:
- return_call <funcidx>, the tail-call version of call
- return_call_indirect <tableidx> <typeidx>, the tail-call version of call_indirect
More info here: https://github.com/WebAssembly/tail-call/blob/main/proposals...
if you want vim keybindings: https://marianoguerra.github.io/vibecard/?vim
I also wrote a forth in wasm by hand here: https://github.com/marianoguerra/ricardo-forth
And a wasm compiler that fits in a tweet: https://wasmgroundup.com/blog/wasm-compiler-in-a-tweet/
I'm also the co-author of a book that shows you how to write a compiler that targets wasm for a small languaje using js: https://wasmgroundup.com/
Here's a direct link to the wasm text format for the OOP and forth implementations:
- https://github.com/marianoguerra/mclulang/blob/main/wat/fatt...
- https://github.com/marianoguerra/ricardo-forth/blob/master/s...
> WebAssembly provides no ambient access to the computing environment in which code is executed. Any interaction with the environment, such as I/O, access to resources, or operating system calls, can only be performed by invoking functions provided by the embedder and imported into a WebAssembly module.
more info here:
with the component model's wit you get higher level types like enums, option, result and generics: https://component-model.bytecodealliance.org/design/wit.html
if the host provides the guest wasm module via imports a function to create and run from an array of bytes then it can be done today (if I understand you correctly).
Here's some related content: https://github.com/pdubroy/til/blob/main/wasm/2024-02-22-Run...
short demo: https://x.com/warianoguerra/status/1759988555869266329
longer writing: https://marianoguerra.org/msite/binary-tetris/
if they are targeting Wasm pre Wasm-GC then they have to ship their GC in the Wasm module and it can't interoperate with "the outside world"
if they use Wasm-GC then they use the host's GC and values can be shared with the host and other guests.
[1] https://github.com/marianoguerra/ricardo-forth
[2] https://github.com/marianoguerra/ricardo-forth/blob/master/s...
[3] https://www.ioccc.org/1992/buzzard.2/
[4] https://github.com/marianoguerra/ricardo-forth/blob/master/s...
`1 + 2` sends the message `\ + 2` to `1`
`a foo ()` sends the message `\ foo () ` to `a` (the parenthesis are the nil value)
`1 + 2 - 3` sends the message `\ + 2` to `1` and then the message `- 3` to the result of the previous message send
But there's a relation, two years ago I prototyped a thing that tried to make a headless version of instadeq that could run in the browser and the server, the idea was a dataflow language where the data was represented as apache arrow tables where filters and transformation expressions where compiled to wasm. The prototype kind of worked and I had a lot of fun, I thought about sharing the fun by writing a small book about creating 10 toy languages that compiled to Wasm, I shared the idea with Patrick, he said he was thinking about something similar and the idea evolved into the current book.
Disclaimer: I'm the co-author
Writing a Minimum Viable Cartridge for WASM4 (https://wasm4.org/) using WAT:
https://twitter.com/warianoguerra/status/1748382204508410149
Wasm compilers in a tweet:
https://twitter.com/warianoguerra/status/1576166873296941056
A WebAssembly compiler for a reverse polish notation calculator in 269 bytes of JavaScript:
https://twitter.com/warianoguerra/status/1677271664009138177