News for hackers. Stuff that matters.
Re:The best WebAssembly runtime may be no runtime by VikingCoder on Monday December 11, 2023 @02:36PM (#38604403)
Some language -> WASM -> C -> Cosmopolitan C Compiler -> Actually Portable Executable that runs on just about anything...?
Re:The best WebAssembly runtime may be no runtime by CalChris on Monday December 11, 2023 @02:44PM (#38604497)
Why not just Some Language -> C -> CCC -> executable? What is WASM bringing to the table?

Or better yet Some Language -> MLIR.

Re:The best WebAssembly runtime may be no runtime by turbolent on Monday December 11, 2023 @03:07PM (#38604819)
Very few languages have "Some Language -> C" or "Some Language -> non-common OS / arch combo". The "just" part is a whole new backend, which is a massive amount of work for common languages.

But it turns out many languages do have "Some Language -> WASM" now. WebAssembly brings portability to the table.

Re:The best WebAssembly runtime may be no runtime by turbolent on Monday December 11, 2023 @03:03PM (#38604771)
Exactly!
Re:The best WebAssembly runtime may be no runtime by kllrnohj on Monday December 11, 2023 @08:16PM (#38607919)
No more than "Some language -> its native toolchain" already is or isn't.
Re:The best WebAssembly runtime may be no runtime by VikingCoder on Tuesday December 12, 2023 @01:39AM (#38610310)
Did you read up on Cosmopolitan C Compiler when it was discussed here?

No, it's not exactly the same amount of portability as some language and its native toolchain. If you give me source code in some language that I can transpile to C or C++, or into WASM (and then into C), then I can give you a single file which can be executed on Linux, BSD, Mac, or Windows.

That's not remotely the same thing as "its native toolchain."

You, a developer or tech savvy person, might not see any difference.

But if I hand a non-tech-savvy person a file and they can just run it, no matter what OS they're using - with no pre-requisites - that's kind of magic.

Re:The best WebAssembly runtime may be no runtime by kllrnohj on Tuesday December 12, 2023 @11:18AM (#38614208)
> then I can give you a single file which can be executed on Linux, BSD, Mac, or Windows.

Using what libraries & syscalls? A portable IR and a portable executable are very different things, yet the WASM crowd loves to conflate them. WASM is only a portable IR, it doesn't get you portable programs at least not if you want your program to do anything beyond a trivial hello world.

Re:The best WebAssembly runtime may be no runtime by VikingCoder on Tuesday December 12, 2023 @03:44PM (#38618203)
For WASM, that's what WASI is all about, yes?

And for Cosmopolitan Libc, there's documented Functions:

https://justine.lol/cosmopolitan/functions.html

And if you want to see things beyond a trivial hello world, you can check out some examples:

https://github.com/shmup/awesome-cosmopolitan

https://github.com/burggraf/awesome-cosmo

Or you can see a pretty big list of pre-compiled Actually Portable Executables here:

https://cosmo.zip/pub/cosmos/bin/