3 ms·
There's no way to distribute really lightweight thunks of arbitrary code. Maybe WASM can work here, especially if you shape the standard APIs in the right way.
by lachlan-sneff 6y ago
There's no way to distribute really lightweight thunks of arbitrary code. Maybe WASM can work here, especially if you shape the standard APIs in the right way.
You'd also need built-in support in tooling and compilers, where you can compile specific functions or modules into something that can run separately without actually doing that manually.
- theamk 6y agoThis depends on how lightweight are those chunks. If you goal is <0.1 sec startup -- yeah, then you'll need WASM. If you are OK with 1-5 second of startup, you have a ton of options. Apache Spark uses JVM magic to send out the the raw bytecode. You can start up docker container. If you are willing to rewrite stdio, you can exec machine code under seccomp/pledge. There are even full-blown VM solutions -- Amazon Firecracker, which claims that: "Firecracker initiates user space or application code in as little as 125 ms and supports microVM creation rates of up to 150 microVMs per second per host."
- threeseed 6y agoAnd for people that don't know. AWS Lambda uses Firecracker under the hood.
- j88439h84 6y agoI dont really understand your claim. You can send code to another computer and it can execute it and send it back. What is the problem?