3 ms·
Ada's got a lot of really nice features. - really nice strict typing (you can define a type which represents an number which varies between two values which ar
by david-given 11y ago
Ada's got a lot of really nice features.
- 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 http://cowlark.com/2014-04-27-ada
...and interested parties might like to see a multithreaded Mandelbrot what I wrote: http://ideone.com/a1ky4l http://ideone.com/a1ky4l
- euan_torano 11y agoPlus there's the ravenscar profile for working with hard real-time systems, making it possibly the best language for working with embedded and safety critical systems. If only the tooling was a little better (as mentioned above), Ada would be my go-to language of choice.
- david-given 11y agoWhat sort of tooling were you looking for? I'm happy enough with gprbuild, gdb and the command line tools; I tried GNAT GPS for a bit and loathed it on sight.
- cbd1984 11y agoSo it's almost as nice, and almost as safe, as Haskell.
- tomjen3 11y agoNo it is not nearly as nice as Haskell. It is however usable in contexts where Haskell will get people killed and on embedded devices where you can reasonably afford the Haskel overhead. Also I haven't seen design by contract as enforced by the compiler in Haskell yet (not this is different from testing).
- dalke 11y agoThat was an excellent writeup. I took the liberty of submitting it as an HN link.
- dalke 11y agoMade it up to 19'th on the main page.
- david-given 11y agoThanks! /self goes and looks at web logs Yikes.