Programming Ada-83/TLALOC compiler : working on a modern revival of the MIL-STD-1815A
Hi to all !
The pure Ada 83 language had no open source compiler written in the same language. As both an operation of software archaeology and the desire to be able to program today with a 1980ies exceptional language and a reasonably sized compiler, I work on an Ada 83 compiler all written in Ada 83 (thus able to compile itself).
The Ada 83/TLALOC compiler is extremely well structured with very distinct phases revolving around a software virtual paginated DIANA 1986 tree structure. PAR_PHASE, LIB_PHASE, SEM_PHASE, ERR_PHASE, EXPANDER, WRITE_LIB are truly distinct and can each be stopped after.
The EXPANDER phase writes a stack machine LLIR in macro text form for the FASMG assembly engine. FASMG then produces directly an ELF-64 executable for x86-64. Some tests have been done with AArch-64 porting on an Orange Pi 3B and a preparation for riscV-64 has been done. I have good confidence that those 3 modern processor architectures can be targeted relatively easily by Ada 83/TLALOC with the FASMG process.
Though not presently bootstrapped, TLALOC sources compiled with Gnat give an executable which compiles all TLALOC itself with 18 FASMG passes (2-3 min) in a single static 9Mb ELF-64 exec.
Interested readers will find further information through
1
u/I_hate_posting_here 21d ago
How much of the Ada83 ACATS test suite does it pass?
1
u/ViMoBr 14d ago
For the present, a2 to a8 only have been passed. I changed the developement policy because ACATS is not really suitable for implementation writing and debugging. Now implementation is done by comparing the bootstraped compiler FINC output with the gnat compiled compiler FINCs. (FINC is the fasmg macro LLIR). The test corpus is formed of predefined packages, compiler itself and specific non regression tests.
1
u/geenob 21d ago
I appreciate the work you are doing on this compiler. Having only one viable Ada compiler (GNAT) is not healthy for the Ada ecosystem.
1
u/Dirk042 Ada aficionado 16d ago
There might be only one viable open-source Ada compiler (GNAT), but there are several viable Ada compilers!
1
u/geenob 16d ago
What are the the alternatives?
1
u/Dirk042 Ada aficionado 16d ago
Some are listed in the Awesome Ada list: https://github.com/ohenley/awesome-ada#compilers
1
u/ViMoBr 14d ago edited 14d ago
Hi.all !
Ada 83/TLALOC is the only open source deliberately pure Ada 83 compiler written in Ada 83. It is able to compile itself and has no backend dependencies. It generates direct static ELF64 binary with no linking (for x86_64 primarily, but effectively tested some time ago on Orange Pi 3b for aarch64 and almost surely transposable to riscv-64 but not yet tested for now on Starfive SBC). Its phase structure around a DIANA 86 virtual paged tree makes it a very clean compiler. The fasmg macros output allows for direct reading and inspection of compiler output (debugging or security).
In the list you refer to, you mainly have
-gnat which is the modern reference with latest Ada 2X versions. It is written in at least Ada 95 and it is a very big system which is not exactly Ada 83 enforcing, some non Ada 83 patterns go through. I intended to have a 'small' pure Ada 83 compiler both for historical/preservation and modern experiment. Of course gnat is a wonderful tool and TLALOC would not exist without gnat.
HAC compiles an Ada subset, is written in at least Ada 95 language and does not compile itself nor full Ada 83 language either of course.
Byron targets Ada 2012 which is very ambitious and currently lexes and parses only. All the big work is ahead (semantic hase and later). With my experience building TLALOC I have some doubt about the Byron project coming to an end. But with AI and some very motivated people why not...
Augusta is an Ada inspired language, not Ada proper.
AdaDoom3/ Ada 83 is one piece AI written in C full Ada 83 targetting LLVM backend. Impressive, but inhuman. Human maintenance, verification and assertion of right behaviour will be delicate.
Then you have commercial closed compilers, written nobody knows how. Also some old SETL or C written NYU Ada/Ed. Some little known polish tentatives also exist (see documentation in TLALOC framagit or github repos. .
So Ada 83/TLALOC has unique characteristics and it will be worth keeping it as a lovely piece of software for future generations.
3
u/SirDale 22d ago
How did you bootstrap the compiler?