How to convert C to D using compiler?

Dennis dkorpel at gmail.com
Wed Dec 8 14:20:44 UTC 2021


On Wednesday, 8 December 2021 at 13:19:52 UTC, bauss wrote:
> I never said everything doesn't get finished.

It's easy to get that impression when you wrote:

> Nothing is ever completed or workable.

And only specified afterwards that it's limited to 
"ground-breaking features", which is a pretty big caveat by the 
way. If I say "static/dynamic arrays, `scope(exit)` and `foreach` 
work pretty good", then you could just reply "well, those are not 
ground-breaking".

> nogc is still too limited

Do you have a bugzilla issue, or are you referring to liberal use 
of GC allocations in druntime/Phobos?

> betterC is still somewhat limited

It works well when translating C code to D, which was its 
intended use case. It's when you start writing new -betterC code 
with D features that you get cryptic/unnecessary TypeInfo errors, 
which makes this an interesting case: it shows how things can be 
unfinished not because the implementation doesn't match the 
requirements, but because the requirements update, as people 
started using it for e.g. WebAssembly / embedded purposes.

> scope  has so many bugs/edge cases that hasn't been solved, 
> making it unusable in general.

This year there actually has been lots of progress in eliminating 
those bugs, e.g.:
[Fix issue 17977 - destructor allows escaping reference to a 
temporary struct 
instance](https://github.com/dlang/dmd/pull/13349)
[Fix Issue 22366 - [dip1000] scope variable can be assigned to 
associative array](https://github.com/dlang/dmd/pull/13156)
[Fix issue 20245 - address of ref should be scope 
](https://github.com/dlang/dmd/pull/12812)
[Fix issue 21912 - delegate assigned to return scope variable 
needs closure](https://github.com/dlang/dmd/pull/12880)
[Fix Issue 20150 - -dip1000 defeated by 
pure](https://github.com/dlang/dmd/pull/12010)

I aggregated the remaining ones here: 
https://github.com/orgs/dlang/projects/4/


More information about the Digitalmars-d mailing list