Slashdot Log In
C, Objective-C, C++... D! Future Or failure?
Posted by
Hemos
on Mon Apr 19, 2004 08:03 AM
from the yet-another-programm-language dept.
from the yet-another-programm-language dept.
TDRighteo writes "OSNews is carrying a quick introduction to a programming language under development - D. Features include garbage collection, overrideable operators, full C compatibility, native compilation, inline assembler, and in-built support for unit testing and "Design by Contract". With all the discussion about the future of GNOME with Java/Mono, does D offer hope of a middle-road? Check out the comparison sheet."
Related Stories
[+]
The D Programming Language, Version 1.0 570 comments
penguinblotter writes in a journal article: "Soon, Walter Bright is scheduled to release version 1.0 of the D Programming Language. D is a systems programming language. Its focus is on combining the power and high performance of C and C++ with the programmer productivity of modern languages like Ruby and Python. Special attention is given to the needs of quality assurance, documentation, management, portability and reliability. D has appeared on Slashdot a few times before, and Walter has continued to add more and more features. Most Slashdot community comments in these articles have been offered on feature X or spec Y without reading through the extensive D newsgroup archives. It has been here over the past seven years where extremely gifted and experienced programmers hashed out discussions and arrived at excellent implementations of all the ideas discussed." Read on for the rest of penguinblotter's writeup.
This discussion has been archived.
No new comments can be posted.
C, Objective-C, C++... D! Future Or failure?
|
Log In/Create an Account
| Top
| 791 comments
(Spill at 50!) | Index Only
| Search Discussion
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1)
|
2
(1)
|
2
wow (Score:5, Funny)
(http://en.wikipedia.org/wiki/User:Spangineer)
Oh, wait...
Re:wow (Score:4, Informative)
(http://llimllib.f2o.org/)
Re:wow (Score:5, Insightful)
(Last Journal: Friday June 11 2004, @11:15AM)
For the pedantic - I consider this post to be about the zlxrt language.
Here's one (Score:4, Funny)
(http://slashdot.org/)
How about "Double-D"? *That* will bring out the programmers in hordes.
Re:wow (Score:5, Funny)
(http://www.karmadillo.org/)
You guys are all behind the times. I'm already on E!
Yeah - turn up that thumping music man!!!
Re:wow (Score:5, Informative)
(Last Journal: Wednesday November 28, @05:59AM)
Re:wow (Score:4, Informative)
(http://www.negativenumber.com/jorkapp)
It was essentially BCPL stripped of anything Thompson felt he could do without, in order to fit it on very small computers, and with some changes to suit Thomson's tastes (mostly along the lines of reducing the number of non-whitespace characters in a typical program).
According to Ken, B was greatly influenced by BCPL, but the name B had nothing to do with BCPL. B was in fact a revision of an earlier language, bon, named after Ken Thompson's wife, Bonnie.
Microsoft will come out with it's own version (Score:5, Funny)
(http://slashdot.org/)
Re:Microsoft will come out with it's own version (Score:4, Funny)
(http://slashdot.org/~T-Kir)
Or instead of sharp, use the hash orientation and you could have D-bong... mind you'd have to be on drugs to be able to use it though ;-)
Re:Microsoft will come out with it's own version (Score:5, Funny)
(http://www.security-forums.com/)
Cue loads of VD jokes
Re:Microsoft will come out with it's own version (Score:5, Funny)
(Last Journal: Thursday February 24 2005, @11:27AM)
Re:Microsoft will come out with it's own version (Score:5, Funny)
(Last Journal: Thursday June 05 2003, @09:57AM)
Re:Microsoft will come out with it's own version (Score:5, Funny)
full C compatability? (Score:4, Interesting)
(http://www.beegle.org/)
In "small program" languages like perl, giving people lots of ways to do things is a feature. In a "large program" language, providing both C compatability and garbage collection is a maintainability nightmare. You'll have people who use both, or worse yet, who only understand one, so to understand the mixed code that results from a hybrid langage like this, you'll have to be utterly proficient with -both- languages.
Re:full C compatability? (Score:4, Insightful)
I wish the article actually compared to objective-c, as the story's poster seemed to imply...
Re:full C compatability? (Score:5, Informative)
Re:full C compatability? (Score:5, Insightful)
(http://www.int64.org/)
Because it's not handled by D's garbage collection, it still needs to be freed. I'm sure this will make those developers who love to leak memory even worse.
Re:full C compatability? (Score:5, Insightful)
It happens a lot. I've seen a few expensive C-based libraries that clearly show their designers struggled with the classic caller-callee allocation dillema and lost. Debugging memory leaks in programs that use these libraries is typically hopeless and requires high effort-versus-progress computationally-expensive run-time checks to find them. I like C quite a bit, but it is disheartening to see such a simple malloc() function cause so much pain.
Re:full C compatability? (Score:5, Interesting)
(http://iabervon.org/~barkalow/ | Last Journal: Saturday May 31 2003, @02:01AM)
One thing I'd really like to see in Java is Object.free(), which would tell the garbage collector that the object is garbage and can be freed, and cause any further use of the object to throw a FreedMemoryException. This would be useful both as a hint to the system (letting it get rid of things the object references early) and as a debugging aid (so you can find cases where stuff remains in use after you don't think it will). Of course, it violates Java's sandbox design to have a C-style free() which recycles the address space.
Re:full C compatability? (Score:5, Insightful)
Just about anything you need, there's a C library for it.
Think nice things like opengl,pam,openssl,GUI librairies, database
libraries, and heaps more.
Having access to those is very nice, and you don't have to wait anyone
to port those to a new language(which probably won't happen anyway.)
I'd imagine how far C++ had gotten if it couldn't use C libraries..
Don't need to imagine -- it was the whole point (Score:5, Informative)
(http://www.devphil.com/)
Stroustrup is on record many times over as saying that link compatibility with some existing language was a design criterion for him. If not C, then something else.
It is an axiom in the C++ community that compatibility with C is both C++'s greatest strength and its greatest weakness.
Re:full C compatability? (Score:5, Insightful)
(Last Journal: Sunday April 16 2006, @10:03PM)
For those of us who don't like unpredictable...
pauses...
in our programs while the garbage collector does its work, will we be able to turn off garbage collection entirely or run the garbage collector only at specified times?
directly, them you're a good enough programmer to ensure that you've called for each new. And with std::auto_ptr, it's as easy as How much simpler does it need to be?I'll answer my own question: even if this is possible, if D ever becomes a serious language, we will be using libraries written by other people, libraries that do rely on garbage collection.
So, no, we won't (realistically) be able to turn off the garbage collector, which means that we won't be able to write real-time programs, and it'll even be touchy writing programs, such as, oh, audio or video players, that require near real-time performance. (Not to mention the disappointment we all felt with the various java window-widget APIs (AWT, Swing) that looked great but couldn't run fast enough to respond to the mouse.)
Look folks, taking care of your own garbage wasn't possible in C for a library writer (even ones returning opaque pointers to structs that allocated their own memory) because you had to rely on the library user to call your cleanup function(s).
But the library user could clean-up. The problem was essentially that some programs didn't care enough to be careful -- pointers actually had to be tracked.
Now, it's fine if a library user wants to add on a garbage collector by re-writing malloc to track allocations. But libraries, which are intended to be used by lots of programmers, to write code, and by lots and lots of end users who run code should not use garbage collectors themselves -- because that forces the library user to use garbage collection too.
But in C++, library writers can write libraries that take care of their own garbage even when used by careless users, because the compiler will automatically call class destructors which can do clean-up. (Yes, except in the case of derived classes -- the writer of the derived class has to explicitly write a dtor to ensure the parent class dtor is called.)
And in C++, with the Standard Template Library, there's little need for non-library writers to do explicit allocation at all -- std::vector and std::string and std::auto_ptr, just by themselves, take care of most of the problems of memory leaks and buffer overruns.
If you're using C++ and you feel that you're a good enough programmer that there's real need for you to be calling
So why complicate things with garbage collector and tracking down circular references and unpredictable pauses? Garbage collection is a bad answer for non-trivial programs, and pretty much necessary for trivial programs.
Re:full C compatability? (Score:5, Insightful)
(http://www.winsper.org.uk/)
Re:full C compatability? (Score:4, Interesting)
Re:full C compatability? (Score:5, Informative)
(Last Journal: Sunday April 16 2006, @10:03PM)
My point was that to avoid the problem of circular references, the garbage collector does have to be more sophisticated, and sophistication takes time and (memory) space -- time and space that a program may or may not be able to spare.
"for very many applications modern garbage collectors provide pause times that are completely compatible with human interaction. Pause times below 1/10th of a second are often the case,"
Pause times below 1/10th of a second? Hmm, how much below? TV-quality video is 24 frames per second, so a one-tenth second pause means dropping two or three frames. Acceptable? Perhaps, but not desirable.
"Does garbage collection cause my program's execution to pause? Not necessarily."
Yes, if you read my post carefully -- perhaps you missed a word or two when the garbage collector in your head did some clean-up -- I didn't say that pauses were inevitable. My complaint -- and not just mine, it's no revelation that garbage collection has may detractors -- is that the pauses are not predictable by writer of the program.
With non-garbage collected language, I know that memory allocation will either succeed ort fail, and I know (or a library writer knew) when allocation happens, because I'm explicitly coding it. So I know, at this particular point in my program, either allocation succeeded or failed.
But garbage collection can happen at any time, and cause a pause at any point in my program -- even when I'm needing to re-fill under-run buffers or read volatile memory or make time-critical choices. With garbage collection, I no longer have an algorithmic program, in which I can say what it's doing at any particular point in the code.
Then come back and make some informed comments, instead of spouting nonsense. Thank you.
That overly hostile arrogance suggests you're either a zealot or a fourteen year-old. That sort of blustering generally indicates someone who isn't that confident in himself or his argument, and so wishes to preempt questioning by being a posturing like a "tough guy"; it's particularly prevalent on the net -- though I'll grant that you didn't hide behind an Anonymous Coward post. Adults can disagree and discuss things without resorting to insults and attitude -- and I think you'll be able to do that too, with a little more experience.
Re:full C compatability? (Score:5, Informative)
No it doesn't. Handling of circuler references falls naturally out of most GC algorithms. One of the simplest possible memory algorithms is the mark & compact GC, which handles circuler references naturally.
Pause times below 1/10th of a second? Hmm, how much below? TV-quality video is 24 frames per second, so a one-tenth second pause means dropping two or three frames.
You disable the GC in those cases. A good GC will give you the option to manually manage memory in certain cases (say, through a pool allocator), so in any time-sensitive paths, you can disable the GC and rely on those other options. There are also real-time GC's that have absolutely bounded pause times.
But garbage collection can happen at any time, and cause a pause at any point in my program -- even when I'm needing to re-fill under-run buffers or read volatile memory or make time-critical choices.
You do realize that you have this issue with any modern OS? A malloc() can take tens of thousands of clock-cycles if it decides to mmap() to get more backing memory, and the kernel decides to block the app.
Re:full C compatability? (Score:4, Informative)
(http://shapedwaves.blogspot.com/)
Then again, malloc needs sophistication as well, and can be every bit as slow as a good garbage collector. Indeed, even garbage collectors for C (try google with "garbage collector") can outperform the regular glibc malloc sometimes, even when there is NO reference counting involved. Which btw is another issue, reference counting + malloc pretty much combining the bad (and slow) things from both worlds.
Pause times below 1/10th of a second? Hmm, how much below? TV-quality video is 24 frames per second, so a one-tenth second pause means dropping two or three frames. Acceptable? Perhaps, but not desirable.
Such pausetime on a machine capable of playing TV-quality video in the first place indicate an awful garbage-collector. Even a stop-and-copy shouldn't take that much time, and these days we have generational collectors which only bother with the "youngest" stuff, that is, stuff most likely garbage. And you can make that incremental, it's not even very hard, and you can then slice the "pause" into almost as small parts as you want. There are collectors which provide real-time guarantees. Mallocs usually don't.
With non-garbage collected language, I know that memory allocation will either succeed ort fail, and I know (or a library writer knew) when allocation happens, because I'm explicitly coding it. So I know, at this particular point in my program, either allocation succeeded or failed.
Except this isn't necessarily true either. One example is Linux, which doesn't guarantee that there is memory left, because memory isn't allocated when you map pages, but when you touch them first time. If you allocate memory, and there's not enough free virtual memory to fill in the pages when you actually need them first time, then OOMkiller is called. Speaking of which, unless you lock (all) pages into memory, you won't know whether there'll be pauses anyway, since that memory of yours might just as well be a block of hard-drive space. Welcome to the world of virtual memory. Guess already which pause takes longer, a call to an incremental collector or the swap-in? Oh, and do you have a deterministic thread scheduler in your OS?
Finally, if you have an incremental collector (designed for this) you could run it with priority lower than your "real-time" tasks, and you could then collect only when the processor would be idle otherwise. Dijkstra's classical tri-coloring was actually developed for a scenario where there is one processor for running the task (mutator) and another for collecting the heap (collector). That you didn't think of this pretty much proves you've got no idea about garbage collectors.
Just because there are bad collectors doesn't mean they all are bad. And even stock solutions, over are the days when Lisp machines hanged for hours to collect their memory. Unless you are running the CPU at 100% all the time, you'll have plenty of time to collect.
Old news (Score:4, Interesting)
(http://www.intelligentblogger.com/ | Last Journal: Monday August 27, @11:47AM)
2. Java and
3. If a new popular language does come on the scene, you won't notice it until it has nearly taken over the world. Oh, and developers will love it so much they'll drop everything else (like what happened with Java).
Re:Old news (Score:4, Interesting)
(http://fforw.de/)
Java is successfull because:
- it offers a nice abstraction for system specific issues which is only seldomly leaky [joelonsoftware.com].
-
you can dive into an unknown project, select a random source file and understand it. You may have problems getting the big picture, but the code itself is there - there are no suprises like operator overloading, defines etc. All you need to know about the class is in it (and it's superclass and interfaces)
-
its complex enough to do some magic in it, but the idiot next cubicle can't run totally amok and wreck the whole system.
IMHO all these reasons are more important than for Java's success than hype.Obligatory java response... (Score:5, Informative)
Re:Obligatory java response... (Score:5, Informative)
That's because 1.4 is the CURRENT version (Score:4, Informative)
Well, since 1.5 is still in beta [sun.com] , I don't see how this is an invalid comparison.
Re:That's because 1.4 is the CURRENT version (Score:4, Insightful)
(http://fforw.de/)
Re:Obligatory java response... (Score:4, Insightful)
(Last Journal: Sunday April 16 2006, @09:28PM)
Templates.... great. It's like C++, but it's not.
Sounds like a good idea (Score:5, Insightful)
However, I it is doubful it will gain a foothold in the current ocean of multiple, semi-specialized languages.
A feature every language should have (Score:4, Interesting)
I really wish lanugages would start implementing the ~ operator from perl (as with $myvar =~
D @ Google (Score:5, Informative)
(Last Journal: Monday February 13 2006, @07:11PM)
Computers > Programming > Languages > D [google.com]
New programming languages are interesting, and sometimes I wonder what the next "big thing" will be. Will we have another big, revolutionizing, new concept like "object-oriented programming" that you simply must know in a near future?
Re: Fads (Score:5, Insightful)
(http://www.dpbsmith.com/)
There are fads in programming just as there are in clothing and management methodologies. And there are always people telling you to adopt the flavor of the month, I mean wave of the future if you don't want to become obsolete.
And you can usually ignore them.
I sat out PL/1, which, well, gee, it had BIG BLUE behind it (in a day when IBM's domination was far more complete than Microsoft's is now). And it doesn't seem to have done me much harm.
True, you can score big by being the person who actually has the "two years experience in" (language-that's-only-existed-for-two-years) that the recruitment ads want, but if you go this route remember that it's easy to be knowledgeable in the latest language if you've just spent some unpaid years in college learning it. If you want to make a career out of always having the skill that's in demand, keep in mind that the only reason the skill is in demand is because it is rare--and you'll need to be quite clever at guessing the next fad, and dedicated about finding out how to educate yourself in it while keeping your day job.
Re: Fads (Score:4, Insightful)
However I just look as this forum and I can't fail to notice that most of the mainstream languages are so because of what they can offer to a certain target of people. For instance you can see how C / C++ remain unbeaten in the low-level programming field. A friend of mine told me perl is used a lot in science (and web programming as well). Something like Java is quite useful for multi-platform development. Visual Basic makes fast development for Windows true. And of course other languages have their purposes too.
So to put it simple, I get the feeling that the future will divide programmers into different fields of programming. Much more than we are split now, that is. So I am not sure that the "wave of the future" will be just one winner, like it's been in the past. I already can see that there are several winners for several different reasons.
My 2 cents,
Diego Rey
try, catch, finally (Score:3, Interesting)
(Last Journal: Friday June 11 2004, @11:15AM)
In theory this would be an ideal solution. It forces programmers to think about what they're doing. In practice, it doesn't. Coders are too busy thinking about the actual problem. Error checking gets in the way. They end up implementing the quickest way of ignoring the problem. The result is that we're no better off than if we just checked return values. The application should be doing what the user wants. Not the other way round.
Re:try, catch, finally (Score:5, Insightful)
Exceptions provide an obvious answer to the problem of how to handle different types of problems. If a file doesn't exist and someone tries to open it, a FileNotFoundException is thrown. If a file exists but the permissions don't allow access, an IOException is thrown.
Exceptions also provide a MUCH cleaner way of propagating errors. If one method calls another method to open a file, and the file can't be opened, how do you tell the original caller that there was a problem? With exceptions, you simply declare that your method throws IOException, and then (typically) skip the try-catch-finally block.
actually, the more important reason for exceptions (Score:5, Interesting)
(http://www.carnageblender.com/)
Exceptions let you throw the error where it happens and catch it where it makes the most sense, however far down the stack that may be.
Re:actually, the more important reason for excepti (Score:5, Informative)
(http://slashdot.org/)
Summary (Score:5, Informative)
(http://operawatch.com/)
Dropping multiple inheritance ? (Score:5, Interesting)
Re:Dropping multiple inheritance ? (Score:5, Insightful)
(http://slashdot.org/~bradkittenbrink/journal | Last Journal: Sunday December 08 2002, @05:08PM)
Re:Dropping multiple inheritance ? (Score:4, Insightful)
(http://www.slamb.org/)
How about StreamSocket [slamb.org]. Okay, multiple inheritance isn't required in the strictest sense, but object-oriented programming isn't, either. MI makes this class make much more sense - it is both a stream and a socket.
In a language providing only support for multiple interfaces, you'd have to reimplement at least one of those in the derived class. You'd probably end up just dispatching all of the calls in the derived class to a shared implementation elsewhere. Not nearly as clean.
Or you could pull a Java and have a getStream() method on the StreamSocket. (Make the caller do the dispatching to the shared implementation.) I don't like it either.
Plus, if you were gonna copy multiple inheritance from c++ you'd need to copy all those nasty casting operators.
I don't see how eliminating MI makes any of them unnecessary:
Looking forward to job ads (Score:5, Funny)
Looking forward to job ads saying :
Duh !!
D already exists? (Score:3, Interesting)
Can anybody confirm this in any way?
p.s. If I'm not mistaken there's also an "F", based on Fortran if I'm not mistaken.
Unneeded history (Score:4, Insightful)
D is designed to address the shortcomings of C++. While a powerful language, years of history and unneeded complexity has bogged down that language. They want to overcome C++'s "history" while still maintaining C compatibility. Suddenly, I'm confused.
A, B, C, D, ... R! (Score:5, Funny)
(http://folk.uio.no/kjetikj/ | Last Journal: Thursday October 28 2004, @05:00PM)
What about C++0x? (Score:3, Interesting)
(http://projectjj.com/)
Last I heard about that was in this Slashdot story [slashdot.org] from 2001...exactly 3 years ago, nearly to date.
But that was supposed to be the next official holy grail, no?
Re:Toss out C. (Score:4, Insightful)
Re:Toss out C. (Score:4, Insightful)
(http://www.crystalspace3d.org/)
However, I'm not sure I agree for software where security is little or no concern but speed is the main issue. One example of that kind of software is games. I'm author of a 3D engine in C++ and I also program in Java for a living. I think that for things like these low-level languages like C and C++ are still the way to go. You can argue that computers are getting faster and faster. But user expectations about what those games can do are also constantly rising.
Greetings,
Re:Toss out C. (Score:5, Insightful)
Leads to cleaner code, in my opinion. C++ doesn't require you to do it, but I still do.
declare all your functions before using them
What's the big deal about this? If your tired of typing, you either need to learn to copy/paste, use an IDE that will generate code for you, or find a new industry.
C takes much more time to compoile than Java/C# because all the stupid headers take forever to parse.
Ever hear of "Make" and "Makefiles"? You don't need to keep recompiling things than havn't changed.
Pointers are a problem because they allow unsafe code that forces the hardware to make up for lack of security in the software. Repeat after me, security is a software problem.
Pointers, in some capacity, are needed for low level programming. If you don't need access to hardware, then you might have a reason to consider something besides C.
C! (Score:5, Funny)
(http://www.boozepoint.com/)
with apologies to eminem...
to the tune of 'without me'
Two GUI classes go on the inside; on the inside, on the inside
Two GUI classes go on the inside; on the inside, on the inside
Guess who's back Back again C is back Tell a friend
Guess who's back, guess who's back, guess who's back, guess who's back
guess who's back, guess who's back, guess who's back..
Sun's created a monster, cause nobody wants to code Java no more
or basic, but something quicker
Well if you want speed, this is what I'll give ya
A language called C that won't let you do "is a"
Some "has a" that makes me feel sicker
than the bugs when I build patch that's critical
using make to compile and be building
with a language that allows object orientating
Your var name's too long, now stop line breaking
Cause I'm back, I'm a new var and instantiating
I know that you got a job Bill and Steve
but your company's trust problem's complicating
So GCC won't follow ANSI or copy memory, so let me see
They try to recompile with visual C But it feels so bloated, without C
So, connect with SLIP, or create a RIP Fuck that, write a function, and shift some bits
And get ready, and use a pattern like proxy MS just settled their lawsuits, expect a levy!
Now this looks like a job for C So everybody, just code in C
Cause we need a little, bit more speed Cause it runs so slowly, without C
Now this looks like a job for C So everybody, just code in C
Cause we need a little, bit more speed Cause it runs so slowly, without C
Little Hallions, MS feelin litigious Embarrassed that users still listen to RMS
They start feelin like ellen feiss 'til someone comes on the television and yells SWITCH!!!
A visionary, beard's lookin' scary Could start a revolution, lives in a bear cave
A rebel, although emacs ain't real fast and there's the fact that I only got one class
And it's a disaster, such a castastrophe for you can see so damn much of my class; meant to use C.
Well I'm back, i-j-k-x-y-z-out-ta-var-names Fix your damn indentifier tune your code and I'm gonna
open it, under vim, maybe pico and variables, no such thing as a member
I'm interesting, the best thing since assembly but not Polluting the namespace with inherits
We're Testing, your functions please Feel the tension, soon as someone commits some C
Here's my webpage, my code is free who'll pay the rent? What, You code with vi?
Now this looks like a job for C So everybody, just code in C
Cause we need a little, bit more speed Cause it runs so slowly, without C
Now this looks like a job for C So everybody, just code in C
Cause we need a little, bit more speed Cause it runs so slowly, without C
An object in
AT&T, you can get your ass kicked worse than those little C++ bastards
And Ruby? just like a static property not even used with KDE and QT
You're not like C, you're too slow, let go It's over, nobody'll code in OO!
Now let's go, -9's the signal I'll be there with a whole list of XM and L
I use SOAP, XPATH with XSL And you know perl's just like coding in symbols
everybody only just codes C so this must mean, some com-pile-ing
but it's just me i'm obfuscating And though I'm not the first king of controversy
And i'm not the worst thing since assembly but I am the worst thing since 86 XFree
do use BASIC and JSP and used it to get myself wealthy
Here's a concept that works twenty million new coders emerge
but no matter how many fish in the sea half of them can't even code C
Now this looks like a job for C So everybody, just code in C
Cause we need a little, bit more speed Cause it runs so slowly, without C
Now this looks like a job for C So everybody, just code in C
Cause we need a little, bit more speed Cause it runs so slowly, without C
Re:C! (Score:4, Funny)
(sorry for the OoO, but else it wouldn't post cause I had to few chars per line)
OoOoOoOoO WRITE IN C
OoOoOoOoO
OoOoOoOoO (sung to The Beatles "Let it Be")
OoOoOoOoO
OoOoOoOoO When I find my code in tons of trouble,
OoOoOoOoO Friends and colleagues come to me,
OoOoOoOoO Speaking words of wisdom:
OoOoOoOoO "Write in C."
OoOoOoOoO
OoOoOoOoO As the deadline fast approaches,
OoOoOoOoO And bugs are all that I can see,
OoOoOoOoO Somewhere, someone whispers"
OoOoOoOoO "Write in C."
OoOoOoOoO
OoOoOoOoO Write in C, write in C,
OoOoOoOoO Write in C, write in C.
OoOoOoOoO LISP is dead and buried,
OoOoOoOoO Write in C.
OoOoOoOoO
OoOoOoOoO I used to write a lot of FORTRAN,
OoOoOoOoO for science it worked flawlessly.
OoOoOoOoO Try using it for graphics!
OoOoOoOoO Write in C.
OoOoOoOoO
OoOoOoOoO If you've just spent nearly 30 hours
OoOoOoOoO Debugging some assembly,
OoOoOoOoO Soon you will be glad to
OoOoOoOoO Write in C.
OoOoOoOoO
OoOoOoOoO Write in C, write in C,
OoOoOoOoO Write In C, yeah, write in C.
OoOoOoOoO Only wimps use BASIC.
OoOoOoOoO Write in C.
OoOoOoOoO
OoOoOoOoO Write in C, write in C,
OoOoOoOoO Write in C, oh, write in C.
OoOoOoOoO Pascal won't quite cut it.
OoOoOoOoO Write in C.
OoOoOoOoO
OoOoOoOoO Guitar Solo
OoOoOoOoO
OoOoOoOoO Write in C, write in C,
OoOoOoOoO Write in C, yeah, write in C.
OoOoOoOoO Don't even mention COBOL.
OoOoOoOoO Write in C.
OoOoOoOoO
OoOoOoOoO And when the screen is fuzzy,
OoOoOoOoO And the editor is bugging me.
OoOoOoOoO I'm sick of ones and zeroes.
OoOoOoOoO Write in C.
OoOoOoOoO
OoOoOoOoO A thousand people people swear that T.P.
OoOoOoOoO Seven is the one for me.
OoOoOoOoO I hate the word PROCEDURE,
OoOoOoOoO Write in C.
OoOoOoOoO
OoOoOoOoO Write in C, write in C,
OoOoOoOoO Write in C, yeah, write in C.
OoOoOoOoO PL1 is 80's,
OoOoOoOoO Write in C.
OoOoOoOoO
OoOoOoOoO Write in C, write in C,
OoOoOoOoO Write in C, yeah, write in C.
OoOoOoOoO The government loves ADA,
OoOoOoOoO Write in C.
Re:C! (Score:4, Funny)
(Last Journal: Monday February 13 2006, @07:11PM)
You fucking geek.
You must be new h... No, wait...
Libraries (Score:5, Insightful)
Re:Libraries (Score:4, Informative)
(http://www.nodomain.org/)
Nice to see a system language (Score:5, Insightful)
Really, kudos to Walter Bright for this little piece. It needn't become popular, if it stays good it's plenty more than enough.
High Hopes (Score:5, Insightful)
(http://www.google.com/ig | Last Journal: Wednesday April 11 2007, @09:55AM)
The only thing about D that bothers me is the inclusion of the Garbage Collector and several other runtime components that occur in the background of your program. I'm not sure I really like that; it sounds a little *too* close to Java, if you get my drift. What I'd really love to see, and what I hope D inspires if not actually implements, is a language with the power of C/C++, but the easier syntax of Java.
D *seems* to be the first step in that direction. I hope it goes further.
Hmmm.... (Score:4, Insightful)
Walter Bright's D is free as in beer but not speech, and there's only the one compiler. Do we really need another language that's a bit like C++?
It's not entirely closed source (Score:4, Informative)
(http://ika.sf.net/)
David Friedman has already had success connecting this frontend to the GCC code generator, in fact: http://home.earthlink.net/~dvdfrdmn/d
Success is Elusive (Score:5, Insightful)
(http://www.coyotegulch.com/)
D is certainly a very interesting language;
However, there are many interesting languages. Over the years, I've explored Prolog, Modula-2/3, Oberon, Haskell, Ocaml, and others. All of those embody some very interesting concepts; in some cases. they may be "better" than mainstream languages.
But the fact remains that no one has ever paid me (or anyone else I know) to write code in Ocaml, Haskel, Oberon, Prolog, or D. For the most part, it is C, C++, and Java that feed my family; upon occasion, clients need Python and Fortran 95. I'd love to be paid for a project in D or Ocaml; I'm not going to bet the farm on that happening.
I wish the world of languages (both human and computer) was more diverse -- but reality suggests a hard road to popularity for original concepts like D. I respect and appreciate Walter Bright's abilities; his Zortech compiler paved the way for C++, and provided excellent optimization. I wish him luck in promoting his vision.
Wishing for this yesterday (Score:4, Interesting)
(http://miyakohouou.dyndns.org/ | Last Journal: Thursday October 07 2004, @01:15AM)
Being able to use pointers if need be is also something really nice about this language that I have found that i really long for in Java at times (not so often to actually use, but oh how much easier it would be to explain the way some things work if pointer wasn't a dirty word in java).
I have not really looked at C# much, but it seems to be freed of many of the complaints about Java (lack of pointers for example), but still has the problem of being a bytecode compiled language running in a VM, and adds the problem of being owned by the company that everyone loves to hate (or at least not trust). AFAIK C# also is not C compatible.
I think these facts leave at least a niche for D, and if it's well done it could soon become one of the DeFacto languages of the future. It seems like development has been going on for quite a while on this, I'm honestly suprised that i've never run across it before, since I have been, mostly out of curiosity, looking for just this. I'm not sure how it will pan out, but I am definitly going to give this new language a shot.
D as Delphi? (Score:3, Funny)
(http://mets.netfan.ne.jp/)
All the C++ programmers are laughing at you... (Score:3, Funny)
(Last Journal: Tuesday September 25, @09:39AM)
Re:All the C++ programmers are laughing at you... (Score:5, Interesting)
So if somebody with those credentials thinks there are things we could do better, maybe we should at least take the time to listen to him....
Obsession with C-like syntax (Score:5, Insightful)
(http://nick.vargish.org/)
There are far better syntax models for an object-oriented programming language than C. I wish people who feel a need to create new languages were willing to base their efforts on a framework more suited to their goals.
Bander (in curmudgeon mode)
D does not have dynamic classloader (Score:5, Insightful)
P, not D. (Score:3, Interesting)
(http://uncensored.citadel.org/ | Last Journal: Sunday November 23 2003, @03:10PM)
Buncha wetbacks.
Re:P, not D. (Score:5, Interesting)
(http://blog.adjective.org/)
See the Wikipedia [wikipedia.org]
Full C compatibility sucks (Score:5, Insightful)
(http://www.krose.org/~krose/)
In sum: C++'s biggest problem is its C legacy. Tear it away, add real type-safety, and you have a language much more powerful and safer than Java.
D WON'T compile C code (Score:5, Informative)
Binary C Compatibility:
D programs can import and link against C code and libraries, providing D with free access to a huge amount of pre-written code. Note, however, that D is not link-compatible with C++, so pure C wrappers are required to access C++ code in D.
Personally, I've been praying for years for a language like this to get adopted. Why is it that I can only use full object oriented programming for web/network applications?! Sure.. I know you can do more than this with Java or C#, but is it really practical?? Usually it's just a massive drain on resources. If you need high performance, then you can't do better than C++. Unfortunately, C++ is a transitional language (just look at it's name..). A pure object oriented, fully compilable language that has no VM is desperately needed. I can't believe it's 2004, and such a thing still hasn't been adopted. I hope D (or something like it catches on.. As much as I loved it when it first came out, I'm sick of wrestling with C++ code.
I was hoping for more C (Score:5, Interesting)
(http://ghazan.hazara.org/)
I'm not sick of C at all. I was hoping for more like ANSI C 04 or something (like ansi c99), more low-level, more control, less objects, less behind-the-scenes crap like garbage collection. The quality of code is always higher with C than C++, unless VERY well programmed with C++, and for that reason alone, C code is reused more despite being less reusable. C++ allows for more cheap right-out-of-college employees, while C gives us quality code that lingers for decades. Think UNIX for a second, and give me an example of something in C++ that has lived so long and so well.
I hate fatter higher-level languages, and we all seem to hate backwards compatibility. If a language has 100 keywords, and you make the next version backwards compatible with 100 more keywords, any sample code can have 200 different keywords in it. Thats making it all tough. C is like RISC, fewer instructions that can be used more creatively, so a smaller amount of code can give you more functionality.
Its all a conspiracy by computer manufacturers. Say you come up with a language that produces binaries slower than Java, all of a sudden a Pentium 3.0GHz with HT is too slow for it, the market keeps pushing for faster and capitalism works. doesnt matter at all that you can run a file/print/mail/application/web server on a 386sx or an ARM MCU 2mm^2 in size running some operating system made in C.
Shenanigans (Score:4, Interesting)
Now before anyone goes on and on about the existence of GC [hp.com] for C/C++, my definition of "real" GC is that it has to be a NON-conservative, compacting, ephemeral collector. Collectors outside this definition have their place: they help you clean up leaks. But they cannot guarantee two features which are crucial to collectors in any modern language: safety and speed.
Safety. You just can't tell the difference between a pointer and an int in C. Thus there are all sorts of ways of hiding pointers as ints in the language, causing memory leaks. Conversely, if you've encoded a pointer in some way, or have allocated hanging off the edge of a struct (a *very* common occurrance -- Objective-C uses this as its basic objejct storage procedure underneath, or used to) the collector may reap your memory before you're done using it. Ungood.
Speed. One of the things that makes HotSpot kewl is that it moves around memory as it does collection; as a result long-lived objects get compacted together, taking advantage of cache loads. This can't be easily done in GC if it's not allowed to fool with your pointers safely.
The point of garbage collection is to be ubiquitous and invisible. This isn't possible in C/C++.
C++'s successor is already here.... (Score:3)
(http://www.robert.to/)
Now before you think I'm nuts, I was skeptical, too. But after programming in C# for the past year, I absolutely love it. The language is perfect. Why design another one? Just make sure good Open implementations get done for it, and leverage all the good design work Microsoft has done!
Google incompatible (Score:4, Funny)
(http://mtobis.googlepages.com/ | Last Journal: Sunday October 08 2006, @03:10PM)
Exactly how are we expected to Google for such things?
Please give your projects distinctive names with more than one character, thanks.
OBJECTIVE-C: APPLE VERSION? (Score:5, Interesting)
(http://www.reanimality.com/)
Nice to see once more another myriad of articles that espouse all sorts of wonderful capabilities while either due to ignorance or purposeful deception leaves Apple's Objective-C compiler out of the comparison list.
No matter. All in due course.
Limbo is the only legitimate successor of C (Score:5, Interesting)
(http://uriel.cat-v.org/)
Limbo was developed in Bell Labs by the the same people that created Unix, C, and Plan 9 [bell-labs.com], and someone once described it as "the language the creators of C would have come up with if they had been give and enormous amount of time to fix and improve C", that is exactly what Limbo is.
Dennis M. Ritchie: The Limbo Programming Language [vitanuova.com]
Brian W. Kernighan: A Descent into Limbo [vitanuova.com]
Together with Inferno [vitanuova.com], Limbo forms the best platform for distributed applications.
Inferno and Limbo were recently released under an open source license and you can download them here:
http://cgi.www.vitanuova.com/cgi-bin/www.vitanuov
Inferno/Limbo are the only hope for some sanity in the software industry!
Best wishes
uriel
Inaccurate comparison sheet (Score:3, Informative)
(http://www.relate-institute.org/)
Screw More Languages (Score:4, Insightful)
(http://slashdot.org/ | Last Journal: Wednesday October 23 2002, @05:38PM)
After Java and C#, why do we need yet another rendition of "what C should have been"?
As far as I'm concerned the standards for C (89,99) are a reasonable place for this language given all its history.
More than anything else we need more standardization of libraries, in the same vein as libc or the STL, but updated to include almost 20 years worth of experience with all kinds of drivers.
Programmers don't need a new language as much as they need powerful, open, standardized, updated libraries.
Re:What about Objective C? (Score:4, Insightful)
I agree that the world doesn't need yet another extended C. If you're going to build a modern buzzword-compliant language, build it from scratch!
Considering the era C came from, it's a fundamentally good procedural language. Not perfect. Probably not even great. Just good.
In particular, its terse syntax and heavy reliance on operators instead of keywords makes C code dense and hard to read. You can write readable C code, but it takes a conscious effort, some documenting, and some discipline *not* to use every clever coding trick that pops into your mind. (I've read one opinion that C really stands for Clever, because it encourages you to do all sorts of excessively clever things that you'll later regret.)
The reason why the whole software industry seems hell-bent on created mutated versions of C, several decades later, is beyond my understanding.
They should have a form for ppl with a C successor (Score:3, Interesting)
Probably the language's greatest goal is the elimination of archaic and/or needlessly complicated features. For instance, D does away completely with the C preprocessor, relying instead on built-in versioning capabilities. Forward declarations are out the window on the same token. Also, it replaces the often-complicated multiple inheritance of C++ with Java's single inheritance and interfaces.
Thank you very much, but we can already write a program without using the features we don't like. If that's a primary goal of your language (as opposed to side effect of offering some advanced features like GC), I think I'll pass.
Besides, multiple inheritence is useful and meaningful when your object really both an InputStream and an OutputStream. Duplicating default code or having a A where every method calls B->method is just silly.
As for C preprocessor, it can be used to do enormous work in a page of code. Like auto-generating stubs for hundred functions that get a mutex, call the original function which is not thread safe, release the mutex and return the original function's results. There are solutions for each specific use, for example Aspect-based programming. But there is still a need for a tool that can more safely extend language's grammer without writting a complete parser first. Until then, let's just use the only one available, but only when templates, aspects and such don't solve the problem. In fact, I want JPP, especially for #ifdef.
Nice Comparison (Score:4, Interesting)
Nice feature comparison, except for the fact that it's wrong. Perhaps the authors of D would do better if they actually learned C++ first? Designing a new language when you're clueless is the first sign of disaster. Look at Java.
Resizeable arrays: D Yes, C++ No
BZZT.
Arrays of bits: D Yes, C++ No
BZZT.
Built-in strings: D Yes, C++ No
BZZT.
Array slicing: D Yes, C++ No
BZZT.
Array bounds checking: D Yes, C++ No
BZZT.
Associative arrays: D Yes, C++ No
It's called a map.
Inner classes: D Yes, C++ No
BZZT (perhaps they meant specifically the automatic parent resolution?)
typeof: D Yes, C++ No
BZZT.
foreach: D Yes, C++ No
BZZT.
Complex and Imaginary: D Yes, C++ No
BZZT.
Struct member alignment control: D Yes, C++ No
Give me a break, every C++ compiler supports this. It's just implementation defined.
Now go look at D's page on Design By Contract in C++: here [digitalmars.com]
Notice that any C++ programmer can come up with a far better implementation than theirs using child class destructors and inlining. In fact, Stroustrup even put one in his book in case you're having trouble getting the brain in gear.
The comparison list combines cluelessness and sophistry ("C++ doesn't have this feature! It's in the STL, not the language" - oh please) to try to promote their own half-baked language.
Conclusion:
Yet another half-baked useless language.
The problem with C++ (Score:5, Informative)
(http://www.animats.com)
C++ itself is undergoing a revision. But the plans for it aren't that good.
The big problem with the C++ committee is that most of the members don't want to admit the language has major problems. Neither does Strostrup, who has written that only minor corrections are needed. If that was really true, we wouldn't need all those variants on C++ (Java, D, C#, Objective-C, Managed C++, etc.)
The committee is dominated by people who like doing cool things with templates. Most of the attention is focused on new features for extending the language via templates. It's possible to coerce the C++ template system into running programs at compile time (see Blitz [oonumerics.org]). Painfully. LISP went down this dead end, where the language was taken over by people who wanted to extend the language with cool macros. (See the MIT Loop Macro. [cmu.edu]) We all know what happened to LISP.
What isn't happening is any serious attempt to make C++ a safer language. C++ is the the only major language that provides abstraction without memory safety. That's why it causes so much trouble. C++ objects must be handled very carefully, or they break the memory model. This usually results in bad pointers or buffer overflows. Java, etc. are protected against that. This is the basic reason that writing C++ is hard.
It's not fundamentally necessary to give up performance for memory safety. I've written a note on "strict mode" for C++ [animats.com], an attempt to deal with the problem. I'm proposing reference counts with compile-time optimization, rather than garbage collection. The model is close to that of Perl's runtime, which handles this well.
Garbage collection doesn't really fit well to a language with destructors, because the destructors are called at more or less random times. Microsoft's Managed C++ does that, and the semantics of destructors are painful. With reference counts, destructor behavior is repeatable and predictable, so you can allocate resources (open files, windows) in constructors and have things work. The main problem with reference counts is overhead, but with compiler optimization support and a way to take a safe non-reference-counted pointer from a reference counted object, you can get the overhead way down and reference count updates out of almost all inner loops.
C++ itself isn't that bad. The language could be fixed. But I don't see it happening. Microsoft has gone off in a different direction with C#. SGI, HP, DEC, Bell Labs, SCO, and Sun are defunct or in no position to drive standards any more.
What C++ needs is some hardass in a position to slam a fist on the table and say "Fix it so our software doesn't crash all the time". It doesn't have one.
Going down the chart point by point... (Score:3, Informative)
Function literals This is excellent. Function literals would make C++ a much better language. The STL cries out for them. While Java doesn't have function literals, it has something pretty close -- anonymous nested classes. But C++ has nothing very close. The best you can do is something like the Boost lamba library, which while impressive, it quite horrible. This feature makes D pretty interesting to me.
I'd be interested to know what D has in terms of standard libraries -- something akin to the STL..?
Dynamic closures Not sure exactly what this is, but I imagine it makes D into a fully-functional language. Sounds great! It makes me even more interested.
Resizeable arrays Well, I don't think this claim stands up -- that C++ doesn't have resizeable arrays. After all, since D is a garbage-collected language, I'm guessing its arrays are on the heap, not the stack. C++ has resizeable heap arrays -- vector, etc.
Arrays of bits Again, I take issue with C++ not having these. Check out Boost::dynamic_bitset.
Built-in strings Once again -- no way. C++ certainly has built-in strings, in any meaningful sense of the word -- std::string.
Array slicing I'd be intersted to see an example of how D's array slicing compares to C++'s interator-based programming. I'm not sure what's being talked about here, exactly.
Array bounds checking There's really no meaningful way you can say C++ doesn't have array bounds checking. Come on! What C++ has, which might be much better than D, is switchable array bounds checking. You don't _have_ to check array bounds (e.g. for release builds), but it's trivial to add if you want it.
Associative arrays Wrong! C++ certainly has associative arrays. They're quite excellent. See std::map and std::multimap. And of course, you can build any special sort of associative array you want -- say, a hash.
This chart is completely biased against C++ -- quite unrealistic. Why not just stick to the _real_ benefits D has over C++, and not kick up alot of FUD? It only serves to make people like me (rightfully) skeptical.
Strong typedefs OK, fine -- typedefs aren't strong in C++. But if you want something to be strong, make it a class/struct/enum. Why do typedef's need to be strong? What's really being said here is that D lacks a "type alias", which is what a C++ typedef is -- just a shorthand for another type. Does D have that?
String switches Just syntactic sugar, although I admit it might be nice syntactic sugar.
Multiple Inheritance An unfortunate deficiency of D. I find multiple inheritance to be quite useful. But D can't have everything -- that's OK. If this were D's only deficiency, it wouldn't be fatal to me, especially because...
Interfaces ... interfaces get you _most_ of what's good about multiple inheritance. But not all.
Dynamic class loading This is a nice thing about Java. Too bad D doesn't have it (but hardly a fatal problem, for me).
Inner classes Seems like D's functional programming capabilities trump the lack of inner classes...
Covariant return types Ummm -- what are these? C++ has them, so I must know what they are....
Properties Syntactic sugar...?
Inline assembler
Direct access to hardware
Direct native code gen Excellent. However, one reason I really like C++ is that there are toolchains for a huge variety of hardware. If there were a gcc front-end for D, that would go a long way to addressing this issue...
Lightweight objects Meaning, stack-allocated objects?
Explicit memory allocation control Does this mean D has _real_ destructors (unlike Java's pseudo-d
Against the grain... (Score:3, Interesting)
With C#'s generics being somewhat gimped and users working on a functional library for D that is similar to STL but easier to use, D is really shaping up nicely as a future development platform and a bleeding-edge language, kind of like what C++ is today with template metaprogramming. I tend to gravitate towards the looser, more esoteric languages like Perl and C++ because of the steep learning curve -- who doesn't enjoy a challenge?
So don't bitch about how it sucks because it isn't C. It's amazing C is still kicking.
Re:the most interesting part of that table (Score:4, Informative)
(http://trypticon.org/)
Troll away, maybe people will start paying attention when the dozens of useful Java libraries are available from C#. *shrug*
What I really need right now though is a nice, clean looking language with access to well-thought-out libraries for image loading/saving and virtual filesystem access. I can't find any of this stuff in a portable form other than on Java, unfortunately. :-(