13,486 karma · joined Jun 1, 2016 (10y ago) · 4,896 submissions
comment 10y ago · link · parent
Types are far more rigorous - you can ensure, with types, that your code behaves in a certain way given any input. Yes, this extends to "design" bugs ie: not just crashes - you can write a type that ensures that an API can only be used correctly, for example. You can encode logic like "Don't allow unauthenticated users to access this content" into your type system - and you no longer need tests.
Of course, type systems don't prevent you from writing tests. They actually make it easier, you can generate test cases based on types, as an example.
comment 10y ago · link · parent
I think if you're used to a language like Java or C++ you may not see what types can really buy you, but that's because most languages have bad type systems.
comment 10y ago · link · parent
True, especially since they appear to be using a traditional seccomp sandbox, which means the process really can't do much.
Based on the architecture there is no broker process involved, you simply feed in data via read() and it writes the data out via write(). It has access to two other system calls by virtue of seccomp, so your kernel attack surface is quite small - but it is there.
The "no hostile process could escape the sandbox" is not really true since it assumes a perfect implementation of each system call available.
That said, kernel attack surface is drastically lowered, as are the capabilities of the process. But it can still read and write arbitrary files - unless, of course, they filter on fd, which I suppose they likely are.
As for determinism and robustness, those are still valid. To quote your other comment:
> an already de-facto secure library used millions of times every day.
The fact that it is used often does not mean it is "de-facto" secure. How could it? You can not prove it is secure, and doing so would be a huge pain. Whereas, given safe rust, you have strong guarantees about what can and can't happen in the code.
comment 10y ago · link · parent
Using Unique Ptr it's a bit hard IIRC (it's been 2 years since I've written C++) but still possible.
comment 10y ago · link · parent
True, but languages with support for affine types are, to my knowledge, uncommon.
"One problem is where to put your state-specific type info when you're not using it."
Can you elaborate? I have not run into this issue.