The D Language Progresses
xsniper writes "D made its debut here on Slashdot in August 2001. Since then, many new features have been implemented, to include: operator overloading and slew of additional functionalities. It was featured as a cover story for the February 2002 issue of Dr. Dobb's Journal, and has been ported to the UNIX environment. I encourage programmers to revisit the specs to see how Walter Bright has addressed their concerns. A copy of the compiler is also available for testing. I'm sure some would be surprised by the achievements made thus far."
What is D?
D is a general purpose systems and applications programming language. It is a higher level language than C++, but retains the ability to write high performance code and interface directly with the operating system API's and with hardware. D is well suited to writing medium to large scale million line programs with teams of developers. D is easy to learn, provides many capabilities to aid the programmer, and is well suited to aggressive compiler optimization technology.
D is not a scripting language, nor an interpreted language. It doesn't come with a VM, a religion, or an overriding philosophy. It's a practical language for practical programmers who need to get the job done quickly, reliably, and leave behind maintainable, easy to understand code.
D is the culmination of decades of experience implementing compilers for many diverse languages, and attempting to construct large projects using those languages. D draws inspiration from those other languages (most especially C++) and tempers it with experience and real world practicality.
Why D?
Why, indeed. Who needs another programming language?
The software industry has come a long way since the C language was invented. Many new concepts were added to the language with C++, but backwards compatibility with C was maintained, including compatibility with nearly all the weaknesses of the original design. There have been many attempts to fix those weaknesses, but the compatibility issue frustrates it. Meanwhile, both C and C++ undergo a constant accretion of new features. These new features must be carefully fitted into the existing structure without requiring rewriting old code. The end result is very complicated - the C standard is nearly 500 pages, and the C++ standard is about 750 pages! The reality of the C++ compiler business is that few compilers effectively implement the entire standard.
C++ programmers tend to program in particular islands of the language, i.e. getting very proficient using certain features while avoiding other feature sets. While the code is portable from compiler to compiler, it can be hard to port it from programmer to programmer. A great strength of C++ is that it can support many radically different styles of programming - but in long term use, the overlapping and contradictory styles are a hindrance.
It's frustrating that such a powerful language does not do basic things like resizing arrays and concatenating strings. Yes, C++ does provide the meta programming ability to implement resizable arrays and strings like the vector type in the STL. Such fundamental features, however, ought to be part of the language. Can the power and capability of C++ be extracted, redesigned, and recast into a language that is simple, orthogonal, and practical? Can it all be put into a package that is easy for compiler writers to correctly implement, and which enables compilers to efficiently generate aggressively optimized code?
Modern compiler technology has progressed to the point where language features for the purpose of compensating for primitive compiler technology can be omitted. (An example of this would be the 'register' keyword in C, a more subtle example is the macro preprocessor in C.) We can rely on modern compiler optimization technology to not need language features necessary to get acceptable code quality out of primitive compilers.
D aims to reduce software development costs by at least 10% by adding in proven productivity enhancing features and by adjusting language features so that common, time-consuming bugs are eliminated from the start.
I thought the next one was supposed to be called P. First came B, then came C, in the order BCPL, which was an older language.
Before C came B, before B came A, and after C came C++, ++ meaning +1, or in other words, D. So if the next language is D does C++ become C 1/2? or C.5? ...someone had to sacrifice the karma to say it
SecondPageMedia - Wha
The next one is obviously DD.
The next language should be named C+=2!
autopr0n is like, down and stuff.
D LANGUAGE RELEASED
"The D Language: It's C! With Implants!"
...oOOo..'(_)'..oOOo...
If not, it's obsolete already.
I've already got the grades for it.
As soon as they get to F, which I am intimately familiar with, I might pick it up..
And of course, generics.
Now all it needs is some community support and ECMA goodness. I think it has a good chance of being widely used.
Aside from the garbage collector and foreward declarations..
...damn ...smells like Object Pascal (Delphi) to me..except with "{" instead of "begin"
1. interfaces instead of multiple inheritance
2. Cross platform (somewhat at the moment)
3. compiled and the ability to go down to assembly
4. use of try..finally and try..except exception handling.
gdc (GNU D Compiler) sounds too much like GDB
"We have got to make Stan understand the importance of voting, because he'll definitely vote for our guy." - South Park
"It doesn't come with a VM, a religion, or an overriding philosophy."
Not a religion? Neither was C. Neither was Java. Neither was C++. Neither was vi. Neither was Emacs. I think we all know where this is going and that that statement should be considered pure FUD. And a new language covered in FUD is not a good thing, even if it look like a good thing(tm).
I took a look at the sample code on the page and have too say it looks alot like Java too me. If it can do everything it says it can then cool, maybe I'll play around with it. But untill some large corperation adopts it and makes it a standard I don't think I'll have the motivation to really learn it.
now where are the library functions?
One of the changes since the last time we heard about D is the addition of floats and doubles (32 bit and 64 bit floating-point types, respectively) in addition to the "extended" type (as much precision as available). This is absolutely a Good Thing -- extra precision can be just as bad as insufficient precision, and adding these types allows people to ensure that they're using the right precision.
It would have been really nice to see the same thing for the math library functions; as it is, the only sin function is an extended -> extended function. IEEE doesn't require determinism on transcendental functions the way it does for arithmetic functions (which, I'm guessing, is why it isn't provided here), but there are times when it would be quite helpful.
Remember, there are times when getting the right wrong answer is more important than getting the right answer.
Tarsnap: Online backups for the truly paranoid
EMACS not a religion?
:->
It has most, if not all, the qualities of a religion.
Legend has it that C was named after the grade that Brian Kerighan and Dennis Ritchie got for it after they submitted an early spec as a project for a programming languages course.
Is it the same for the 'D' language, I wonder? =)
The reason why C++ is so popular nowadays for numerical, engineering, graphics, and scientific applications is that it supports value classes: classes allocated on the stack, passed around by copying, and represented without any additional overhead. They are used for things like points, points with small coordinate ranges, vectors, 3D rotation matrixes, rectangles, and lots of other types. I don't believe any systems or applications language for which efficiency is a consideration can do without them.
Why the creators of D think that providing value classes is a problem, I don't understand. Sure, C++ fell all over itself with initializers, but lots of other languages have managed just fine. Pascal has value classes, and so does C#. JavaGrande recognized the lack of value classes as one of the biggest deficiencies in the Java language.
And it's not something a compiler can just optimize automatically, no matter how good it is: the use of value classes has user visible effects on interfaces and data structures.
so it's like C++ but without the stuff that gives compiler writers keyboard indentations on their foreheads.
must... stay... awake...
I don't see what adding Javascript support to the language will help.
Hello World in "porn":
10. Jizz "Legs Spread!";
Maybe off topic, but 'yet another language'? Where c++ may do too much: Templates Operator Overloading Go back to a simpler time... then giveth objective C! It has the 'named' parameters (in its own way), arbitrary message handling (methods to everybody else), hell even a traceback! Not even java has operator overloading, there maybe a reason.... (reduce ambiguity?) We need simpler languages, not progressively 'general purpose' languages... a 'CISC' language vs. 'RISC' lange... Objective C is just that... simple.
What we see depends on mainly what we look for. -- John Lubbock Now search for that bug slave!
A
B
C
[D]
E
F
Almost there! Only two more innovations and the developers will finally have run out of alphabetic excuse for their shitty software...oh wait.
Every time someone comes up with a new GC'ed language that has C-ish syntax and a VM someone has to say it's a Java rip-off. Look at the specs, understand the differences, give it a rest.
TeleSoft/Alsys/Aonix have had, for quite some time, a language called D that is used to describe the operation of events and manage dialogs (D = dialog) in TeleUSE. Its been around for 10 years, so so.
The dogcow says "Moof!"
A runtime is a binary library that exports certain functions. The Win32 and glibc runtimes are a couple that Slashbots are probably somewhat familiar with. They have specialized routines that facilitate some kind action that the language itself does not directly support.
A VM is a completely different beast. It is a complete runtime environment for your program. Whereas a program that uses a runtime is typically compiled into machine code, a program that uses a VM is typically compiled at runtime from source (Perl) or parsed into memory from bytecode (Java).
It has become fashionable to call runtimes "VMs", especially in the Unix world where multiple APIs are supported on the same kernel, but it is a misnomer. (You'd expect the pedantry that is so prominent in the Unix culture to correct this, but I digress.)
I have been pwned because my
EMACS= Emacs Makes A Computer run Slow. Didn't they teach you that in seminary!
VIM is the one true religion grrr editor because its just an editor and does not conflict with the way unix does things.
May you burn in the utmost pits of hell for your statement of such blashpemic purporations.
http://saveie6.com/
Wow. It must be exciting to have an NFL coach as a neighbor!
Unfortunately, his original D compiler was written in BASIC, which he ran interpreted, so compilation was slow. In order to speed up the interpreter, he used the sort of "source code compression" that is illustrated at Chuck's Power Koding - removing any unnecessary spaces, using long source lines and having as few actual lines as possible.
(This kind of ancient interpreter didn't use byte codes - if you looped ten times, you'd parse the loop's source code ten times!)
We suggested that he rewrite his D compiler in D so he could get it to compile faster. He decided to do that, and worked really hard at it but got it working after some time.
As a complication he improved the language, but it meant that his old compiler wouldn't compile the newer kind of D code. I think what he did was make two revisions of the D-written compiler, one written in the old syntax that would understand the new, but could be compiled by the BASIC version and then an update that was written in the new D that could compile itself.
It was a sort of mix of Pascal but with lots of convenient stuff like BASIC string handling mixed in. I don't think the language would have made any computer scientists happy - D was designed to suit Mike's personal style.
He used it at first to write an Adventure-style game (a text adventure) that he and another friend designed.
Later he wrote a text-adventure compiler, where he could write a specification file for a text adventure, process it, and an executable file for a text adventure would be generated.
He didn't have to get a real summer job because he was selling these generated games to game software publishers!
Mike was an amazing programmer. He taught me a lot of what I knew about C and x86 assembly early on.
This was all on 640 kb 8088 DOS PC's that were outfitted with whizzy 10 MB hard drives. The students in the computational physics lab were expected to use the hard drives only during class, and to store their personal files on floppy when we weren't actively working at the PC's.
So his D language compiler would fit on a floppy. The old 5 1/4" inch kind, that really flopped. I think they stored 360kb.
I wonder whether we would all be better off if programmers designed their own personal languages just to suit their own personal styles. Yes, there would be portability problems but wouldn't we be more productive?
I got my own chance to hack a whacky compiler. This was a team effort though and I was just a contributor. Star Sapphire Common Lisp manages to run a complete common lisp environment with MicroEmacs on a 640kb DOS 8088 PC.
The way it does that is by swapping to an 8 MB backing store file. But the 8088 doesn't have an MMU, you say? That's right - we operated the virtual memory manually, by writing C code that would explicitly get or put each lisp cons from or into the VM system with a function call.
It made it ... interesting ... to operate on complicated data structures. I designed the implementation of the lisp scoping rules, among other things.
Oh yeah, and I was the source code control system and project manager. We didn't have a network - networks were way too expensive in 1986. What I did was wait until late when all the other programmers went home, copy the changes off all their machines onto floppy, integrate them on one machine and then copy the new release onto everyone's PC.
Kids these days. Don't know when ya got it good.
Request your free CD of my piano music.
"Not having the right programming language" is a poor excuse.
.NET is trying to mimick the TAO, but there can be only one and it will be evident, through their failures, that they lack the TAO.
It isn't the programming language, it's all the shortcomings of developers that cause software to be poor. Only some will receive the TAO, it is upto those few to write it down into software. Linux has the TAO. GNU HURD is waiting for the TAO. Microsoft's
In freedom, you don't find the TAO, the TAO finds you!
As I recall...
Dilbert: No! C is not the grade of the project. It's the programming language I'll use on it.
PHB: (After a few seconds) OK. But why don't you program at least with B?
What's the purpose of creating entirely new languages? Is a new language even entirely new, or is it an evolution of older languages incorporating new concepts and methodologies? Or is the creation of a new language just a way of leaving a mark? Or, even worse, is it a manifestation of that damnable desire to start from scratch every time? (I'm afflicted by it... most coders I know are afflicted by it...)
Here's what I'd like to know, in my limited knowledge of languages: What languages out there are truly modular? Are there any languages that encompass basic logic principles and which are then able to be augmented by blackboxed modules? So, if you had a language that needed string concatenation, you could whip up a string concatenation module that would then become part of the language.
Now, I'm walking a semantic line here, because you can presumably do all that by writing header files, includes, classes, etc. that contain new logic within the structure of the language. But what I mean is a language that by its nature is abstracted and modular, even to the point where the syntax of, say, control structures could be modified in a module?
And, if the answer to my question is "Well, hell, you can do that in C!" then why do we need to bother writing a new language? Is it just to keep things fresh and interesting?
It just seems that with all the many languages I've learned and used, there's very little that I can think of that one language can do that another language can't. Where doing something in one language is harder than in another because the structure of the language makes it awkward, maybe that points to a language that needs to be made obsolete.
I guess the root question I'm asking is: Are there any truly novel languages out there, or are they all just variations on a common theme, with shared shortcomings and much duplication of effort?
Be gentle. :)
Somewhat. At least they don't allow niggers or faggots to live here. Bungi = Bunghole + nigger. Queer.
I don't know much about D, but if it supports structs, isn't that essentially the same thing as a value class (save the instance methods and such)?
I personally prefer passing pointers instead of having to remember if the object is being copied behind the scenes or is the original object because I used an ampersand (pass by reference). If I wanted to make a copy, I'd call the "copy" instance method and poof, one has a copy. If I'm worried about my objects being changed, then just make the object immutable.
But that's just me,
F-bacher
James Tiberius Kirk: "Spock, the women on your planet are logical. No other planet in the galaxy can make that claim."
C++, ++ meaning +1, or in other words, D
Since when does the ++ operator increment the variable name and not its value? Duh?
--Jim
So there!
(Goingware? Hey, I remember you from BeOS days.) I'm guessing this is the Mike Roberts of TADS? I bought that program when it was shareware--and never really got around to finishing the text adventure I wanted to write with it, although that wasn't the language's fault. It was really well-designed.
Implementing things in Ruby is really fast, and what makes it fast are the objects and blocks. I really don't understand why so few new languages have efficient block-handling (to allow nice and easy-to-write visitor partterns and things like that).
I wrote a small application server few my website (with it's own HTTP implementation and all) initially in about 10 hours while just learning Ruby. The downside is that Ruby is a bit slow.
Well, fortunately this is free world, and I can still dream of doing a compiler for a Ruby-style language in the future.
Software should be free as in speech, but if we also get some free beer, all the better.
called structs.
For one, they keep decimal (which binary floating point can't represent). Then they mix bases on the hexadecimal floating point, with mantissa in hex, and a binary exponent expressed in decimal. I guess they couldn't find a way to put in balanced ternary.
"Score a touchdown 1,2,3?"
Is that really the Eagles fight song?
Was it selected in a contest among eastern Pennsylvania elementary schools?
C++ needs an overhaul; the cruft has gotten too thick. But, sadly, D isn't it.
Walter Bright is a good compiler writer; he did the Zortech C++ compiler, years ago. So D is not a paper language.
- No multiple inheritance
- All objects accessed by reference on the heap
- Not source-compatible with C
- No namespaces
- All member functions are virtual (unless the compiler figures out they don't have to be)
So basically, we'll still need C++ for a bunch of things. At least it's got templates, I guess.Also, it's a bit funny that the preprocessor is mentioned twice under "Features to Drop." This guy must really hate the preprocessor. :)
Can someone post some example code of D, like a Hello World program?
This post was generated by a Cadre of Uber Monkeys for Monkey-Man2000 (603495).
well, the d is tenacious of course, the ragekage show!
After C/C++ give me C# before D.
check out this link for the E homepage: http://wouter.fov120.com/e/index.html
dsarn I wish I had the moderator points to spend, That was funny...
OTOH, maybe I should connect with other people rather than by geeks....
LedgerSMB: Open source Accounting/ERP
Hmmm, last time I checked out D, operator overloading was deliberately left out on grounds of being "evil" and "used only for vectors, strings and smart pointers anyway".
Goes to show that some people actually _DO_ learn.
REDMOND, WA 10:39PM PST - Microsoft Corp is pleased to announce our new state of the art language, D# . Additionaly, Microsoft is anouncing our own VM which will run regular D code plus our own set of WDE (Windows D Extensions) which will improve the usability of D and decrease development times. Microsoft corp would like to stress that there will be a D-VM for other platforms soon (within 20-30 years).
No, Eagles' fans can only count to three.
B is all you should need to write a good app. C++ with that newfangled OOP, but that was too hard so now they have this 'D'... whatever happened to pascal anyways?
Why back in my day, I would write b++ code on my 25lb laptop while trudging through the snow on my way to the coal mine (uphill both ways). And I thought I had it easy! My dad used to 'program' with oscilloscopes and huge racks of patch cables (actually thats true) when punch cards came out he thought that was the best method that would be for a while... All you young curmudgeons with your D this and visual that and open source hullabaloo. Twenty three skidoo to all of you!
I haven't seen any development in a while, but Connective C++ is a rather interesting language, reminds be of VeriLog sorta, but compatible with C and C++ source (being a C++ extension)
check it out
"I would say that 99 per cent of what my father has written about his own life is false." - L. Ron Hubbard Jr.
Oh yeah VIM does not conflict with *nix standards, but since I am with GNU/Linux (GNU's _not_ UNIX) I prefer a
- logical,
- easy-to-learn,
- beautiful and
- powerful
editor. If I just want to type some text into a file I can still useand -WOW!- I don't even need to know some dumb *beeeeep* commands no one is able to remember.Forgot a command in EMACS? [F10] and all your problems vanish. Because EMACS has a menu (WOAH! must sound frightening for you!)
Btw RMS rulez. And sorry for the bad English.
"Karma: Bad (mostly affected by moderation done to your comments)" Mods@/. != geek?
It would be wonderful to have a Ruby compiler...
But I'm not sure it's possible to compile a language as dynamic as Ruby where you can:
- add methods to objects or classes at runtime
- Do things like conditional inheritance or conditional mixins
- mixin modules to objects or classes at runtime (extend)
Ruby is extremely dynamic... I'm not sure how you compile something like that down to static object code...
By submitting english to ECMA?
After all, a language can't be a "standard" without ECMA! No Sir! Just look at where Perl would be without ECMA backing!
I think it might be a tad premature to seek out D "standards" when D only comes from one location...
Eh. The way I see "D" is this:
C++ was alone for the night when Eiffel stopped by, noticing C++ was by itself, "just for a few drinks". Well, things started to get out of hand and just then Java walks in. Tense moment. Awkward silence. But to C++'s relief, Java joins in.
Well, as luck would have it, Java gets pregnant but the three of them have found they really enjoy each other's company, they balance each other out in certain areas, so they buck convention and all move in together and raise the kid under an "alternative" family, and hey, there's nothing wrong with that. They call their kid D, and while he's still young and has a lot to learn, he's got features, interfaces, delegates and assertions built in. He might just turn out all right after all.
Watch for the movie, starring Richard Gere as C++ (he's older and has a rumored past, but he'll give the rest of the case a few pointers), Catherine Zeta Jones as Java, and Renee Zellweger as Eiffel (she's hot, but underappreciated). Lil' Bow Wow will guest star as D.
I don't see any features that would enable the use of functional programming techniques. I don't see any mention of function pointers or overloading (), so how does he expect to write, for example, a general sorting function? (i.e. Sort array a of strings case insensitively)
...will be called D flat? No, wait, they already have that since C# is the same as Db.
http://saveie6.com/
- C++ programmers tend to program in particular islands of the language, i.e. getting very proficient using certain features while avoiding other feature sets.
- A great strength of C++ is that it can support many radically different styles of programming - but in long term use, the overlapping and contradictory styles are a hindrance.
- It doesn't come with a VM, a religion, or an overriding philosophy.
- D aims to reduce software development costs by at least 10% by adding in proven productivity enhancing features and by adjusting language features so that common, time-consuming bugs are eliminated from the start.
The first two I am not able to counter at all - I simply don't have the experience. I don't know if he does, either, so I don't buy it. The last... why 10%? Why not 11%, 15%, or 11.38%? It just seems silly.As for philosophy, every language has a philosophy. D adheres to the object oriented paradigm - that's a philosophy. Beyond that, it seems to me that it tries to attain simplicity in use while trying to force good programming standards. That's most definitely a philosopy.
I've read a bit about the language itself, and I am interested in the unittest and contracts in particular. Those features would be great additions to any language, I think.
But I don't see a need for the language itself. It seems like Walter Bright looked at the current OO languages and decided they weren't adequate for his needs. So he designed and implemented his own. This is commendable, but I don't see the result as being different enough from the other available OO languages to make any sort of switch or adoption advantageous.
I think that languages get adopted widely when they offer something that other languages can't do, or do very poorly. Fortran allowed an abstraction higher than assembley. C++ allowed object oriented design using notation many people were familiar with and at high speeds. Perl allowed easy text manipulation. Java allowed platform independence (yeah, yeah, with the JVM, but that I think is what sold it). All of the feature additions and deletions are nice (well, not all of them, I like some of the things he decided against including), but I don't think they add up to something that people really need. And if you can't produce that, I don't think the language is going to catch on.
Modern languages like Java and C# support the use of reflection, where classes can access what they are made of which can sometimes greatly simplfy design. Unf. I did not see any mention of reflection on the website...
Now if D had templates AND reflection, that would be unique and awesome! Haven't seen any language pull that one off (I think C# has it in the works). IMHO they are both necessary to develop truly elegant code.
ralvek
Yet another way to write and manipulate ints, floats, struct, and classes.
Why don't people put as much effort into designing standardized interfaces for networking, threading, forking, database access, distributed logic, graphics, etc.
He goes on and on about how we need unified syntaxes for unit testing, inline assembly, assertions, etc., but is curiously silent with regard to the above issues.
What are the killer apps? Apache? OpenLDAP? OpenOffice? Mozilla? Konqueror? Photoshop? Gimp? Quake? Neverwinter Nights? Crystal Reports? Gaim?
Now with that list in mind, how does D make anyone's life simpler? Need a TCP/IP socket? Sure! Just use the POSIX one...unless you're on Windows...or coding for BeOS... What about talking to a database? Well there's ODBC implementation #1, ODBC implementation #2, native database-specific API #1, etc. Well at least there's graphics right? OpenGL all the way...except when you need DirectX...or the framebuffer interface... And for GUI libraries, we have GTK+, Qt, FLTK, MFC, XUL, etc. Along those lines, do you use Gnome or KDE for your object model? Do I write to libxml or use some COM wrapper for MSXML3.DOMDocument?
What good is uniformity in a complex type when anything I want to do with the language that implements it requires an unending list of non-D libraries that throw uniformity out of the window? Please explain to me how my life is enriched by this language? Please explain how solves more problems than it creates?
Sure Java, Python, et al have their share of problems, but at least I can open a socket or a filehandle without doing market research on libraries first. At least code written in those languages is readable by someone who knows the language. Database calls look the same no matter your operating system. That's what I want. Not just some new and exciting method for representing imaginary numbers.
And while we're talking about data types, he writes at length about how ints, longs, floats, etc. are all well-defined sizes unlike in C even though saying int16, int32, and int64 would be much easier to read and helpful. In addition, while the other types are well-defined and char is well-defined as a single 8-bit byte, wchar is sometimes 2 bytes, sometimes 4 bytes, and could be something else in the future depending on the wind. Ask the i18n coders about their experiences with wchar_t. Most end up using an avalanche of #ifdefs or just sidestep it altogether with their own array of bytes. Why? Because sometimes they're using UTF-16 and other times it is UCS4. You need to know how big the character type is! It's not something you leave up in the air! char16...char32... Are these too much to ask for?
I hope to god that no one actually adopts D for real work in the near future. If they do, they will run into the limitations I mentioned above and figure out some hack to get it to work. Hack begets hack begets hack and you are left with another bloated language lacking uniformity that people will bitch about on tech discussion boards. And then some person will say, "Hey! I've got this new language that fixes all of those inconsistencies with D that we all hate."
1. Wash
2. Rinse
3. Repeat
- I don't need to go outside, my CRT tan'll do me just fine.
Just an observation:
C to C++ took 16 years.
C++ to C# took 14 years.
C++ to D took 16 years.
C to C++ and C++ to D are equal.
Conclusion: C# sharp won't suceed. D will.
And right now, any new binaries which I need to write, I do them in Ada95. If D is somehow better than Ada then I will start using it when possible. Obviously if you are doing something which relies on c++ libs then just stick with that, but if you have the luxury of a new project, then hey what the heck use the new D compiler. Why not, anyways.
Clickety Click
There are some basic system facilities that have to be secure. This includes SSH for example.
Because of pointers and lack of bounds-checking, C++ is not it. Java doesn't interface with low-level system facilities very well. If this newfangled D language does all that, this may be the security Holy Grail.
There's an axiom at Bell Labs (where C and C++ came from, for those who don't know):
Some languages are designed to solve a problem. Others are designed to prove a point.
You cannot apply a technological solution to a sociological problem. (Edwards' Law)
Hi, :)
did i get the point? It's a slick C++ (without C) and some Ada-like techniques?
Did really sound nice to me, hope, it's going to be used in OSS development heavily.
(gcc will provide a backend soon, i think
When a silver bulet for the next decade comes, consider using Ook# to keep yourself employed!
You're obviously stupid - the Browns already beat the titans once this year
You always can use C, or Objective-C if you want to program object-oriented.
You can use C++ if you think, programming C would be to easy. And you can use Java if you think, C would be too fast. :)
If you want to write a really big and complex application, you better add support for a scripting language (as Guile, Ruby, Perl or Lua).
And finally if you don't like that C doesn't has GC, just use some GC-lib.
- C source code compatibility - Yes. Wow, gosh.
- Link compatibility with C++ - No, can be linked to C++ Builder modules
- The C preprocessor - Yes
- Multiple inheritance (ie Full not Java-style) - Yes
- Namespaces (use modules instead) - Yup
- Tag name space - Yup
- Forward declarations (compiler searches whole module for name definition) - Nope
- Include files - Mostly 'Yes' but a little bit 'No'. Delphi does allow includes, but it doesn't
use them in the C/C++ sense; it imports binary symbol tables like D. Score
1/2.
- Creating object instances on the stack as opposed to the heap - Yes, dropped when Turbo Pascal
became Delphi
- Trigraphs and digraphs - Yes
- Preprocessor - Yes
- Non-virtual member functions - No, but the Delphi syntax copes better than C++ with the cited
problem (no error messages when you fail to supply a virtual base class)
by using an extra keyword - override - to signal programmer intent. Score 1/2.
- Bit fields of arbitrary size - Yes
- Support for 16 bit computers - I suppose 'No' since Delphi 1 was 16-bit.
- Mutual dependence of compiler passes - I think 'Yes', but I am out of my depth
- Compiler complexity - Probably Yes - deduced from Object Pascal's fast compilation. Besides everything
is less complex than C++.
- Distinction between . and
->. Yes - uses only '.' operator.
So 13/17. Better offers?The kind of syntax that allows for "if", "while", "else", and so on, not followed by braces, where
if (very-long-condition);
{
do-stuff;
}
always executes do-stuff.
The kind of syntax where 013 is not equal to 13.
The kind of syntax where
if (a = 1)
{
return true;
}
always returns true.
Those stupid errors need a lot of attention to be avoided as a programmer, and are not detected until the program misbehaves or fails the unit testing, wasting a lot of programmer time.
Such syntaxic pitfalls are a legacy from C (or most probably even before). It should not be in any language that claims to be modern !
Most dynalinking codes allow libraries to cause an initializer function to be run when they're loaded. So the problem you're describing isn't really new and exists on most systems today.
;)
Besides, no system can verify the integrity of itself-- you'll run into Godel's incompleteness theoreum if you try.
Yes, on a piano it is. As on most guitars. But on a recorder flute or for example a violin, Csharp and Dflat are not the same!
.. and the Browns have also beat the jets
Which version of pascal would that be? Some people insist that when you say "pascal has" you should refer only to the published standard pascal, which doesn't have classses of any kind whatsoever.
I've been programming for years in the most popular commercial extension of Pascal, Delphi. It has no value classes.
and so does C#.
I have Jesse Libery's book "programming C#" (2nd ed) right here. On page 126 he notes "although a class is a reference type, a struct is a value type" . Thus C# does not have reference classes.
My Karma: ran over your Dogma
StrawberryFrog
I was looking at the list of features.
While it looks fine, and useful, I can't help noticing that last time we heard about D it didn't have most of these features (templates, overloading etc.) and they were claiming that the lack of these features was it's strength.
I called them ignorant swine for that at the time.
The new D looks a lot like Modula 3, a great language aiming at the same sort of niche which disappeared without a trace.
Rocky J. Squirrel
Emacs users will be cast into the fiery void of arcane key combinations. Vim is the one true editor!
:wq
I'm extremely unimpressed by this language. Looking at it it seems the author his learned a little bit of C++, and then, without fully understanding it, set out to "fix" it. Looking at the "differences with C++" page, I find he made the following changes:
... ...
- An extra keyword is needed to specify a constructor. Whoop-dee-doo, *that* will certainly gain us a 10% productivity gain!
- The baseclass constructor can now be called from any point within the child constructor - or presumably, not at all. I'm not sure what prompted this odd notion, but I can see a new class of bug here: forgetting to call the baseclass constructor.
It also breaks the guaranteed destruction order of C++ - C++ guarantees that destruction order is opposite of construction order. Without a fixed construction order, presumably D has no fixed destruction order either.
- The structure comparison feature is poorly thought out. The author uses a very nasty method to compare two structs, and then he complains that the method he used is nasty so C++ must be 'fixed'.
I do agree that it would be nice if some sort of structure comparison facility existed within C++. However, the correct way to do this would be to add a structure (or class) inspection facility. Such a facility would serve more than just this one need - for instance, it could also be used to build a serialization feature for structures (or classes). This way orthogonality would be preserved.
The author of D obviously missed this and added a little wart to the language just to solve one specific problem. Worse, this solution does not at all scale to the other comparators (, >=). Suppose I have a struct s { int a, int b }. How can the compiler define a meaningful operators1). Again, orthogonality (and with it understandability) suffers.
- The strong typedef feature is a good idea. I wish it were added to C++.
- The "module" idea is again badly thought out. Instead of giving more and more code access to more and more private members, what is needed is to precisely allow access, for one specific class, to a specific body of code. One way to do this is to add a fourth type of protection class (alongside public, protected, and private) that grants access to only one specific other class (and possibly its children). Like this for instance:
class X {
public:
private:
interface class Y:
void func ();
};
The function func contained in the 'interface' block is part of class X, but can only be accessed by class Y. Thus we get the benefits of having a friend declaration (to whit, a class can have members that are accessible to a specific non-child class, but not to everyone else), without giving up the benefits of the 'private' keyword.
In comparison, the module feature just makes the problems with the friend declaration worse by removing *all* boundaries within the module.
For large projects, being able to fence off members (using a private declaration) is not just a theoretical nicety. It is a matter of life and death.
- The 'cmp' function: I do not entirely understand how it works, but I guess the 'cmp' function returns an integer that specifies either , or >=. Bear in mind that since I'm guessing here my criticism could be wrong.
First of all, why return an integer and not an enum? Second, what stops you from doing exactly this in C++? Define your overloaded operators once for a base struct or class, derive your structs or classes from that base struct or class, and override the virtual cmp function for each child that needs it. The amount of work is nearly the same - all you need extra is the base comparison operators.
- Namespace 'using' declarations: I do not have enough experience with namespaces to comment on this.
- RAII: I (and I imagine I am not alone in this) commonly use this strategy on dozens of things that are not memory or semaphores. They are used for *anything* that must be deallocated, including windows, controls, files, filescan structures, printer enumerations - the list is endless. I only have *one* delete statement in 160,000 lines of code - in my autopointer class.
Not having to write that one delete statement is not going increase my productivity by 10%. In fact, if I wanted to do that I should stop reading slashdot...
And the Browns ain't going to the Super Bowl, so it don't matter, does it?
Why not simply use a well-designed, modern language like Ocaml (www.ocaml.org)? Functional programming and strong typing compined with type inference can give your productivity quite a boost, once you get used to the modern times.
Algol68 does all the things claimed for D, and more (Including support for threads). Designed and tested 30 years ago, it only died because it was not invented by IBM, who, at that time, were the power that M$ is today. And the books about it were printed in decent fonts :->
Come on all ye compiler-writers, and give us an Algol68 compiler (preferably will support for NetBSD on Sparc :-)
Sent from my ASR33 using ASCII
Except by Middle-Aged Computer Scientists
Well, although I am a Emacs (and GNU) fan, it is really ``Generally Not Used'' by anyone I know.
Can anyone write a D compiler?
Does it have to be approved?
I assume the compiler itself isn't open source.
How much is this going to cost me (or my employer)?
What are the plans for commercial vs. non commercial licences.
Rocky J. Squirrel
If I look at the specs, it looks more like Delphi with C++ syntax then a C++ derivate.
They call ocaml a hacker's language? HAH!
...since so far C-like programming languages seem to be following the letters of the programming language "BCPL". Yes, the language that preceded C was B, but the fact that it precedes it in the alphabet is a coincidence.
I do not know whether anybody calls Ocaml a hacker's language nor even what your idea of a hacker's language is. Fact is that Ocaml is a language that supports the process of problem solving better than many other language and certainly better than C, C++, or D. Anybody who invested a week or two to learn how to program in a modern language like Ocaml will experience that he/she is now suddenly capable of implementing more functionality in less time. Maybe even with less lines of code. And much smaller likelyhood of crashes. Actually, I have yet to see a program written in Ocaml crash.
I really should have read the article before posting. Oh, I forgot, this is slashdot.
On the first page there are links to both a win32 compiler and a linux port. Download them to read the license.
Don't expect slashdot to do your homework. If you had really been interested in evaluating this, you would have read the article before posting.
The frontend leaves you at the stage of the syntax tree after semantic checking, so it's ready for translation into an IR. I wrote a dumb backend for my Linux port, so I can help anyone with the trickier parts of the frontend, like struct initialisers.
Compare this (C++):
with this (Java/D/whatever):
And they say try/finally is less error-prone? Gimme a break. Repeat after me: encapsulation good, code duplication bad.
Aside: how do I insert friggin' spaces with this ecode thingy?
I think it's a real shame that D lacks a bool type. That's the first thing I looked for when I went to the spec. It's such a trivial thing to add, and (in my experience) makes a lot of code quite a bit cleaner (i.e., easier to read/understand). It could also (in theory) help a compiler optimize code, because there are only two possible values (enforced at compile time!) rather than the entire range of the integer type.
Only local function variables? Why not class members? Oh, and the garbage collector calls the destructors in the non-auto case. I don't see how they are different from Java finalizers, and pretty much everyone agrees that Java finalizers were a bad idea.
"I could imagine it being a real pain for a new programmer to learn a language like that."
D isn't for beginners. It's for intermediate to advanced programmers of medium to large programs. Read about it here:
http://www.digitalmars.com/d/overview.html
"Consensus" in science is _always_ a political construct.
Note: all D users agree that by downloading and using D, or reading the D specs, they will explicitly identify any claims to intellectual property rights with a copyright or patent notice in any posted or emailed feedback sent to Digital Mars.
Does this bother anyone else besides me?
Only the compiler front end appears to be open source. The libraries appear to be proprietary.
The D language looks great, but it's the kiss of death to a language if potential users don't know if they can legally use it. Their FAQ needs to be more explicit on this issue.
http://www.opend.org has an effort to make a truly free version of the language (a front-end for GCC).
The biggest selling point for me is D's direct, language-level support of complex and imaginary number data types. The C/C++ treatment of this issue is a hack at best. Delphi uses variants, which I find distasteful, and Java ignores the issue altogether. So for me, a developer who knows C++ and wants to write scientific applications, it looks like D has just the features I want.
I guess what I meant was that C and C++ tend to enable, instead of restricting programmers "for their own good." (correct me if I'm wrong, but that's the impression I get from Java)
:) (it's also got things like final methods, for which it is a compile-time error to override)
Also, one little thing: D will un-virtualize a specific call if it can come to the conclusion that it's not necessary. More or less ideal, I think.
"Break out the gin, and the small violin, I'm a raging success as a failure." --Firewater
I see way too much code like this:
// does nothing // Many lines later when we finally want it:
// make the cleanup happen. // cleanup is done here because we fooled C++ into doing it. Too bad // nobody can figure this out by reading the source!
class FunnyName {
public:
FunnyName() {}
~FunnyName() {do_the_cleanup_I want();}
};
function() {
FunnyName funnyname;
do_stuff();
}
I think explicitly stating what is wanted with finally is far better.
I think even better would be to somehow specify the "finally" back where the decision it was needed was written. Usually this was due to some action at the start of the function. Some syntax like this, maybe:
function() {
finally {cleanup_A();}
do_A();
finally {cleanup_B();}
do_B();
do_other_stuff_that_might_throw_exception();
}
The result of the above, if no exceptions are thrown, is that do_A, do_B, do_other_stuff..., cleanup_B, and cleanup_A are done in that order. cleanup_B and cleanup_A are done if exceptions are thrown (unless do_A throws an exception in which case only cleanup_A is done).
The reason for this syntax is so that when I decide do_A is no longer necessary I can delete it by deleting (or commenting out) 2 adjacent lines of code.
You forgot:
4. Profit!
From a person who develops in C++, Java, and Object Pascal (Delphi) a lot, it's nice to see a language show up that sort of just glops it all together into one big Frankensyntax. *shrug* Now if Borland would just support it with a Delphi-esque IDE and port that to Linux ala-Kylix and call it Builphix...
C-- Is an abstraction of Assembler and C combined. Great for use in decompilers. Or as in my case decompilation.
Regards
now3djp
http://cminusminus.org/
Instead of wasting their time on another language that isn't going to become anything but a fad, why don't these morons use their intellect to help solve some real world problems like the decline of society and the destruction of the environment? Another bunch of losers that want to make sure that their putrid life has some meaning by leaving their mark somewhere.
I wish going from C to D would be considered progress by the Dean of my college. Sheesh.
Ocaml is fabulous, except for one big wart: it lacks overloading. Declaring a function again with a different parameter signature simply replaces the function. This forces you to make the type polymorphic instead of the function, which isn't cool when you don't want to touch the type. This tends to make adaptors come into play when they shouldn't have to. Compare to Haskell, which does have overloading (but forces very weird monad syntax and semantics on you when you want state). Is anything being done to address this rather annoying problem? It's not a complete show-stopper, but it does make me feel like I've been limited where I shouldn't have been.
I've finally had it: until slashdot gets article moderation, I am not coming back.
Looks a little better than c++ (which I've been doing for 11+ years), what with enforced single calling of class/object destructors, garbage collection, try/catch/finally blocks, package/module, doing away with throwback preprocessor syntax....but would anyone really use this for device drivers and OS kernel writing? No, probably not. And if not, then why bring over the "low level" features of C, like primitive data types, unions, explicit pointers.....leave that stuff for the C libraries that you maybe CALL with your high level language.
All about me
Adding on (I wish slash supported something like .5e's editing), the overloading problem's even worse than lacking ad-hoc polymorphism. I don't think there's even a type for operators (e.g. ordinal, sequence) like haskell has, so you couldn't make a type implement the list operators if you wanted to. Add to that having different infix operators for float and int. I can see not mixing them (implicit promotion is evil) but you can't even add two floats with + and you must use +. instead. I don't want to sound like I hate ocaml, but those are some real turn-offs that could and should be fixed.
I've finally had it: until slashdot gets article moderation, I am not coming back.
As someone who used Emacs on character terminals back when a bitmapped display that could be used for text editing wasn't even a pipe dream, I can tell you that the Hurd wasn't even a twinkle in RMS' eye when emacs came out. The original Emacs was written in ITS TECO on the DECsystem 10. Let's face it, folks, Emacs is the Old Religion. :')
As for first tools, I believe that RMS thought of gcc as the first tool, but I could be wrong - it's been a long time.
BTW, speaking from my experience with gcc hacking way back when, I can say pretty definitively that if you want to have some fun geek adventures and learn a lot, you could do worse than to participate in hacking on the D compiler.
I remember sitting around with Walter and his buddies, talking about how much trouble Walter had in implementing C++. This was before the ISO standard, and to some extent, before the ARM definition. Walter isn't a fool; he's one of the brightest programmers I've ever met. When C++ was first emerging, I talked with compiler developers from Watcom, Microsoft, and others; all found C++ to be more than a challenge. Stroustrup invented an incredible power tool that ANSI complicated through the committee process; I am impressed that anyone has come close to making this monster work.
D is Walter's attempt to move beyond C++, based on his experiences in writing C, C++, and Java compilers. I'd say he has an excellent understanding of the issues involved.
Do I use D? No. While a good effort, D simply doesn't address my programming needs. When I look at a "new" language, I consider O'Caml or Haskell or something that provides very different paradigms. I don't believe it is possible to define a single, all-purpose programming language that scales across the spectrum of applications. I haven't got anything against D, but it doesn't do anything for me that I can't get elsewhere.
Whther or not I use D is irrelevent to its future. Walter Bright has created yet-another-C-derivative; it may succeed, or it may end up like the hundreds of "good ideas" that never caught on. But don't make the mistake of thinking Walter is foolish; he has a fine mind and has produced brilliant software before. He once started from obscurity to build the first useful XC++ compiler for MS-DOS and Windows; I will not be surprised at all if he proves his mettle again with D.
All about me
There are good reasons for this. Note that the different design decisions that are made for a language ultimately should lead to make life easier for the programmer.While some of the issues you raise might look like limitations or complicated at first sight, they allow a design that makes other things possible which are more important. For example, the different operators for float and int might look like unnecessary work at first sight, but when you look at it a second time it makes you more aware of what type you are really using. This is actually a strength of Ocaml and one of the reasons why programs tend to be less error prone once the have managed it through the compiler. I am not really an expert, but I suspect that this also makes type inference easier or even possible, and this by far outweights the problem of typing that additional dot for float addition. Type inference and type parametrization are something that is incredible useful, once you have tried it. The nice thing about Ocaml is also that you can actually use different programming paradigms, depending on taste and aplicability: modules, functors, closures, objects, functional style or procedural style, pattern matching - it is your choice.
That is not what I want for sure. I want a language based on conceptual integrity, and then it is the compiler job doing the better of it. To me, and perhaps to Donald Knuth, having the compiler determine the language is like the cart driving the oxen.
Perhaps what I want would be more in the way of a relational Scheme or ML. But then, the missing part is the relational system, not Scheme or ML.
BTW have someone ever tried to create a compiler for Dijktra's guarded programming language?
Leandro Guimarães Faria Corcete DUTRA
DA, DBA, SysAdmin, Data Modeller
GNU Project, Debian GNU/Lin
... up until this point I thought it looked quite good. Unless you can turn it off and get around it, it's not going to be too good for embedded realtime systems - a reserve for C for quite a while now.
Also not sure about the intrinsic thing in Phobos - isn't it the job of the compiler to spot processor specific optimisations and apply them in a transparent manner?
-- Mike
What languages out there are truly modular? Are there any languages that encompass basic logic principles and which are then able to be augmented by blackboxed modules?
Don't know if this language still exists but Modula-2 was designed to offer Pascal like syntax with very strong support for programmers pulling in each other's modules as a black box. It was the core design principle. Logitech (yes the mouse people) used to make a very cheap compiler for the PC though I'm sure you can pull down free ones today.
Another language with very strong black box module support are mainframe COBOLs; in fact many languages popular on mainframes (like VAXBasic have this).
The fact is today though almost every language has good support for black box modules and it turns out that the advantages of great over good don't outweigh the huge limitations so today's languages tend to have strong support.
Are there any truly novel languages out there, or are they all just variations on a common theme, with shared shortcomings and much duplication of effort?
Anyway I really think you are using novel wrong here. What it seems like you are asking is "are there languages different from one another so that's its worth knowing more than one". For this I'd say absolutely. Mathematica for example offers huge advantages in programmer productivity over C with numberic extensions for symbolic work; plus an interactive vs. a static environment. So for example what might takes weeks in C takes in hours in Mathematica to write and debug. OTOH Mathematica code tends to execute roughly 2000x slower than the same code implemented in C. So here you get a clean trade off of programmer productivity vs. computer productivity.
And in general that's the case with interpreted dynamically typed languages vs. fully compiled staticly typed languages. The real novility that is going on today (with languages like Java) is to try and avoid the extreme cases (like C and Mathematica) and try and get high programmer productivity and high computer productivity. Parrot for example is an excellent project which is working on this very theme.
LISP was genuinely novel. Lex and Yacc were genuinely novel. Highly specific languages designed for one task but Turing complete (like sendmail's language) were genuinely novel. OTOH is novel what you are after?
i gave kathleen fent a "Cleveland Brown" last night (shit on her ample cleavage, then titty fuck her).
Do you even lift?
These aren't the 'roids you're looking for.
The stated argument is that it's desirable to make the language "look like" C. If you want a language that looks like C, use C. Personally, I want someting better. In fact, I think that making Java look like C was one of Java's biggest mistakes; it lulls the programmer into a false sense of familiarity when in fact Java's semantics are much different than C's.
And if you just want to make sure that C programmers don't get burned by their old habits, there's a simple solution to that as well. Require that each case end with a "break" or "fallthrough" statement. That way there's no ambiguity if the user forgets the break, it will produce a compile error.
Be careful not to overlook other aspects of DDJ.
See for example the neo-fascist editorial on the Feb edition by J. Erickson, and his take of state laws discriminating against immigrant workers (i.e. his interpretation of New Jersey SB1349 applying to legal resident aliens)
Morons like J. Erickson affect DDJ as a whole, and focusing only on theat publication's technical aspect will just allow such hateful incompetence to fester further.
Dictionary Definition
Heisenbugs are eeeevil!:P
Is this a sigs-optional kind of place? 'Cause I am totally down with that if you know what I mean.
D doesn't seem to have an equivalent to the Java interface.
His name was Rocket J. Squirrel, in case anybody cares. No, I ain't using my karma on this one!
Yes except that people will start writing code to those C libraries and build a mountain of code that has no consistency. Even if there are native D libraries, what benefit would it give if there are three different interfaces for database access? D doesn't need to implement everything. Software darwinism is a good thing. But at least specify the interfaces!
.NET). Why? Does Sun write every database driver out there? No. They wrote a database API interface almost from the beginning to which vendors could write their own implementations. The obvious standard made ad hoc interfaces seem ridiculous. And rightly so!
Otherwise I will have to do the market research to determine which API I will code to. I don't have to do this in Java (or
Imagine what C++ would have been like if it didn't have be compatible with C. Unfortunately, that similarity was the only way that it could get a foothold and get used.
D, on the other hand, is not prentending to be "C with classes" or "C only better." A D compiler cannot compile C or C++. I applaud the author for making the clean break and taking only the parts of C and C++ (and Java) that make sense. But as soon as the tutorials pop up in Dr. Dobbs and various online venues that teach OpenGL programming with D as linkage to the C library, D is screwed.
Modern C++ can do so many things, but because of the C baggage, it is constantly held back. 95% of the time, you should never use char* for strings in C++. std::string makes much more sense in almost every way. It's easier to use, consistent with the STL, and about as fast as char*. There is so much code out there that uses char*, however, that std::string adoption (and std::list, std::map, std::vector, etc.) has been unreasonably slow.
Don't underestimate inertia. D should try to stay out of the limelight as long as possible so that these design issues can be worked out. Otherwise you'll end up seeing ad hoc implementations of every major feature with no consistency. And we will be right back where we started -- only with a new name to our troubles.
- I don't need to go outside, my CRT tan'll do me just fine.
How does it feel to lose to a homo, then?
delphi is a _well thought out__ (unlike c++) oo extention to pascal, which is basically just really really verbose c. It would follow that they would be similar.
However, it has some features distinctly different from delphi's that are very interesting, and make it unique in it's own right ant not "just another (blah blah blah)".
Old truckers never die, they just get a new peterbilt
Mike wrote his first D compiler the normal way until it worked right, then "compressed the source code" to make the interpreter work right.
I saw the source, and it looked just like all those obfuscated C code entries.
Request your free CD of my piano music.
How do you deal with tab/space alignment?
To indent code in a proportional font, place each line's first non-whitespace character directly below the character in the line above it that would be directly above it if the font were monospace.
Will I retire or break 10K?
I thought the next one was supposed to be called P
My theory on the B-C-P-L progression: P is short for "Plus Plus" as in C++. L is a reversed J, as in Java language.
Will I retire or break 10K?
The actual clock speed is 2000/3 MHz, or 666.6 repeating
The actual clock speed of the PII 266 was 266+2/3 MHz, but Intel still rounded down to satisfy truth in advertising laws that state that you can't overstate the speed of a product.
Will I retire or break 10K?
The sequal to C should've been P.
If you don't believe that P stands for "Plus Plus", then how about swallowing up both of the next letters in .pl?
Will I retire or break 10K?
Hmm. I don't get it. I'm seeing: (1) D specifically doesn't include a philosophy, and (2) one of the things that made C++ clumsy is that the language is so huge, each programmer uses a particular feature subset, which can make using C++ between various developers harder.
Wouldn't having an overall philosophy help prevent the "programming in your own island" problem they say C++ has? I'm not seeing how this is any improvement.
The other thing that's weird is I don't hear about any target program being used to drive D development. Usually that's somewhat important.
D looks like C/C++ updated for the 90's. Fabulous. As an application programmer, if there's one thing I have no use for, it's a C/C++ updated for the 90's. I'm much more interested in what Paul Graham is doing with Arc.
I know you're joking but it's missing the point.
He wasn't joking. The code he posted was the very code the orginal poster was raving about. It's not like he pulled some obscure C out of left field to make his point; he simply posted the code 434 byte CSS descrambler that ebyrob brought up as an example of the power of C.
-- MarkusQ
That a good root for a language "religion", isn't it?...
Aargh! Why did they have to give it a single-letter name? How are you supposed to do a Google search for "D"?!
In fact, I wish they would make it a feature of the language that you can't have a single-letter variable name. Every try to grep for all uses of a variable named, "c", in a C or C++ program?
A language that does not allow functions to return functions (or rather, closures) can only be called retarded and crippled IMO. If D is supposed to be a "modern" C then it is already an anachronism. It looks a bit like an attempt to modernize transportation by making those horse-carriages out of carbon fiber ....
An aspect of programming that doesn't get discussed much is how they interact with out mental frailties.
Arguments about the best/fastest/smallest/cleanest language generally play to our personal predjudices.
The need for self expression often motivates us to choose a language, maybe you like objects or regular expressions. Maybe compilers are a drag or you never quite fathomed all that multiple inheritance syntax.
But overall we're flawed as a species and tend to make the same mistakes over and over:
We are forgetful: hence C prototypes show us when we've forgotten what function parameters should be.
We are careless: hence Java exceptions force us to think about (if not do anything about) error handling.
We need structure to aid comprehension: hence while/repeat/for etc when goto and if work just fine.
etc. etc.
In my view a good language is one that takes account of our stupidity and compensates for it, avoids it or slaps us in the face before we ship it to customers.
Frankly, languages like C and particularly C++ are poor in this regard when compared to languages like Java.
Sure, a Godlike coder will produce a smaller, faster solution in assembler, C or C++. But what about the rest of us that forget to free strings in our destructors, accidentally introduce side effects into out macros or have creative mishaps with CVS?
If there are no standardized interfaces, the code I write today will be intimately tied to the library I use. Or I could write an abstraction layer (basically an interface) but there will be no consistency when I change jobs or inherit someone else's work.
If there are well defined interfaces with substandard implementations, it won't matter too much. Once a better library comes out, I can just relink and use it.
Imagine being able to write the following:Yes, this is simplified and based on Java's GUI model, but you get the idea. No imagine that you could write to this API (or one like it) and plug in Qt, GTK, MFC, or whatever.
I don't want the ultimate graphics library (UGL); I want the ultimate graphics interface (UGI) into which I can plug in the UGL.
- I don't need to go outside, my CRT tan'll do me just fine.
It is useful in any kind of coding, just not to break the developers' way do to things they're used to. Including this directly into D allows for automatic inlning and calling convention optimisations.
They're called structs.
From the specification, it seems that D is actually designed to be able to do quite a bit of low level programming. In the section on 'Interfacing to C', the spec states that you can use C's malloc and free without interference from the GC. (Yes, GC scares me a little too, so I was heartened by this.)
Not that I'd go a'kernel-hacking with D myself, but it seems possible.
-matt
Garbage Collection make any language totally unsutible for most if not all embedded (device) programming and deffinitly unsutible for an realtime (soft or hard IMHO) programming. The problem is that you can never be sure when everything is going to come to a hault while GC does it's business.
The real problem comes when several different developers collaborate and each uses a different proportional font. What appears aligned on the originial developers screen is a twisted mess on another developers screen.
Monospace font solves this problem.
The real reason we use monospaced fonts is so that we can all think we're coding on 80x43 or 80x25 terminal screens.