What is the DRACO compiler?The DRACO (A.K.A Draco) compiler has not been released yet, although some work has been completed. The name "Draco" was selected to fit in with the constellation theme of the AuroraUX project, and a backronym was assigned to it: DRagon's Ada Compiler Option. The "Dragon" in the name refers to LLVM, which has a Dragon as the logo for their project. The basic idea is to replace the "GiGi" component of GCC (this is a cute name for "GNAT-To-GNU" or "GG"). GiGi is written in C and it tranverses the GNAT Abstract Syntax Tree (AST), converting the Ada AST into the GCC SSA Tree structure, which feeds into the GCC backend to produce executable code. The concept for Draco is to replace the C-based GiGi with an Ada component called "DLC" for Draco-LLVM Converter. It will transverse the GNAT AST and produce LLVM Intermediate Representation using the standard LLVM libraries. This is not a trivial task; this is more than 20,000 lines of code, although a good chunk of that is excellent commented documentation. The "GCC" driver has already been rewritten in Ada. The C language can not be completely irradiated from GNAT due to the low-level operating system interfaces, but once LLVM is able to build a working GNAT, then the approach will be to use LLVM with Clang to build the c files once. We will NOT maintain the requirement for GNAT to completely build itself, but rather we will always require the help of clang. With this approach, we can ditch the C compiler as well. We also want to ditch autotools, so Draco will be built by the CMake build system, and it will include the ability to generate cross-compilers. The new code will be licensed with the ISC license, which is similar to the 2-clause BSD license. Draco's overall license will be the same GNAT Modified General Public License (GMGPL) used by the FSF. It carries over with the GNAT code. To date, the only way to compile Ada code using LLVM is through the LLVM-GCC front-end or the DragonEgg plugin for GCC. Neither can produce enough working Ada code to build GNAT. |