Building LDC runtime for a microcontroller
IGotD-
nise at nise.com
Mon Sep 7 20:55:54 UTC 2020
On Monday, 7 September 2020 at 19:12:59 UTC, aberba wrote:
>
> How about an alternative runtime + standard library for
> embedded systems...with a least bare minimum. I've seen a
> number of efforts to get D to run in those environments but
> almost none of them is packaged for others to consume.
Adam D. Ruppe's book "D cookbook" describes another way by
augmenting object.d in order to get "full D" to compile. I guess
this was written before betterC existed. It will be similar to
betterC, a very naked system without druntime. To be honest I
like this approach better as it opens up for gradually adding
functionality.
A small runtime + standard library is about the only possibility
in order to fit in those microconroller systems. Alternatively it
might be better just start from scratch and implement often
limited functionality they requires. The problem as I mentioned
before was that OS dependent stuff is mixed with OS independent.
I think that OS independent should be broken out so that it can
more easily be used for embedded programming.
Memory management can be a problem too. OS independent library
code might expect full GC support and there seems to be no
documentation which functions that does and which doesn't. I was
thinking GC might not be that much of a problem for medium sized
microcontroller systems. In practice you can have a fixed pool
that is initialized from the beginning, non expandable. Still
there is a GC memory overhead penalty.
In the C/C++ world generic standard C libraries for embedded
systems are rare, often unfinished, limited, GPL soiled so there
are difficulties there as well. Often there are tons of POSIX
filth in them as they are assumed to run on some kind Linux
system.
More information about the Digitalmars-d-learn
mailing list