WASIX, the Superset of WASI Supporting Threads, Processes and Sockets
wasmer.io
wasmer.io
I was looking into some detail of a WASI call and there is… basically nothing.
Also the latest version of the docs is called something like “snapshot3” or whatever. I thought “wait this is it? that’s the whole definition”? apparently it is.
edit: here. The actual latest definition is in "legacy/preview1". Yes that is the latest WASI definition.
https://github.com/WebAssembly/WASI/blob/main/legacy/preview...
What do the inputs mean? How should it behave in some extreme conditions? Eh YOLO who knows. All implementation dependent. This document is literally all there is. That's it, that's the WASI definition.
Because of that, we tried to be as detailed as possible about the system calls. We might to define them further, but hopefully the WASIX docs are a good start! https://wasix.org/docs/api-reference
ahhh actual definitions!
WASM is a language independent byte code that runs in browsers, like “assembly but for browsers” that multiple languages can compile to instead of there only being javascript.
…but that ran in a browser sandbox, and people wanted to use it in containers, so they invented WASI, which lets WASM assembly code interact with the base system, sidestepping the container of the browser; but it needs a runtime on the host system (not a browser) to run.
Now this is WASIX which added more non standard extensions to WASI so that more programs can run on it.
We had an entire full stack cross platform runtime (browsers) to run our code in, but instead we now need to get a new set of “low level” runtimes to run the same code for, eg. containers?
Sounds a lot like java to me; byte code, runtime, “cross platform binaries”, write once, run anywhere…
How is this meaningfully different?
The only remarkable difference appears to be you can target it with existing c++ code?
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.
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.
My usual hardware CPU runs Common Lisp code very well, thanks to this native x86-64 compiler: https://www.sbcl.org/
Would be fun to visit the alternate universe where we went that way...
[0] https://wingolog.org/archives/2022/08/18/just-in-time-code-g...
I would also suggest to officially separate WASM from any notion of API. So that any working group anywhere in the world could design whatever API they want/need - but it would not wreck the purity of WASM as a result.
WASI/WASIX initiatives are good in that regard.
EDIT : to clarify it, both Chrome and Firefox (nightly) require feature flags to enable WASM GC as of writing.
The only chance of survival is to declare WASM GC a heresy and to largely ignore it until it rots away like Intel iAPX 432 did. But considering the financial model of the current WASM development this plan may be unrealistic.
For example, the nice WASM <-> CPU bijective mapping of capabilities is going to be lost. WASM GC now turns the WASM into something completely different, something in the rank of Java, .NET, Flash, Node JS, or Elang.
For any GC to work, there must be a notion of a component model that defines the type system and the rules of type interactions. This is a complex topic by itself with myriads of decisions and compromises to make. This means that the end result won't suite everyone, if anyone at all.
This will lead to WASM GC stagnation - it will be there but nobody will be using it because no one wants to loose the ground and compatibility with real CPUs. There may be some users like Dart or Flutter with their niche opinionated situations, but it's a drop in the ocean.
As the time will pass, WASM GC will be gradually becoming a burden as it does not come for free - it requires maintenance, patches, security fixes. In the end, browser vendors may proclaim the WASM a new "Flash", "Java Applet", "ActiveX" that should be eliminated due to overdesigned complexity, too wide API surface, and associated security risks.
Rinse and repeat, there is nothing new under the sun.
No it's not. If you want to know how it's meaningfully different - go look look high level overview of JVM and WASM - and if you still don't get it - then you're probably not the target audience for either and you should just be using whatever the tool stack it's targeting them.
A bus and a cargo truck are not the same just because they have similar wheel base/size and abstractly do the same thing.
It never started out that way, but it certainly is ending up that way. Everything that made WASM stand out from the traditional bytecode VM is being patched back in through extensions like WASI and now WASIX.
I was originally excited for WASM because it started out as a fully sandboxed system. No I/O other than flat memory buffers, so no chance whatsoever of escaping its sandbox.
Now WASIX introduces networking, file system I/O, mutltithreading, forking, even TTY support. It's not as powerful as the JVM yet, but give it a few years and I'm sure you can use them interchangeably in a few years.
Add enough extensions to the runtime everyone uses and you end up with another JVM. The JVM is very good and so is the .NET runtime and any other bytecode runtime you can think of, but the distinctions start to fade as more features get tacked onto WASM.
"Special OOP instructions" - you mean like object model and garbage collection ?
WASI is aiming to run in the browser sandbox which means it's API interface has to be more sandboxable than POSIX. Implementing POSIX compatibility layers on top of it is going to be leaky.
Removing the limitations that make WASM such a safe system to implement and replacing it with POSIX system calls is like ripping out the seats and replacing them with a trailer hook up. There's nothing wrong with being able to attach large trailers to your vehicle, but the type of vehicle you're converting may be better off without your alterations.
The JVM contains instructions such as instanceof and various ways to invoke a method that mirror the OOP approach of Java. Garbage collection instructions are also extensively used, of course, but they're not as OOP specific.
Unlike WASI, WASIX adds open()/read()/write()/close() to WASI. It also adds fork(), exec(), and wait(). With modern web APIs (such as the filesystem API) many of these can be added without any virtual implementations, but WASI and WASIX are also targetting other use cases. One use case being pushed by a lot of WASM companies is for WASM to replace Docker containers in a Kubernetes cluster, for example.
If you can trivially move existing code to run in a WASM VM you get the benefits of isolation and a convenient artifact to move around for deployment and scheduling.
I think the history of successful platforms are ones that still supported the old way of doing things, while enabling a new and better way. Of course that comes with lots of tradeoffs that are often hard to stomach.
However, that would make it end up as "Java but different". That's not a bad thing, there's absolutely nothing wrong with Java as a technological concept!
The redneck engineer in me disagrees.
Arguing that WASM isn't JVM as defence, while forgetting computing history isn't great either.
And it isn't from the 1950's, it is since then.
IMO this is wrong direction.
Better direction is to move into browser. Add arch/wasm to linux kernel. Compile it to wasm. Compile systemd to wasm, glibc or musl, with docker in the end. Now you can run linux in your browser. You could run it before, but this way makes it as native to browser as possible. Probably will be very fast and suitable for work.
Now with docker ask people to compile their software to wasm. Now you can run postgres and kubernetes in your Chrome tab. All you need is some escape hatch for network ingress/egress which is not hard to implement.
May be implement virtio-gpu with webgpu and you can easily run full-fledged Gnome in your browser tab. Not hard to sync your disk to S3, so you can open this VM from any computer and run it locally.
Basically VM in your browser, cross-platform, cross-architectured.
This is what the world has come to.
Scala? Kotlin?
To be fair these came into play WAY after the JVM
JVM bytecode is quite approachable: https://en.wikipedia.org/wiki/List_of_Java_bytecode_instruct...
And does look superficially similar to WASM instructions. When WASM gets GC, I have trouble seeing what's fundamentally different between the two, to be honest... even something like (parts of) the Java stdlib will be available to WASM with the WASI API, making the difference too small to distinguish them into different categories IMO.
[1] https://blogs.oracle.com/javamagazine/post/creating-a-java-o...
That's interesting. So if you wanted to build a C compiler targeting the JVM, you would just request a big byteslice from the API and implement your own stack + heap on top of it (such that you never actually use the JVM GC)?
> And does look superficially similar to WASM instructions. When WASM gets GC, I have trouble seeing what's fundamentally different between the two, to be honest... even something like (parts of) the Java stdlib will be available to WASM with the WASI API, making the difference too small to distinguish them into different categories IMO.
It sounds like the fundamental distinction is that WASM will have both manual memory management APIs as well as GC APIs while Java will only have GC APIs.
IBM TIMI was designed for C and C++.
Amsterdam Compilers Toolkit was designed for Pascal, Modula-2 and C.
Nothing new really.
As for the others since 1950's, plenty of stuff to study there.
The following technologies were all silver bullets:
* ActiveX, COM Object model, XPCOM
* Unified Modeling Language (UML)
* Extensible Markup Language (XML)
* Computer-aided software engineering (CASE)
* Java Virtual Machine
* Ionic, React Native, Qt, Gtk, Flutter
Something tells me that the problem is bigger than anyone can chew and the abstraction solution is sometimes more complicated than the underlying thing being abstracted.
I think WASI and WASIX is an EXTREMELY important API for the future of computing. It's a chance to create a superior operating system runtime interface.
But they're not doing io_uring style syscall queues.
Superior operating system runtime interface and POSIX don't rhyme. The fossilization of POSIX on Unix-like systems, endlessly piling stuff on top of that creaky foundation is probably the single biggest issue holding back the future of computing.
WASIX is probably a pragmatic design if you want to run your existing Unix programs on top of WASM. If anything, it's for the past of computing.
I encourage you to read the design documents for the Fuchsia operating system, especially those for the Zircon kernel [2] for a fresh, legacy-free take on a system call interface.
[1] https://www.microsoft.com/en-us/research/uploads/prod/2019/0...
what you must realize is that one does not have to use a syscall if they don't like it in (e.g. just use rust to code your app and it will never call the fork syscall)... but taking that choice away from others who want to use it is unfair as its denying them access to the WASM ecosystem (e.g. bash)
OpenVMS for example does not provide fork(). What it does provide is vfork() by doing some internal book-keeping within the C run-time library and delaying the actual child process creation until exec() is called [2].
The POSIX specification eventually standardized posix_spawn() [3] as a partial alternative for fork() due to its numerous issues, some of which are detailed in the rationale section of its specification. Sadly, it appears its usage is not as widespread as it could be.
I'm not blaming the WASIX project for providing POSIX semantics since running POSIX-compliant programs is an explicit design goal. What I do wish is that more people realize that POSIX isn't the pinnacle of operating system interface engineering or some sort of holy scripture that shall not be questioned. It's 1970s legacy from long defunct hardware and obsolete software (think PDP-11 and Version 7 Unix) that was written down as a specification in the 1980s.
[1] https://docs.rs/libc/latest/libc/fn.fork.html
JVM forces you to write in Java or a JVM targeted language but WASM lets you compile any language that creates a WASM backend.
> JVM forces you to write in Java or a JVM targeted language
And this
> WASM lets you compile any language that creates a WASM backend
Are basically the same thing.
There’s no fundamental reason that all these languages couldn’t target JVM byte code instead of WASM. It never happened, not nearly as much as WASM backends are, but it could’ve.
? -> CORBA -> RMI -> SOAP -> REST -> GraphQL?
? -> SOA -> Microservices
? -> EDI / X12 -> XML -> JSON
p-code -> ? -> JVM -> WASM
Burroughs, all Xerox PARC, Lisp Machines, OS/400, Oberon, Limbo, original Modula-2, QuickBasic, Amsterdam Compiler Toolkit, VB, ...
Or EDI?
It's like saying we had the Model T, but people just keep inventing new cars.
And thanks to stuff like this, contemporary browsers are now so complicated that they only run on the top handful of platforms. So how is it progress? I bet JVM runs more places than modern browsers.
> VM forces you to write in Java or a JVM targeted language but WASM lets you compile any language that creates a WASM backend.
WASM forces you to write in something that has a WASM backend just like JVM forces you to write in something that has a JVM backend. It's just the same all over again. And again.
Microsoft's .NET allowed you to compile C++ to pure CIL (.NET's bytecode) and run it inside a VM since the early 2000's. It wasn't very popular so it was deprecated.
People compare WASM to JVM, but to me it looks like a more lightweight reinvention of Microsoft's CLR (Common Language Runtime) which was designed to support multiple languages (C#, C++, VB) from day 1.
There's your problem.
Sure, .NET is technically cross-platform, but that's a relatively recent development, and WASM has runtimes that let it run in most environments, even microcontrollers.
Also, looks like C++/CLI had conflicting syntax with standard C++, so it might not have worked on some applications without some patches.
That changes everything. Coupling the VM and the language was IMHO a huge mistake.
Wasm + WASI(X) + WebGPU is what the Java VM should have been. I guess we were not ready at the time.
I should note I haven't spent much time studying either of them.
As if the VCs baking up all those WASM products are doing it from the warmth of their hearts.
https://en.wikipedia.org/wiki/Architecture_Neutral_Distribut...
Just one example out of many others, for C and C++ based workloads.
100%
WASM is "Java byte code for the 21st century."
> How is this meaningfully different?
It's lower level, making it a lighter, more flexible target platform for a variety of languages.
No classes, typing, GC (yet), required runtime, etc.
Whereas Java byte code is really only meant for Java (and variants -- Groovy, Clojure, Scala, Kotlin)
That said, you can run a large subset in the browser.
A key difference is that it's actually gaining traction on multiple platforms.
IDK if CLR tried and failed to do that, or just didn't try.
Edit: this supports browsers!!! Amazing!!!
wasm isn't a browser-only thing
And yes, lots of echoes of Java's "write once run anywhere" but as lots of people have pointed out, wasm is language agnostic, and many languages have support for it.
Since I've been web applications and distributed systems, the evolution has been something like this.
1. Copy files around, into the web or application servers directory. This was simple but isolation, repeatability and testability was hard. The application dependencies were directly tied to the host, so you had to be very careful about your upgrades breaking applications. The lack of isolation is not suitable for multi-tenant environments for security and capacity planning reasons. It's pretty hard to run multiple-applications (1)
2. Things like bundler, and other language specific tools that let you bundle your application dependencies together. Avoids some of the host OS related upgrade issues, but again, no real isolation.
3. VMs. The whole cloud industry started on this. You get true isolation of your whole application at the cost of complexity and weight. Scheduling new VMs is not a fast process because you're copying around or at least booting a whole OS. You still have to manage OS images. There is also generally a tax on memory that you have to pay, so you waste some resources with VMs to get the isolation. Amazon invested in Nitro to avoid paying a lot of this tax.
4. Containers. Lighter than VMs, good enough isolation in a lot of cases, especially inside of an organization. Lower tax than VMs. More testable. But containers are still fairly heavy, startup time can be slowish. So you have some limitations on how fast you can scale up and down in response to load. Also isolation isn't good enough for some workloads. So we see things like firecracker VMs being used to improve isolation.
5. Wasm on the server side. Much lighter than containers. Less memory overhead, way less startup time. Probably faster startup time than even firecracker. So for lambda like workloads you could could have a lot better cold start latency. You probably have good enough isolation that you don't need to resort to things like firecracker to isolate customer workloads. Because of the fast startup time you could probably pack your long tail of workloads even tighter to get better effective utilization out of your server infrastructure.
(1) In the early 00s I worked at a place where we wrote our own simple process supervisor and used some tricks with LD_LIBRARY_PATH to let us bundle all application dependencies with the application. So you could run multiple application that needed different libraries on the same host, and upgrade your host without as much worry about host OS library changes breaking our applications. It was a kind of proto-container, without all the other isolation cgroups give you.
Fork is not a windows-native primitive, and while cygwin may have implemented emulation, the performance sucks. Pthreads is in a similar situation.
So, given that this will mainly target linux well, I'm not sure what advantages it brings over native code. It mostly feels like native code with extra steps.
As you say, it's not straightforward.
They run under Windows, Linux, the various BSDs, and macOS.
> We want to welcome as many developers and companies joining and participating in WASIX. This is a project that aims to be governed by many entities, not just one.
> Wazero, Zig, and AssemblyScript could be great additions to the governance team, but any others will be more than welcome. As long as you want to move WASIX forward you will be welcome to chime in and participate in its progress.
They also quote an old tweet from the founder of Docker, and I can't see any new tweets about Wasmer from him: https://twitter.com/search?q=wasmer%20solomonstre&src=typed_... He tweeted about a competitor to WAPM, a Wasmer product: https://twitter.com/solomonstre/status/1584817684172005376 It seems likely that shykes moved along from Wasmer along with many others. If there were a time for him to indicate he's still emotionally invested in Wasmer, this would be it!
Also, of course you can ask other former employees and they'd tell you the same: work culture is toxic. In fact the list of ex-employees is huge because of this... I'm thankful I quit fast enough. If any throwaway account replies to me, you'd know who it is.
* classical shared memory (mapped into the main address space) is very hard to do in the context of Webassembly, especially in a performant way. Not impossible, but complicated. It would be valuable to add, but there are different approaches as well (like sharing additional Webassembly-level memories between instances, for example)
* WASI already has a concept similar to select
* unix sockets would be a pretty straight-forward addition
> Why include error-prone cruft?
A big goal here is to make existing software compile to Webassembly, with only a relatively small amount of changes.
For writing new software the direction of WASI (going towards the fine-grained capability model) is a very valid approach. But that won't get you compatibility with pretty much all software in existence.
And there is space to explore both directions.
Unwinding is a somewhat cleaner interface than setjmp/longjmp, and it's a useful primitive in its own right, especially if you can attach a notion of a stack trace to the unwind primitive. At a low-level language primitive level, unwind can be seen essentially as a combination of a mechanism to have two distinct exit points from a function call (the normal and exceptional return addresses) and an intrinsic that causes the function to return via its exceptional return address instead of the normal return address.
> if you want asynchronous interrupts, you’ve got to have an equivalent to signals.
... not really. There's a few different kind of signals. Synchronous processor signals (e.g., SIGSEGV, SIGFPE) could be supported via something akin to unwind rather than signal handlers (and this is essentially how they work on Windows). The asynchronous events can instead be supported by basically having some primitive notion of an event loop, dropping those signals as events in the event loop. Signals already interoperate pretty sketchily with event loops, and many signal handlers for asynchronous events already tend to boil down to "just dump this as an event in the event loop", so you're left with a pretty sketchy work around to do what you actually wanted to do.
Interfaces like fork and POSIX signals are pretty notorious for being generally wrong ways to do what you actually wanted to do; if you're making a new OS ABI, there's absolutely no reason to include them, especially because they can be hard to emulate on some OSes, e.g., Windows or Fuchsia (which lacks POSIX signals altogether).
> Unwinding is a somewhat cleaner interface than setjmp/longjmp, and it's a useful primitive in its own right
I think the distinction is becoming subtle enough that we need to define our terms here. I’d distinguish three mutually interexpressible (is that a word?) systems:
(1) Marks (for lack of a better term): C. There’s an object that designates an activation (jmp_buf) that you can ask for (setjmp), unwind to (longjmp), and must not let escape. Upside: disjoint error filters do not require cross-ABI cooperation. Downside: finalizers do.
(2) Panics: Forth ’94, Lua, Go. There is a singular dynamically scoped recovery point where you can unwind and pass some data, which it will be able to rethrow further if it wishes. Upside: finalizers do not require cross-ABI cooperation (unless you hardwire backtraces). Downside: disjoint error filters do.
(3) Exceptions: C++, Java, arguably Common Lisp THROW/CATCH as a degenerate (no-subtyping) case. There is a single system of errors mandated by the platform (or language, as the case may be) and a stack of handlers of two types: catch, associated with an error type, which stops propagation of its subtypes and runs user code; finally, not associated with anything, which suspends propagation of anything, runs user code, then resumes propagation. Upside: implements the semantics of C++ directly in the system. Downside: anybody who wants anything else will have to fight the system.
(4) Filters: Win32 SEH (both old- and new-style), Itanium ABI (IIUC). Basically (3) but a catch-type handler is matched by running user code, either in the middle of an unwind (simpler) or before it (does not destroy stack traces). Upside: you get some degree of language interop compared to (3). Downside: the interop is still anemic compared to the complexity.
(4a) Declarative (4): Win32 SEH (new-style), Itanium ABI. Upside: security (?), speed (?). Downside: uninvolved code (C, JIT) needs to get involved; better get your stack maps right the first time (*cough* Itanium’s 30% size overhead *cough*).
To me, only (1) and (2) sound like real options on the VM level. If what you mean by “unwinding” instead of longjmp is (2) instead of (1), I’d say the advantages and disadvantages here are basically mirror images of one another and so far I can’t see a reason to prefer either. If you mean to replace (1) with something else, please elaborate—my options (3) and (4) are somewhat fuzzy and possibly nonexhaustive.
> especially if you can attach a notion of a stack trace to the unwind primitive.
As a registered Conditionist[1,2] who thinks all systems of non-resumable exceptions suck, I take exception to this (pun not intended). More directly, if you’re going to turn SIGFPE or SIGILL or SIGTRAP into exceptions, the debugger / crash recorder / etc. needs a stack trace available on an ununwound stack, and those tools are the only consumers of a stack trace in non-insane production code anyway.
See also the part about the stack map format in (4a).
So far, then, I feel that the stack trace tie-in is just not a good idea.
> At a low-level language primitive level, unwind can be seen [as] a mechanism to have [...] normal and exceptional return addresses[.]
I’m unaware of double-barrelled CPS being used as anything but a theoretical tool, but it would be interesting to see. [This is the part that made me think you meant (2) by “unwinding”, as it fits this model most naturally.]
>> if you want asynchronous interrupts, you’ve got to have an equivalent to signals.
> ... not really. There's a few different kind of signals. Synchronous processor signals (e.g., SIGSEGV, SIGFPE) could be supported via something akin to unwind rather than signal handlers (and this is essentially how they work on Windows).
Which is why I said “asynchronous” :) (in part as a reference to VMS / NT APCs). But OK, let’s have a digression: I agree that SEH is better than POSIX signals for synchronous processor traps, with two caveats:
- Whatever you replace a SIGILL handler with must be able to resume instead of unwinding, as the use case might be instruction or syscall emulation (SEH can do this, but your proposal doesn’t mention it);
- Whatever you replace a SIGSEGV handler with must also be able to resume and will probably find the memory location more interesting than the call stack (this is a problem with POSIX signals[3] that Linux solves with userfaultfd, and also a problem with SEH which Windows solves with an inferior hack[4]).
(End of digression.)
> The asynchronous events can instead be supported by basically having some primitive notion of an event loop, dropping those signals as events in the event loop.
I don’t expect I want to live in your proposed world—in an event loop, the flow controls you—but I probably want to see this world in more detail first.
Your mental model for async notifications also seems to be an I/O-bound program that wants to have the environment notify it about I/O. So had mine been—and then I wrote a CPU emulator, which is by necessity CPU-bound and cannot (non-hackily) afford to check for events with a syscall but still wants to hear about them, and suddenly SIGIO was looking mightily attractive.
This is niche. It is also solvable by having a second thread run select() and set the same flag my SIGIO handler currently uses and the emulation loop polls. A case where you wanted to gracefully terminate a thread, though (a case that I have admittedly not yet encountered, and that is even more niche), would require nothing less than an actual signal.
Again, niche. I’m not at all advocating for using signals everywhere POSIX does. But it’s not hard to think of cases where nothing will do but a notification that can actually interrupt your instructions and not just system calls. Maybe such cases are too obscure to handle (Java certainly seems unhappy with asynchronous thread termination), but “YAGNI signals” is a different argument from “signals evil”.
> Signals already interoperate pretty sketchily with event loops
AFAICS this is a problem of Unix getting select() and threads too late and the retrofit being subpar, not an inherent flaw. (And once again, I entirely agree that most POSIX signals should be turned into other kinds of notifications... It’s just that not all of them can.)
> Interfaces like fork and POSIX signals are pretty notorious for being generally wrong ways to do what you actually wanted to do [...].
Signals, see above. My argument about fork was very different: I don’t like it; I just don’t think it‘s guilty of GGP‘s specific charge of being error-prone—certainly not more so than shared-memory concurrency.
[1] https://news.ycombinator.com/item?id=31196046
[2] https://news.ycombinator.com/item?id=33983418
[3] https://sourceware.org/legacy-ml/libc-alpha/2018-03/msg00214...
[4] http://bytepointer.com/resources/pietrek_vectored_exception_...
The closest contemporary thing is fly.io, but recently they became less strategic and more opinionated. Another attempt is sandstorm.io but it was abandoned by the original authors. So... maybe WASM and the initiatives like WASIX will give it to us?
This way if one application gets compromised, it won't result in the entire physical server being subverted.
With a sufficiently complete environment like wasix, you don't even need the rest of the OS or even a kernel. A filesystem and a networking stack is all you need. Just load a unikernel from network boot and you are good to go.
There's still going to be someone running Kubernetes, or provisioning VMs.
> where you do not have to concentrate on "how to run" something.
Sounds nice, been hearing this pitch for a long, long time. I really don't mean to be harsh, but it just sounds naive at this point.
> We don't have any current plans, but... I was the co-founder of Sandstorm.io before going to Cloudflare, and Durable Objects are very much inspired by parts of Sandstorm's design. So yeah, I've absolutely thought about it. ;)
Most contributions presently come from outside the original Sandstorm team, but some significant features and refactors have come out since the company shut down from former employees too.
Sandstorm is still maintained:
https://github.com/sandstorm-io/sandstorm
At Libera.Chat IRC #sandstorm . Welcome :)
One exciting advantage of WASM over containers is that it can run across different processor architectures and operating systems (the proprietary distribution of Docker runs on Mac but it does so by running a linux VM and containers not built for amd64 are noticeably slower).
Something like: https://tailscale.com/blog/ssh-console/
you can hack it into a browser, i guess, but that's subverting the fundamental purpose of the thing
Of course the browser can't offer an actual networking stack by itself, but you can augment that by proxying traffic through a server over Websockets/WebRTC.
Wasmer might have some plans in that direction...
My best guess is that they're using some kind of WebSocket proxy server; that's how Emscripten does it: https://emscripten.org/docs/porting/networking.html
The fact that POSIX is 1970s legacy, rusted beyond salvaging and an extremely poor fit for modern system designs and expectations is another problem.
I happen to like the design of the syscall layer of Fuchsia's Zircon kernel [2], but it's not a full substitute for POSIX (notably, file and network I/O are built as userspace features of top of IPC channels, they are not kernel concepts).
[1] https://www.geoffchappell.com/studies/windows/win32/kernel32...
> As an example, we have created wasmer-web , which basically showcases that any WASIX program published to Wasmer (including those with threads and forking!) works also with Wasmer running on the browser.
Does it support networking? (And if so, is it using a proxy to connect to the internet or is it using a virtualized network layer that stays in the browser?)
How is fork implemented? (Asyncify all the code?)
I was looking at the Github org page (https://github.com/wasix-org), but I can't figure out where this stuff is.
it's basically nonsensical to try to adapt wasi in the browser
my point is that this is a nonsensical thing to do
https://github.com/john-sharratt/wasix-witx/commit/3b1469687...
now I know its hard to imagine someone other than your personal boogeyman contributing value to the open source world, but there is a real need for me to keep my coding skills up to scratch and it just so happens that `wasmer.io` are the coolest kids in WASM town right now, so I'll share my spare time with them thanks.
In any case, you can access any SSL website with curl -k flag:
wasmer run --net curl/curl -- -k https://google.comThe supposed specification is more of an API reference and I don't really trust it to tell the developer what you can really do that works well on all platforms. It doesn't document platform-specific limitations, but I don't see it documented anywhere else either.
I also wonder about copying Unix semantics for fork and exec in a supposedly platform-independent spec. It seems like that won't work equally well everywhere.
I think this is a very bad idea, and should be rejected. If not... we'll just take another 10 years until capabilities show up again, continuing the Sisyphean cycle.
* WASIX does not allow one to open a random file in the host environment, in fact WASIX changed absolutely nothing in file system ABI's at all from preview1 - it just added other extensions.
* WASIX has not removed the capabilities model and instead extended it to support Berkley sockets - i.e. there are capabilities defined for the new socket operations.
* WASIX is fully sandboxed, meaning the network is completely virtual and can be restricted as much as one likes
* TTY and forking is also fully sandboxed.
* You can't reject the Internet
Multithreaded WASM is awesome.
My dream is a just in time compiler, performant, simple, easy, scalable, safe multithreaded runtime.
I use Java, Rust and C for my multithreaded programs.
However, Wasm on computers with a full set of syscalls available is isomorphic to native code. Worse, because programs in C/C++ and other unsafe languages can compile to Wasm, any security bugs in those codebases will be present when compiled to Wasm. Wasm programs can still have buffer overflows, use-after-frees, and all the other fun memory safety issues; threads will add data races and memory ordering bugs to the mix.
The only benefit of Wasm in this space seems to be that you don't have to recompile your programs for a new architecture - kind of like a lower-level Java. But as soon as your program needs to interact with OS features or existing native libraries, this benefit is going to go out the window...
You can still corrupt memory, you can't implement ROP or subvert control flow in a non data-dependent way.
it does seem like wasi has been stuck, in the outside view, for quite a while.
would welcome any comments from wasi/wasix insiders.
- full Berkley socket support
- sub-process spawning, waiting
- forking
- TTY support
- pipes
- event streams
- DNS resolving
- longjmp/setjmp
without these we can't compile our favorite apps in our favorite languages
lets help get these into preview2 so that WASIX is not needed anymore but until then the community needs an interim solution that has long term support - that is WASIX's complimentary goal.
lets reflect on this - if this was done as pull requests to `preview1` then would it have been accepted?... it would have received rejection comments around even the idea of these particular POSIX compatible syscalls.
WASIX should be seen as a preview 1.5 rather than something new, just extensions to WASI that add the missing bits that are badly needed today to actual compile useful apps from various code bases.
at a minimum this is an interim solution so that app developers can just start compiling their code bases into WASM and we can all get moving forward together - no one wants a fork here.
of course the WASI maintainers are reading all this and hopefully this will be a wake up call to add these missing syscalls as a priority also into preview2 so everyone benefits - then WASIX can die and its purpose is served... but until then WASIX will get long term support so the community can proceed literally today onwards.
until that is resolved, their products should probably not be viewed in good faith
In your view, what would it take to get the not-in-good-standing issue resolved?
What do you get out of shitposting Wasmer when they announce an initiative they are excited about? (I'm mostly trying to understand your psychology, not whether or if you have some kind of competing financial interest)
probably the most effective way would be for the organization to release a statement abdicating their previous controversial positions, and for the CEO to resign
i'm summarizing well-understood opinions of the ecosystem
https://news.ycombinator.com/item?id=30785511
Also "we didn't sign the agreement but the lawyers pushed the application forward anyways" sounds very...un-lawyer-y. Kinda sus.
Like, I want to believe you, it just seems weird of lawyers to do the thing without the i's dotted and t's crossed. I can see software devs totally barging ahead, but lawyers, less so.