Re:WASIX, the Superset of WASI Supporting Threads, Processes...
by wbl on Tuesday May 30, 2023 @01:01PM
(#36127345)
The great wheel continues to turn. If your wasm environment is a thin wrapper around the host you need to worry about the underlying system. So expect to see more and more abstraction or a break in portability. Similarly WASM assumes a lot about your language: imperative, statically typed, limited polymorphism, no GC (for now). It's not a good target for JS or Perl6 or Smalltalk or Common Lisp.
[ Parent
| on HN ]
Re:WASIX, the Superset of WASI Supporting Threads, Processes...
by garganzol on Tuesday May 30, 2023 @01:07PM
(#36127436)
WASM reflects the usual capabilities of a hardware-based CPU. Just like your usual hardware CPU cannot run Common Lisp directly, neither can WASM.
JS, Perl, Python etc. all run well on widespread CPU architectures like ARM and x64. And that's why they will run well on WASM too given an appropriate runtime for that language.
To sum it up, WASM assumes nothing about a language - it's just a CPU, albeit a virtual one.
Re:WASIX, the Superset of WASI Supporting Threads, Processes...
by wbl on Tuesday May 30, 2023 @01:24PM
(#36127674)
Obviously Church Turing tells us all substrates are the same in power. So when we talk about running well on X we mean something else.
WASM is not like any CPU in common use today. It's a stack machine with structured control flow and strongly typed pointers. The instruction sequence is a graph. Memory is not a flat address space.
Re:WASIX, the Superset of WASI Supporting Threads, Processes...
by __s on Tuesday May 30, 2023 @01:33PM
(#36127803)
I wouldn't call it a stack machine. Constraints requiring static stack depth is designed to be converted to SSA which then gets efficient register allocation
Re:WASIX, the Superset of WASI Supporting Threads, Processes...
by ShroudedNight on Tuesday May 30, 2023 @01:22PM
(#36127638)
My experience with CPython (a while ago now) was that it ran like a dog on POWER, and that if you didn't account for the idiosyncrasies of the architecture in the interpreter's implementation, running "well" was a pipe dream. Considering WASM actively masks the underlying architecture, what evidence is there that other managed runtimes will naturally run well on WASM?
Re:WASIX, the Superset of WASI Supporting Threads, Processes...
by garganzol on Tuesday May 30, 2023 @01:27PM
(#36127707)
That's an interesting and open question. Especially the ability to JIT the code on the fly, so it could travel, say, Java -> WASM -> Hardware path. It seems that it technically possible [0] but there will be dragons.
[0] https://wingolog.org/archives/2022/08/18/just-in-time-code-g...
Re:WASIX, the Superset of WASI Supporting Threads, Processes...
by robotresearcher on Tuesday May 30, 2023 @01:57PM
(#36128146)
> Just like your usual hardware CPU cannot run Common Lisp directly
Would be fun to visit the alternate universe where we went that way...
Re:WASIX, the Superset of WASI Supporting Threads, Processes...
by mepian on Tuesday May 30, 2023 @05:42PM
(#36131312)
>Just like your usual hardware CPU cannot run Common Lisp directly, neither can WASM.
My usual hardware CPU runs Common Lisp code very well, thanks to this native x86-64 compiler: https://www.sbcl.org/