The state of tooling

This is due to the non-Ada parts of GNAT. If you wrote a new Ada compiler in another language, it wouldn’t bootstrap anyway :-)…

You’d pretty much need someone’s backend, though, unless you want to manually generate code for all possible targets…? and that introduces all sorts of new complications.

Unless your backend is C, I guess?

I’ve sometimes thought about writing a compiler for an Ada/Oberon-like language, and typically I’ve thought of targeting llvm or wasm. Alas, time…

It wouldn’t need to if it wasn’t built in Ada.

See here

GNAT LLVM - still needs an Ada compiler (GNAT, most likely, because the Ada source used by GNAT LLVM is the same as that used by GCC, and in some cases it’s not quite Ada. I have an email somewhere with tantalizing hints about the differences).

I keep wanting to try GNAT LLVM, and keep not finding the time. :frowning:

An example : In my previous work, I was using QNX (V6.6.0) as an OS for a ARM target. There is no Ada compiler on this platform, only a C one (GCC). I tried to compile GNAT on this platform but was not successful. I’ve not been able to bootstrap GNAT.


Exactly, you’d have to build a cross compiler and then build it on the host before you moved it across to the target.

The majority of the people in this thread have not really answered my original post nor barely touched on any point raised apart from @DrPi and it’s really annoying that nobody can see the problems other than me because it just makes me think “what’s the point?”

These issues won’t go away.

A cross-compiler would be enough. The standard workflow (with C) is to cross-compile on a PC (Windows or Linux) and remote run/debug the executable.
Adacore sells a GNAT cross-compiler for QNX 7.x and later but not for previous QNX versions.

I am waiting the best part of 5 years for a solution to get GNAT on ArchlinuxARM. And with crosscompilers for microcontrollers.
No luck so far.
Even on Debian where the GNAT compiler is available for ARM there are no ‘gnat-none’ microcontroller crosscompilers.
So yes, I completely support a compiler not written in Ada or one that can transpile let’s say to C for bootstrapping.

1 Like

WASM is how zig is bootstrapped, apparently. This could be a solution. Wonder how hard it would be to build GNAT to target WASM… Maybe go through GNAT-LLVM?

There’s AdaCore’s CCG, and also the old SofTech Ada-to-C compiler, now marketed to morons.

The latter isn’t free, I don’t know anything about either.



1 Like

Seems the ARG has discussed reflection which would solve part of my issues. A way not mentioned in the AI is opening the compiler to the programmer.