logoalt Hacker News

csb6today at 7:13 PM1 replyview on HN

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://learn.adacore.com/courses/intro-to-spark/chapters/01...


Replies

bneb-devtoday at 7:22 PM

SPARK seems interesting. Any ideas how it compares to Salt?

- C performance? - Generics? - Syntax ergonomics?

Thanks for sharing!

show 1 reply