logoalt Hacker News

ameliusyesterday at 2:17 PM6 repliesview on HN

We need programming languages where every imported module is in its own sandbox by default.


Replies

mike_hearnyesterday at 4:51 PM

Java had that from v1.2 in the 1990s. It got pulled out because nobody used it. The problem of how to make this usable by developers is very hard, although maybe LLMs change the equation.

jerfyesterday at 3:17 PM

Now is probably a pretty good time to start a capabilities-based language if someone is able to do that. I wish I had the time.

jFriedensreichyesterday at 2:27 PM

We have one where thats possible: workerd (apache 2.0) no new language needed just a new runtime

show 1 reply
saidnooneeveryesterday at 3:42 PM

just sandbox the interpreter (in this case), package manager and binaries.

u can run in chroot jail and it wouldnt have accessed ssh keys outside of the jail...

theres many more similar technologies aleady existing, for decades.

doing it on a per language basis is not ideal. any new language would have to reinvent the wheel.

better to do it at system level. with the already existing tooling.

openbsd has plege/unveil, linux chroot, namespaces, cgroups, freebsd capsicum or w/e. theres many of these things.

(i am not sure how well they play within these scenarios, but just triggering on the sandboxing comment. theres plenty of ways to do it as far as i can tell...)

show 1 reply
staticassertionyesterday at 5:03 PM

In frontend-land you can sort of do this by loading dependencies in iframe sandboxes. In backend, ur fucked.