← Back to context

Comment by amelius

2 days ago

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

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.

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.

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

  • I mean, the sandboxing aspect of a language is just one thing.

    We should have sandboxing in Rust, Python, and every language in between.

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...)

  • What if I wanted to write a program that uses untrusted libraries, but also does some very security sensitive stuff? You are probably going to suggest splitting the program into microservices. But that has a lot of problems and makes things slow.

    The problem is that programs can be entire systems, so "doing it at the system level" still means that you'd have to build boundaries inside a program.

    • you can do multi process things. or drop privs when using untrusted things.

      you can use OS apis to isolate the thing u want to use just fine..

      and yes, if you mix privilege levels in a program by design then u will have to design your program for that.

      this is simple logic.

      a programming language can not decide for you who and what you trust.

      1 reply →

Or just make side effects explicit in the type system through monads or algebraic effects.