[GSoC 2019] Interested in Baremetal D Runtime and project ideas
IGotD-
nise at nise.com
Sat Apr 6 21:31:19 UTC 2019
On Saturday, 6 April 2019 at 18:52:04 UTC, Stefanos Baziotis
wrote:
> On Saturday, 6 April 2019 at 17:50:39 UTC, IGotD- wrote:
>> On Thursday, 4 April 2019 at 13:56:08 UTC, Stefanos Baziotis
>> wrote:
>>> [GSoC 2019] Interested in Baremetal D Runtime and project
>>> ideas
>>>
>>> Hello,
>>>
>>> [...]
>>
>> What is in the runtime we need for baremetal projects that
>> betterC doesn't provide?
>
> There are a number of routines for which D currently calls the
> C standard library equivalent. For example, memcpy, memmove
> etc. and also malloc(), free() etc.
> The idea is that these should be implemented in D to provide a
> more baremetal
> environment for D, for limited resources (aka embedded
> systems). Note that the C standard library provides a lot of
> benefits for the general case, mainly that it has been used and
> tested for years.
>
> https://wiki.dlang.org/GSOC_2019_Ideas#Baremetal_D_runtime
memcpy, memmove and such are heavily architecture dependent and
needs an implementation for each architecture (even on sub
architecture level) in assembler in order to be optimized. At
least this what I've seen for the C/C++ compilers. We can have a
fallback in D though. Correct me if I'm wrong, doesn't LLVM
provide with such primitives, at least partly?
When it comes to malloc and free, I would suggest we have just
hooks for these. Baremetal people have very different opinions
what allocator suits their needs. Example allocators are of
course welcome but being able to change to whatever allocator you
want is essential for baremetal.
More information about the Digitalmars-d
mailing list