Live data from Hacker News

The reference D compiler is now open source

forum.dlang.org

61–70 of 313 posts

Re: The reference D compiler is now open source

#61
post #28
post #21

Earlier quoted context omitted.

There's a wide range of possibilities int that statement that include the case where you would almost always want D over Rust, and the case where you would almost never want D over Rust. The question is, how much easier is D than Rust, and how much safer is D than C++.

There is no quantitative metric for safety and easyness. If you can afford a garbage collector, D easily wins over Rust. If you really need the safe manual memory management, Rust wins. In between is still a large grey area.

Is the GC mandatory in D? I was under the impression some time ago that D could run GC-free, but the standard library still widely used GC. Did I just misunderstand?

Re: The reference D compiler is now open source

#62
post #59

Please don't get me wrong, as I don't want to start a flame here, but why do they call D a "systems programming language" when it uses a GC? Or is it optional? I'm just reading through the docs. They do have a command line option to disable the GC but anyway...this GC thing is, imho, a no-go when it comes to systems programming. It reminds me of Go that started as a "systems programming language" too but later switch…

Why does gc disqualify a language as a system's language? P.S. I think of a system's language as one that runs directly on the machine, e.g. Swift, C, go. They operate at the "system" level.

Could one write a driver in D?

Re: The reference D compiler is now open source

#63
post #8

Honestly, since I'm slightly psychotic about these things, this is a kind of huge to me. Part of the reason I never learned D was because the compiler was partly proprietary. Now I have no excuse to avoid learning the language, and that should be fun.

I refused to touch Swift until Apple open-sourced it for the same reason :-)

No problemo - dmd works on the Mac :-)

Re: The reference D compiler is now open source

#64

Earlier quoted context omitted.

There are plenty of reasons why Rust could win outside of requiring safe manual memory management. It is an expression based language with ad-hoc polymorphism, algebraic data types, hygienic macros, first class functions, and race-free concurrency. I don't use rust because I don't need manual memory management and I require subtype polymorphism for a lot of things, but I choose Scala over D.

Neither Rust nor Scala hold a candle to D in terms of compile-time introspection. You can do things with it that are near unbelievable - "you must ask yourself if some law of nature was broken" quoted from memory in http://dconf.org/2015/talks/alexandrescu.html

Scala developers can do whatever they want or need at compile-time.

Re: The reference D compiler is now open source

#65
post #17

This was something that always rubbed me the wrong way about the language, and it was an impediment for adoption for me (for D, but also Shen and a few others). In this era, there is no excuse for a closed source reference compiler (I could care less if it's not a reference compiler, I just won't use it). I'm surprised it took this long to do this, it seems like D has lost most of its relevance by now...relevance it…

D is easier than Rust and safer than C++. That is a valuable point IMHO.

And it also interfaces very nicely with C/C++ libraries and code.

Re: The reference D compiler is now open source

#66
post #62

Earlier quoted context omitted.

Why does gc disqualify a language as a system's language? P.S. I think of a system's language as one that runs directly on the machine, e.g. Swift, C, go. They operate at the "system" level.

Could one write a driver in D?

Yes

Re: The reference D compiler is now open source

#68
post #48

Earlier quoted context omitted.

There's plenty you can do with D but not C++, see regex, bitfields, swap member-by-member with checks for mutual pointers, the pegged library for grammars, etc etc.

I don't know, Boost has me convinced that even things like regexes in C++ templates could be possible, if your compiler has a big enough stack to handle very deep template recursions. It's theoretically possible to build a regex parser in C++ templates, right? It would be horrible, but possible.

With D it is possible and not horrible and already done. ;)

Talk: http://dconf.org/2014/talks/olshansky.html

Re: The reference D compiler is now open source

#70
post #61
post #28

Earlier quoted context omitted.

There is no quantitative metric for safety and easyness. If you can afford a garbage collector, D easily wins over Rust. If you really need the safe manual memory management, Rust wins. In between is still a large grey area.

Is the GC mandatory in D? I was under the impression some time ago that D could run GC-free, but the standard library still widely used GC. Did I just misunderstand?

In my understanding, you're overall correct, but they've also been working on reducing that need, making more and more of it work without a GC.
Post reply on HN