logoalt Hacker News

tancoptoday at 2:45 PM10 repliesview on HN

We need effect based languages now. It's the only way to guarantee policies like no network, no file access, no unsafe code or FFI for a library before it even compiles. If anyone from epic is reading this please give us a timeline for open sorucing the Verse compiler.

In the mean time I think it's possible to hack Cargo and run all build scripts in a microVM. The blast radius will be limited to malicious code in the binary instead of uploading all your CI secrets and deleting the whole hard drive.


Replies

jmulltoday at 4:04 PM

I think this is an attractive chimera, but will never be popular and will only be used much in specific domains.

The thing is, trust is a massive optimization. If you believe code from X is competently made and not malicious, you can accept that code without any additional overhead. (Building trust is a significant effort, but trust begets trust, so there's a resonable path from starting small to scaling.)

It's not that these mechanisms that require less trust (none of them eliminate it, BTW, when you examine them) can't work. It's that they'll inevitably be outcompeted by trust-based systems (in most domains).

E.g., compare the effort of creating a new, full featured, general purpose language, promoting it, building and maintaining all the tooling and documentation around it to support it, etc to the effort of creating and maintaining a curated package repository of trusted packages (and/or adding trusted code to extend the standard library) for existing language X.

(It's not clear to me you could provide enough value from a new language focused on effects that you could convince any but a few from adopting it at all, even if it dropped from the sky fully formed with all tools, docs, etc. in place from day one.)

vayliantoday at 3:00 PM

> It's the only way to guarantee policies like no network, no file access, no unsafe code or FFI for a library before it even compiles.

It's not the only way. You can sandbox processes. I think sandboxing is the much more reasonable approach, because in the end of the day, there are still closed-source software products where you can't demand that the manufacturers use certain language safety features.

show 2 replies
rtfeldmantoday at 2:57 PM

I think the only language that's used in production where malicious dependencies can't do arbitrary effects is https://roc-lang.org - but it's a pre-0.1.0 language and as such its production usage is extremely minimal for now.

rrooktoday at 3:41 PM

Some shameless self promo - I'm working on one!

https://hale-lang.org/proof/

insanitybittoday at 2:51 PM

https://github.com/insanitybit/witchy

This is why I'm building this language. It's capabilities based. Build scripts can't just do whatever the hell they want to, everything is auditable, and it layers its sandboxing.

It's for fun and anyone looking should understand that this is AI driven building with human driven design, but the goal is to demonstrate.

prpltoday at 3:15 PM

I have been working on a cross platform way of sandboxing without a VM:

https://github.com/brianv0/formwork

jooops1today at 3:48 PM

Can you explain how an effect based language helps here? Also to note filesystem access can allow network access on many systems and also the other way around.

burnt-resistortoday at 2:49 PM

More than that, we need capability-based languages. No capability passed to it, no permission.

show 2 replies
throwaway894345today at 3:00 PM

Why does every build have the ability to run arbitrary code by default in the first place? That seems like something you should opt into only under very specific scenarios and even then it should probably be built around a WASM sandbox or microVM (as the parent suggested).

show 1 reply
quotemstrtoday at 2:51 PM

MicroVM this, effects that --- can we discuss security without needing to invoke bay area buzzwords?

The idea is "least privilege", and we desperately need it in computing. The precise technical mechanism we use to achieve it is less important than committing to the idea that a dependency doesn't run with full privilege of its host program and an install script doesn't run with full privilege of the programmer.

The original Linux seccomp is old enough to drink. It's always been possible to do things like expand macros in a no-IO environment. Nobody's bothered to do it over the past two decades. Why would anyone bother in the next two decades?

show 1 reply