Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASI OS #57

Closed
olanod opened this issue Jun 14, 2019 · 8 comments
Closed

WASI OS #57

olanod opened this issue Jun 14, 2019 · 8 comments

Comments

@olanod
Copy link

olanod commented Jun 14, 2019

Just throwing a bold title out there to look back in few years with satisfaction or disappointment 😝 We all know it needs to happen right? But now I just wonder how it would happen. 🤔

I'd like to hear opinions and crazy ideas on how an operating system around WASI would work, to reduce the overhead of a runtime and the translation to system calls there are projects like cervus that implement a WASM subsystem for Linux, if you take that further and strip out the Linux things you don't need, add package management, daemons, IPC and what not you are left kind of with a wasm linux distro no? But Linux world and its kernel might be too bloated for that WA-OS might need, perhaps a fresh micro kernel which it's only API is the WASI core sys calls and drivers and other stuff as user space modules? I see most WASM things are being build with Rust perhaps inspiration or parts from Redox could be a base of such system?

Another thing to take into account creating an OS is your target users, I guess it wont be the same targeting a desktop, a cloud environment or an embedded device, but maybe this hypothetical OS can fit all use cases? like be a good replacement for linux+containers on the cloud, perhaps have a hybrid scheduler to run real-time critical stuff as well as a GUI?

Talking about containers, I was curious about Docker co-founder post saying if WASI existed back then they wouldn't have needed to create Docker. Sure they overlap but not completely, so what can we do to make them overlap even more and conquer the cloud? 😈 As far as I understand the capability based isolation system is good for sandboxing processes but won't give you other things you get with containers like the network namespaces and cgroups to define custom networking for your app and limit the resources it gets, our OS and some WASI extensions could come in and fill the gaps right?

Let me hear your ideas! List things that such an OS would need and some clever person might see them and get the inspiration to put all pieces together 😉

@skyne98
Copy link

skyne98 commented Jun 14, 2019

I think that microkernel systems like Redox can benefit from it more than average, because drivers can be distributed as usual WASI executables right away.
However, what are the benefits to that? Considering that the WASM runtime would be most probably written in Rust, you would be limited by the number of targets Rust itself supports. That means that you would be free to compile usual Rust code to usual microcode, as usual. You would need to ship a compiled kernel anyways.
If we are talking about the apps, then that's a totally different story, because you may be interested in distributing them in a platform-agnostic manner. In such a case, you can use something like kernel-wasm in wasmer repo to avoid the "bloat" of the linux kernel.

@olanod
Copy link
Author

olanod commented Jun 14, 2019

The idea might not make sense at all, that's what I'm trying to validate. When it comes to this topics I'm mostly just a hyped fanboy typing fancy words in a keyboard waiting for a grown-up to put sense into them 😂

Like in many cases it could happen just because it can happen and people still manage to have tons of free time in this modern busy world. So let's say it happens and someone creates a Wasm only OS, at this point in time I'd like to think the world is all crazy about Wasm and Wasm runtimes are an important dependency of all major OSs because start-ups realized who cool wasm+wasi is to create modern apps and how bad electron is. Suddenly a WAOS doesn't sound so bad right?(killer mobile OS maybe?) if I'm running wasm apps anyways an OS optimized for this kind of binaries and with an ecosystem built to make this apps feel like at home would certainly be beneficial. Yes it's always mostly about the apps, apps that you can quickly showcase in a website, that can be made faster or better integrated with the OS when installed as a system package and run even faster and more integrated when run in a purpose built OS.

@MarkMcCaskey
Copy link

MarkMcCaskey commented Jun 14, 2019

@olanod those are definitely good ideas and we're working on some things that similar to many of those ideas; just not as an OS.

It'll be interesting to see if Google does anything to seriously adopt WASI. I don't know very much about Fuschia, but I've heard it has some similar capability based things; I imagine that Wasi probably provides a more complete system, especially with being able to pass around reduced capabilities to other modules and things like that.

I, too, am very excited about the future of WASI. Hopefully it becomes standard enough that I can actually feel comfortable running all the arbitrary programs I'd ever want on computers I care about.

@skyne98
Copy link

skyne98 commented Jun 14, 2019

Yeah, I think that, in theory, WASI can become the new cross-platform bytecode for such platforms as Android (ART) and others, replacing outdated Java bytecode.

@dumblob
Copy link

dumblob commented Jun 14, 2019

As far as I understand the capability based isolation system is good for sandboxing processes but won't give you other things you get with containers like the network namespaces and cgroups to define custom networking for your app and limit the resources it gets, our OS and some WASI extensions could come in and fill the gaps right?

This should actually be possible [1] [2] [3] as one of the main advantages of capability-based systems is the possibility to "refine" a received capability further using "any" available means (maybe even BPF).

@lazarevk
Copy link

Whole WASM idea is to build functional application for system-agnostic environment with performance close to native applications. This means to have applications which runs in in controlled environment of WASM engine on any OS with efficiency provided by engine implementation.
In this approach having custom implementation of kernel does not make a lot of sense. Any custom implementation will reduce amount of the devices on which such applications would run. Development and maintenance of custom kernel would be unbearable for small community for wide variety of hardware platforms. And as result usage of such applications will be extremely limited.
Linux kernel on other hand has large community and supported almost on any hardware platform.
WASM engines are supported in most modern Internet browsers. And this allow to run WASM applications on platforms supported by Linux. Other OS will be supported as soon as WASM engine supported. And OSes/btowsers will start competing for efficiency of running WASM applications.
WASI initiative will allow to expand functionality of WASM applications to system task and provide privileges/capability/access/resource separation. And containers in would allow to implement separation efficiently (at least on Linux platform).

@sunfishcode
Copy link
Member

I'm going to close this issue now, as discussion has subsided and there isn't anything directly actionable here. A WASI OS is indeed a technical possibility. If you're wondering why you don't hear much talk about such a thing yet, one of the reasons is that outside of narrow use cases, WASI as it exists today isn't actually that great yet. We have a lot of unglamorous work still to do.

@Lennie
Copy link

Lennie commented Nov 9, 2019

(sorry to add to a closed issue, just wanted to add this to the list)
If anyone remembers the "Birth and Death of Javascript" presentation, the suggestion was to add Javascript inside the Linux kernel this to completely remove the syscall overhead.
I think that would be a one avenue. Did you know the The Linux kernel already has a (or multiple similar) VMs ?: BPF, eBPF and XRP, so at least in theory WASI could be one too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants