Hacker News

42

Show HN: QuickBEAM – run JavaScript as supervised Erlang/OTP processes

by dannote17747318035 comments
Interesting!! I've been playing around with QuickJS lately and uses Elixir at work.

I'm interested to hear about your sandboxing approach running untrusted JS code. So you are setting an memory/reduction limit to the process which 100% is a good idea. What other defense-in-depth strategies are you using? possible support for seccomp in the future?

by jbpd9241774809242
1. Are each of the JS processes running in its own process and mailbox? (I assume from the description is that each runtime instance is its own process)

2. can the BEAM scheduler pre-empt the JS processes?

3. How is memory garbage collected? Do the JS processes garbage collect for each individual process?

4. Are values within JS immutable?

5. If they are not immutable, are there risk for memory errors? And if there is a memory error, would it crash the JS process without crashing the rest of the system?

by hosh1774814182
Running JS on the Beam VM, all written in C. I don't know if this is just cursed, or absolutely brilliant, either way I love it and will be following closely. Will definitely have to play with it.
by waffleophagus1774809650
love this! a while back i noodled around with this idea, but didn't get that far:

https://github.com/ityonemo/yavascript

glad to see someone do a fuller implementation!

by dnautics1774812331
This is very interest to me because we have accumulated a few node packages containing logic that services simply import. So in theory I could now use those node packages in elixir?
by theflyinghorse1774806165