help / color / mirror / Atom feed
From: Simon Wright <>
Subject: Re: Should light runtimes get more consideration?
Date: Thu, 28 Sep 2023 14:25:18 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: uf3i1e$3kj1k$

Kevin Chadwick <> writes:

> That buffer support is pretty neat but my main concern which Gnat may
> (it may not) address more than the current language by providing a
> cortex runtime. Is that such demanding runtimes are brilliant but I am
> not sure if even Ravenscar is scalable to so many microchips such as
> Rust is trying to support. That isn't a huge issue but barriers to
> entry like having to work out your own exception replacement might be
> turning users away. Which is unfortunate when Ada is the best language
> out there by a significant margin for embedded development or frankly
> any protocol or hardware register use.

When I started on Cortex GNAT RTS[1], a large part of the motivation
(aside from the fun element) was that AdaCore's bare-board RTSs were
GPL'd (they still are). Not that I cared about that, but other people

I took the approach of AdaCore's SFP (small footprint) profile, now
renamed to light tasking, which implemented Ravenscar tasking but not
exception propagation or finalization.

The tasking part wasn't too hard, though I think exception handling and
finalization might have made things more difficult. Basing the tasking
on FreeRTOS saved a lot of grief (there are a couple of areas when the
resulting semantic isn't _quite_ Ada's).

I did some work on finalization, not merged.

Exception handling, without finalization, seemed a daunting prospect,
specially since the last project I worked on before retirement regarded
an unhandled exception as requiring a reboot (and ditching any missiles
in flight).

The current implementation has about 17 files (1 .h, 1 .s, 9 .ads, 4
.adb) to customise to the chip (setting up interrupt vectors, the clock,
and memory). There are about 200 Ada sources that are common.

AdaCore currently have 68 RTS packages in the Alire gnat_arm_elf
toolchain. 18 of these are 'embedded' packages (full Ada, but with
Jorvik tasking). I'd be surprised if they had a higher proportion of
chip dependency than my efforts. Most if not all of the exception
handling will be chip-independent. I'm not sure how many of the 90 or so
Ada sources in the STM32F4 gnarl/ directory are actually chip-dependent,
I get the impression it's not high.


So, unless you're going to use some target that AdaCore haven't released
support for, your best bet must be to either use or at worst start from
the available RTS packages.


  reply	other threads:[~2023-09-28 13:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 11:44 Should light runtimes get more consideration? Kevin Chadwick
2023-09-28  3:48 ` Randy Brukardt
2023-09-28  9:46   ` Kevin Chadwick
2023-09-28 13:25     ` Simon Wright [this message]
2023-09-28 17:51       ` DrPi
2023-09-28 20:53         ` Simon Wright
2023-09-28 21:18           ` DrPi
2023-09-28 23:51             ` Chris Townley
2023-09-29  9:59               ` Kevin Chadwick
2023-09-29 10:42                 ` Chris Townley
2023-09-29 13:44                   ` DrPi
2023-09-29 13:42                 ` DrPi
replies disabled

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