News for hackers. Stuff that matters.
Re:Adding ANSI C11 C compiler to D so it can import and comp... by WalterBright on Monday May 10, 2021 @05:43AM (#27104295)
Walter here. AMA.
Re:Adding ANSI C11 C compiler to D so it can import and comp... by throw_m239339 on Monday May 10, 2021 @06:23AM (#27104456)
No question, just thanks for your hardwork and D contributor's. Diversity, competition and choice are important when it comes to programming languages.
Re:Adding ANSI C11 C compiler to D so it can import and comp... by mariusor on Monday May 10, 2021 @11:23AM (#27106996)
Hello Walter, sorry for the (mostly) off-topic question, but is there still hope for having a variant of the standard lib that can be used w/o the garbage collector?
Re:Adding ANSI C11 C compiler to D so it can import and comp... by mhh__ on Monday May 10, 2021 @12:01PM (#27107509)
There is real momentum behind Phobos v2 now, can't give any promises about a timeline, but we're thinking about it, and Andrei is back in the fray now.

The standard library won't be a variant you can use without the GC but rather one that is allocator agnostic wherever reasonable

Re:Adding ANSI C11 C compiler to D so it can import and comp... by LAC-Tech on Monday May 10, 2021 @06:26AM (#27104461)
Do you think there's tension in Dlang trying be both a systems language like C++ AND a high level garbage collected language in C#?

Which is more important?

Re:Adding ANSI C11 C compiler to D so it can import and comp... by pjmlp on Monday May 10, 2021 @08:07AM (#27105047)
Re:Adding ANSI C11 C compiler to D so it can import and comp... by LAC-Tech on Monday May 10, 2021 @08:13AM (#27105096)
I'm somewhat in agreement.

There are a lot of people in 2021 who - for whatever reason - feel like they need to program personal computers without using GC. As you point history shows that's a lot less true than people think, but nevertheless - that is the sentiment.

Dlang tries spends a lot of effort trying to attract these people, by making more and more of the stdlib nogc, having @nogc annotations, experimenting with deterministic manual memory management etc etc. But I feel like they'll never convert most of them.

Re:Adding ANSI C11 C compiler to D so it can import and comp... by pjmlp on Monday May 10, 2021 @08:43AM (#27105348)
Meanwhile C# and Go keep being improved to play on the same place that D wants to be.

I also agree with the sentiment, the language issues with some not so well worked out features should be fixed, instead of trying to please everyone.

Re:Adding ANSI C11 C compiler to D so it can import and comp... by ku-man on Monday May 10, 2021 @11:11AM (#27106781)
"... the language issues with some not so well worked out features should be fixed, instead of trying to please everyone."

This. For average programmers like myself, latest and fanciest language features are of little value. C++ and (unfortunately) D are in the same quest: to incorporate every programing language paradigm available, the extra complexity be damned. In the specific case of D, I'd rather have a good assortment of native D libraries than more bells and whistles added to the language.

Re:Adding ANSI C11 C compiler to D so it can import and comp... by aldacron on Monday May 10, 2021 @06:46AM (#27104545)
Obviously I'm not Walter, but IMO, D's approach to GC does not create any tension. It's just a systems language with a GC that's there if you want to use it. You can disable it completely or only where you need to. Yes, you lose some features when you do so (like automanaged memory for dynamic array operations), but the tradeoffs are well-known and worth the loss when you need to make them. Consider WekaIO, which used D for their filesystem. No GC anywhere:

https://dlang.org/blog/2018/12/04/interview-liran-zvibel-of-...

Re:Adding ANSI C11 C compiler to D so it can import and comp... by skocznymroczny on Monday May 10, 2021 @07:21AM (#27104714)
I think there's more to the tension than GC. GC is the red herring that everyone jumps to when it comes to such comparisons, but I think there are many more issues that could cause tensions. For example OOP features, inheritance, properties, that kind of things. For system programmer oriented folks these features are usually considered bloat, more high-level/application programmers consider them very valuable features.

For me currently D provides a good level of balance between those worlds, but the aforementioned GC isn't an issue for me at all so I have it easy.

Re:Adding ANSI C11 C compiler to D so it can import and comp... by pjmlp on Monday May 10, 2021 @08:09AM (#27105064)
Depends, the future could already have been here, instead of playing catchup with the past.

"Eric Bier Demonstrates Cedar"

https://www.youtube.com/watch?v=z_dt7NG38V4

Re:Adding ANSI C11 C compiler to D so it can import and comp... by p0nce on Monday May 10, 2021 @07:20AM (#27104708)
If you use D across your organization, you can use the GC for internal tools and scripts, while keeping high-performance product code GC-free. So it's not really a hindrance, as you don't have to use different languages.
Re:Adding ANSI C11 C compiler to D so it can import and comp... by teleforce on Monday May 10, 2021 @08:21AM (#27105170)
This!

I think D should latch and promote more on the idea of having on-demand performance when it's necessary with GC convenience for the rest of the application. Soon having borrow checker capability ala rust and cyclone will only strengthen the narrative.

Re:Adding ANSI C11 C compiler to D so it can import and comp... by mhh__ on Monday May 10, 2021 @08:50AM (#27105419)
That's what we already do however the popularity of things we thought were obvious implies we need to market D better.
Re:Adding ANSI C11 C compiler to D so it can import and comp... by WalterBright on Monday May 10, 2021 @03:04PM (#27109566)
I usually write D code using both GC and manually managed memory. Tension between the two is like which is better, a socket wrench or an end wrench? Most of the time you can make either wrench work, but sometimes ya just need one flavor. Even a clawfoot wrench now and then!
Re:Adding ANSI C11 C compiler to D so it can import and comp... by qorrect on Monday May 10, 2021 @11:11AM (#27106790)
Thanks for all your work, screenshot of my 2000's era DigitalMars CD :D -> https://imgur.com/a/SwlpZBR ( sorry for the gorilla hands )
Re:Adding ANSI C11 C compiler to D so it can import and comp... by WalterBright on Monday May 10, 2021 @03:00PM (#27109537)
I'll be starting my new DigitalMarsCoin soon, and rather than being a digital currency, it will rely on original Digital Mars CDs. Hold on to those CDs! The value will surge!
Re:Adding ANSI C11 C compiler to D so it can import and comp... by qznc on Monday May 10, 2021 @07:14AM (#27104673)
Is there a comparison with the other approaches, like htod? The PR describes them but does not say why this is better.
Re:Adding ANSI C11 C compiler to D so it can import and comp... by WalterBright on Monday May 10, 2021 @03:10PM (#27109615)
I've found over and over that building something seamlessly into the compiler is transformative, easily a factor of 10 in adoption of it.

The obvious examples are Ddoc, the builtin documentation generator, and unittest, the builtin unit tester.

Re:Adding ANSI C11 C compiler to D so it can import and comp... by dom96 on Monday May 10, 2021 @07:45AM (#27104873)
You've been a compiler/language developer for many years now (many decades?). How did you get into this field of work? Do you have any regrets about this becoming your niche? :)
Re:Adding ANSI C11 C compiler to D so it can import and comp... by aldacron on Monday May 10, 2021 @08:48AM (#27105396)
The answer to the first question is detailed in the HOPL IV paper, 'Origins of the D Programming Language', freely available here: https://dl.acm.org/doi/abs/10.1145/3386323
Re:Adding ANSI C11 C compiler to D so it can import and comp... by WalterBright on Monday May 10, 2021 @03:11PM (#27109626)
Regrets? I should have made it open source from the beginning! Stupid me.