3 ms·
> If 99.9% of code you write works, but every once in a while code nondeterministically encounters space leaks, that's a bad thing for the reliability of the la
by chriswarbo 4y ago
> If 99.9% of code you write works, but every once in a while code nondeterministically encounters space leaks, that's a bad thing for the reliability of the language as a whole.
I don't know what you mean by "nondeterministic"? The behavious is occasionally hard to predict, but it's completely deterministic.
Compare it to e.g. writing C in a certain style, relying on GCC to optimise it. Those optimisations might not apply for one chunk of code, so we end up with bad performance. Yet it's completely deterministic.
- bmitc 4y agoI think they probably more meant something like chaotic, in that small changes to your program can have big changes in the space leak space.
- ummonk 4y agoI should have said "undefined". What I meant was that the space the program will use isn't defined by the language itself and can't be known at compile time. It's dependent on implementation details of the compiler (GHC), and the particular input you feed to the program when executing it.
- runeks 4y ago> What I meant was that the space the program will use isn't defined by the language itself and can't be known at compile time. You can know the space usage (in relation to input size) of some Haskell programs at compile-time — e.g. if you use a constant-memory streaming abstraction. I don’t know much about Rust, but I don’t think it guarantees known space usage of all possible programs at compile-time.
- ummonk 4y agoDon't know if Rust has this ability, but SPARK (a subset of Ada for safety-critical code) does have the ability to guarantee known space usage, as well as guarantee that a program will terminate.