9 ms·
A Random Walk Through Ada (2014)
- Narishma 10y agoNeeds a 2014 in the title.
- Avshalom 10y agoAda 2012 is still the most recent standard.
- throwaway7645 10y agoThe language is pretty old. I'm not sure it needs a huge amount of extra features. They added full OO support awhile back, although its probably not necessary for a lot of embedded projects. There's a company (Ada Core I think) that keeps their products up to date.
- Avshalom 10y agothe big thing for 2012 was adding more design by contract support and (as a consequence) added limited support for control structures to be expressions instead of statements (which I expect will slowly expand in the future).
- grzm 10y agos/old/mature/ :)
- username223 10y agoIndeed, that company is Ada Core, and their pricing page tells you everything you need to know about why you're not using Ada: """ All of our products are available as annual subscriptions... For general inquiries regarding our products and solutions or to learn how you can apply for an evaluation, please contact sales@adacore.com. Use the following form to receive a price quote. Please fill it out as completely as possible so we can provide you with the most accurate pricing information. """ -- http://www.adacore.com/gnatpro/pricing http://www.adacore.com/gnatpro/pricing In other words, standard Enterprise Pricing: "if you have to ask, you can't afford it."
- Avshalom 10y agoOf course on the other hand sudo apt-get install gnat
- pjmlp 10y agoThere are a few other ones. PTC, which bought Aonix and Atego, both Ada vendors. Green Hills, I think. Then IBM had Ada compilers but they have sold their unit to someone else, I think one of those companies bought by PTC. Finally I guess there might still exist a few lesser known ones, living from their maintenance contracts.
- dmix 10y agoNoticed that when he referenced Heartbleed. I can't believe it's already been 2.5 years since that happened...
- Keyframe 10y agoEvery time I see something on Ada, it seems like a really nice language. Easy to read, easy to write, performance seems to be there with C++, easy (?) to interface with C, multi-threading seems to be somewhat easy too... So, what's the deal, where's the catch? Why people aren't jumping on it like they do with, I don't know, Rust?
- goatlover 10y agoAda is like Smalltalk or Lisp at this point. It's not new and shiny. It's not being marketed. It's seen as outdated, or even extinct (how many people know an Ada developer or project)? Like it or not, people bandwagon technologies. Not to say anything against Rust, Go, etc. But how many people who have jumped on one of those bandwagons did so after examining Ada, and found it wanting in comparison, do you suppose? There's also the expectation that a more modern language will have modern tooling people today need, and community support easy to find (if it's caught on).
- femto 10y agoI'd expect someone who knows VHDL could get up to speed on Ada pretty quickly. VHDL is a widely used Hardware Description language, which was derived from Ada.
- gaius 10y agoPL/SQL is also derived from Ada.
- pjmlp 10y agoWhich makes me a bit happier every time I have to dig into our stored procedures. :)
- user5994461 10y agoTo have done [a bit] of both. I doubt that.
- 10y ago
- tomrod 10y agoI haven't learned Ada yet, but I've heard praise and eulogies from HN a few times it has been mentioned in recent years. At first pass, it appears to have a lot of unnecessary keywords, and the semicolon terminator (at first pass) seems arbitrarily required. Is it really that great of a language? What does it provide that FORTRAN, C, and/or Julia don't provide in terms of speed, or Python in terms of readability?
- toomanybeersies 10y agoThe advantage of Ada is that it's meant to be an incredibly safe language. That's why blocks have to end with the block type (e.g. if...end if) This is to ensure that you haven't accidentally nested things wrong. It also has runtime bounds checking for arrays, ranged variables, no multi-line comments, safer pointer handling etc. At the time, it was definitely one of the safest languages to use. Fortran is a real pain to read or write, and is designed more scientific computing than applications. C is terribly unsafe (hence why buffer overflows are the most common security vulnerability).
- kbenson 10y ago> from HN a few times it has been mentioned in recent years At some point, nickpsecurity[1] will find this thread and school us all on the intricacies of Ada. ;) 1: https://hn.algolia.com/?query=nickpsecurity%20ada&prefix=false&page=0&dateRange=pastYear&type=comment&sort=byPopularity https://hn.algolia.com/?query=nickpsecurity%20ada&prefix=fal...
- ar-nelson 10y agoThis really makes me want to try Ada, if I could find a good fit for its low-level features (game development, maybe?) The biggest thing that would make it annoying to write in is the verbose syntax--it's like the worst of Java, VB, and Standard ML. And yet, that same verbosity makes it kind of nice to read. I think there's an inherent friction between "write-friendly" and "read-friendly" languages. It would be nice to have a language with a few different "dialects" (the way Ruby often has several equivalent ways to write certain constructs), such that a programmer could write the initial code in an extremely terse language, then run a formatter and get back a beautifully-formatted, much more verbose form of the same code.
- Keyframe 10y agoVerbosity leaves me on the edge as well. But then I look at the promise of what Ada brings. It would mean trading in a bit more writing time for a possibility of a lot less debugging time.
- fghgfdfg 10y agoAnecdotally, it's vastly reduced debugging time in my own personal projects. My most notable problems have all turned out to be the result of things like using the wrong input, or misunderstanding some external spec. At first it was actually a little unnerving that things weren't breaking, but with time I've come to expect that. I came from C++, where I always joked that if things appeared to work correctly the first time around something serious was broken. It's not free though. You do end up spending more time getting the compiler to actually accept your code. With time I've gotten much better at this, although at first it could be quite a fight. But a compiler error is so much nicer than a bug, so I do think it's very worth it. And when it comes to coding, how long it takes to type is pretty irrelevant as long as you can type half decently. Typing the code is really the easiest part.
- zem 10y agothis is a really good feature that i've never seen elsewhere: > For extra robustness you can name blocks and use the name when closing them. In the above example, I could end the procedure with end Program.
- didip 10y agoSo, the question I have is: What is the OSS compiler for Ada that works on Linux and OS X?
- no_protocol 10y agoGNAT
- Keyframe 10y agoI'm just going through the motions. GCC has FSF GNAT which I wan't on macOS, but in order to compile gcc with ada support you need to have GNAT already. So, what I'm doing now is: download GPL GNAT from Ada Core here: http://libre.adacore.com/download/ http://libre.adacore.com/download/ and build your gcc, as usual, with ada support from that. Then you can use FSF GNAT gcc. You can even compile again with FSF gcc to make it double sure it's working. Apparently, FSF GNAT version is what you want in order to make commercial software since it has a runtime license, which Ada Core version doesn't. You would have to pay for Pro version. Someone correct me if I'm wrong.
- Tomte 10y agoAnother cool thing in Ada world: SPARK. https://en.wikipedia.org/wiki/SPARK_(programming_language) https://en.wikipedia.org/wiki/SPARK_(programming_language)
- axman6 10y ago(Reposting from lobste.rs) It's a shame there wasn't more information on the tools Ada provides for concurrency - I haven't seen another language which gives you as much flexibility and power to write safe concurrent code. It's much more heavy weight than some other languages in some ways, but gives you very strong guarantees you don't get elsewhere. It also would've been nice to talk a bit about some of the features which make it particularly well suited for embedded systems: * things like the ravenscare profile which give you a safe subset of the language using statically allocated never terminating threads * the ability to select the scheduling algorithm (including ones with task priorities which are used to avoid the possibility of deadlocks completely - see the priority ceiling protocol for more details) * the ability to address specific memory locations being built into the language, not just casting ints to pointers like you would in C * full control over how elements on records are laid out, including endianness, this is essential with the previous feature when you're dealing with memory mapped IO registers for controlling hardware * the ability to define that certain data types can only be used at certain specific memory locations (see https://cs.anu.edu.au/courses/comp4330/Lectures/RTES-03%20Interfaces.01.pdf https://cs.anu.edu.au/courses/comp4330/Lectures/RTES-03%20In... "pages" 314 - 332) For anyone who's had to write code to interface with hardware on micro controllers, they're probably wetting themselves with excitement by now, doing this in C relies on the compiler doing what you think it will, which there's no guarantee of because the ability to use many of the features is implementation defined, if defined at all. ANU's COMP4330, which these slides come from, is an excellent resource for learning more about both Ada and real time systems in general: https://cs.anu.edu.au/courses/comp4330/1-Lectures-Contents.html https://cs.anu.edu.au/courses/comp4330/1-Lectures-Contents.h...
- cturner 10y agoQuick note others may find useful. I found this offputting: the idiomatic mixture of upper/lower case and underscores in the syntax. Unnecessary cognitive overload. I've just done a quick test with current gnat and this works: you can just write everything in lower-case.