Kernel-WASM: Sandboxed kernel mode WebAssembly runtime for Linux
github.com
github.com
Granted, it is surprising that browsers are increasingly taking this role rather than operating systems. But this module runs in the kernel.
Yes, but the easy part is to think about what would be possible if hardware was fast enough. Not sure what you mean by lessons learned from JVM.
Anyway, the GC-included approach is of course the one taken by Javascript and JVM.
Instead of adopting PNaCL in 2011, here we are a decade later still trying to figure out how WASM will be able to support all computing models.
Such a couple of examples of platforms using bytecodes as main executable format.
We've been trying for decades, and it only kind of caught on with Java, so no it's not really obvious that it's preferable.
Is this a reference to another old language whose name we mispronounce today? Or just a joke to say that by 2035 JavaScript will be so irrelevant that we won't even know how its name was pronounced?
The talk has predicts a lot of what is happening around wasm.
The irony is that with its 3% market share, if it was today on the age of Chrome OS based Web, Google would have been able to push it no matter what.
To make a tl;dr, the video talks about a technology called asm.js which other applications end up compiled into so they can run with near-native speeds on any system which supports asm.js. This technology ends up being a compilation target meaning that JS gets eventually forgotten as a language because everyone just compiles everything into asm.js which is executed natively on the kernel.
Just do a s/asm.js/WASM/g and it'll suddenly start making sense.
What we're yet to see is this last point becoming the default, so execution of user programs kind-of makes a circle by returning to kernel mode, except now a trusted WASM-to-native compiler/runtime is responsible for ensuring system safety. Might happen in the next few years.
[1]: https://en.wikipedia.org/wiki/Singularity_%28operating_syste...
The idea is still really interesting, though. It's almost like micro-containerization. I was reading this and it's what sold me on attempting it:
https://www.techtarget.com/searchitoperations/news/252527414...
This kernel project is a bit outdated since is not using the latest Wasmer API (3.1), but it would be great to see community can pick it up and move it further. By making Wasm run in the kernel we were able to get really great runtime systemcall speeds since the program has not to pay any costs for crossing kernel protection rings
There's no official kernel mechanism where IO is entirely done in userland (Like Intel's DPDK and SPDK). The kernel will be context switching & doing IO. Single core was just an extreme example to make that extremely visible & obvious, but the core point is the kernel needs time too during io_uring, whatever the core count.
No context switches ever needs to occur.
We may technically be at 100% no context switching, but we did kill 1/8th of our cores or whatever & stress the fabric a lot more, just to satisfy a technical constraint we set up that sounds good but is actually foolish to ask for.
Going totally userland is probably smarter. Go all in on SPDK or DPDK (storage/networking). You'll need dedicated networking for the app. In general though, I think your top post was 90% right, and that's good enough, and right now hunting for 100% is a mis-goal.
io_uring is a compromise with a lot of advantages over that, and can be configured in different ways depending on how hard you want to optimize things.
I very much agree io_uring is a great way to go & it was a good mention. But you mischaracterized it at the start & dont acknowledge that at all.
This is a parade of shitty disingenine crappy posting, that favors pathetic minor technicalities over the main use & actuality. Shame on you. I was trying to inform a little bit while 90% agreeing & you have brought confusion & misdirection at every turn. Seriously bad mojo dude, just awful. Almost no users will experience what you describe. It's still phenomenally good & great, excellent, a world better, but you are still using a 0.001% case, a technical possibility, to say you arent wrong, while admitting nothing, no caveats, to the 99.999% who wont experience what you are promosing. Kill your insane ego & be reasonable, think of all the people you are misleading just a little bit.
If you seriously think io_uring completely supplants any and all reason for projects like kernel-wasm, I continue to disagree. I'd agree that io_uring captures a huge amount of the potential value, makes things much better. But there's still barriers that get crossed in io_uring & considering other options, in my humble view, is interesting. I have seen zero willingness on your side to entertain any such possibility.
Being in the kernel alone doesn't remove interrupt-driven context switching, or being scheduled out by other kernel threads. Those are all completely orthogonal concerns, which can all be fixed without needing to put more user code in the kernel.
You still haven't shown any compromise. I think almost no one would agree with you. io_uring is great, but as much as you dodge around the fact, there's still a kernel/user barrier, and there are systems like kernel-wasm or DPDK that keep processing on one side or the other, and as much as you for some asinine reason or simply personal failing, you are unable to admit that obvious clear & essential advantage.
> I didn't. io_uring allows to remove context switching entirely. That is a factual statement.
If you use io_uring, there is more kernel work than there otherwise would be. Work must transit the user/kernel barrier. And this has a cost, which can be avoided by other schemes. Simple as that. Fact. Stop throwing smoke bombs & be real. Can you show even any recognition what-so-ever, any attempt to acknowledge a single statement I've made (as I have done yours), rather than blow up every single thing I've said? It seems not. This seems like enormously bad faith posting, not done in the spirit of finding out & discussing.
https://news.ycombinator.com/item?id=32069418
https://github.com/WebAssembly/tail-call/issues/15#issuecomm...
So, WebAssembly has achieved what Java tried to sell us since it's inception?
Can we open up a new class of vulnerabilities in Mitre?
As usual, this benchmark is comparing against an extremely naive implementation. It even uses a non-optimizing compiler!
A fair benchmark would take advantage of all the features that native code has available - huge pages, CPU acceleration, io_uring, and, most obviously, a compiler that supports -O2.
If they did that, the native code would smoke wasm.
Winning benchmarks is meaningless without a business case for them.
That's the first sentence on the GH page. It seems they decided to mix marketing in first.
And by faster they mean IO performance which is fine in principle but generally people think about compute when they care about the performance overhead of WASM because there is nothing about it that should make IO slower than native but everything about it makes compute slower than natively compiled programs.
WebAssembly is to Web what JavaScript is to Java.
I think it was Microsoft that saw that running graphics in kernel is a bad idea.
But, yeah, this was a very long time ago and why not make the same mistakes over and over again.
> WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine.
Yes, browsers implement this nowadays but there are other implementations as well. You can compile them into llvm bytecode for example or there's another for the GraalVM etc
The reason why it doesn't quite work out is that typically such a thing, AOT-compiled into native code, still carries with it its limitations and assumptions. It's technically native, but experiencing the native APIs only through a narrow peephole in the fence.
If we let this meaning of "native" take over, we're gonna need another word for actually native things.
Sometimes, that works well enough, though!
Subjectively I think WASM's feature and non-feature list makes it plausibly kernel-friendly in a way that eg. Python isn't, but there may not be a concrete line to draw around that