News for hackers. Stuff that matters.
Re:The Case for D by steveklabnik on Friday October 30, 2009 @09:48AM (#911984)
There are two big problems with D.

1) Everyone treats D2 as being the current stable version of the language, when it isn't. 2) Tango vs Phobos when it comes to D1.

But trust me, the D community is aware of those things. [1] There are a lot of tensions over the developments of D2, how they're going, etc. If and when D2 ever actually comes out, it should address lots of the issues.

But you may see something sooner than that.

[1] : http://www.jfbillingsley.com/blog/?p=53

Re:The Case for D by Nelson69 on Friday October 30, 2009 @12:48PM (#912307)
A top quality, supported, opensource compiler would help. The LLVM front-end looks promising but I half expect it to be abandoned. It's kind of odd, it definitely seems like there is a desire for a compiled machine code producing language to compete with C and C++.

I kind of remember this argument with Ada over the years, particularly when the GNAT front-end to GCC was mainlined. Having tools available is a big noticeable percentage of the problem; maybe 30-45%. Tooling is becoming more than just a compiler though, an eclipse IDE for D would be nice too and it's probably required for serious consideration by the masses. Supported and live are important for this stuff.

Another aspect of adoption seems to be adoption. It's a snowballing kind of thing. In the GNAT/Ada days there were a lot more advocates of its use than there were users. If you really want D to start getting more attention, then start doing some successful D software, particularly packages that get attention seem to be good (see Mono and Tomboy) Ada has a good complaint compiler that is supported and still doesn't have many users. Some free/open software that shows some of the benefits and advantages of D would help.

Re:The Case for D by steveklabnik on Friday October 30, 2009 @01:10PM (#912352)
Yes. This is actually is one of the main points of contention... that the dmd frontend is 'source available.' The community is doing some things to address this, but that's all I'll say.

LDC is a really great project. It's not being abandoned anytime soon, trust me. Those guys are working hard, and they answer bug reports really, really fast. Though I'm admittedly slightly biased, since they use my kernel as a test case.

There are several IDEs that support D, though I can't think of them off of the top of my head, since I use vim. Posiedon?

There have been several intersting D projects, but you're right, more would certainly help. The blog post I linked to's author wrote a little language called MiniD that's pretty interesting, I (and several others) are writing a kernel, etc... but dsource.org can look like a graveyard sometimes...

Re:The Case for D by WalterBright on Saturday October 31, 2009 @05:14AM (#913401)
The dmd front end is GPL'd.
Re:The Case for D by steveklabnik on Saturday October 31, 2009 @11:23AM (#913611)
Thanks for the correction, Walter. As Wikipedia says:

The Digital Mars D compiler is the official D compiler by Walter Bright. The compiler front-end is licensed under both the Artistic License and the GNU GPL; the source code for the front-end is distributed along with the compiler binaries. The compiler back-end source code is available but not under an open source license.

Re:The Case for D by JulianMorrison on Friday October 30, 2009 @11:46AM (#912203)
Having read that blog post, I can completely and emphatically rule out using D at all for anything, unless and until I hear it's no longer a pitiable train-wreck (and I won't hold my breath).
Re:The Case for D by steveklabnik on Friday October 30, 2009 @12:45PM (#912300)
Honestly, 99% of this doesn't matter if you're not concerned about the politics of the development of the language itself. If you code with D1, and pick a library... none of this matters.

Your comment is akin to "After seeing the debacle with the C++0x committee, I will rule out C++ for anything until I hear it's no longer a train-wreck." Which might be legit. Just saying.

Re:The Case for D by blub on Saturday October 31, 2009 @08:22AM (#913483)
It's not akin to C++/C++0x at all. C++03 is standardized and the current mainstream compilers do a good job of implementing that standard; the tools are rock-solid. C++0x is coming along nicely, with support from the big industry players. Concepts were dropped, but the rest of the features are still a massive improvement over C++03 and I can't wait to use them.

On the other hand, reading that blog post about D has confirmed my worst suspicions about the instability of the language and the immaturity of the tool set.

Re:The Case for D by ponce on Saturday October 31, 2009 @09:21AM (#913514)
There is an awful lot of problems with C++ though.

- The tool are certaintly not rock solid. Parsing requires arbitrary look-ahead and semantic pass, order of headers inclusion matters, #if and dirty tricks are everywhere

- compilation is slow

- non standard extensions makes painful portable C++ across compilers and platform, because you need them and they can have incompatible syntax

- C++ const is useless when it comes to optimization or concurrency.

- any real world project involving C++ is going to be challenging if you're not working with top C++ library implementers or emasculating rules (like "no exceptions" or "nothing goes in the constructor" at Google)

Anyway, even if C++1x was already here and completely supported (which C++03 is not), D would still have an edge.

Despite its current problems D greatly enhance productivity over C++. Refactoring is _way_ faster when you have import and no headers to maintain. Properties enhance expressivity a lot. You have access to the machine, value semantics, and reference returns, so there is nothing conceptually wrong with it.

Also, in D there is much less skill diffference between library writers and typical programmers as compared to C++.

Finally if you really want C++1x features, I sincerely advises to try D because there is a lot of overlapping.

Re:The Case for D by h3r3tic on Sunday November 01, 2009 @12:42AM (#914706)
> - compilation is slow

What I've learned is that people don't really care about full builds when doing large projects. The separation into header and source files means that when you change a source file, only this one has to be recompiled. You only do massive rebuilds when modifying headers.

In case of D, when you modify a module, the change can possibly propagate indefinitely. Even when you just change the body of a function and think the modification should be isolated, consider that the build tool must assume this function may potentially be used at compile-time to generate code for other modules. The changes propagate as far as they would with .h files (unless the build tool can do semantic analysis or make unsafe assumptions).

To this fact, add how DMD only outputs template instances into one object file when compiling multiple modules at the same time. If you're lucky, at the next incremental build it will output them into the same modules. If you're not, you end up with unresolved references. This template emission method is an optimization - the alternative is a lot of bloat that object files generated by C++ compilers suffer from. I agree with Walter's position that what DMD does should be the default. And it is possible to make a good build tool that deals with this issue. I've tried doing that for DMD-Win, but its case, such a build tool is currently infeasible due to toolchain issues.

Re:The Case for D by WalterBright on Sunday November 01, 2009 @05:36AM (#914928)
You can do "header" files with D, too. They're called .di files and the compiler will even generate them automatically, or they can be built by hand.

The compile speed advantage D has over C/C++ is that in the latter the header files must be reparsed for every source file. In D, the header files only need to be reparsed once, and then it is looked at symbolically for the rest of the source modules.

D is also faster at compiling because the lexical grammar is designed to require little processing.

Re:The Case for D by h3r3tic on Sunday November 01, 2009 @11:29AM (#915190)
That latter advantage is true, but D's "header" files are currently impractical. Creating them by hand is a major source of pain, greater than with C/C++. The automatic generation on the other hand is troublesome for at least two reasons:

1) It's very sensitive to the contents of .d files. For instance, It leaves the bodies of inline-able functions in, thus if you modify such a function in the .d file, it will again mean a change spill to the .di and modules importing it (directly and indirectly). Similarly if you just reorder the functions in a module or change a private constant. This could partially be mitigated by a sufficiently smart build tool that tracks symbol importing, aliasing and usage in order to infer the modules that need to be recompiled. Sadly, this is quite complex and no current tool does it at the moment.

2) It assumes none of the functions will be used at compile-time (by stripping away function bodies depending on whether they may be inlined), which forces you to stuff them all into compile-time-only modules.