4 ms·
Ask HN: C with a Borrow-Checker
What would be the closest thing to C with Rust's borrow-checker? Imagine a memory-safe C that would enable "fearless concurrency", but without all the constantly moving advanced features of Rust.
I looked at Zig, but it doesn't have anything like the borrow-checker.
- eimrine 6y agoHow about Lisp? It is memory-safe and has fearless concurrency and you have not told anything about garbage collector. Long time ago it has been used for system programming (Lisp machines). PS. I was expecting a link to a website but it is just "Ask HN" topic.
- gypsyharlot 6y agoSorry, I updated the title to reflect that this is a question. Specifically I was thinking about really high performance applications. I guess Lisp is maybe a good candidate for that.
- zuzun 6y agoModern C++ with smart pointers and the synchronization primitives from its standard library.
- thesuperbigfrog 6y agoProbably SPARK (programming language derived from Ada with advanced proof capabilities). The next release of SPARK will support pointer ownership similar to the Rust borrow checker: https://blog.adacore.com/using-pointers-in-spark https://blog.adacore.com/using-pointers-in-spark https://arxiv.org/pdf/1710.07047.pdf https://arxiv.org/pdf/1710.07047.pdf Concurrency in Ada is very easy. I haven't used SPARK enough to be familiar with its concurrency, but it looks very similar to Ada, but with added restrictions to allow for proofs: https://docs.adacore.com/spark2014-docs/html/ug/en/source/concurrency.html https://docs.adacore.com/spark2014-docs/html/ug/en/source/co...