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.

3 Likes

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.

Sigh…

sauron_plus_plus

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.

Please do not make a new language. Ada desperately needs good libre tooling, and a new language would need a very strong case to get any users. You’re right, it’s practically impossible to write an entire toolchain alone, but that’s what you’d be doing if it’s for an entirely new language; whereas I bet there’s massive interest in a solid Ada toolchain.

I don’t think bootstrapping is a showstopper. Bootstrapping Rust is a pain because the only Rust compiler is in Rust and there’s a new version every six weeks; whereas Ada is an ISO standard and has an existing non-circular compiler. Personally, I find it hard to take a “low-level” language seriously if it isn’t self-hosted: its bootstrap chain goes up, then back down. I think that’s also why Rust and Zig ultimately moved to self-hosting (which was a mistake in Rust’s case, but not for Zig and wouldn’t be for Ada).

4 Likes

That requires a completely NEW/different toolchain, something I brought up on the google group and was basically stomped on.

You’re missing the point of a new/small language taking less time.

As for bootstrapping, it is an issue, it was ALWAYS an issue with gnat.

Then there are the people on here, who have given me grief for posting because I have a REALISTIC outlook, which puts me off coming here; and the last time wasn’t the first by these people. Honestly, dealing with what I am currently dealing with and then having that just put me off doing any Ada altogether.

Then there’s the glacially slow development of the language and the putting off of useful features for that tooling you mention. I could be dead by the time the next revision is finalised.

Then there’s the absolute refusal to dump features that were considered mistakes at the time and newer features work around those and refusal to slim the language down by removing old crap. This only works to make the language larger and more complex to implement. I wouldn’t want to try to implement C++, it’s almost as mad to try to implement Ada 2022 and beyond at this point.

But, I’ve said for years now, that there has to be a new Ada compiler for it to live.

And if I were to do this, I would need serious funding as the current government here seem to be as bad as the last one, in a lot of areas.

I would like to know which features you are refering to. You could make a blog article about it, we need more articulated hot takes, to put pressure on big evil corpo Adacore.

e.g. above.

And Ada needs another toolchain away from AdaCore, for competition.