Should I choose Ada, SPARK, or Rust over C/C++? (2024)
blog.adacore.com
Should I choose Ada, SPARK, or Rust over C/C++? (2024)
1–10 of 173 posts
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#2If its a personal project then try each and see what you like. Work project then follow your company development guidelines.
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#3I found that learning Ada was a good way to learn how to write good C++ code, because both languages are at the same level of abstraction but Ada is clean and opinionated.
The best a example is RAII. This is a pattern in C++ that you have to follow if you don't want to make a mess. In Ada it's a language feature called Controlled Types.
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#4(2024)
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#5Even though it's an Ada ad, 'C*/*C++' vs 'Ada*, *SPARK' is wild.
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#6I found that learning Ada was a good way to learn how to write good C++ code, because both languages are at the same level of abstraction but Ada is clean and opinionated. The best a example is RAII. This is a pattern in C++ that you have to follow if you don't want to make a mess. In Ada it's a language feature called Controlled Types.
Do you feel the same is true for someone who does mainly rust nowadays ? I had the same feeling with rust & python ; If there are any patterns that help in other languages I'd definitely like to look them up
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#7I know there is a belief that Rust/Ada etc is safer than C/C++ and in some cases that is true. I know of multiple, airworthy aircraft that are flying with C++ code. I also know of aircraft flying with Ada. The aircraft flying with Ada is hard to maintain. There is also a mountain of testing that goes into it that is not just unit testing. This mountain of integration, subsystem and system level testing is required regardless
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#8I've never heard of SPARK. What advantages does it have compared to Lean?
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#9I'm not sure I'd want to limit the selection of languages that much. Depending on the project and how much language risk you can manage (as opposed to security risk), there also is D, Odin, and Zig. And probably a bunch more I'm unfamiliar with.
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#10C++ is a good alternative to "C/C++"