Notes on Ada
ada.kyleisom.net
ada.kyleisom.net
And pricing on AdaCore is "Get a Price Quote." Which means, "you can afford it."
It's actually freeer to download the FSF-distributed version, which is GPL'd with the library extension. See: http://www.getadanow.com/
The FSF version is usually a couple of minor releases behind the AdaCore version, but is otherwise much less hassle.
It's too bad that more mainstream languages don't have things like this (except for vanilla `assert` I guess). I would prefer this to something like built in unit tests.
[1] I'm assuming you are not talking about static verification, which I guess would use Spark?
procedure increment(v: in out integer)
with
post => v /= v'old
...
(/= is Ada's not-equal-to operator.) This enforces as a postcondition that the value of v must have changed. You can even refer to the old versions of arrays.Plus, the run-time type checking required by more complex type expressions are augmented by compile-time checking. If the compiler can deduce that a conversion will always be correct, it won't emit a check. If it can deduce that it will always be wrong, it'll error out at compile time.
It all works really rather well.
The only trouble I have with preconditions and postconditions is that you have to declare them in your module's interface, which is public, rather than in the module's implementation, which isn't. So you can only test your module's public interface. If your module doesn't expose a state variable to the outside world, you can't use it in a precondition or postcondition. I find that a very odd design decision.
- really nice strict typing (you can define a type which represents an number which varies between two values which are not known at compile time and the compiler will enforce it. And then you can define an array with it as an index, and it'll just work).
- fully nested everything with seamless upvalues. First class support for nested functions makes a lot of things easier.
- amazingly nice, rendezvous-based, type-safe message-passing concurrency. Think Go channels, but better.
- full support for generics. (e.g. the standard complex number library is supplied as a generic package so you get to specify what number type you want it to use.) There's a standard genericised container library.
- sanitised pointers. It's actually syntactically invalid to leak a pointer from an inner scope to an outer one.
- full OO support (although it's been shoehorned a little uncomfortably into the syntax; they should have added some more keywords).
- full low-level control over structure layout. You can specify the meaning of every bit of a structure, if you want (including, IIRC, endianness). If you want to.
- built-in support for design by contract. Most things you can specify preconditions and postconditions, and the compiler will enforce them.
- really fast. Like, about the same as a good C++ compiler.
The tl;dr is: fully compiled, old school systems language with rather antiquated syntax but an amazing feature set.
I did a writeup last year: http://cowlark.com/2014-04-27-ada
...and interested parties might like to see a multithreaded Mandelbrot what I wrote: http://ideone.com/a1ky4l
If only the tooling was a little better (as mentioned above), Ada would be my go-to language of choice.
Also I haven't seen design by contract as enforced by the compiler in Haskell yet (not this is different from testing).
/self goes and looks at web logs
Yikes.