6 ms·
For people looking for other languages with statically checked contracts, you might want to check out SPARK, which has been around in some form since the late 1
by csb6 3mo ago
For people looking for other languages with statically checked contracts, you might want to check out SPARK, which has been around in some form since the late 1980s. It is a subset of the Ada language and had been used for safety critical code in aerospace and defense projects, as well as for some Nvidia firmware.
It also uses Z3 to discharge proof obligations generated by the contract annotations, and it lets you use swap out different theorem provers as backends.
The GNAT Ada compiler (which is part of GCC) allows you to turn off the dynamic safety checks that are usually inserted into Ada programs at build time so you can optionally remove them if they are proven unnecessary.
Here are some resources for comparison:
- https://www.adacore.com/languages/spark https://www.adacore.com/languages/spark
- https://learn.adacore.com/courses/intro-to-spark/chapters/01_Overview.html https://learn.adacore.com/courses/intro-to-spark/chapters/01...
- bneb-dev 3mo agoSPARK seems interesting. Any ideas how it compares to Salt? - C performance? - Generics? - Syntax ergonomics? Thanks for sharing!
- pjmlp 3mo agoIt is a way to formally verify Ada, it meets all those criterias.
- bneb-dev 3mo agoIt looks like verification is distinct from the compiler.
- csb6 3mo agoYes, it has generics. The syntax is Pascal-like, which some people used to C-family languages dislike but I personally find nice. Performance can definitely match performant C code. (intended use cases include real-time systems and embedded devices) The language overview can be found here: https://docs.adacore.com/spark2014-docs/html/ug/en/spark_2014.html https://docs.adacore.com/spark2014-docs/html/ug/en/spark_201...