Unlike other parts of GCC, GNAT copyright is held by AdaCore due to some special arrangement with the FSF.
For the compiled CE releases on their website, AdaCore strips the runtime exception:
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
So yes, binaries compiled with that particular compiler are de-facto under GPLv3, and you have to abide by its terms (eg. if a customer using these binaries requests the source code)You are of course free to build the compiler yourself, or use the Ada compiler that comes with your distro.
The sources are available, you just don't get a tag that tells you which exact combination of files AdaCore used to build and verify their binaries.
This is a strategic PITA, and AdaCore have in recent years made some moves to improve the situation, with being active on github and responding to issues in general.
> Unlike other parts of GCC, GNAT copyright is held by AdaCore due to some special arrangement with the FSF.
Adacore holds at least the copyright of their own contributions and therefore can decide whether they want to release their version of GNAT with or without the runtime library exception; the FSF version eventually inherits also the contributions of Adacore, but the Adacore version is more current.
> So yes, binaries compiled with that particular compiler are de-facto under GPLv3, and you have to abide by its terms
This doesn't have anything to do with source or binary version. The reason is that the binaries provided by Adacore are compiled from their (most recent) source version which they publish under GPL without the runtime library exception. For this (and only this) reason you create a "combined work" when you link your code with the Adacore version of the runtime library. This doesn't change in any way if you compile the GNAT version of Adacore by yourself; you still don't have the runtime libary exception which only Adacore can give for their contributions.
You'll be violating the terms that allow you to use the compiler if your source code isn't GPL licensed. That doesn't mean your source code is automatically converted to GPL. It just means you don't have a right to use the compiler or to distribute the binaries you've produced with it.
- FSF: Is GPL but contains an exception that allows you the create programs which are not GPL (basically the same as e.g. g++)
- AdaCore Community : Also GPL, but no exception. Hence your program is also GPL.
- AdaCore Pro: Commercial and allows you to create programs which are not GPL.
It's true that you may only use GNAT GPL for hobbyist use and GPL software.
But breaking GNAT's license doesn't make the software created GPL. It just makes you liable for damages. And cessation, of course.
> But breaking GNAT's license doesn't make the software created GPL
If you do not comply with the terms of the GPL license you're no longer allowed to use the code/software licensed under GPL. Under GPL 2, you can continue to use the code/software after the license violation is removed. Under GPL 3 the copyright holder might terminate your license (see section 8 of GPL 3).
This is an important distinction.
But it's still true, that using the Ada core GPL Ada compiler, which does not come with lgpl/run-time exception - you can only legally distribute binaries under the GPL (or commercial license).
This does not matter much if you don't distribute code to others (eg: break system of a car - gpl/commercial; build a web server to sell/stream movies - gpl/internal use).
I still think it's probably a mistake to have the fsf and Ada core version be so similar, yet differently licensed (because it is confusing - most are used to gpl compilers comming with lgpl/runtime exception, like gcc).
I am not wrong. The runtime of the Adacore Community edition is under GPL, as are many libraries included in the Adacore edition that are not included in the FSF edition. Your binaries will be under the GPL. (Technically speaking, you could compile executables with this version of GNAT that are not under GPL by writing your own runtime. Practically, this is pretty much impossible and nobody has ever done it.)
The FSF edition allows you to compile executables without license encumbering, because it is licensed under the mGPL.
If you want mGPL (with the runtime exception) you need to wait for the FSF version.
This is well-known in the Ada community, but I thought I'd mention it because occasionally people don't know the license conditions of various GNAT versions very well. Such as you.
"If the resulting software were GPL, all those nasty contradictions would go away. Let's assign GPL to the software and the problem is solved."
Unfortunately, the law doesn't work that way.
I mentioned it precisely because people get it wrong so often.
Why would any one invest time or effort in a commercial language such as Ada, Eiffel or even Xojo and LispWorks, that require you to pay for Automated test support and what is considered by most standards now basic libraries
And not only that, the communities are usually tiny and support is probably very limited to the commercial support they provide, and when it comes to languages, languages with big communities, provide infinitely better support than commercial support for proprietary languages or implementations
The cost of AdaCore is not just the compiler license, its the total ecosystem cost
Adacore's support is excellent - you're talking directly to gcc/gdb devs. There is no intermediate layer. I've hit a number of nasty technical issues ( compiler bugs mostly), usually fixed within 48h. They then provide you with what they call a 'wavefront' which is essentially a patched version of the compiler which is supported as well.
It is true that the ada community is small, but there is no real other contender in that space ( embedded, formal verification, qualified toolchains, etc).
Edit: nvidia uses spark/ada (from adacore), it's not clear to me what other options they might have given what they want to do (video presentation in the link)
"AdaCore + NVIDIA Partnership | AdaCore" https://www.adacore.com/company/partners/nvidia
I still have fond memories of (the sadly late) Robert Dewar answering a ticket of mine 'this is so slow, whyyyyyyy?' with a 'we have implemented a change that should improve the performance of your code' so fast I hadn't had the time to go talk to our local Ada guy for an alternative idea.
They also have world experts in formal methods like Yannick Moy and Claire Dross who will help you prove you jump-start a Spark project and are pushing the state of the art every year (proof of floating point code, pointer/ownership...).
Money well spent.
And to be clear: not from AdaCore, just a customer.
Here is the Ada 2012 standard: http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-TOC.htm...
If you create a programming language that meets all of the Ada standard requirements, you will have your own Ada implementation.
You could use whatever backend suits your needs (or write your own) and license it accordingly.
> Why would any one invest time or effort in a commercial language such as Ada,
(1) Ada isn’t a commercial language
(2) What other free language covers the style and paradigm Ada addresses? Rust maybe (I haven't really done a detailed analysis) now subsumes Ada, but has a different focus and a lot of cognitive overhead related to that focus. Haskell or another static functional language with a robust type system might provide an alternative approach to some similar benefits, but not the same style and paradigm.
Qt/Delphi/C++ Builder versus free beer GUI tooling is another.
Or doing RAD Web Applications in Outsystems or doing it all by ourselves.
Certain quality levels are only reachable when people pay for their tools.
If it is an Ada implementation, why wouldn't they call it Ada rather than alang?
If the language implements the Ada standard (http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-TOC.htm...), it is Ada, regardless of how the particular implementation is licensed.
The fun part is that dragonegg became an important part of clang/llvm for years (before it was phased out) to compile fortran (before flang) and to compare clang results and gcc's. I seem to remember other interesting uses but my memory is failing me.
Duncan Sands (the original author I think?) is an outstanding engineer and very fun person to talk to.
[0] https://blog.adacore.com/combining-gnat-with-llvm [1] https://blog.adacore.com/use-of-gnat-llvm-to-translate-ada-a... [2] https://blog.adacore.com/android-application-with-ada-and-we...
Here are a few questions, which probably don't have an answer in the Ada standard but might in specific implementations:
* Is there a way to declare data layouts to have compatibility with C, similar to #[repr(C)] in rust?
* Is there a way to catch C++ exceptions?
* Is there a way to catch C longjmps()?
* Is there a way to have some kind of custom control over ABI issues, e.g. define custom FFIs to langauges with a different ABI? Or anything close to this? For that matter, does any language have something like this or does it not make sense?
Yes, and if you have a C header file, gcc can even translate most struct definitions for you. Here's an example of a "thin" binding generated that way: https://github.com/JeremyGrosser/notcursesada/blob/master/sr...
* Is there a way to catch C++ exceptions?
Yes. https://www.adacore.com/gems/gem-114-ada-and-c-exceptions
* Is there a way to catch C longjmps()?
By default, the GNAT runtime uses setjmp/longjmp to implement exceptions. I'm not sure how you'd connect that to a C library's setjmp though.
* Is there a way to have some kind of custom control over ABI issues, e.g. define custom FFIs to langauges with a different ABI? Or anything close to this? For that matter, does any language have something like this or does it not make sense?
ABIs are selected with the Convention aspect. Conventions are implementation defined and would require patches to the compiler to add new ones. GNAT currently supports Assembler, C, CPP, COBOL, and Fortran calling conventions.
Is the implementation of a Convention isolated enough that it would make sense to be extensible?
One thing I had in mind is something like Postgres. Some functions in Postgres are called in a specific way that converts arguments into an array first, and handles SQL NULL values. If I were to define this as a new Convention, it would inherit a lot from the "C" Convention, but would do some transformations first.
If it could handle a longjmp() as well, then the new Convention would also do whatever setup (manipulate some global variables and call setjmp()) so that the caller doesn't have to worry about the longjmp().
The challenge with handling longjmp() in rust is that you can't call setjmp() as a normal FFI function (because it can return twice, like fork(), which is not a normal control flow). Also, longjmp()ing into rust code is just not defined behavior, even if it "works" for now. I assume there are similar challenges in Ada.
[1] https://github.com/onox/inotify-ada [2] https://github.com/onox/evdev-ada
As a simple example you can lookup what the compiler generates as a low-level binding [0] that is wrapped in a higher level API [1].
BTW you can also bind Ada to Java (although support is a bit limited I know places where it's in prod). Don't remember if it's a commercial product or oss.
And for the python people, my company financed a first version of ada-py-bind, inspired by the great pybind11. Still a lot of code to write (or generate) but it works fine.
Thanks onox for those two links!
[0] https://github.com/persan/zeromq-Ada/blob/651ca44cce831c2d71...
[1] https://github.com/persan/zeromq-Ada/blob/651ca44cce831c2d71...
I don't think osx is a target market in any way : their customers are unlikely to use macs in production.
Debian/Ubuntu: sudo apt install gnat gprbuild
Arch Linux: sudo pacman -S gcc-ada (get gprbuild from the AUR)
NixOS: https://github.com/fluffynukeit/adaspark/
I think it's also available on Fedora IIRC.
And then go to https://learn.adacore.com/ :)
very big loss to not have ada on one of the big linux distributions.
(build your own! yes, it can be done...)
edit. fixed wrong word