Hello everyone! I’m Efraim and I’m the one who applied and received funding from NLnet for the Ada bootstrap.
A bit about me: I’ve been a member of Guix (from-source Linux distribution) for about 10 years now and one of the maintainers for about 2 years. There I’ve been responsible for several of the architecture ports (aarch64, riscv64, powerpc) and have continued to keep them, and others, running with patches and tweaks over the years. I enjoy deep dives into topics while figuring out hard problems and then creating Guix packages to keep everything working going forward. The first time programming really clicked for me was while I was learning C (back around 2012, so C99), and between that and Guile (used by Guix) is often where I end up when trying to work through ideas.
Every 4-6 months it seems we get someone who comes by and asks why we don’t have GNAT available as part of our GCC package. After one of these times we ended up with Ada/Ed packaged in Guix, with some workarounds for 64-bit architectures. At the time I did some software archaeology in Debian’s archives and I was able to find some compiled packages for gnat from before the Ada frontend was merged into GCC but I wasn’t able to figure out how they had built it. I had hoped that with more time we would come across something that we could use to bootstrap GNAT but everything seemed to require an existing Ada compiler.
The plan:
The plan isn’t finalized yet, and NLnet has said that if things change they’re happy to work with me about changing the milestones. My initial plan was more from whole-cloth, using flex and bison, to try to build a new front-end for GCC that could then build enough of a working compiler in GCC that it could then be used to build GNAT for real. As I started to break down the parts that I might need I remembered that Ada/Ed was around as an Ada 83 interpreter, and I already had a copy of it in C. This led me to my now current plan; update Ada/Ed from the late 80’s so it works on more and 64-bit architectures, add support for Ada 95 (and probably 2005), write a wrapper for it similar to gdmd for gnatmake/gprmake/others as needed, and use that to build the first GCC with Ada support.
My initial target is a bunch of Linux architectures (x86_64, i686, armv7, aarch64, riscv64, powerpc64le), that is, not just x86_64, and I see no reason to not get it working on other OSes also.
I saw @HawkerFrake mention plan9 and I’d be interested in learning more about what might be required to have it run there. I don’t want to make changes that hurt portability if it’s possible.
To answer a couple of questions:
Why C?
As @Irvise pointed out, the bootstrap is only really meant to be a stepping stone to the next compiler. I haven’t been involved in the live-bootstrap project but I have been in Guix’s bootstrap process. I view it as basically 3 stages: Get to a working C compiler, progress through the decades to something more modern, build the final packages which are used to build the rest of the system. That’s the simplified version, there can be multiple rounds of building and rebuilding packages when going from one stage to the next. The C compiler specifically because so much of the software written for use for building other packages is written in C.
Why not a transpiler?
The goal here is to bridge the gap from the final C compiler to a full featured Ada compiler (GNAT specifically in this case), not necessarily to have something that is regularly used. As far as using transpiled code, it becomes problematic since it’s not the “preferred medium for making changes”, but if it’s transpiled once and then used as a base for future editing that’s generally acceptable.
What license?
From the README in Ada/Ed it looks like it is already licensed GPL2+.