RFC: Pay-as-you-go, Portable D Runtime for Microcontrollers (and maybe more)

Mike via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 10 17:26:37 PDT 2015


On Wednesday, 10 June 2015 at 10:06:19 UTC, Adrian Matoga wrote:

> Generally, if we stick to the pay-as-you-go approach most
> features of D runtime (even exceptions and RTTI) can be ported.
> They will not imply any costs when not used, but will be ready 
> to
> use out-of-the-box when they're needed.

I haven't had a pay-as-you-go experience with RTTI.  In fact 
TypeInfo has become my mortal enemy [1].  I submitted a bug 
report for now [2].

[1] TypeInfo not garbage collected (discussion) - 
http://forum.dlang.org/post/quemhwpgijwmqtpxukiv@forum.dlang.org
[2] TypeInfo not garbage collected (bug report) - 
http://bugzilla.gdcproject.org/show_bug.cgi?id=184

There is an implementation of an -fno-rtti switch [3], but 
unfortunately, I have found it compromises on a few things 
(slicing, postblit, and maybe others).  I think
the best way forward is to move TypeInfo to the runtime as 
described in [4].  I'm currently working on an initial pull 
request for it, but I have to admit that I don't know much about 
what I'm doing in the compiler and am struggling with it.  But 
I'm afraid if I don't do it, it won't happen.  I can't even 
continue with my work without it.

[3] -fno-rtti implementation - 
https://github.com/D-Programming-GDC/GDC/pull/100
[4] Move TypeInfo to the D Runtime - 
https://issues.dlang.org/show_bug.cgi?id=12270

> I'll try to push this work on github later this week.

I look forward to seeing it.  It's encouraging to see more 
interest in using D for this Domain.

Mike




More information about the Digitalmars-d mailing list