5 ms·
What's the plan for Phobos (and more generally the ecosystem) to be usable from the betterC subset of the language? In your opinion, how much of the development
by keldaris 8y ago
What's the plan for Phobos (and more generally the ecosystem) to be usable from the betterC subset of the language? In your opinion, how much of the development focus is aimed in that direction? Are there any parts of the language itself that will be made available to betterC that currently aren't?
- WalterBright 8y agoMost of the effort for BetterC has come from myself. Based on the buzz about it, it's usage is steadily expanding in the D community. The idea of BetterC is to not link to the D runtime library at all. So, the parts of Phobos that are usable from it are the parts that: 1. are "header only", meaning all the functions are templates 2. don't use exceptions or the GC 3. don't use OOP classes (which rely on the GC and the runtime) Not much of effort has been expended cataloging this, though.
- giancarlostoro 8y ago> 3. don't use OOP classes (which rely on the GC and the runtime) I was not aware of this at all, do you ever see a time where you could compile D with classes an all with no garbage collection? I am not bothered by the GC coming from C# and Python but it is interesting to know where D is headed since I know there were many efforts at making D compile without any GC. Basically do you think it will ever make sense for D to just compile without GC by passing a compiler flag? Irrelevant of what D features are used, and maybe it can tell you which features cannot be used without GC (sorry if this already is a feature, I use D I'm not a guru yet).
- WalterBright 8y agoThe compiler flag would be -betterC. You can use classes with no GC if you're willing to allocate and initialize them manually.
- keldaris 8y agoThis begs two questions, it seems to me: 1. Would it make sense to work on (for the community in general, not necessarily you personally) a header only standard library, a sane STL if you will, for betterC? 2. Is there any interest in language support for GC and runtime independent classes/interfaces? I understand this is partly doable already by abusing templates, but I imagine the results aren't necessarily pretty or concise. Regardless, thanks a lot for the responses. I haven't managed to write much D beyond small experiments due to ecosystem and related issues, but the ability to incrementally integrate small parts of D in a C++ codebase as freely as betterC lets me is very tempting.
- WalterBright 8y ago> Would it make sense to work on (for the community in general, not necessarily you personally) a header only standard library, a sane STL if you will, for betterC? It's a very good question. Most of Phobos is already templates or the GC, so that wouldn't be much change. A more complex problem is working without exceptions. I don't have a ready answer for that, it's a good area for investigation. D already has support for "COM" classes/interfaces which work in BetterC.
- acehreli 8y agoWeka has recently open-sourced their no-GC library Mecca: https://github.com/weka-io/mecca https://github.com/weka-io/mecca Here is Shachar Shemesh's introduction: https://www.youtube.com/watch?v=xNWRgEHxOhc&feature=youtu.be&t=765 https://www.youtube.com/watch?v=xNWRgEHxOhc&feature=youtu.be...