Open aayushmau5 opened 8 months ago
Here are a few considerations.
another way of safety would be through , FireCracker VM instance for each example. or each page. Can be discussed.
I was thinking one VM instance per liveview process.
another way of safety would be through , FireCracker VM instance for each example. or each page. Can be discussed.
I was thinking one VM instance per liveview process.
That could work. It might be premature optimisation to design for scale just yet. But we should consider all alternatives and build the easiest / safest. (whatever ships fast)
My reservation around VM instance per liveview process is : boot time. (~150 ms) and memory consumption (___ MB)
One model that could
work for elixir is how cloudflare workers are architected. https://blog.cloudflare.com/cloud-computing-without-containers
They don't spin containers! But they leverage isolates
in V8 to sandbox
workers. So, essentially the VM is always up.
That idea can be taken further for elixir => because for beamvm , these processes could be clustered !
My reservation around VM instance per liveview process is : boot time. (~150 ms) and memory consumption (___ MB)
Right. We can try to evaluate which works better for us in terms of memory consumption. iirc microVMs have less memory consumption as compared to docker.
That idea can be taken further for elixir => because for beamvm , these processes could be clustered !
cool idea!
what's the isolates
alternative in beam world? or perhaps we can use https://github.com/TheFirstAvenger/safe_code?
Will have to dig for finding isolates
for beam world.
How do we go on about creating this project?
Ideas
I was thinking we can use liveview for UI, and use microVMs(like firecracker) to execute user input code.
For contents, we can take inspiration from: A tour of Go and Gleam tour.
Implementation
Currently i don't know anything about running VMs through elixir code, so can't comment on that front.
Any contributions are welcome :)