6 ms·
Make with Ada: Redux
- losvedir 10y agoHeh, I didn't understand the title at first and thought it had something to do with an implementation of the JS redux library in Ada. Anyway, it's a cool write up. I wish Ada came up more on HN. It's one of those languages that, like the author, I only know of as one that's "built for reliability, mainly used in defense applications". If it's fast and safe, why doesn't it get the attention that, say, rust does?
- prodigal_erik 10y agoAda isn't safe the way Rust is safe. It can statically check that an access type (pointer) is only used with objects from a particular storage pool, but dangling pointers to deallocated objects and stack-allocated objects still happen.
- Raphael_Amiard 10y agoIt's a bit more complicated than that. Ada has no safe object deallocation, but guarantees safety as long as you don't use any unchecked operations (object deallocation being one). Ada is also much more powerful than C/C++ in terms of how far you can go with the safe subset of the language, since you can pass/return objects of unknown size in and out of functions by value. There is no doubt that Rust static guarantees in terms of allocation/deallocation are very useful in some contexts. There is also no doubt that they're not sufficient at all to express every useful programs (for example you cannot safely express any structure with circularities, linked lists/graphs). In those cases you'll be back to unsafe constructs directly or indirectly. So Rust has more expressivity in this regard but is still no silver bullet.
- jeromel 10y agoIn terms of safe programs (e.g. programs that, if failing, could kill people), dynamic allocation is not allowed anyway (at least, dynamic deallocation is not allowed). So this makes this point void. Rust makes user-land programs less prone to crashes, but safe programs found a better way years ago to deal with deallocated pointers issues. That's also one of the reasons that prevented Ada compilers back in the days to create a garbage collector: there's no sound way to have a garbage collector compatible with real time constraints (which is sometimes safety critical: just imagine an air bag waiting for a garbage collection when it would instead need to pop out), and people creating safe applications don't need it anyway. So why bother?
- smitherfield 10y agoIt's before my time, so YMMV, but it seems that the 90s-era "HN crowd" took something of a "shoot-the-messenger" approach to Ada, assuming it must be a terrible language because it was created by the Department of Defense. Not unlike how anything associated with Microsoft used to be treated until pretty recently. Complaining-about-languages-you-don't-use was an even bigger phenomenon in the era when the internet/open-source was not widespread, and trying out a new language was often far from a trivial thing to do. It's always a bit amusing to read an old article from the 90s or early 00s, filled with unironic praise for langs now considered poor-to-mediocre, like C, Perl and PHP. (Because these were the languages that didn't take a great deal of effort/money to start writing in the first place).
- agumonkey 10y agoI didn't pursue it, but I found some blogs about low level type safe Ada through generics and modules that looked very interesting. Since, I believe, most of us are sad about C lack of safety, seeing these was inspiring.
- stesch 10y agoCurrent complaints are about the language not being free enough. And kind of boring looking.
- jordanb 10y agoThe main compiler nowadays for Ada is GNAT, the compiler is GPL and the runtime is LGPL. In a sea of C-syntax languages I find an ALGOL-syntax language to be really neat looking. :) I think the biggest problem with Ada is a small community/mindshare.
- the_why_of_y 10y agoActually Ada is quite unusual in that the official ISO standard has always been licensed under terms that permit unrestricted redistribution and even modification; it is AFAIK the only ISO language standard that you can install as a package[1][2] from Debian's "main" repository. The language is thus more free than ISO C and C++, where everybody googles for "draft" pdfs and hopes their content does not substantially differ from the actual standard. [1] https://packages.debian.org/jessie/ada-reference-manual-2005 https://packages.debian.org/jessie/ada-reference-manual-2005 [2] https://packages.debian.org/jessie/ada-reference-manual-2012 https://packages.debian.org/jessie/ada-reference-manual-2012
- pjmlp 10y agoBecause compilers used to be pretty expensive, and the only one free, GNAT, took a long time to become available. Also the average age of HN readers seem to never have seen or used Algol variants for systems programming, so Rust gets hyped, while ESPOL, NEWP, Mesa, Modula-*, Ada, .... get forgotten. It is great to see people adopting Rust, but it would be nicer if history doesn't get forgotten.
- adamnemecek 10y agoI believe that the Ada complier was like $2-3K back in the day which turns out is a major obstacle to language adoption.
- gaius 10y agoIf it's fast and safe, why doesn't it get the attention that, say, rust does? It failed for the same reason that Smalltalk and Lisp failed: back in the day compilers and even access to documentation cost a fortune, so there was no way to "kick the tyres" for the average developer. The only people using it were people already employed at companies who were using it, and they used it strictly for their day jobs. Nowadays you can get them for free of course (along with supported commercial implementations) but their time has passed. Incidentally, a subset of Ada lives on in PL/SQL for which there is a large installed commercial base.
- cocktailpeanuts 10y agoI hope someone creates React/Redux with Ada and posts it under the same title.
- Yenrabbit 10y agoI really regret not getting my act together and working on my entry for the Make With Ada contest - the language really appeals to me. One day...