Current state of "D as a better C" (Windows)?

Vladimir Panteleev vladimir at thecybershadow.net
Tue Jan 21 18:18:42 PST 2014


Hi,

What's the current situation of using D without Phobos/Druntime?

Sometimes, it's quite useful to be able to use D to create tiny 
EXEs/DLLs. For example, create simple DLL plugins that will be 
loaded into non-D programs, or even not have a 50-line program 
take half a meg. Additionally, some tasks require injecting a DLL 
systemwide (into every running process), so it is critical to 
minimize the impact by being as unintrusive as possible and 
having a minimal overhead.

I've started a "framework" for this purpose a while ago[1], but I 
heard of people starting similar projects since then and I think 
they've gotten further than me. Would there be any interest in 
collaborating and turning this into a community project?

I think some goals would be:
- A "runtime" (object.d) which provides either stubs for the 
current compiler hooks, or implementations with minimal 
dependencies
- A "standard library" which does not require runtime support, 
but can also be used when using Druntime (as a GC-free 
alternative to Phobos)
- Using MSVCRT on 32-bit as well
- Options to enable/disable various runtime features? For 
example, a project may want to use exceptions (which requires 
ClassInfo) but not the GC.
- Support for the Unilink linker? I think it is better at 
generating smaller binaries that OPTLINK.

There is also some ongoing work on the -betterC switch[2], which 
I'm quite excited about, but it seems to be currently blocked on 
waiting for the next DMD release as the changes[3] might break a 
lot of code.

  [1]: https://github.com/CyberShadow/SlimD
  [2]: https://d.puremagic.com/issues/show_bug.cgi?id=11881
  [3]: https://github.com/D-Programming-Language/dmd/pull/2561


More information about the Digitalmars-d mailing list