3 ms·
> Right, because that's the only way to do it? What's wrong with that? Maybe the fact that it's wrong? Compile-time bounds checking is such a classic "hello wo
by chriswarbo 11y ago
> Right, because that's the only way to do it? What's wrong with that?
Maybe the fact that it's wrong? Compile-time bounds checking is such a classic "hello world" example for type checkers that it's become a cliche (eg. https://www.quora.com/What-are-some-good-examples-of-practical-applications-of-dependent-types-BESIDES-vectors https://www.quora.com/What-are-some-good-examples-of-practic... )
Dependent types make zero-overhead bound checking trivial. More recently, less powerful type systems like liquid types have been proposed (because reasons). Zero-overhead bound checking is usually on their feature list, since a) it's ubiquitous b) it's easy.
- acconsta 11y agoGreat! Please implement them in Rust as soon as possible. But until then, Rust's approach is runtime bounds checking.
- chriswarbo 11y agoI don't know about Rust, I've never used it (and I rarely use C). However, I do use dependently typed languages every day, so I was replying to refute the "that's the only way to do it" argument.
- acconsta 11y agoFor... building software? I thought dependent types haven't escaped research languages.