12 ms·
Clearing up Myths about Ada
- pumpkinhead 5y ago"However, there’s a version of GNAT released by AdaCore called “GNAT Community Edition” which is similar to FSF GNAT but does not provide the runtime exception." Ok, so if I download the GNAT Community Edition from Adacore, how I do switch GPS to use the FSF GNAT tool chain? How about the static analysis tools? Windows and Linux? Everytime I look at Ada, I want to start doing a project with it. What a wonderful tool.
- pyjarrett 5y agoI added a note about how you can use the Alire 1.1 release candidate to install toolchains. > Ok, so if I download the GNAT Community Edition from Adacore, how I do switch GPS to use the FSF GNAT tool chain? Toolchains are customizable within GNAT Studio. If you use `alr edit` your Alire-configured toolchain should be selected. I would check to be sure. I don't work on Alire, but that work last time I tried. (I've been using Visual Studio Code lately as my editor) > Windows and Linux? I've built and run several projects on Windows and Linux without a problem.
- ajxs 5y agoFor anyone wondering about how to use the FSF version of the GNAT compiler: There are packages available in Ubuntu package repositories, very likely others too. GNAT's GPRTools are also available in a separate package. When I first tried Ada I was up and running in no time.
- Raphael_Amiard 5y agoThere are also toolchains shipped as part of Alire since 1.1: https://github.com/alire-project/alire/blob/release/1.1/doc/user-changes.md#toolchain-management https://github.com/alire-project/alire/blob/release/1.1/doc/... So you have a workflow similar to cargo in Rust: * Install package manager * Let package manager install toolchains * ??? * Profit
- henrikeh 5y agoTwo more: Ada is a name, not an abbreviation. It should be written "Ada" and not "ADA". --- Keywords in Ada should be written in lower case letters: It is a common misconceptions that Ada enforces or encourages upper case, but here is the official Ada 83 Language Reference Manual on the subject: http://archive.adaic.com/standards/83lrm/html/lrm-02-09.html http://archive.adaic.com/standards/83lrm/html/lrm-02-09.html... > Reserved words differing only in the use of corresponding upper and lower case letters are considered as the same (see 2.3). The manual itself doesn't even use upper case: > For readability of this manual, the reserved words appear in lower case boldface. So even the Ada standard recognizes the upper case is less readable and undesired.
- DoingIsLearning 5y agoIs anyone aware of any small/medium size companies in a regulated industry that are actually using FSF GNAT in production? I come across a lot medical device startups/contracts who could be a really great fit for an embedded application in Ada but who will not have the budget for Adacore's GNAT. The production examples on Adacore's website are typically very large companies in regulated industries.
- the_only_law 5y agoSadly I’ve only ever seen Ada used in Legacy codebased at large companies. I did see a very cool looking job listings the other day at a small company, but it involed getting rid of Ada.
- Agingcoder 5y agoAda's use is certainly not limited to legacy codebases (see nvidia's recent foray into ada + Spark). In particular, in the 'industrial provable' space, there's almost no competition I think. If you have to write the source code for an artificial heart, what are your options?
- Lucretia9 5y agoThat is still a major problem. I helped a guy get fsf gnat running on yocto for his startup, they didn't use Ada in the end though.
- morelish 5y agoI’ve wanted to try Ada and Spark for a while mainly to try formal verification and because a professor I listened to for a while keep banging on that most bugs don’t need to be written if you use Ada properly. (Shrug.) Who knows, I’d like to try it sometime.
- traceroute66 5y ago> most bugs don’t need to be written if you use Ada properly. I think both Airbus and Boeing have been doing their best to demonstrate the limitations of Ada and Spark.
- ajxs 5y agoIronically, you're right. Given the incredibly strict regulatory environment they work within, and the incredibly small margin of error, the fact that two of the biggest manufacturers of commercial aircraft choose to use Ada/Spark speaks volumes.
- msla 5y agoHow many fewer bugs would they have if they used a language with a real type system, like Haskell?
- StreamBright 5y agoYour professor was assuming most bugs are bugs that Ada language features protect against?
- bluGill 5y agoC++ is probably going to get contract support which if it works out will allow the same tools. I've read the latest paper, it isn't as powerful as Spark, but should get there.
- pjmlp 5y agoLets see if it has better luck than the version that was temporarly accepted in C++20.
- open-source-ux 5y agoTwo other beliefs about Ada: 1. It was designed by committee. According to Wikipedia, it was designed by a small team at Honeywell Bull in France. A different connotation from the label 'committee'. What is the more accurate description? It may seem unimportant, but most programming languages are designed by one or two individuals and the word 'committee' is perceived negatively by many developers. (Aside: Julia was designed by multiple authors, but no-one says the language was designed by committee.) 2. Ada is a very large language. Not suitable for small projects. This belief about the size of the language is true, but the question is: does it matter? I prefer small languages over larger ones, but I would be interested in the opinions of Ada developers. Is the language size irrelevant? And is Ada suitable for projects of any size?
- pjmlp 5y agoWhile it is a large language, by now it is probably still smaller than C++20, C# 10, Common Lisp, Python 3.7 or GHC Haskell. :)
- open-source-ux 5y agoThank you. That's busted a wrongly-held belief I've held about Ada - that it's size dwarfs other languages. Good to be corrected!
- pjmlp 5y agoThe language was naturally huge for 1983 hardware, and when compared to what 8 and 16 bit home computers were capable of. Except we are now in 2021 and while Ada 2012 has naturally gained on features, since 1983 there are other ecosystems that grew beyond what is available in Ada, like my list above.
- Agingcoder 5y agoIt's definitely significantly smaller than c++
- ajxs 5y agoTo me the size of a language, and the size of a project, are totally different metrics. One could make the case that a large language provides developers with a more complete toolset suitable for smaller projects. My own experience with Ada may be different to that of others, however I've really seldom needed to use any non-core libraries to accomplish what I've needed to do. If you factor in the STL, I'm sure Ada would be far smaller than modern C++. Rust is no doubt smaller than Ada though, however I've never like the idea of needing to use third-party libraries for basic functionality that the language itself could provide.
- pjmlp 5y agoHere is another one, Ada Core is the only Ada vendor. There are still 7 companies around selling Ada compilers, granted not all of them support the very latest standard. https://www.adacore.com/ https://www.adacore.com/ https://www.ghs.com/products/ada_optimizing_compilers.html https://www.ghs.com/products/ada_optimizing_compilers.html https://www.ptc.com/en/products/developer-tools/apexada https://www.ptc.com/en/products/developer-tools/apexada https://www.ddci.com/products_score/ https://www.ddci.com/products_score/ http://www.irvine.com/tech.html http://www.irvine.com/tech.html http://www.ocsystems.com/w/index.php/OCS:PowerAda http://www.ocsystems.com/w/index.php/OCS:PowerAda http://www.rrsoftware.com/html/prodinf/janus95/j-ada95.htm http://www.rrsoftware.com/html/prodinf/janus95/j-ada95.htm
- nabla9 5y agoIf there are 7 companies selling compilers + FSF GNAT how can Ada Core be the only vendor?
- pjmlp 5y agoThat is the myth, duh.
- tempodox 5y agoClearing up myths about Ada. You overlooked that context.
- CopOnTheRun 5y ago
- ncmncm 5y agoI have seen a claim that Ada now has or is getting something akin to C++'s destructors or Rust's Drop trait. What would Ada's version be called, and what would it look like? To me, the destructor is the single most distinctive and powerful feature of C++, adopting it is what made Rust viable, and lacking it makes Zig overwhelmingly less interesting than it might have been. If Ada got destructors, that would promote the language, in my view, from dead to potentially viable.
- atombender 5y agoAda's version of this is called controlled types. A type can have a finalizer method that gets called when a value needs to be destroyed.
- msla 5y agoIs it possible to precisely control when it gets called? If not, how predictable is it?
- atombender 5y agoYes, you have complete control over this. In short, it's a hybrid between manual and automatic memory management. Memory allocation is a complex subject in Ada, and I'm not familiar enough with it to explain all the nuances, but here [1] is a good discussion. [1] https://stackoverflow.com/questions/67131931/does-ada-deallocate-memory-automatically-under-some-circumstances https://stackoverflow.com/questions/67131931/does-ada-deallo...
- zozbot234 5y agoDoesn't the Ada.Finalization package (since Ada 2005) give you this anyway?
- deleted 5y ago[deleted]
- ncmncm 5y ago
- mothsonasloth 5y agoOne question I would like to know: "Why should I learn Ada if I am not programming AIM-9X heatseeking missiles in my day to day job?"
- thesuperbigfrog 5y ago>> "Why should I learn Ada if I am not programming AIM-9X heatseeking missiles in my day to day job?" Because it changes the way you think about programming. Taking about Lisp, Eric Raymond said: "Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot." Ada provides a different kind of enlightenment than Lisp: 1) Ada has a powerful type system that lets you define exactly what values are allowed and how they should work: https://learn.adacore.com/courses/intro-to-ada/chapters/strongly_typed_language.html# https://learn.adacore.com/courses/intro-to-ada/chapters/stro... https://learn.adacore.com/courses/intro-to-ada/chapters/more_about_types.html https://learn.adacore.com/courses/intro-to-ada/chapters/more... 2) Ada has built-in concurrency primitives that very simple to understand and use: https://learn.adacore.com/courses/intro-to-ada/chapters/tasking.html https://learn.adacore.com/courses/intro-to-ada/chapters/task... 3) Ada supports design-by-contract programming to precisely define the semantics between different parts of your code. Design-by-contract is ideal for large codebases and helps to catch errors similar to unit tests, but within the code itself: https://learn.adacore.com/courses/intro-to-ada/chapters/contracts.html https://learn.adacore.com/courses/intro-to-ada/chapters/cont... Even if you aren't writing code for heatseeking missiles, learning about Ada can make you a better programmer.
- noneeeed 5y agoI loved using Ada for concurrancy at university. I'm always surprised how few languages seem to have such a good built in concurrancy toolkit. I guess it's more use in the contexts where Ada is normally found.
- msla 5y agoIt seems like Ada is an early attempt at what Haskell gives you. Why bother with it now?
- nottrobin 5y agoAnyone else click on this expecting a post about Cardano?
- jayp1418 5y agolol
- yodsanklai 5y agoAda was one of the first language I learned academically then I've never had the chance to use it again. It's not one of these fancy languages everyone want to use for their toy projects. However, I remember it was a pretty cool language. Better static checks than C, including a robust module system, clear semantic. I'd like to give it a try again as an experienced programmer and see how the language has evolved over time.
- noneeeed 5y agoDid you got to the University of York? I did and I've never met anyone from another uni who learned Ada. I think I was lucky to go and work for a company where I got to do both Ada (specifically SPARK) and Prolog in a professional capacity. It wasn't until I used them "for real" that I really appreciated the benefits of both when used for what they were designed for. Sadly Ada has a bad rep, in part I think because it was mandated on so many terrible death-march defence projects. It seems to be having a minor renaissance, with people like Nvidia using Ada 2012 and SPARK to code their Risc-v security chip.
- belorn 5y agoWhen I was in high school (the Swedish version of it) in the early 2000, the introduction to programming course used was Ada. When I then later entered university their introduction course to programming was C. As a beginner language I recall it being quite nice compared to C.
- yodsanklai 5y agoNo, French institution in the late 90s. At that time, common choices for beginner languages were C/C++, which weren't that great compared to Ada. Usual criticism was that Ada wasn't mainstream but I think it was a good pedagogical choice nonetheless (and it's not like we're learning only one programming language anyway). It taught me to think in terms of abstract data types without the added complexity of class-based languages. Eventually, they switched to Java who became popular around that time.
- 5y ago
- iphorde 5y agoI always enjoyed Ada. Built an entire fly-by-wire flight control system in ADA running on TI chips. One of my favorite projects of all time.
- blacktriangle 5y agoHere's one question not on the list: what's the Ada job market look like? As a web dev looking to deep dive on some non-web topic with the pragmatic constraint that it must be a hireable one, Ada seems promising but I wouldn't know where to start looking for jobs.
- 7thaccount 5y agoNot good. It was supposed to be THE language for military work in the US (Ex: F-22 Raptor was mostly Ada), but they had trouble hiring people and got rid of the "use Ada" requirement, or so I've been told. Newer planes like the F-35 JSF have used much smaller amounts of Ada (mostly C & C++ iirc...there is a breakdown somewhere to compare languages used in both planes). It is also used in some critical infrastructure projects like trains and stuff. In short, C & C++ took over. SpaceX surprisingly used a LOT of LabVIEW in their mission control.
- CivBase 5y agoI work with Ada professionally and there's a lot to love about it. However, I have one big gripe that constantly gives me problems. It has nothing to do with the myths in the articles, but it's rare that I get to talk about this language so I'm taking my opportunity. Ada's syntax makes differentiating variables/arrays from functions unnecessarily difficult. This is because parentheses are used for both function calls and array accesses. And function calls without parameters do not require parentheses at all. Lets play a game. See if you can figure out which is a variable, array, or function. A := B; C := D; E := F(G); H := I(J); A, B, C, E, H, and J are variables. F is an array. D, G, and I are functions. The only way to really tell what's what in many cases is to look up definitions. That would be fine... except there is very little competition for Ada IDEs. I use AdaCore's GNAT Pro Studio (GPS), but the interface is clunky and often very slow compared to modern JetBrains IDEs. This syntax issue is a constant frustration and it's something which could have very easily been avoided.
- Lucretia9 5y ago> but it's rare that I get to talk about this language comp.lang.ada, reddit.com/r/ada, irc, gitter, telegram, etc. > A, B, C, E, H, and J are variables. F is an array. D, G, and I are functions. That was by design, because when it was designed, ide's like we have now didn't exist so being able to change a variable to an array from a function or vice versa was made easier. There is another reason and that mathematically an array is a function.
- CivBase 5y ago> comp.lang.ada, reddit.com/r/ada, irc, gitter, telegram, etc. Yeah, but I don't want to join a community just to make a single complaint about a 40 year old language. > That was by design, because when it was designed, ide's like we have now didn't exist so being able to change a variable to an array from a function or vice versa was made easier. What a bizarre decision for a language built around such a strict and elaborate type system. I'd consider it being difficult to swap functions and variables to be a feature.
- egberts1 5y ago
- pabs3 5y agoAre there any open source projects written in Ada?