comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Adapting an Ada compiler to generate 8051 code (Again?! ;-)
Date: Thu, 1 Apr 2021 18:34:07 -0500	[thread overview]
Message-ID: <s45l9g$m1f$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: icm5tmF7ak3U1@mid.individual.net

"Niklas Holsti" <niklas.holsti@tidorum.invalid> wrote in message 
news:icm5tmF7ak3U1@mid.individual.net...
> On 2021-04-01 2:14, Randy Brukardt wrote:
>> "Niklas Holsti" <niklas.holsti@tidorum.invalid> wrote in message
>> news:icgdhjF3j1eU1@mid.individual.net...
>> ...
>>> I have often wished that there would be Ada compilers for more
>>> microcontrollers, but I understand why there aren't. An Ada-to-C 
>>> compiler
>>> seems the most promising route.
>>
>> Send $$$. ;-) This was a project that was ideally suited for the
>> Janus/Ada compiler suite, but we never were able to find a customer
>> for it. The problem is always that the first customer has to pay a
>> substantial part of the development; later customers don't have to
>> pay that freight. (Back in the "waiver" days we considered doing it
>> for the "fun" of making DoD-types have to find better excuses to
>> avoid Ada than a compiler not existing for it, but the likely ROI
>> wasn't there to convince the angel investors to go along with the
>> idea.)
>
> Yes, things like that were among the reasons I had in mind for the lack of 
> such Ada compilers. Plus the fact that the pain of writing a small C 
> program is much less than the pain of writing a large C program.
>
> If you think that targeting Janus/Ada to small microcontrollers is 
> practical, I have two questions for you:
>
> Can you describe, in general, the Janus/Ada internal program 
> representation that, say, an 8051-back-end would get as input?

It's called "JCode" (named long before Java existed, at least publically), 
and it is based on the ideas of p-code, tailored for what we needed for 8086 
and similar processor output. There are other inputs (mostly in the form of 
a partial JRL, which carries the unit dependencies and the like), but most 
of those are related to the binder.

Decent code generation for it is quite easy, since it is a rather low-level 
form. It's relatively easy to write a passable code generator and then 
incrementally improve it with pattern matching. One could probably build 
much fancier schemes on top of it; we thought about that periodically, but 
experiments showed that the differences wouldn't be worth the work. (Robert 
Dewar famously said that "most optimizations are disappointing", definitely 
a true fact from my experience.)

> Would you be open to external/community participation in creating new back 
> ends for Janus/Ada, either under NDA or working from a public definition 
> of the internal representation, and either work-for-free or work for some 
> share of future sales?

Yes, certainly. Contact me directly at the usual e-mail.

                          Randy.


  reply	other threads:[~2021-04-01 23:34 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30  9:04 Adapting an Ada compiler to generate 8051 code (Again?! ;-) mockturtle
2021-03-30  9:56 ` Dmitry A. Kazakov
2021-03-30 11:24   ` Gautier write-only address
2021-03-30 11:27   ` mockturtle
2021-03-30 12:01     ` Dmitry A. Kazakov
2021-03-31 23:08       ` Randy Brukardt
2021-03-31 23:06   ` Randy Brukardt
2021-03-30 10:40 ` Niklas Holsti
2021-03-30 11:32   ` mockturtle
2021-03-31 23:14   ` Randy Brukardt
2021-04-01 15:07     ` Niklas Holsti
2021-04-01 23:34       ` Randy Brukardt [this message]
2021-03-30 11:24 ` Luke A. Guest
2021-03-30 13:28   ` Luke A. Guest
2021-03-30 12:45 ` Björn Lundin
2021-03-30 15:49 ` Shark8
2021-03-30 19:16 ` Paul Rubin
2021-03-30 21:28   ` Luke A. Guest
2021-03-30 21:48     ` Paul Rubin
2021-03-31  4:46       ` Luke A. Guest
2021-03-31  7:19         ` Simon Wright
2021-03-31 23:20         ` Randy Brukardt
2021-04-01 12:22           ` Luke A. Guest
2021-04-01 23:43             ` Randy Brukardt
2021-04-02  0:41               ` Luke A. Guest
2021-03-31  8:23     ` Niklas Holsti
2021-03-31 20:46 ` Gautier write-only address
2021-03-31 21:14   ` Shark8
2021-03-31 21:25     ` Gautier write-only address
2021-03-31 21:46       ` Shark8
2021-03-31 23:22       ` Randy Brukardt
2021-04-01 13:19   ` Luke A. Guest
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox