Sponsored by Dragon Age: Origins
Join the Dragon Age: Origins development team on Facebook view!
facebook.com/DragonAgeOrigins - EA presents BioWare's new dark fantasy epic Dragon Age: Origins. '9/10' from Game Informer.
89 Comments
- Xenoxi, on 10/12/2007, -0/+20Yes, it is apparently a native language.
- Phr00t, on 10/12/2007, -1/+18I've been programming with D for some time. I was drawn to it for its speed, safety and modern features. It is definetly worth checking out -- also, www.dsource.org has plenty of cool projects using the D programming language, including my project "FreeUniverse". Wish I had more free time to work on it these days :-)
- msikma, on 10/12/2007, -0/+15How about criticism? Surely, this isn't a perfect programming language, so I'd like another side to tell me some of the bad things about this language (even if they don't apply to every user, or if there are very few). A practical comparison with the C family of languages (again, done by someone else than someone from this site) would also be nice, just to learn more about it.
- farther, on 10/12/2007, -21/+35"Native code"? So there's a programming language coming that only Navaho windtalkers can understand?
- Wootery, on 10/12/2007, -1/+12Lack of libraries is a biggy - You can't use C++ libraries in D.
(wxD, which ports wxWidgets from C++ to D, does so in an.... interesting way, http://wxd.sourceforge.net/ ) - pauleric, on 10/12/2007, -7/+17Here's my criticism: So what? It's really not very different than C++ or Java. It doesn't have any features that they don't already have, or can have with libraries. It may have some marginal improvements and simplify a few things, but it's "yet another" language with no compelling reason to exist.
- inactive, on 10/12/2007, -0/+10Something tells me you just don't want to learn another language.
- zttrx, on 10/12/2007, -5/+14I'm sorry, what I meant to say was WOOOO A NEW LANGUAGE TOP 100 WAYS TO LERN C# IN TEN MINUTES A MUST READ THE BEST YOU'LL EVER SEE
- TechnoRabbit, on 10/12/2007, -14/+23That's Navajo, not Navaho. If you're going to make stupid comments, you should probably learn to spell.
- zttrx, on 10/12/2007, -5/+13"Time for a new language"? You realize D has been in the works for at least seven years, right? Goddamn people.
- inactive, on 10/12/2007, -1/+8Native and fast:
P4 benchmark:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all
AMD benchmark:
http://shootout.alioth.debian.org/debian/benchmark.php?test=all&lang=all - inactive, on 10/12/2007, -0/+7www.dsource.org
- ilitirit, on 10/12/2007, -0/+7Obligatory link to Kenta Cho's games.
http://www.asahi-net.or.jp/~cs8k-cyu/index_e.html
Shoot 'em Ups written in D
:-) - Phr00t, on 10/12/2007, -0/+7The sad thing is... name mangling and differences between compilers make using libraries from C++ difficult. You can interface with C libraries, using the include file converter. There are some good D libraries coming, most listed on dsource.org.
- smitting, on 10/12/2007, -2/+9Here's the language comparison chart:
http://www.digitalmars.com/d/comparison.html
Personally, I prefer C# since it's almost the same thing. D doesn't require a VM, but C# comes with a huge library. VM performance isn't a problem anymore (do some testing if you don't believe me). Cross platform with D is nice (Mono works sometimes) but I'm dealing with server code most 99% of the time, so platform already isn't an issue.
And some of the features this chart mentions as missing c# features are available in the .Net library, like associative arrays....
Dictionary<string,int> would declare an associative array of ints keyed by strings, Dictionary<Identity, HttpRequest> would declare an associative array of page requests keyed by the user's identity. - trib4lmaniac, on 10/12/2007, -3/+9You forgot "AWESOME" and "AMAZING"
- smitting, on 10/12/2007, -0/+6I'm not a big Microsoft fan in general, but I actually prefer the c# syntax for delegates:
delegate bool FilterTest(int n);
int[] filterInt(int[] a, FilterTest filterTest)
{
List ret = new List();
foreach (int x in a) { if (filterTest(x)) ret.Add(x); }
return ret.ToArray();
} - inactive, on 10/12/2007, -0/+6There is one though it's not complete - http://www.dsource.org/projects/descent
- simeonb, on 10/12/2007, -0/+6It is both native and contains no runtime. These are not redundant, native languages like haskell (in the glasgow haskell compiler) compile the runtime into the binary. Having no runtime means that there is closer integration to the machine such as a standard way to use assembly language, and it is also trivial to directly link in C code. The base a.exe file is also much smaller (under 250KB for me out of gdc).
- zttrx, on 10/12/2007, -3/+81. If there's a better all-purpose language than C, I'd like to know what it is, and exactly why. (and I'm not talking about C++, I'm talking about C)
2. Why did you mention C#? C# has as much to do with C as .NET has to do with Java. - simeonb, on 10/12/2007, -0/+5I haven't found much that I can think of about the language. It is pretty refreshing, although I haven't done huge projects with it. For me it was difficult to install. You need mingw on windows so that you have gcc, and then you can install gdc (gnu d compiler). The base binary size was 250KB, and with C it might be 25KB or less. There are good ide's like codeblocks that can work with D easily, although you have to install gdc (which requires mingw of course) and then configure codeblocks to use gdc. These are the biggest things that stick out for me. The language is easy to get into although there is a lot to learn about all the features if you are trying to be thorough. It is very clean and consistent though, so learning them is fun and empowering, and not about memorizing inconsistencies.
- inactive, on 10/12/2007, -1/+6Dont ruin with name of compatibility, like what other people did with C++.
- Pxtl, on 10/12/2007, -3/+8The problem with D is that it was designed to simply "fix C++" rather than to design a new, better language. If you expand your horizon outside of the rather limited family of C/Pascal derivatives, you'll find that there are numerous other programming language concepts that were, until recently, horribly implemented in these conventional languages. D really doesn't address these concepts at all, any more than C++ does. C# 3.0 is finally adding various functional programming concepts and relational language concepts into it, and yet the C# userbase is screaming about the "impurity" of these ideas - but C# has it's own pile of flaws.
There's nothing like watching the development of programming languages to realize that the software development community is populated almost entirely by screaming children. - Pxtl, on 10/12/2007, -1/+6Yep. I agree that the disjoint nature of language development is appalling. The professional (and hobbyist) world is forever trying to re-invent C++, while the academic world is building towers of confusion in which you can express anything you like tersely, but nobody can understand it (or use it since there aren't any libs).
- inactive, on 10/12/2007, -1/+6Somebody should note that the long awaited 1.0 version of D will be available very soon (probably within a few days).
- Pxtl, on 10/12/2007, -1/+5@zttrx
I mention C# because it is just the most recent descendant in the C language family. And while you may think it's pretty far from C, it looks a hell of a lot more like C than does, say, Lisp or Forth.
Lisp is a perfect example of a language whose lessons have been forgotten. Rather than try to implement the be-all and end-all language, Lisp is just a set of simple constructs that can be used to express any more complex linguistic concept - OOP is implemented as a set of macros. Now, is Lisp perfect? Of course not. But does anyone have any business designing a language without experiencing languages like Lisp or Caml? Hell no.
C is wonderful at what it was designed for - legible, high-speed assembly-like code, and legible arithmetic. But once you start describing more complex concepts in it, you start running into places where the language is clumsy, unsafe, and messy. The problem is that newer languages take the equally stupid approach of _forcing_ simplicity and safety on you, instead of allowing you to construct safe objects (which C++ laudably introduced). - inactive, on 10/12/2007, -2/+6simeonb: The GDC compiler is a bit of a pain to set up but DMD is very easy (just unzip 2 files).
- asterite, on 10/12/2007, -0/+4And Descent it's not a dead project: soon it'll be usable and I'll be adding features to it while you can use it and test it. :-)
- adinb, on 10/12/2007, -1/+4@farther: That would be the codetalkers.
For info about the codetalkers and their incredible achievements take a look at: http://www.navajocodetalkers.org/ or http://www.history.navy.mil/faqs/faq61-2.htm , or take a look at the wikipedia or stop by Albuquerque, NM and listen to one of the few remaining code talkers speak about their experiences in person. - inactive, on 10/12/2007, -2/+5Unfortunately, no.
"The problem now is, that the Java API classes are heavily interconnected; a simple "Hello World" application uses the security manager which uses AWT which uses... Because of this, you will always have a big part of the class library in your binaries"
Compiling a simple 'hello world' app with GCJ (native compiler) results in a 10 meg binary. - simeonb, on 10/12/2007, -0/+3kmk2006: Thanks, I will give that a try. I set up DMD months ago and I had to configure text files and their paths to get it to work.
Also I found that by using strip the binary goes down to 144KB. - cplusplus, on 10/12/2007, -0/+3Well, not 10 Meg. Here I read its 8M - or 5 stripped.
http://comments.gmane.org/gmane.comp.gcc.java.devel/13001
But you have a point. - EEBaum, on 10/12/2007, -0/+3Why not both? :P
- simeonb, on 10/12/2007, -0/+3I wouldn't say that D fixes C++ because it throw away compatibility with it. I think it does the same things better than C++ through design experience. From reading the message boards, there were lots of ideas from difference language incorporated. Auto type inference, templates, integrated data structures etc. Functional programming techniques could be added easily with a library as they were with Python, but yes, they are not there now. Check out this filter function I wrote yesterday, it seems to work well, and you have control over what gets copied where. In retrospect, I could have just used the original array.
int[] filterInt(int[] a, bool delegate(int n) filterTest)
{
// copy by value a = b would be copy by reference, and actually this isn't necessary at all
int[] filteredList = a[];
int flIndex = 0;
// auto type inference
foreach(x;a)
if( filterTest(x) ) {
filteredList[flIndex] = x;
flIndex++;
}
filteredList.length = flIndex;
return filteredList;
} - cg0def, on 10/12/2007, -2/+5@bnolsen yes, both java na c# do not allow direct access to the underlying architecture because those are not OS programming languages. Both languages were designed with an already existing OS in mind. ( java not so much at the beginning ) And if you must use c# as an example you should also remember that the implementation of c# used by MS requires the use of .NET and in that case there is no problem to write the particular module that needs tight memory control in C++. However, about 95% of all code ever written does not need those features and the benefits of writing code faster largely outweigh the drawbacks of using a little bit more RAM.
Anyway my biggest problem with D is that its one more language that has only the support of a small community. The single largest reason why C/C++ is as popular as it is today is the large developmental community around them. Never mind the fact that there are vast numbers of libraries that do pretty much everything you can think of. There is an international and industry wide committee that controls the way C++ develops and at the end of the day most of those same companies would be writing the next OS or the next Office Suite. So what chance does D have in competing with C++? None whatsoever. Anyone who believes that a programmer can chose what language to use is either insane or has never worked for a 50+ devs. company. You have a project manager and he/she has a boss as well and at some point up the management ladder there is a chain of people that know only that they want to software to be ready yesterday and to work great. So one of the managers choses a well know well proven language that it's not going to be D even on it's best day. No offense but I wouldn't chose a no-name language even if my company was just starting up.
So the only playground for D left are OSS projects. Well some have picked it up but it still requires considerable retraining and I can understand why most devs are reluctant to pick it up even if it is as great as the site says. No offense guys but you don't even have an IDE and the installation on anything but a couple of flavors of linux is hell. Long gone are the 80s when IDEs were text based and you had to use a terminal/console in order to compile. At it's current stage D looks very much like an academic project only it doesn't really have the backing of one. It is a great project though and I wish the maintainers had a little bit more business skill ... - TheJeffer, on 10/12/2007, -0/+3.Net programs don't actually run in a VM. It's a common misconception, because people think it's like Java. Programs actually get Just-In-Time compiled into native code when you run them. And half the time, that's not even an issue, because a good programmer will use a tool provided by Microsoft called ngen that will do the precompilation once and then store the resulting native code in the user's cache... meaning you're basically just running native code. What .Net is, more than anything else, is a great framework of libraries.
- Continuum, on 10/12/2007, -0/+2The biggest problem I see here is not with D but with programmers thinking that there should be only one language.
Each language out there (that is in common use) has its following for a reason and has been shown to work properly. Sure, for example, it may be easier to read code Java than in C but is readability of code for your application important? or is performance important? or cross-platform compatibility?
I hate when programmers bicker over the "best" language to use because, really, they are all good when used for their purpose.
anyways, off the rant. And if we are going to say what language is best, iI vote for *****.
http://www.muppetlabs.com/~breadbox/bf/ - Corneliusm, on 10/12/2007, -0/+2Garbage collection is optional. You can explicitly allocate and deallocate memory using your favorite keywords (new and delete) if you want control. Otherwise, a garbage collector handles memory management for those afraid of having to fix memory leaks.
Still, as a C++ developer, I don't see any new features in D that excite me enough to switch over. Maybe if the industry begins to shift, I'll force myself to learn... - brundlefly76, on 10/12/2007, -4/+6Wow, awesome, so way overdue.
I cant think of any language initiative more important then retiring C/C++. - waenyinepu, on 10/12/2007, -0/+2There's a somewhat more concise filter function available in the Cashew library for D (which I maintain, I admit it, so I'm slightly biased, oh well). It is defined as a function template as well, and is suitable for IFTI "pseudo-member" usage. (Its a D'ism. Read on for example.) The following is direct copy+paste (other than the # prefix) from the Cashew repository.
# T[] filter (T) (T[] haystack, bool delegate (T) dg)
# body {
# T[] result ;
#
# foreach (needle; haystack) {
# if (dg(needle)) {
# result ~= needle;
# }
# }
# return result;
# }
# unittest {
# _begin(r".filter(Dlg)"c);
# int[] foo = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
# auto sub = foo.filter((int x) { return (x % 2) == 0; });
# assert(sub == [2, 4, 6, 8, 10]);
# _end;
# }
Once we get type inferance for delegate literals it will become that little bit more generic. Cashew is located at:
http://www.dsource.org/projects/cashew
Now to explain that "pseudo-member" D'ism. Its really just a side-effect of the D's properties concept, which causes the use of AnyArray.AnyFunction() to be the same as AnyFunction(AnyArray). Not a true feature per se (it was added by accident... so of course, we all loved it) but it can sometimes make expressions a bit more readable (less nesting of the parentheses, chaining instead).
if (validate(convert(acquire("blah")))) { ... }
versus
if("blah".acquire().convert().validate()) { ... } - w3bsmith, on 10/12/2007, -0/+2All the nay-sayers comments say the same thing I've felt for the 4 years I've known about this language.
Where are the advantages? Why would you learn some new form of C unless forced to? That's my main hold back from learning C# more thoroughly. If I don't need to learn it, and if it adds nothing new to my range of problems to solve, no new tool with which to solve them, then why should I bother?
I must admit I did try it years ago. The thing that spurred me on into trying it was because I had spent a delightful few months having learned another new language; Ruby. Having been pleasantly delighted by one I felt hopeful about the other. What a let down.
Give me Ruby any day. I can blend it easily into C for those sometimes needed speed boost, and I can still have LISP like ease of reading! I agree that every programmer should use LISP, Pascal, Assembly, et cetera before moving on to new languages. You learn an appreciation for and are more discrete in your choices of new languages and their uses. - achacha, on 10/12/2007, -0/+2Personally I don't want garbage collection, I want to control when and how memory gets deallocated. If I wanted that I would choose Java or C#. And you know what, I love multiple inheritance, but it's not meant for the weaker programmers, so while most will point out its evils, I can point out its many advantages. C++ is a great language, which is great for pretty much anything in the right hands, for scripting we have Python and Ruby, for higher level development we have Java and C#... I can't see a reason why I would switch to D.
- waenyinepu, on 10/12/2007, -0/+2As of about an hour ago, the 1.00 release has been posted. Bound not to be perfect, but we're lucky to have gotten this far. (And poor Walter... what with all our whipping at him, we're lucky he's stuck with his project despite us D users.)
- BuddhaChu, on 10/12/2007, -0/+2@kmk2006
The stats you link to are misleading because D scored WAY better in one category that must have skewed the results. If you compare D to just "C gcc", it's slower by a decent amount.
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=dlang&lang2=gcc - PlancksCnst, on 10/12/2007, -0/+2The biggest problem with D:
-It's not Lisp - inactive, on 10/12/2007, -0/+2cplusplus: I think that's a little old. With each new version of GCJ, the class library has become larger and larger. When I said 10 meg
binaries, I meant when GCJ 4.2 is used.
http://www.thisiscool.com/gcc_mingw.htm - ermau, on 10/12/2007, -0/+2Hashtable is even better as it has no single type requirement for either the key or the values.
- mike503, on 10/12/2007, -0/+2a coworker of mine once told me he wanted to make a language called D, with the best of C and C++ worlds...
i'm trying to see if his name is in here. that'd be a gas. - lnostdal, on 10/12/2007, -0/+2Nothing new here .. *continues Lisp-hacking*
- ronaldst, on 10/12/2007, -2/+4@TechnoRabbit
If you feel you have to correct others then do so without being vulgar and insulting. -
Show 51 - 89 of 89 discussions



What is Digg?
The Digg Toolbar for Firefox lets you Digg, submit content, and keep track of Digg even when you're not on the Digg site. Download the official