D with minimal runtime
dangbinghoo
dangbinghoo at google-mail.com
Wed Jun 17 02:09:47 UTC 2020
On Tuesday, 16 June 2020 at 01:16:27 UTC, Andrei Alexandrescu
wrote:
> On 6/15/20 4:50 PM, Walter Bright wrote:
>> On 6/15/2020 3:16 AM, IGotD- wrote:
>>> As we have discussed before, the best way for this in my
>>> opinion is to have an abstract interface in druntime for the
>>> OS functions. This way we could stub those functions that the
>>> programmer doesn't need.
>>
>> If you include the line:
>>
>> extern (C) void printf() { }
>>
>> somewhere in your code, printf() will *not* get linked in.
>>
>> An extra interface layer is not necessary.
>
> Word. Any work on reducing druntime needs to be based on a good
> understanding of how linking works.
hi,
many pepole is requiring that the D runtime needs to be minimal.
Yes, this "is a linking problem" just if you're always using
"normal" or "rich" OS, things matter if you trying to using D in
the microcontroller target such as STM32F4 or something similar,
these platfrom has hundreds of KB ram and maybe 1MB of flash
memory, it's powerfull enogh for running the D language.
if you trying to build a betterC programing on these
platforms(only RTOS or no OS at all), it shows that D runtime is
requring some thing that only Rich-OS have.
the rust and zig programming language is doing better in this
situation, the D runtime can be made only need to requiring ANSI
C stdlib (like nim 'any') and then the D runtime is more portable.
thanks!
----
binghoo dang
More information about the Digitalmars-d
mailing list