On Sunday, 1 February 2015 at 21:58:19 UTC, Walter Bright wrote:

There's nothing inherent to D or druntime that requires a multithreaded operating system. After all, a single threaded OS is a multithreaded operating system that simply returns an error when a call to create a new thread is initiated.

Agreed, but in the current druntime implementation, by the time the program reaches main, 2 threads have already been initiated. There is also some runtime and code-size overhead with TLS, even if one is building a single-threaded executable. I need to look into this in more detail though before I start spouting ideas. But I certainly welcome the dialogue.

IIRC he also proposed moving more of TypeInfo implementation to the runtime so TypeInfo layout can be modified by the runtime or even completely avoided by not implementing it in the runtime. The main response was that it complicates compiler code too much for little benefit. Obviously bare-metal programmers might disagree on the little benefit part and as Mike points out rust seems to do similar things.

We did something similar with the GC info, i.e. RTinfo. I think the same technique could be use for TypeInfo.

I think Adam may have it right with Issue 12270 [1]. But I reject the notion that TypeInfo is a baked-in feature of the language, and if one want to eat the oatmeal cookie, they have to eat the raisins too.

Mike

[1] - Move TypeInfo to the D Runtime - https://issues.dlang.org/show_bug.cgi?id=12270

Reply via email to