Request embedded Ada95 system and relative hardware size

The Ada95 rendering can be minimal in that Tasking and Access types are not needed.

The subject here spawns other questions such as just how small is an embedded system to run a 6,000 line Ada95 program. In other words could the environment with application occupy an ASIC or an FPGA ?

This request follows from IBM not allowing their supposed Ada95 to VHDL transliterator to be used externally (I read this as it does not exist as they are always eager to sell vaporware), and the third party vendor declined to develop such a transliterator as a “good idea” due to no huge external funding commitment.

While it is poor form to reply to one’s own post, I cannot further edit this one since out of 40 views there were no responses in six days, speaking volumes.

Are you asking for recommendations for embedded hardware to program in Ada? I don’t program ASICs nor FPGAs, but if you can get a C program onto those, then there should be no issue getting an Ada program to fit on them, especially if you compile with zero Ada runtime.

I’m curious, did you try the various restriction profiles and optimization switches to see how small you can get your executable ?
You can also limit the CPU time or memory available for your thread to see how low on resource while stlll performing as expected.
I’m no expect in benchmarking but I think just the number of lines of code doesn’t tell us much about your requirements.

Conceptually, you could have an optimizer that, at link-time, could strip out portions of the runtime that are not used, or substitute in smaller/leaner implementations for reduced/restricted forms; since the various restrictions explicitly limit those, you could pass the restrictions to the linker to supply/generate that runtime, rather than forcing some form of whole-program analysis.

1 Like

Doesn’t the --gc-sections GNU linker option do that (doc here) ?

Some linkers do it by default (they only include actually used subprograms). For instance Turbo Pascal (and possibly Delphi) for ~40 years…

Likely because it’s GCC, and GCC’s design forces things. What’s there now is “good enough” and “how we’ve always done it that way”, and using Ada’s Pragma Restrictions to direct linking is not general. (Honestly, it’s likely the reason we don’t have an open sourse APSE.)

Maybe, but I thought that was more a touch-up/post-processing sort of option, which is a but different than simply starting from the first to never include/link the parts that don’t need it.

… and subject morphed to linker conjectures.

Because it is at this step that compilers will reduce the size of application binaries to only the required parts.

Yes of course GNAT/GCC can do that. Use the linker switches -ffunction-sections, -fdata-sections, and --gc-sections (thanks @zertovitch for pointing everyone to the relevant documentation).

2 Likes