Yo,
I'm actually, for all intents and purposes, a professional Ada programmer. I've been developing a Desktop application (90% Core Code in Ada, with WxWidgets UI based in C++), written entirely by myself, for nearly 7 years. Compiling/Running on both Windows 10 x86 and Apple Mojave x64 using Ada 2012 at this moment into a static executable.
I've developed my own bindings to Win32 C++ APIs and UNIX C APIs, for both Filesystem and Networking interfaces (had too for reasons below). So I've done more than a small amount of C/C++ language interfacing to other libraries. I also correctly use the GCC G++ linker with Clang and MacOS LibC runtimes entirely (no libstdc++ components anywhere in MacOS) to link mixed source applications using GPRbuild tools.
I only comment to correct the statement that Ada GNAT is GPL linked and forces you into a GPL license. This is a common misconception that Adacore likes to keep going, but it's not true. I will explain for the benefit of all in this topic.
Free Software Fundation (FSF) GCC compilers licensed under GPL 3 have a "runtime exception" clause:
https://www.gnu.org/licenses/gcc-exception-3.1.en.html
This basically states that linking against the standard compiler runtime in the final executable isn't the same as linking against a third-party GPL library at the OS level. It's different and is an exception to the linking rule for FSF GCC compilers. Your code doesn’t become GPL licensed just because you use a GCC compiler to compile it (normally).
Now the confusion comes into how Adacore distributes their free compiler and tools.
When you go to Adacore and download a "free" compiler, their license demands you become GPL, they do this by removing the exception language comments in the source code (dumb), compiling the SAME free source code, and forcing you to agree to the license during installation or download. Now they have you locked in, if you don't pay them an enormous fee for GNAT Pro, they will sue you if you release your software commercially. If you use their provided "free" GNAT library, called Gnat Collection (Gnatcoll), whether with a FSF or GPL compiler, they got you again, and will sue you. They ONLY license Gnatcoll under the GPL publicly, unless you buy a private license.
If you want to develop commercial Ada code, with a GCC compiler (like me). It's a very simple task.
1. Compile or download a GCC distribution that is marked as FSF.
a. Don't ever download ANY software from Adacore, unless it's the dev-side support source (like Aunit), which isn't part of a final executable and therefore the license doesn't matter.
b. For Windows I've found MSYS2 to be the best way to get the latest GCC FSF components that work well on Windows and FSF build tools & scripts to function easily. I’ve done this for CMake, Aunit, CPPUnit, GPRBuild, XML/Ada, OpenSSL, and WxWidgets.
c. You’ll have to compile XML/Ada and GPRBuild for yourself from GitHub AdaCore source, I recently submitted bug reports that were fixed, so this should now be easy to do in MSYS2 by just following their steps to build/bootstrap.
d. For MacOS, we all use this (this guy does amazing work!):
https://sourceforge.net/projects/gnuada/...%20OS%20X/
Both of these are STATED to be FSF GCC compilers with FSF submitted patches.
2. While using/learning Ada, don't ever, ever...look at, reference, and use GnatColl or Ada Web Server code of any kind unless you’re doing online, backend SaaS, where licensing doesn’t matter. Only the libraries provided by the Ada language Reference Manual (LRM) are standard and covered by the exception! Any custom source from Adacore requires an Adacore license. Now you know why I had to write my own networking and filesystem packages for each platform. If I had used Gnatcoll, they’d have me. Writing it yourself means you own it. Took several years to get it all, works fine now, and Adacore can’t say “bo” about it.
So to summarize, you can program on Android (Dragonfly FSF compiler, but Adacore JNI would cost you!), MacOS, Linux, and Windows with Ada for free, for commercial purposes, by downloading and restricting yourself to FSF compilers and only use libraries with dual licenses that allow commercial usage without reciprocity.
If someone has a counter example, by all means tell me, but I’m currently 100% confident these above statements are correct as I’ve staking 6+ years of my life on it.
For the question in everyone’s mind as to why someone would start a new program in a supposedly dead language like Ada and do all this. The answer is very simple.
I used to work with a Microsoft vendor in Redmond, WA (near main campus) for nearly 7 years. During that time, gaining experience, I thought of a great desktop application that my friends and I would totally use and need if someone actually made it (not going to disclose fine details at this time). Now I had already signed my intellectual property rights away on my employment contract. I took the leap and quit my job and then started coding (GitHub Private Micro backed-up). I had done extensive research before quitting and I needed to use a language that did several things for me:
1. I could get a free/low-cost compiler (hopefully the same compiler family) for Windows and MacOS (Linux was a maybe…it’s not too hard but it’s low priority right now to make a Linux client).
2. The compiler had to compile to a native executable, use native APIs, and require no support software on the client machine before installing/using my software.
3. The language had to have threading primitives and the strongest typing I could find. Why? Because I’m not a self-described genius, I’m likely to mess this whole thing up unless the compiler helps me. That means I need lots of compiler checking, type checking, bounds checking, blocking task checks, etc…I was new and wanted as much automated help as I could get. Java was out (bad experiences) and I never correctly learned C or C++ to use it in real-world applications (faking types without protection) without shooting myself in the foot out of the starting gate. Plus, I really don’t enjoy working in C++ syntax once templates came into the picture.
4. I wanted as much of a “single source” application as possible. Very little code would be platform specific (to help bug reports and such).
5. I wanted to attempt to use several mindsets (Micro services, package models, contract programming models, etc).
Well, all I could find was GCC compilers, running Ada…so that was the answer. Rust wasn’t out for all platforms yet (but if I were to do it today, I’d likely chosen Rust, wasn’t possible in the past). Swift never had Windows compilers. So Ada was the logical choice to satisfy those requirements.
I’ve never regretted it, I’ve had to learn the language paradigm (read 80’s books on Ada when the language was new and the most recent texts). Took a while to understand the shortcomings, design mindset, and expected usage of many of the Ada features. GCC also crashes or has issues doing things that are technically not disallowed by the LRM, but I guess it’s not correct usage to do things like nested selects or ATC inside a passive task, etc…got a lot of crashes.
Once I got a handle on passive versus active task termination problems, backwards finalization of tasking scopes (parents finish before children and can naturally yield but won’t finalize any of their (now invisible) objects before any children finalize their objects, make signaling a pain if you have a dying parent trying to signal an active-tasking child, if child was passive you could just do a rendezvous, can’t with active tasking), requiring using custom counting semaphores to guard reiterate object finalization in threaded applications (ifs and null access checks don’t work! Ada may re-run an object’s destructor multiple, partial, times which don’t always set conditionals to guard against multiple finalizations), access type lifetimes, and generics (especially nested generics!). Everything else made sense when I read it.
Now that I have good handle on them, I enjoy using Ada (less its online library services limitations), after nearly 7 years I’ve only spent about 3 days of total time in GDB, finding bugs. I spend so little time messing with real technical problems (versus logical ones) that I love working in Ada! It’s a shame most companies won’t invest in using Ada, so far the stated rewards of reliability, readability, and maintainability weren’t exaggerated. I’d never go back, If given a choice.