Combining GNAT with LLVM
blog.adacore.com
blog.adacore.com
Correct me if I'm wrong, but from the README [1], the answer appears to be:
> The dragonegg plugin works with gcc 4.5, 4.6, 4.7 or 4.8
But a little more digging reveals that there are patches so[2]
> DragonEgg works for for GCC v8.x
Lack of Google-fu or am I missing something? If they believed dragonegg is flawed, why not just lay it out? I prefer that over a goose chase that doesn't fully check out.
[1] http://llvm.org/svn/llvm-project/dragonegg/trunk/README
[2] https://lists.llvm.org/pipermail/llvm-dev/2017-August/116705...
Essentially, Dragonegg was only ever a last-resort way to get LLVM IR. If you're trying to build a LLVM backend, you might as well emit LLVM IR directly from your frontend rather than trying to deal with a GIMPLE backend and then a GIMPLE-to-LLVM converter.
Just like Lisp and Smalltalk still have their commercial offerings available.
Naturally communities that want to be payed for their work, while refusing to pay for their tools aren't aware of such offerings.
I imagine Adacore has a larger share, but have no data to back that up.
Adacore is (I'm guessing) the main vendor for lots of aerospace projects with deep pockets that aren't going away soon and it runs on mostly anything GCC runs on. They're also expanding their business into areas where cyber security is a concern.
I think its very telling that real-world JOVIAL code bases are being converted to C, not Ada. Ada was supposed to replace JOVIAL. http://www.semdesigns.com/Products/MigrationTools/JOVIAL2C.h...
There are also tools to convert Ada to C/C++/Java: https://www.mapusoft.com/ada-to-c-changer/
I'd start any new embedded system in C or C++ with an appropriate coding standard, static analysis checks, and perhaps run-time ones. No way I would consider Ada. Maybe someday Rust will penetrate more, but it has a ways to go.
1) Clean-up of backend interface code to make it more robust and less GCC-specific
2) Allow for GNAT to target more platforms such as modern Apple devices (where GCC support is waning and LLVM is preferred) and WebAssembly
Right now they are stating that it is not production-ready, but I would not be surprised if the LLVM-based GNAT gains peer status with the GCC-based GNAT or even overtakes it.
Also, I was referring to AdaCore's implementation of the compiler backend. GNAT's architecture is structured like so:
GNAT Frontend (parsing, analysis, expansion) -> GNAT Backend (translation of frontend tree to something GNU or LLVM can understand) -> LLVM or GCC
This backend is quite complex and has a large role in how LLVM can optimize. My argument is that GNAT's GCC backend is 25 years old and a new backend written for LLVM probably generates better/cleaner code.
Also of note is that the GCC backend is written and C and the LLVM is actually written in Ada meaning its more uniform with the GNAT frontend.