Slashdot Mirror


The D Programming Language

dereferenced writes: "Walter Bright, author of the original Zortech C++ Compiler and the free (as in beer) Digital Mars C/C++ Compiler, has posted a draft specification for a new programming language that he describes as "a successor to C and C++". It seems to me that most of the "new" programming languages fall into one of two categories: Those from academia with radical new paradigms and those from large corporations with a focus on RAD and the web. Maybe its time for a new language born out of practical experience implementing compilers."

530 comments

  1. Re:Convince me by denshi · · Score: 2
    The server will work fine until 10-11 pages are trying to be rendered at the same time. When this happens each page slows down to a point to where the system seems to get backlogged with requests. it's not too much time until there are 30-40 pages trying to render at the same time. We have a hefty database (running on an SGI Origin class server) and it doesn't seem to really be the bottle neck.. but the CPU's on that machine are at 100% and creeping..

    The strange thing is when we are running in a low concurrency environment the pages are lightning fast...

    That's an obvious threading problem. The CPUs are spinning at 100% just checking and releasing locks & mutexs. When you are in low concurrency the threads can get enough time to themselves to complete and don't trip over each other. In your high load situation the threads can't get enough time to finish computing. Such poor design, along with bloat and general obtuseness, have kept me from deploying Java "app servers" (read: boondoggle) in any kind of production environment.

    Remember: threads are hard. And locking will fill an exponential resource space. If you're just going to throw faster hardware at it, you should switch back to process based arch.

    That's why your Perl,Python, and PHP services deal with heavy loads better - no thread contention. OTOH, they have all that process creation overhead (which is linear rather than exponential like lock contention), so if you can fix your thread bugs you can beat them.

  2. Re:Sounds like... by Earlybird · · Score: 2
    Didn't Borland end up buying the Zortech compiler and turning it into Turbo C? There were a lot of C compilers back then.

    No -- Symantec bought Zortech, turned it into Symantec C++, back when Symantec was into development tools; it had the coolest Windows IDE at the time, but like many other Symantec products throughout the years it died a silent death.

    Walter Bright probably did a deal with Symantec to acquire the rights to the compiler and development tools; essentially this the free C++ compiler available on the Digital Mars site.

    Zortech may have been the first native C++ compiler, but TopSpeed had the better one, known as the fastest compiler around. TopSpeed had a common IDE/back end for C/C++, Pascal and probably some other languages. TopSpeed merged with Clarion and Clarion/TopSpeed was acquired by SoftVelocity. Clarion isn't C++, but its compiler is probably still based on TopSpeed technology.

  3. A critique (and take a look at Ocaml) by Chuck+Messenger · · Score: 3, Interesting
    Briefly examining the specs for D, here are some thoughts which occur to me, based on my experiences with C++, Java, and a few other languages:

    o Multiple inheritance is absolutely necessary. The main way it is useful is for Java-style interfaces.

    o Getting rid of macros (preprocessor) is a very bad idea. What is needed is even more powerful macros (see Lisp).

    o Generic programming with templates is the greatest thing about C++ -- the one feature that puts C++ above other programming languages. I'd rate generic programming capability as being a "must" of any modern programming language.

    o Operator overloading is a Good Thing, in that it helps you set up a well-designed library as a "mini-language". Good programming practice involves reducing the number of keystrokes required to achieve a given result (ultimately). Generic programming, macros, and operator overloading all go in this direction. Eliminating them is a step backward.

    o You say "smart pointers are irrelevant in a garbage collected language". Not true. There are many types of resources which a destructor might free besides memory. One weakness of Java vs C++ is that it is hard to control Java's "destructors".

    The "best" programming language (for general-purpose "big" programming projects) I've encountered may be Ocaml. It can compile into native code as efficient as C++'s. It can also be interpreted. It is stronly typed. It supports a powerful "functional" programming idiom. It looks pretty good to me, although I haven't used it for anything "real" yet. But if you're looking for the "be-all, end-all" modern programming langauge, I think Ocaml's worth taking a look at.

    1. Re:A critique (and take a look at Ocaml) by Chuck+Messenger · · Score: 2, Insightful
      Yes -- overloading can be abused. It's the same reasoning people use against macros -- that they can be even _more_ abused. It takes an experienced hand to use them effectively.

      Still, overloading, and macros, add a great deal to the language, increasing the possibilities for creating powerful libraries, with simple, intuitive interfaces. If you want a language which protects you from yourself, use Java. But don't expect to be as productive! (he says as he ducks for cover...)

      As an example (of overloading), consider the C++ streams library. Imagine having to do:

      put(put(put(put(cout, "Value "), valName), " = "), val);
      It's horrible! Instead, we can write:
      cout << "Value " << valName << " = " << val;
      Nice! It's much faster to type, and much more clear (hence more maintainable and less prone to bugs).

      In my experience, in general, reducing the number of keystrokes (increasing the conciseness of code) leads, simultaneously, to faster-written, less-buggy, and more-maintainable code.

      In general.

    2. Re:A critique (and take a look at Ocaml) by Anonymous Coward · · Score: 0
      The "best" programming language (for general-purpose "big" programming projects) I've encountered may be Ocaml.

      This is my opinion too.

      I would add that camlp4 is a pretty damned amazing pre-processor... I've been playing with Objective Caml 3.01 on Mac OS X, and I have to say this: I have completely lost my patience with languages in the C family (which includes Java if you ask me). None of those languages offer the expressiveness available in caml, and their only attraction to me is their immense library of legacy open source code.

      The world has a huge investment in legacy FORTRAN and COBOL code too.

      The next major language to emerge from academia will be caml no doubt about it.

      --posting anonymously to comply with non-disclosure agreement
    3. Re:A critique (and take a look at Ocaml) by Anonymous+Brave+Guy · · Score: 2, Interesting
      Good programming practice involves reducing the number of keystrokes required to achieve a given result (ultimately).
      Not really. What you really want is to increase productivity.

      Sure, and such surveys as have been done have repeatedly shown that your typical programmer will average roughly the same number of lines of code in a given period of time (about 20 per day, usually). Thus, the more power there is in each of those lines, the better.

      This is why operator overloading is often a great evil -- you are hiding information that is not readily apparent.

      It should be. If it's not pretty much immediately obvious what a + operator means in a given context, then it's clearly a bad use of operator overloading. (Granted, it does get widely abused. So does inheritance. That's not to say these things can't be very useful when used properly.)

      What many people ignore is that operator overloading, like the option to use value or reference semantics, is important to allowing user-defined types to function just like built-in ones. C++ is one of the few languages that (almost) achieves this. As a result, you can do things like writing nice generic algorithms using templates, which is still a much under-rated but incredibly powerful feature.

      For example, in C++, I can write a "sum" algorithm that iterates over an array of values, and +s them all. On ints, you get the sum of the values. On complex numbers, with a suitably overloaded operator+, you also get the sum of the values. On strings, if I've defined + to mean "concatenate" (which even those langauges claiming operator overloading is bad actually do) then I get the concatenation of several strings. All of this makes sense and is nicely consistent. It's just that in C++, it's fully controllable, whereas in Java, you're stuck with + meaning concatenate with a String, whether you like it or not.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    4. Re:A critique (and take a look at Ocaml) by Anonymous Coward · · Score: 0

      "Good programming practice involves reducing the number of keystrokes required to achieve a given result"

      my God - do you really believe this?

    5. Re:A critique (and take a look at Ocaml) by fault0 · · Score: 1

      Yes, Ocaml is a very very very nice language.

      I think that the only potential hinderance to it's long term success is that it does not look like c/c++. Long time C/C++ programmers tend to be very die-hard in that they cannot handle non-imperative programming.

      Of course, once they are introduced to (pure/non-pure) functional languages such as Ocaml, they tend to like it.

    6. Re:A critique (and take a look at Ocaml) by Anonymous Coward · · Score: 0

      Without ad-hoc polymorphism, OCaml can't be used seriously.
      It needs type classes akin to Haskell.
      Perhaps that's how G'Caml functions? I can never seem to find G'Caml, but've heard people talk about it.

    7. Re:A critique (and take a look at Ocaml) by Reality+Master+101 · · Score: 2

      Good programming practice involves reducing the number of keystrokes required to achieve a given result (ultimately).

      Not really. What you really want is to increase productivity. This might mean "reducing keystrokes", but more importantly, you want to maximize maintainability. This is why operator overloading is often a great evil -- you are hiding information that is not readily apparent. What does "+" mean in context X? It can be extremely difficult to know, particularly when bringing on a new programmer to work on old code.

      You're argument will probably be something like, "well, yeah, but everything can be abused" but that's not the point. The point is how easily overloading can be abused, how little it actually adds to the language, and how complex it makes things.

      --
      Sometimes it's best to just let stupid people be stupid.
    8. Re:A critique (and take a look at Ocaml) by Chuck+Messenger · · Score: 1
      You left off "(ultimately)" from my quote.

      That is to say, the goal is to get to a given result (meaning, fully debugged and fully functional) as quickly as possible. In my experience, that means, doing it in the fewest keystrokes possible. Excess verbiage not only takes more time to type in, but more importantly, it opens more possibility for bugs. The goal is to write in the most abstract, most succinct possible way.

    9. Re:A critique (and take a look at Ocaml) by Anonymous Coward · · Score: 0

      Best troll of the day.

      MI + Macros + Templates + Overload + Smart pointers.

      Nice.

    10. Re:A critique (and take a look at Ocaml) by SpryGuy · · Score: 1

      As an example (of overloading), consider the C++ streams library. Imagine having to do:

      put(put(put(put(cout, "Value "), valName), " = "), val);

      It's horrible! Instead, we can write:

      cout

      Yes, that is horrible. But you could also structure it something like this:

      cout.put("Value").put(valName).put("=").put(val) ;

      Which is FAR more likely than the thing you came up with. Just because you chose one of the ugliest and most difficult to parse examples, doesn't mean that's the *only* alternative...

      And I'm DOUBLY against macros. The language itself should provide the facilities you need, so you don't HAVE to require a macro pre-processor. Like 'typedef' instead of #DEFINE for types, and a real include or import directive rather than #INCLUDE. Real language features for defining constants and generics. Macros cause way WAY too much hardship in maintaining software, and what benefits they do provide can better be provided through actual language features.

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
    11. Re:A critique (and take a look at Ocaml) by p3d0 · · Score: 2

      put(put(put(put(cout, "Value "), valName), " = "), val);

      Damn, now if that's not a straw-man argument, I don't know what it.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    12. Re:A critique (and take a look at Ocaml) by Chuck+Messenger · · Score: 1
      I suggested:

      put(put(put(put(cout, "Value "), valName), " = "), val);

      and you suggest:

      cout.put("Value").put(valName).put("=").put(val) ;

      These both require the same number of syntactic elements: 4 "put"'s, 4 sets of (...), and one ";", in addition to the essential elements: "cout", "Value", valName, " = " and val. The only difference is that yours uses four dots in place of my 4 commas.

      By contrast, with operator overloading, we have:

      cout &lt&lt "Value " &lt&lt valName &lt&lt " = " &lt&lt val;

      Here, we've reduced the syntactic complexity, substituting a single &lt&lt for a left paren, right paren, plus a dot-or-comma (depending whether you use your formulation or mine). Three syntactic elements have been reduced to one.
    13. Re:A critique (and take a look at Ocaml) by Chuck+Messenger · · Score: 1

      Make that:

      We've substituted a single &lt&lt for a "put", left paren, right paren, and a dot-or-a-comma. Four syntactic elements have been reduced to one.

  4. Re:First Parrot by Anonymous Coward · · Score: 0

    Why not C-splat?

  5. Re:Sounds like... by tb3 · · Score: 2
    I remember trying to make the Zortech compiler work for an old project of mine circa maybe 1989.

    Didn't Borland end up buying the Zortech compiler and turning it into Turbo C? There were a lot of C compilers back then.
    Which reminds me, back in 1987 I was working with the Computer Innovations CI86 compiler. The documentation was a few hundred pages of photocopies in a 3-ring binder, no tools, just the debugger and linker, but it came with the source. Find a commericial compiler these days that includes the source.

    --

    www.lucernesys.comHorizon: Calendar-based personal finance

  6. Re:Floating Point by AndrewHowe · · Score: 2, Informative

    80 bits, not 80 digits. The x87 supports three formats: 32 bits, 64 bits, and 80 bits. All internal processing is done with 80 bits, but it's rounded when it's stored out as a float or double.
    Some operations always give an 80 bit result (eg. adds & muls) but some (eg. divides) can be limited by the current precision setting.
    floats have 23 bits of mantissa, 7 digits precision.
    doubles have 52 bits of mantissa, 15 digits precision.
    80 bit "long doubles" have 64 bits of mantissa, 19 digits precision.

  7. 'D'? Shouldn't it be called 'P'? by Profound · · Score: 1

    BCPL begat B which begat C.

    So it follows the next character should be P.

    1. Re:'D'? Shouldn't it be called 'P'? by Anonymous Coward · · Score: 0
      Larry Wall already beat you to this joke. Perl was greedy and use the next two characters: "pl".

      And now there are Perl modules in files whose names end with the "pm" extension. Of course everyone(?) knows that if you do

      $x = 'pl';
      $x++;
      in Perl, then the value of $x is "pm". :-)
  8. Re:practical experience implementing compilers?? by t · · Score: 1
    I don't do java but wouldn't that be as lazy as doing #include if you could?

    "What headers do I need?"
    "Fuck it! Include them all!"

  9. Re:Convince me by big_hairy_mama · · Score: 1

    This goes way back to C++ vs Assembly. If you code Java by hand, it will definitely be faster than not (if you know what you're doing). For example, most Java programmers (and IDEs) tend to waste a whole lot of Strings and StringBuffers passing various information around. If you can stop wasting new Object's (of any kind), your programs will run *much* faster. I know, from experience.

  10. Incorrect statements by bpyama · · Score: 1

    "..language with 750 pages of specification cannot do basic things like resizing arrays."

    "String manipulation is so common, and so clumsy in C and C++, that it needs direct support in the language"

    Apparently this so-called expert has never seen the STL.

    1. Re:Incorrect statements by szomb · · Score: 1

      Apparently this so-called expert has never seen the STL.

      No he has, which is why he's running away from it at full speed.

      --
      Just because a few of us can read write and do a little math, doesn't mean we deserve to conquer the universe
    2. Re:Incorrect statements by szomb · · Score: 1

      I guess...if you choose to totally ignore the fact that if you want to use STL's string, you get a few terabytes of useless shit pulled in along with it.

      Ugh.

      --
      Just because a few of us can read write and do a little math, doesn't mean we deserve to conquer the universe
    3. Re:Incorrect statements by bpyama · · Score: 1

      What useless shit are you talking about? My compiler's basic_string class is less than 350 lines of code and includes only . The compiler is only required to compile those functions you actually use. It would not be surprising to me if the executable of a program using std::basic_string were actually smaller than a hand coded version of the same, especially if the hand coded version were required to be exception safe.

    4. Re:Incorrect statements by bpyama · · Score: 1

      You've got to be kidding! All the programmers I've shown the STL to have fallen in love with it immediately. It's a shining example of pragmatic, elegant design. Even if you don't dig the numerics/algorithms/function objects, type safe containers are to die for.

      Besides that, the author endorsed generic programming. He had simply missed the fact that C++ now has resizable arrays(vector), and sane string handling(std::string)

    5. Re:Incorrect statements by SpryGuy · · Score: 1

      All the programmers I know of who have seen the STL have run away screaming from it. And this includes some of the best programmers I've ever seen.

      I too can't really stand it. It's beyond convoluted, arcane, and obscure. Only 2% of the C++ development community can probably follow ANY of the code that implements it. And using it is a bitch and a half.

      Compare it to the Java standard library -- powerful, easy, straight-forward, and consistent. And once it gets generics in the 1.5 release (1.4 has a beta of them), the Java containers will be not only typesafe, but also much more efficient (won't cause code-bloat).

      And in seven years of C++ coding, I've never seen anyone use std:string. Everyone has either already written their own string classes, or are using some other class library that has strings. The STL came along way too late, and it's usage is at best 'spotty' now because of it.

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
    6. Re:Incorrect statements by smittyoneeach · · Score: 1

      He had simply missed the fact that C++ now has resizable arrays(vector), and sane string handling(std::string)
      No, just succumbing to the human tendency to ignore facts failing to support his argument.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  11. Re:After C comes P! by Wavicle · · Score: 2
    Whoa! Somebody who remembers BCPL!

    I guess few remember the great debates (in good humor) about whether the successor to C would be called D or P. Bjarne Stroustrup managed to appease (and probably get a good chuckle out of) both sides by calling his newly developed language C++... An obvious software engineering in-joke.

    --
    Education is a better safeguard of liberty than a standing army.
    Edward Everett (1794 - 1865)
  12. Not nice thing to say by krokodil · · Score: 2

    It is not very nice thing to say, but the guy stuck
    in the time few years ago:

    1. Java is already invented.
    2. Nobody cares about 16 bit code anymore.

    If you like Java, use it. If you dislike java,
    stick to good old C++. No need to invent a new language.

    1. Re:Not nice thing to say by Z4rd0Z · · Score: 1
      What a strange inconsistency in your logic. First you say:

      the guy stuck in the time few years ago

      and then you say:

      If you dislike java, stick to good old C++. No need to invent a new language.

      Who's stuck in time? You also said:

      Nobody cares about 16 bit code anymore.

      If you had read the spec more carefully you would have seen that he had dropped support for 16 bits.

      --
      You had me at "dicks fuck assholes".
  13. I hope he gets it finished by MSBob · · Score: 2

    It would be really nice to have an open alternative to Java that is also compiled. Glancing through the spec there is lots to like there. For instance the idea of building unit tests into the language spec seems like a pretty good one to me and would help popularise unit testing among developers. Native support for unicode is nothing new but it's nice that unlike Java he still retians the ascii type for those who don't need i18n. I hope the guy pulls it off. I'd like to play with a new C++ like language. If he only reconsidered his views on templates though...

    --
    Your pizza just the way you ought to have it.
  14. Re:First Parrot by Anonymous Coward · · Score: 0

    C# = C Sharp

  15. Re:Convince me by bored · · Score: 1

    Yah, I tried to use jbuilder too but on my Athlon 750 with 768 Megs of RAM and a RAID array it was still way to slow to even begin to use. Comparing it with delphi I would say that I need a 20 Ghz machine to match the speed. The Java geeks say that it can be as fast but I slammed a quick little application together that wasn't even very GUI dependent and the speed diffrences were on the order of 10x slower vs the delphi application doing the same thing. I'm not a Java expert but I shouldn't have to be to get decent performace.

  16. Re:Convince me by rossjudson · · Score: 1
    Dude, thanks! I gotta figure out how to write our own custom classloader for our app :) I always wondered how they got that crap to come in so damn fast. Time to break out the JProbe again, and see what can be done.

    Good UI can't be done by just anybody. You really need to throw your best and brightest at it.

  17. Re:First Parrot by Anonymous Coward · · Score: 0

    # == splat?

    I always thought * was 'splat'...

  18. Re:Convince me by Karmageddon · · Score: 0, Redundant
    compare the speed of a VM executed program to a native compiled one

    i don't think it's a quibble or pedantic to point out that the x86 architecture itself is nothing but a VM. The reason you can run "native" code on all the different chips available is because the myriad all implement the same virtual machine. Everyone agrees that code for that virtual machine is executed "quickly".

    If there is something about Java that means it conflicts with this (or some other important) VM, that would be interesting to hear. But it can't be said that VMs are "slow" in general.

  19. Re:Convince me by 32855136 · · Score: 3, Informative

    I'd be interested to see a *true* benchmark

    I've done that - kinda. Wrote several mickey-mouse comparisons (moving memory, calculating pi, etc), in C, C-machine-translated-to-Java and in regular Java.

    The biggest problem was that, for the tasks we were interested in (memory-management, for example) C and Java do it so differently there is no easy way to compare. (Java's habit of creating multiple references to single objects instead of multiple copies of the same object really helps it here).

    In general, Java was 3-4 times slower than C on string manipulation with built-in classes/library functions, but was damn-near identical on heavy maths (Java dropped ~1 second for every 30 secs of calculations.)

    (Visual C++ 6 compiler against Sun's latest JRE for Windows NT. These timings were only ever meant to be rule-of-thumb.)

  20. Re:practical experience implementing compilers?? by markmoss · · Score: 2
    It looks pretty good to me (I've read the parts on converting C and C++, plus "Contracts") -- mostly he's cleaned up the C features that look inconsistent in C++, and made the compiler smarter so the programmer doesn't have to work so hard. And since it's a compiler writer suggesting these changes, it isn't something that looks great but is either un-implementable (Algol, e.g.), or unacceptably slow (Java, anyone?). I'm waiting for the open-source compiler.

    Contracts are a new idea to me, and it looks pretty good. It's a sort of super-assert statement (and assert is now built-in, not a library). Using contracts properly should help both in communicating with other programmers writing related code, and in catching bugs. I don't know about you, but I hate debugging and I'd much rather write bug-free to begin with; this is going to help a little.

    One quibble: his square-root function example shows he's never programmed anything mathematical. The "out" contract specifies that squaring the result gives you back the input. In long integers. That is, x = 20, result = sqrt(x) = 4, result * result = 16, the program fails. In floating point, you can get pretty close, but it's never exact so you can't just assert result * result == x. You assert abs(result * result - x) 10.0E-6 * result, for example.

  21. Re:Maybe? by WM_NCDESTROY · · Score: 1
    Win32 will finally be relegated to "legacy" tech just like DOS interrupts and Win16.
    Oh No!
    ..
    --
    posted via satellite
  22. ah by Lord+Omlette · · Score: 1

    and once again I'm schooled by my roommate. Today's lesson: never ever listen to a word I say, I have no idea what I'm talking about.

    --
    [o]_O
  23. D is not a modern language by Anonymous Coward · · Score: 0

    D does not have the features that people expect in modern languages.

    No closures. OK, I can see a complier writer not wanting to implement them, but they really do come in handy.

    but...
    No currying - heck, I could almost do this with C macros - why should a compiler writer be concerned with this?

    No type inference - to get 90% of cases, all you need is one pass through the IR - it's not hard to implement, and it saves a lot of (no pun intended) typing.

    And don't even get me started about the inability to continue after up-stack exceptions. Keep the stack frame around! It's not that hard.

  24. Re:Incorrect statements(oops) by bpyama · · Score: 1

    "My compiler's basic_string class is less than 350 lines of code and includes only ."

    should read:

    "My compiler's basic_string class is less than 350 lines of code and includes only ."

  25. Re:Convince me by PEdelman · · Score: 1

    That's weird.

    On my P100/48Mb linux box, ImageJ, the only Java program I need to run, runs pretty fast. Startup is a bit slower, and it consumes relatively much memory, but once it runs, it runs as fast as a native program. I use the Sun SDK, but I also used Kaffe and the IBM JRE, with comparable results.

    Just my personal experience.

    --
    Like science? Comics? Wicked...
    Funny By Nature
  26. Re:After C comes P! by RevAaron · · Score: 3, Informative
    Actually, there was a successor to Forth called Fifth. Forth with OO extensions, IIRC. I've not been able to find a reference on the web, but I played around with it in the early nineties, when I was downloading every language I could find off of local BBSes.

    And calling it Fifth fits more so than Further- Forth comes from the word "Fourth," as in the cardinal number. The mythology goes, the filesystem where Forth was first implemented couldn't handle a filename as long as Fourth. ;) Hence, forth.

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  27. Re:Java's fatal flaw by mikec · · Score: 1

    What, exactly, does the lack of unsigned prevent you from doing? Note that you can specify numbers in hex (0xFFFFEEEE). You can shift them without sign extension (a >>> 3). Bitwise & and | work. What is missing?

  28. There's only one problem with this proposal. by Anonymous Coward · · Score: 0

    It's written by the guy who invented Zortech C++ and Zortech C++ (now Watcom) SUCKED!!!!

  29. Re:Convince me by Anonymous Coward · · Score: 0
    Maybe you should wait for you're 13 to start commenting on Slashdot, you illiterate piece of shit.

    Did you mean to say "[...] wait for your 13th bithday before you start [...]", or did you mean "[...] wait until you're 13 before you start [...]"

    I like correcting people in a positive, affirming way.

    Fucktards like you however, are another story.

  30. Cute.. by Da+VinMan · · Score: 1

    I know you're just trying to be funny, but a number of languages make it easy to write crappy code. Among them is Perl, the local favorite here. Not trying to be flame bait, but I don't see how everyone can get all smug about VB's deficiencies (which do exist I readily admit) without looking to their own favorite languages first.

    --
    Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
  31. Javalobby discussion: Java template shortcomings by Anonymous Coward · · Score: 0
  32. Re:tangential: try-catch exception handling by Karmageddon · · Score: 1
    I wrote another response to the other guy who replied about the multiple return values. Thought you might find it interesting... :)

    peace.

  33. Re:Convince me by Anonymous Coward · · Score: 0

    I'm sorry i've used JBuilder and it still has that sluggish you typically feel with java. As well as CPU time they also consume huge amounts of memory. When i have iPlanet App Builder(sun/netscape product) and Jbuilder(borland) open they are using nearly 200 mb of ram (with a 100 of that is swapped out by the OS).

  34. What I hate about C/C++ by dwlemon · · Score: 1

    is the build routine which is often so much more complicated than writing the code itself.

    I *love* writing java when after I've changed a few files and maybe even added some files, all I have to do is

    javac *.java

    and everything is sorted out for me. It makes me cringe when I think about working in C++ again. automake/autoconf are not the answer.. when I have to go find a FAQ just to remember how to get it to compile after I add a new file, and the scripts they generate are bigger than my project.

    Is there anything that makes compiling C/C++ as easy as java?

    1. Re:What I hate about C/C++ by Anonymous Coward · · Score: 0

      if you put everything in the same directory, you can do cc *.c and it builds. The whole point of makefiles is so you don't waste time recompiling the stuff you already compiled. It's really not that complicated. Especially what you are complaining about, just adding a file.

    2. Re:What I hate about C/C++ by SpryGuy · · Score: 1

      It builds sure. But it doesn't link and isn't runnable after that step.

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
  35. Wouldn't be "D" by ptgThug · · Score: 1

    This might have been mentioned already, but... it wouldn't be called "D". C++ is D. The successor to C++, which is to say (C++)++ should be E.

    For those of you keeping score, I think the progression goes: CPL, BCPL, B, C, C++.

    -Travis

    1. Re:Wouldn't be "D" by quinto2000 · · Score: 1

      And therefore the correct name should be 'P' or possibly 'L'. Why would it be D or E?

      --
      Ceci n'est pas un post
    2. Re:Wouldn't be "D" by Anonymous Coward · · Score: 0

      I quite honestly think that you're just an idiot.

    3. Re:Wouldn't be "D" by OpCode42 · · Score: 1

      No, C++ means increment C after you have used its current value, therefore the next language we use should be D. If it was ++C, I would have agreed with you :)

    4. Re:Wouldn't be "D" by quinto2000 · · Score: 1
      C was first designed by Dennis Ritchie for use with UNIX on DEC PDP-11 computers. The language evolved from Martin Richard's BCPL, and one of its earlier forms was the B language, which was written by Ken Thompson for the DEC PDP-7.

      Credit: Unix Unleashed

      Actually, that's exactly where the name for C came from. I remember reading programming books that were surprised C++ wasn't named 'P'.

      --
      Ceci n'est pas un post
    5. Re:Wouldn't be "D" by ptgThug · · Score: 1

      Uhm... I don't think so. You had B. The next letter in the alphabet was C. I don't think C was choosen because it was the next in the BCPL acronym.

    6. Re:Wouldn't be "D" by ptgThug · · Score: 1

      Good point. But are you saying... myLang = C++; or C++; myLang = C; I think C++ was choosen instead of D. I think D was the appropriate choice for C++, but C++ was used for the humor. In any case, I don't see the use of D at this point being logical. I can see (C++)++. But if you use D you are admitting that you are progressing through the alphabet (B then C then D). Maybe I am just too spoiled by Perl, where you can "C"++ and get "D". :)

  36. Multiple inheritance by Anonymous+Brave+Guy · · Score: 1
    There is now pretty unanimous support for dropping Multiple inheritance. The problem with multiple inheritance being that it leads to programs only the original authors understand.

    Excuse me? There most certainly is not unanimous support for dropping multiple inheritance.

    First up, pretty much all OO languages support multiple inheritance of interface anyway.

    Secondly, most serious OO languages support multiple inheritance of implementation as well. The fact that Java and C# aren't clever enough to find a way around it, and instead forbid it, just removes a useful tool from the toolbox of Java and C# programmers. But hey, these people also think classes all belong to the same hierarchy with an artificial common root, so they're pretty much beyond hope as far as OO theory goes anyway.

    As for the "problem" you mention, that's just symptomatic of poor use of MI, and is also symptomatic of poor use of any other language feature. MI of implementation should only be used rarely in most programs, if at all. However, it does allow some programming techniques that are very useful under the right circumstances, and when it's appropriate, there really is no sensible alternative within an OO framework.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  37. It's Java with more good features... by egerlach · · Score: 1
    1. Compiled to native code, not byte-code (although you can compile Java to native code these days too)
    2. Built-in function contracts! Pre-and post conditions are built into the language! This is a great boon for coding stability (and you can compile them out in the final product for speed)
    3. Built-in unit testing! All the classes have their unit tests run on them before the main() executes! Sweet! (again, can be compiled out)
    4. Built-in debug mode! There's a programming construct for debugging! In the language! You can also have support for multiple levels of debugging in the language. (can also be compiled out for speed)
    Overall, I think this is a job well done. To be honest, I'm dissapointed about the removal of templates, because they are the most powerful feature of C++ (I like LISP :). But this language could be a boon to software robustness everywhere! A job well done.
    --

    "Free beer tends to lead to free speech"
  38. Good points and bad points by King+Of+Chat · · Score: 1

    A lot of people I meet can't really cope with C++ so some simplification would not be a bad thing. Losing the C baxkwards compatibility should've happened in C years ago. I like the "no headers as well and macros are a tool of the devil.

    However, there are times when I do want to manage my own memory - generally for performance. If I know I'm going to be allocating a ton of SmallObjs then I write my own new & delete and manage in blocks. Obvious.

    Similarly as someone said earlier, I like operator overloading. If you're doing matrices etc. then it's cool. I also like templates - ugly, but type-safe.

    The good points could've been done by a compiler switch
    Maybe -noshit
    Turns off macros, global functions (apart from main), global variables, C style casts, use of void * and all the other crap which we inherited from Brian and Dennis. Oh, and get a proper auto_ptr class and then we're done. Oh yeah, and get some decent programmers. You can write shit code in any language (try not writing shit code in VB).

    --
    This sig made only from recycled ASCII
    1. Re:Good points and bad points by David+Greene · · Score: 1
      A lot of people I meet can't really cope with C++ so some simplification would not be a bad thing.

      But we can already do this. If one isn't comfortable with certain features of C++, just don't use them!

      Similarly as someone said earlier, I like operator overloading. If you're doing matrices etc. then it's cool. I also like templates - ugly, but type-safe.

      Agreed, but operator overloading and templates go far beyond simple datatypes and containers. The entire C++ iostream library would be impossible without operator overloading and templates allow easy-to-use locales, custom memory management of data structures, metaprogramming, generators, concept checks, traits, generic algorithms and a whole boatload of other things that go way beyond vectors of tuples of maps of strings to functors.

      Sorry to rant, but I've come across too many people who see the STL simply as a container library and entirely miss the beauty of it. It's a shame it was never really completely finished. Thankfully we have things like Boost to fill in the gaps.

      Oh, and get a proper auto_ptr class and then we're done.

      We do have a proper auto_ptr class. It's just not what most people think it is. Herb Sutter's Exceptional C++ covers auto_ptr usage nicely. Sometimes auto_ptr is the only way to make code exception-safe. If you need a more-featured smart pointer, look at Boost::smart_ptr.

      --

  39. Re:practical experience implementing compilers?? by AlanStokes · · Score: 1
    he says the specs for C or C++, for example, are so big that the compilers that implement those specs will contain bugs

    And he should know - I was unlucky enough to have to use his Zortech C++ compiler, and it was absolutely terrible. Loads of code generation errors, a debugger that couldn't cope with large programs, and generally a royal pain.

    --
    - Alan
  40. Maybe mix-in could replace multiple inheritance? by renoX · · Score: 1

    Ruby is using mix-in instead of multiple inheritance and they claim that it is able to do 90% of what multiple inheritance provide..

    It may or may not be interesting for compiled language though.

    I disagree about the macro point: the problem with macros is that they more or less "hide" the real program..

    I agree that one of the weak point of GC is that you don't really control when the object are deleted. But it isn't very easy to mix "scoped object" and GC-able object: what if you assign a reference to a "scoped object" inside a GC-able object?

    Ocaml is nice because it is nearly as efficient as C which is a VERY impressive feat, but it "looks" really,really bad IMHO.
    I would prefer a Ruby-like language with the same performances as Ocaml..

  41. Re:Languages should be written for programmers by Anonymous Coward · · Score: 0
  42. In, Out, and InOut parameters!! YES!!!! by whiny · · Score: 1

    My biggest peeve about Java is its religious insistence that "objects are always passed by reference, primitives are always passed by value". What crap. Yes, I know that for objects the reference itself is also being passed by value, but who cares about the reference itself? The result is: I can return values in object parameters but not primitive parameters. This means there are all kinds of useful methods I can't write without (1) creating extra "return" classes, or (2) using ugly wrapper classes. And please don't tell me that "I'm not doing OO right". I'm just trying to write direct, elegant programs. Another great D feature: the ability to use assignment syntax to call GET/SET methods. So if your class has a property that you later decide requires GET/SET methods, the only thing that changes is the class definition. Support for true multidimentional arrays is another big plus for D. This guy has addressed almost all my major complaints about C++, in a way that Java does not. I would love to program in D. One thing I couldn't find was an explanation of how he does away with assignment/copy constructors. Anyone see it?

  43. C++ and Java by Hard_Code · · Score: 2

    Looks like he took C++, removed all the nastiness, and added all the niceness of Java in. The syntax, and spec is surprisingly Java-like. Sounds like a wonderful language...I was waiting for somebody to makea native Java-like language.

    --

    It's 10 PM. Do you know if you're un-American?
  44. Re:Single inheritance by Anonymous Coward · · Score: 0

    I can't say that I would blame single inheritance for MFC being an abortion... I've written a bunch of Java and Smalltalk code and never missed not having multiple inheritance. Heck, even the C++ code that I wrote didn't use multiple inheritance.

  45. Did anyone RTFA before posting? by markmoss · · Score: 2
    I mean, it's taken me since yesterday morning to skim less than half of the on-line documentation for D, but there were hundreds of posts within the first hour!

    Overall, it looks like a pretty good job, if what you wanted is a language for large projects on modern desktop & server computers. It doesn't entirely take away C's capability of letting you screw up enormously, but it does make screwups a little less likely. For instance, C and C++ programmers tend to manipulate strings with pointers; this results in very efficient code, but combined with sloppy programming (always by management decree, I'm sure) it also results in hundreds of security exploits involving buffer overruns. D gives you dynamic arrays, which handle strings the way they ought to be handled, and I think makes a program that allows buffer overruns harder to write than one that doesn't.

    On the other hand, I do some embedded programing with 8-bit CPU's. I rather suspect that over half the people who frequently code on-the-job are doing the same, although most of them are not "programmers" but rather are EE's, design engineers programming their own designs. Certainly you'll find a few dozen of those 8-bitters in the average american home, even though they own nothing they recognize as a computer.

    D doesn't even define how to compile to a CPU with less than 32 address bits. That doesn't mean it's a bad language -- in fact, it make's it a better language for the 386 and up -- but it does mean that it's widening the gap between embedded programmers and the rest.

    Likewise garbage collection is acceptable in an embedded system of any size only if you can control when it happens, and there is no mechanism in place for this. (The docs do mention that interrupt-handlers probably can't be written in D because of the garbage collection.

    But for desktop and server applications, I like 99% of what I've seen and have just one complaint: operator overloading is _important_, it lets you write extensions to the language.

  46. Re:No templates? by TephX · · Score: 2, Insightful

    Oof... believe me, I know about strong versus weak typing. (I posted the parent, but posted it anonymously by accident.) I learned real programming (i.e. not Applesoft Basic) with Scheme, and learned SML last year. SML is just about as strongly-typed as you can get, and Scheme is weakly typed.

    Weak typing does have some advantages. I use Perl, which is weakly typed, and the convenience is worth it. But weakly typed languages are slower than strongly typed ones (and this is a fundamental limitation that can't be removed, weakly typed languages have to have runtime checks for types). Also, type errors can catch a lot of common mistakes at compile time rather than runtime (for example, putting arguments to a function in the wrong order will often trigger a type error.)

    Overall, I definitely agree that weak typing has some purpose, but for general applications development, strong typing makes for significantly more maintainable code - at a cost to developers, to be sure, but in my opinion a worthwhile one.

    --
    I metamoderate all Redundant and Offtopic moderations as Unfair.
  47. Re:practical experience implementing compilers?? by pmz · · Score: 1
    Basically, I'm arguing that "import package.*" is sloppy in itself, because it is so vague. Using wildcards forces a person to search the full source code to determine dependencies. This trouble can be saved if wildcards are not used. In the long run, I feel that wildcards can actually make code harder to maintain.

    Name clashes can occur even if my own code isn't sloppy. Consider java.util.Date vs. java.sql.Date. One is a subclass of the other, but they behave differently causing potentially subtle bugs. It isn't obvious that "import java.util.*" and "import java.sql.*" can import a class with the same name, unless a person has good experience with both packages. Without the wildcards, it is obvious--even to an inexperienced person--thus making a bug less likely to occur in the first place.

  48. Re:D already exists.. by Tomun · · Score: 1

    E is taken too. Its one on Wouter's languages.
    See here

  49. Re:Maybe? by rabtech · · Score: 4, Insightful

    Have you ever tried Visual Basic? I know it gets a bad rap sometimes, because it is VERY forgiving. It is extremely easy to write very crappy code that still works.

    However, for those who bother to do the job right, VB can be a very powerful tool, used to create shipping application. (As I personally have done.)

    With VB, you don't care about all the "stuff" underneath (which can be a problem when you try to do something that isn't built-in, but there are creative solutions). You just drag controls onto your window, and write the code behind them. Very easy.

    VisualStudio.NET is bringing this in two different directions: First, VB gets full access to everything, and is no longer the "bastard" child of the VS family. Secondly, the other VisualStudio languages get a new Forms system similar to VB's -- just drag controls onto the Window, set properties, then write the code to handle the events. Easy and clean.

    That's really what the entire .NET runtime is about: moving away from Win32. What is easier for using sockets to listed on Port 80? Fooling with the separate WinSock2 API, or doing "Dim mySocket as New System.Sockets.TcpListener(80)" ?
    This message sometimes gets lost because .NET is a very large umbrella. But what it is bringing to the programming side of things is very impressive indeed. An entirely new programming paradigm where everything you ever wanted to do is neatly arranged within the various Class libraries. I know that in and of itself isn't new, but having that kind of support on the OS level IS new.

    Microsoft has already stated that when the Win9x code line is pretty much dead, and everyone is writing to the CLR instead of Win32, they are going to make a move to port the CLR to the WinNT Executive (that is NT's native kernel API). Win32 will finally be relegated to "legacy" tech just like DOS interrupts and Win16.

    --
    Natural != (nontoxic || beneficial)
  50. Re:tangential: try-catch exception handling by anshil · · Score: 1

    I used misused because as far I understood exceptions where invented orignally with error handling in mind.

    Well you donnot need to rethrow excpetions explicitly, however I recoqnize the problem in C++ if a function raises an exceptoin you didn't thought about, every function at least should tell the compiler it is aware of all exceptions that can be thrown, java solves this in example in a brilant way.

    Okay let's the SETI@home say you know that network errors can occur, and guess you're reaction will be always the same, no matter where it occured, here a multidrop is something very beneftical. The way why it is expensive since all the destructors have to be called and memory has to be tidied up while jumping upward. However taking a stop at every fragment and rethrow is even more slower.

    The second reason why multidrops are convinient since it allows the programmer to concentrate on the problem, not to concentrate what everything could go wrong.

    Tradionally people often write C code in the first attempt that just solves a given problem, if some unexpected exeption occurs it simply crashes, then they add crash handlers to the code, which at the end can be even overlay the orignal code completly, one code line for solving the problem, 2 for error checking.

    With well done exceptions you've at least an exceptable error handling from start on, no need to discuss the programmer can inhance it, put if the application exists with a description what went wrong is already far better than a core dump.

    --

    --
    Karma 50, and all I got was this lousy T-Shirt.
  51. Re:practical experience implementing compilers?? by JabberWokky · · Score: 2
    Hey, I didn't say it was a good idea - in fact, I even said I think declarations should have a spot for structured comments.

    Rereading the site, I think these are a mismash of ideas, not completely thought out, or at least not peer-reviewed (a.k.a., "Hey, lemmie bounce an idea off you"). Some of them are good, depending on your localized value of good in the context of a programming language. Some I don't like, but then there are things in all languages that I (or any given programmer) don't like.

    --
    Evan

    --
    "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
  52. So you say it's exactly like Java? by slasho81 · · Score: 1

    I think I like "D". "Java" was way too long for me.

  53. D or P? by doghouse41 · · Score: 1

    As I recall the ultimate ancestor of C was a language called CPL (Computer Programming Language), developed by Martin Richards et al at Cambridge (England) in the 60's. This was thought to be too hard to implement at the time, so a subset (Basic CPL or BCPL) had some popularity for a time into the 70's

    There was a short lived lanuage called "B", which ultimately gave rise to "C" (B*C*P*L) as developed by Kernighan and Ritchie in the 70's at Bell labs.

    So should we whould be calling any successor to "C" by the name "P"?

  54. Re:How about - open your mind to other ideas? by Anonymous Coward · · Score: 0

    Wasn't his entire point that there are no 'other ideas' in this new language.

  55. It's like Nick Wirth and Java had a child by MagikSlinger · · Score: 2

    Reading the document, I felt that old shuddering horror I felt when I learned Modula-2. M-2 looks great on paper until you try to build a major project with it.

    It sounds like he took Java's design aims and added Nicholas Wirth's bugbears (being an academic) and tried to marry them, but the problem I have is: what's the compelling reason to use this over Java? I didn't see anything in there that gives it a clear advantage over Java, and he doesn't give an alternative to templates. Templates, especially as implemented by C++ and Ada, can create type safe structures that a pure OO design can't (A Stack of Objects cannot distinguish what's being pushed onto it at compile time).

    Sounds like he's enjoying the ego trip of making his own language. Personally, I'd rather wait and see what Stroustroup's C++ Redux effort generates.

    --
    The bitter lessons of a veteran coder: http://bitterprogrammer.blogspot.com
  56. Re:Maybe? by MagikSlinger · · Score: 3, Informative

    While I think you have some valid points, you are far too eager to suckle at Microsoft's teat and call the watered down skim soya milk it gives 10% m.f. homogenized.

    I too like VB (quit staring at me like that!), and I agree with you that poor programmers give VB a bad man, but I big to differ on the idea that VB somehow protected you from Microsoft's shifting API's. You've read the reviews for VB.Net? Everyone VB programmer out there is screaming blue murder because the object model in VB has so radically changed that it requires re-learning VB. Yes, I said re-learning VB. MFC has changed their official "ways to do things" with each major release that it's necessary to re-learn MFC every major release. Sure, MS can provide some insulation from their API's, but even their insulation can't protect you from the pointy spikes that poke through everytime MS changes its architecture.

    One other thing:

    An entirely new programming paradigm where everything you ever wanted to do is neatly arranged within the various Class libraries. I know that in and of itself isn't new, but having that kind of support on the OS level IS new.

    As an embittered and disgruntled fan of NextStep, I vehemently disagree with your opinion. :-) You want a seriously kick-ass distributed networking object-based API? Try NextStep's Distributed Objects. Can you say, "Sweeeeeeet!"

    Other than that, I think you made some good points for people to think about.

    --
    The bitter lessons of a veteran coder: http://bitterprogrammer.blogspot.com
  57. Re:Convince me by fredrik70 · · Score: 1

    Well, I don't believe Java will ever reach the speed of c/c++, but then again 'good enough' will usually do: Just look at Windows ;-) From what I heard one reason for Swing being so slow is becuase of Sun, who really hasn't optimized the Swing libs much yet, hopefully it'll be better in the future...

    --
    if (!signature) { throw std::runtime_error("No sig!"); }
  58. Re:Convince me by Anonymous Coward · · Score: 0

    And, of course, native compiled Java isn't slow at all! See GCJ/GCC 3.0.

  59. Bounds checking by Anonymous Coward · · Score: 0

    If you know how to program then you don't write code with buffer overruns.

    The irony is that buffer overruns are easier to prevent in Basic or Java than in C, thanks to lbound()/ubound() or .length.

    1. Re:Bounds checking by Old+Wolf · · Score: 2

      This isn't irony at all, it's exactly my point: to maintain array bounds and check bounds is slow. It's good to be able to whack stars and square brackets in my C code and have it run fast, since I know what I'm doing.

      You can use a template-based array class in C++, which (at a guess) will be no slower than Basic or Java arrays:

      Array Karma(1000);
      Karma[1001] = 50; // bounds checked so doesnt crash

      etc. , and just not use the * and [] syntax. If you were feeling really leet, you could make some macros and typedefs to make your arrays look pretty Basic-like or C-like.

    2. Re:Bounds checking by SpryGuy · · Score: 1

      No, you miss the point made.

      It doesn't NECESSARILY make things that much slower. Especially on today's processors. But it does mean more memory must be allocated. In C/C++, you can pass an array or a buffer to a function, and that function might have no idea how BIG the array/buffer is, and has no way to find out (unless coded to take the length as a parameter, in which case it must TRUST the caller).

      With ubound/lbound and .length(), the routine can at least ask about the size and take care of things accordingly. You aren't checking on EACH access to a buffer or array element, only once up front.

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
    3. Re:Bounds checking by Old+Wolf · · Score: 1

      It doesn't mean more memory must be allocated. How do you think D (or other languages) keep track of the information required to store the length?

      If you pass an Array object in C++ to a function, it'll know how big it is, since Arrays do have the size property.

      If you don't want to check bounds on each access, then don't. Just provide the length() etc. functions.

    4. Re:Bounds checking by SpryGuy · · Score: 1

      C arrays do NOT know their length... and THAT was what I was comparing them with.

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
  60. It's not B, it's P by n0ano · · Score: 1

    How many people know that C was a successor to B which was a successor to BCPL? Based upon that analysis the successor language to C (or C++) should be P (I have no idea what the successor to L should be).

    --
    Don Dugger
    "Censeo Toto nos in Kansa esse decisse." - D. Gale
  61. Re:practical experience implementing compilers?? by Doctor+Memory · · Score: 1

    Maybe we should just go back to BCPL...

    --
    Just junk food for thought...
  62. Re:Convince me by Ashran · · Score: 1

    My machine is hand assembled and tweaked for high perfomance :)
    Theres nothing wrong with my PC, every person in the office has the same problem.

    --

    Before you email me, remember: "There is no god!"
  63. tangential: try-catch exception handling by Karmageddon · · Score: 1
    on the off-chance that any language/compiler designer/implementers out there read this thread, could I put in a request?

    Exception handling should be a "normal" part of the programmers toolkit, not just something used solely for error conditions. For example, a function like "strchr" (search a string for a character) should be available which "throws" the not-found result, rather than returning an exceptional or "distinguished" value such as the nullpointer. Same with eof on a read.

    To give the programmer this ability,

    • catch-throw need to be fast and efficient,
    yes, but they also
    • need to have a simple syntax.
    Calling such a "strchr" should not require several or even one extra layers of squigglies, nor should it require declaring an "extra" variable. The whole point is to eliminate the awkwardness of the temporary variable that distinguished values impose. The (relatively obsolete) language CLU provides a good attempt at this. (I can go into it if this thread provokes some interest.)

    The programmer also needs

    • the standard library to provide a rich but orthogonal set of functions that signal return conditions
    This is the biggest failing I found with Java. Java classes return all sorts of varying and kooky conditions embedded in values. Then, when I tried to implement my own exception-based class wrappers, I discovered that Symantec Visual Cafe had created a nightmare in their debugger:
    • debuggers should not automatically put a breakpoint everywhere an exception is thrown
    because when it's in a tight loop ... ouch.
    1. Re:tangential: try-catch exception handling by Karmageddon · · Score: 2
      Thinking about it more, I realize this whole -tuple method is a completely broken hack for solving the problem. Exceptions are the One True Way to handle these cases.

      Here, you can see the Right Thing is to write code naturally and functionally:

      float factorial (float x) {
      return x * factorial(x-1)
      catch overflow throw overflow;
      }

      that is a billion times better (I put infinitely first, but got an overflow :) than this:

      bool, float factorial(float x) {
      // and by now if you can't see what
      // is so fscked up about this approach
      // you shouldn't be writing code
      // forget about compilers... :)
      }

      Now, you're probably thinking "yeah, but overflow is an exception already" but my point is that looping over an array of strings and looking them up in a dictionary and doing something with the result should be treated just the same way: functionally till there is a not found, and it is so much more natural to write it as an exception rather than put that ugly if in there every time.

      This was my whole point in the beginning: stop thinking of exceptions as "errors" and think of them as normal control flow and build compilers that can handle it.

    2. Re:tangential: try-catch exception handling by anshil · · Score: 2

      Well multiple return values is an old problem, and excpetion throwing is just the latest solution that can be misused for this purporse.

      Well actually you can handle non errors also as exceptions, why not? But becare that exception catching is an expensive job. It requires some time to do multidrops (jump several functions call backward at once, not just one like the normal return), since the complete stack so far has to be cleared and destructed cleanly by that process.

      I'm not saying that exceptions this way is the last answer to the multi-return problem, however they can be misused in this condition.

      to declare a function with multi returns could be done rather easy:

      take this as dummy example:

      int32 , bool positivize(int32 a)
      {
      if (a 0) {
      return -a, true;
      } else {
      return a, false;
      }
      }

      This could be done easily with parsers/compilers however the problem arises how to call the function...
      positivize(4)

      Now how should this be treated furhter? So far there is no public solution to it.

      function(

      --

      --
      Karma 50, and all I got was this lousy T-Shirt.
    3. Re:tangential: try-catch exception handling by sharkticon · · Score: 1

      Or in Python:

      def positivize(x)
      if x > 0:
      return a, false
      else:
      return -a, true

      x, y = postivize(x)
      As Python has tuples as part of the language and they can be unpacked in this manner. I think Perl does something similar as well.
      --

    4. Re:tangential: try-catch exception handling by Karmageddon · · Score: 1
      Well multiple return values is an old problem, and excpetion throwing is just the latest solution that can be misused for this purporse.

      hmm... i don't love your "editorializing" in a supposedly informative answer, but as long as you are equally scrupulous in indicating that a distinguished value like -1 is also a misuse, I won't complain :)

      In any case, as a quibble, it is not particularly multiple return values that is at issue, it's multiple return types (I mean abstract type). Multiple return values is only the latest way of dealing with the issue of multiple return types :)

      It requires some time to do multidrops (jump several functions call backward at once, not just one like the normal return), since the complete stack so far has to be cleared and destructed cleanly by that process.

      actually, the language CLU that I referenced addresses this problem. You see, jumping several frames back up might be a useful compiler optimization, but as an error handling mechanism within the language it is just plain wrong. Let me illustrate with an example:

      If you call a function that signals "arithmetic overflow", you are interested only in arithmetic overflows that are related to the arguments that you passed in. But lets say the implementation of the function changes so that it uses a network socket to commuicate with some SETI@HOME machine that's doing the calculation... if the socket code also signals "arithmetic overflow" under some circumstances, it would be wrong for you to handle this exception because to you it is a "network error" exception having nothing to do with your arithmetic. Thus to be correct, a language should require every caller to dispose of every exception, even if it is to explicity rethrow. This makes exceptions travel up the stack just as returns do unless you wish to optimize. But in that case, the optimization makes exception handling a nice way to handle returns because it is similar semantically to a return from inside a deeply nested set of loops and ifs within a function.

    5. Re:tangential: try-catch exception handling by Karmageddon · · Score: 1

      I tested my other link when I posted it...
      newly correct link

    6. Re:tangential: try-catch exception handling by anshil · · Score: 2

      Tuplets and exceptions are still two completly different things.

      Think about a function that inverts in example complex numbers, using two integer types

      int32, int32 invert(int32 real, int32 imaginary)
      {
      // now how do you do this with exceptions?
      }

      or a function that searches for a specific string and returns the count of the strings, and the first occurnce?
      In c it would be:
      int32 count(const char *text, int32 &first);

      Could be written nicer with duplets:
      int32, int32 count(const char *text);

      Now how do you do this with Exceptions?

      --

      --
      Karma 50, and all I got was this lousy T-Shirt.
    7. Re:tangential: try-catch exception handling by Karmageddon · · Score: 1
      sure... but if you read the thread from where I started it (not deeply nested at all, BTW), the discussion I started was about execptions being useful for "normal" flow of control, not just for "errors". that is a point that seems lost on you and everyone else since you never say, "hey, good idea. I've never noticed that before..." it is an important point so I will keep harping on it till somebody gets it.

      tuples were proposed as an alternative but they don't accomplish the goal. you'll have to forgive me for attempting to stick to my own thread :)

      as to your advocacy of tuples in general, sure, but you need to tighten up your argument by talking about data types. when is a tuple common enough to warrant it's own type (a class or a struct)? should a tuple of a particular type be assignable to a struct of similar type? should a tuple of uniform type be assignable to an array or that type? etc.

    8. Re:tangential: try-catch exception handling by G+Neric · · Score: 1
      slashdot lost several of our comments. I just wanted you to know I did read one that you wrote where you talk about your father implementing a maze walker that was slow because he used exceptions.

      I don't know if you read my response to that (nor if you wrote a response), but in case you did not see it, it was essentially this:

      exceptions can be implemented as tuple returns (invisibly to the user) and that implementation is the same speed as a return and nobody ever says that returns are slow so exceptions don't need to be slow either. this method also unwinds the stack normally so it is simple. it is not as fast as jumping many frames up the stack but if you are doing that and solving the stack unwinding problem you could use that as a compiler optimizations for normal returns too.

      and this takes us right back to the beginning of the discussion so perhaps now after all this you'll understand what my original post said: it is wrong (from a language designers perspective) to think of exceptions as slow and it is wrong (from a language designers perspective) to think of exceptions as useful only for unusual error conditions. And if language designers stopped thinking about it wrong, language users would too.

      You also had one other comment i did not respond to but I will now: you said something like "but character not found in string is an error". I think it is better to think about this abstractly: if a particular character does not belong in a string, then finding it is an error. the function you call should not be passing judgement on what's an error or not, it should simply tell you the answer to "where is the character" including "nowhere" as an acceptable answer.

  64. Annoying compilers by Nicolas+MONNET · · Score: 1



    " It is an error to declare a local variable that is never referred to. Dead variables, like anachronistic dead code, is just a source of confusion for maintenance programmers. "

    I know the linux kernel is full of unreferenced variable warnings. Most likely, it's due to conditional programming. Without preprocessor, will the problem go away?

    I don't know; however I see one case where this is going to be annoying: when debugging, you often comment out chunks of code. Here you'll get an error. Ok, you have to comment out the variable definition, too.

  65. Re:weirdness by Anonymous Coward · · Score: 0

    Don't click here if you use Linux.

  66. parallel programming by CBravo · · Score: 1

    What I think is necessary is the ability to make programmes portable to parallel processors. C is sequential by nature and matlab doesn't really qualify as a programming language.

    I've seen big problems at a dsp-house where making the compiler was the biggest business. You see, no compiler meant no clients. When you know this is multi-million dollar figures...

    --
    nosig today
  67. Re:Convince me by Remote · · Score: 1

    If there is something about Java that means it conflicts with this (or some other important) VM, that would be interesting to hear.

    I'm not familiar with chip design and construction but I see a conflict; please educate me if I'm wrong: I don't see anything "virtual" about machine code being executed by a processor, specially one that can't be flashed. And the fact that a Pentium MMX instruction set is a superset of that of an 80386 does not mean that a Pentium has to use its "native" instructions to mimick those of the 80386.

    You seem to like Java. I'm trying it right now and I think it has its place. I've heard about benchmarks showing Java to be slower than C++ (my favourite) by a factor of less than 2, but the litmus test, for me, is to write some stuff and run it, and my experience has been that it is much slower, maybe by a factor of 5 or more. I must point out, though, that I'm using JBuilder 4, a gift from Borland when I bought C++Builder5.0, maybe Sun tools are better.

  68. yes, it does by KeizerHein · · Score: 1

    yes, and there's are a lot more literate programming tools around.
    Personnly I'm charmed by Donald Knuth 's WEB, it uses TeX as a nice bonus.

  69. Re:After C comes P! by $pacemold · · Score: 1

    > First their was BCPL, then B, then C. Logically the next language in this family would be P. No, no, no. First there was CPL. And logically the next language will be PL. PL/1, to be precise. Boy, I do feel old, too.

  70. BCPL's successors by yerricde · · Score: 1

    Anyone who really knows the origins of the language "C" knows that its successor should be called "P"

    First, there was B. Then there was C. Then there was P, the first letter of the "plus" in C++. Then there was L, but it was really a backward J for Java.

    --
    Will I retire or break 10K?
  71. Re:Nothing special... by pallex · · Score: 1

    "Dynamic array
    Fixing some inconsistency issues of C's syntax ...to make it prettier
    Unicode character support "

    Why didnt he call it Visual Basic?

  72. Re:Sounds like the same reasoning that lead to Jav by IPFreely · · Score: 1

    I did read the spec. I was refering to the purpose/reason for new design, not the implementation.

    --
    There is nothing so silly as other peoples traditions, and nothing so sacred as our own.
  73. Re:The only thing new is the name by mooneyguy · · Score: 1
    BCPL. But .pl is already taken.

    As are .p and .l, unfortunately. :-/

    --
    Mooney Guy N4074H
  74. Re:weirdness by klui · · Score: 1

    Easier to write vaporware.

  75. Re:No, "Fith" is a spoken language by RevAaron · · Score: 2
    Interesting. Not the same thing I'm talking about though, however- this was a programming language with an interpreter for DOS. I can still see the greeting banner it displayed when you started it up.

    PostScript and Forth may be based on some of the same ideas (stack-based), but they're far different in purpose, so I wouldn't say PS is Forth's successor.

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  76. Here's the link by Doug+Merritt · · Score: 2
    I agree that Goldberg's "What Every Computer Scientist Needs to Know about Floating Point Arithmetic" is a good and important read. Google found it several places, including at citeseer

    But you know, just yesterday I re-read 80% of Kahan's site, and he does in fact recommend that non-expert numerical analysists (i.e. just about everyone) should use the maximum precision possible, as a sort of band-aid. Not that a guru like him thinks it's a cure-all, just that it'll help people a bit.

    So Walter isn't that far wrong there, after all.

    --
    Professional Wild-Eyed Visionary
    1. Re:Here's the link by fullcity · · Score: 1
      Good point. And after reading some of the Generic Java stuff somebody up there pointed out, particularly Guy Steele's 1998 OOPSLA keynote, I realize I shouldn't be so harsh.

      A Big Language That Everybody Can Use For Everything could maybe have these FP datatypes:

      • IEEE 754 single precision
      • IEEE 754 double precision
      • IEEE 754 "double-extended"-compliant type
      • IEEE 754 quadruple precision
      • greatest available hardware-supported precision
      The D language could perhaps support only the last type initially. Then the language could be "grown" (in Steele's sense) to support the others. So not a tragedy.

      And less tragic still if he'd put overloaded operators back in (see Steele on Java's BigNums).

  77. Re:After C comes P! by RevAaron · · Score: 2
    Heh. The funny this is that bigForth seems to have more mature tools than the Python and Ruby, which both boast their OO-productivity. bigForth has a GUI editor, an Object system, a class browser, and a whole bunch of other stuff- all written in Forth.

    I'm no Forth bigot, but give bigForth a try- it's fun! I say, I'm impressed!

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  78. Re:Nothing special... by frleong · · Score: 1
    Why didnt he call it Visual Basic?

    Simple answer: because anything that is VB-like is not C-like and anything that is C-like is not VB-like.

    --
    ¦ ©® ±
  79. the successor to C is limbo by DrSkwid · · Score: 1

    A Descent into Limbo
    Brian W. Kernighan
    http://cgi.www.vitanuova.com/inferno/papers/desc en t.html

    The Limbo Programming Language
    Dennis M. Ritchie
    http://cgi.www.vitanuova.com/inferno/papers/limb o. html

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  80. Re:practical experience implementing compilers?? by hey! · · Score: 2

    I am aware (slightly) of literate programming.

    Literate programming, Code-in-html and what I am suggesting have in common that they intersperse code with documentation in markup language. What I am suggesting is different, in that I believe the markup should be semantic, not stylistic in nature. I don't care about the point size of typeface of the comment, but I do care about the nature of the information each comment carries.

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  81. Re:Sounds like... by tb3 · · Score: 2
    Thanks, I knew Zortech, Wizard, and Lattice were bought, but I got the buyers muddled.

    I think Walter Bright should be encouraged to keep doing what he is doing. Your comments about TopSpeed (I remember that one, too) are an illustration of how the software industry is going today; a small number of big companies buying a large number of small companies, with deminishing choices for the consumer. Let's encourage all the innovtion we can, even if we dont' think the idea is particularly sound.

    --

    www.lucernesys.comHorizon: Calendar-based personal finance

  82. Re:practical experience implementing compilers?? by MrDolby · · Score: 1

    What the Baltimore County Public Library? I used to work there for a little while.



    "This is a joke and not to be taken seriously"

  83. Re:No templates? by Anonymous Coward · · Score: 0

    You obviously don't understand what a template is. Smalltalk and Java and a whole lot of other languages (excepting Haskell, Eiffel and the likes)have generic programming in the same vein as C has: through the use of void*. Whether you call them void* or Object doesn't really matter, the only thing Smalltalk adds is the ability to do a runtime check for the actual type. This is not generic programming where the types are correct and known at all times.

  84. Re:Maybe? by bmajik · · Score: 2

    I like VB.NET.

    Given that I converted several hundred program from VB to VB.NET, I can speak on how different the two are.

    Essentially, if you "just got by" with VB6 because of how simple a world view it could present, you may be in for a small learning curve with VB.NET

    Now the good part:
    If you can program in any C-family language, perl, or anything moderately more complex than VB, you're going to love VB.NET because you get to keep the simplicy of VB 95% of the time, but you get 99% of the power of C whenever you want it. These percentages are of course made up, but for those of you that are following C# and like it - VB.NET is almost the same language, what-you-can-do-wise :) They both compile to CLR, and VB and C# can use eachothers classes interchangably. Each has its own specific quirks and strengths, but in general, if you can do it with C#, you can do it with VB.NET, and if you cant, then just do that part in C# (or Managed C++) and then consume it from VB.NET.

    You'll be happy to know that there is no longer a VB runtime - now theres a .NET runtime, and vb simply compiles to it. You'll also be happy to know that theres now a standalone commandline vb compiler. Best of all, theres a standard VB project type called "Console Application". No silly forms ever get involved - at all.

    On the other end of the spectrum, theres a VB project template for creating Windows NT services. This was not even necessarily possible with VB6 - and to do many interesting things in VB6 you needed to import Win32 functions.

    So in general, i think people that are programmers will love VB.NET - it gives all the long-time vb haters and complainers many things they've been asking for - and then some.

    On the other hand, people that can barely grasp VB6 may be in trouble - the new power and flexibility of VB.NET does come at a price in terms of complexity of auto-generated code. If you're already in trouble when you accidentally go into the code window instead of the design window, expect problems with VB.NET.

    --
    My opinions are my own, and do not necessarily represent those of my employer.
  85. Price for everything... by Svartalf · · Score: 2

    Some Java code can run as fast as the native compiled code. Some can't. It's the curse of having that VM- it eats extra cycles, even if it's JIT compiling huge swaths of code (It DOES take time to transcode the bytecodes to native machine code...).

    In the case of the UI's, it's partly a problem that Java just isn't QUITE as fast as either C or C++ and that you've got the sandbox in the way- amongst other things.

    --
    I am not merely a "consumer" or a "taxpayer". I am a Citizen of the State of Texas
  86. Java revisited... by Glock27 · · Score: 1
    Let's see...similarities of D to Java:

    o Single inheritance only
    o All memory access through references
    o Garbage collected
    o No templates
    o No operator overloading
    o No preprocessor

    Differences between D and Java:

    o Unicode supported in source code
    o No religion (ROFL)

    Walter seems to be confused about some things. First, Java doesn't require a VM. See gcj for instance (there are also other traditional Java compilers, such as Transvirtual).

    Also, Walter seems to not understand the value of operator overloading in a very large problem domain - mathematics. This is especially sad given Unicode source code, meaning real math symbols could be used.

    Overall, if I had to grade this language design, I'd have to give it a "D". ;-) It is a very minor knockoff of Java.

    I seriously doubt this language will become popular. If you like it, learn Java...the "Java is slow" mantra is just plain wrong these days.

    186,282 mi/s...not just a good idea, its the law!

    --
    Galileo: "The Earth revolves around the Sun!"
    Score: -1 100% Flamebait
    1. Re:Java revisited... by SpryGuy · · Score: 1

      And lets not forget that Java 1.4 introduces a beta of generics, so people can start working with type-safe collections as soon as this fall... with them being fully incorporated into the language with version 1.5 (18 months later).

      And Java has a damn good (and getting better all the time) class library. Especially once you get into J2EE, with the messaging and logging apis available...

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
  87. Re:Maybe? by uid8472 · · Score: 1

    With VB, you don't care about all the "stuff" underneath (which can be a problem when you try to do something that isn't built-in, but there are creative solutions). You just drag controls onto your window, and write the code behind them. Very easy.

    NeXT/Apple's InterfaceBuilder does just that, but using Objective-C (a small set of extensions to C) instead of a specialized language. You literally draw lines between controls and instance variables, or between buttons and methods.

  88. Re:here comes another war.... by Anonymous Coward · · Score: 0

    I just wanted to reply becuase you wentthrough so much trouble writing what you wrote and nobdy seemed to care.

  89. Re:First Parrot by Anonymous Coward · · Score: 1, Funny

    "C-Pound"? I thought it was "C-Sharp". Actually, I've been calling it "D-Flat" which is the same note, and the word "flat" matches my expectations of Microsoft's language so much better than "sharp".

  90. Re:SECURITY BY DEFAULT by Anonymous Coward · · Score: 0

    It's been done... once in 83, and revised in 95.... it's called Ada. Check it out.

  91. Re:Forth !!!! by cosmo7 · · Score: 1

    : years 10 ;
    : pain SysBeep(10) ;

    i Forth like
    Forth years used->i
    Forth good_qualities =
    readability dup rot pop pop
    work_at_it if readable then

    something_you_wrote a_long_time_ago = if pain then

    someone_else_code

    nifty_return_stack_tricks
    if pain pain pain
    else pain
    then

  92. Putting the "Science" into "Computer Science" by dunkstr · · Score: 1

    Okay, so the vast majority of programmers are close-minded zealots who make ultimatums on the languages they like to use: "It must have operator overloading!", "Templates are the one and true way!", "It must have the power of assembly language." Granted, for what they're doing these statements make sense; but perhaps they're improperly implemented. There are hundreds of languages out there which were introduced to replace the inconsistancies of C and C++. Some have failed because they never got off the drawing board; others were ignored by the industry; and still others just don't work in practice. But these issues can be resolved. The answer to the "Quest for the Ultimate Programming Language"? Empiricism! You know "Human Interface Testing"? Why can't these ideas be applied to programming languages? Compare two languages with similar features except one difference, say "Templates." Have a team of programmers write a simple program, a medium program and a large project with the aid of templates. Have another team write the same programs without them. Compare and analyze. I understand that this idealism can never be put into practice as is; the resources required would be incredible. But surely we can make some small steps. Let's add a list of papers in the spirit of "Goto Statement Considered Harmful." In the future we might see headlines on slashdot like "Multiple inheritance not worth the trouble." Remember, back yourself up with statistics, peer-review and examples; not sophistry!

    1. Re:Putting the "Science" into "Computer Science" by smittyoneeach · · Score: 1

      Time is an even better judge.
      Give it five years, see if C++0x lives up to the anticipation, or we all just get better hardware and do Java.
      I'm curious to see how big of a performance hit the garbage collection makes on the fully compiled language.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  93. Re:switches by rabidcow · · Score: 1

    Anything you can do with switch statement you can do with if...elses.

    And in some cases, if your values are packed closely enough, you can use an array of funcion pointers. (Or better yet, just a simple jump table, but I don't know how that'd work in C. What's the type of a label?)

    If anyone does any improvements to switch, it needs ranges more than strings. I mean really:

    case 7: case 8: case 9: case 10: case 11: -- or something like: -- case (7,11):
  94. Re:First Parrot by Anonymous Coward · · Score: 0

    I'll stick to good ol' C-cross-cross

  95. Re:Garbage collection and all that by reflective+recursion · · Score: 1

    Reference counting is the worst of all garbage collection algorithms, IMO. It can leave cyclic data structures left behind (not to mention costs of incrementing/decrementing a counter.. and the storage of the counter in each object/block of memory used). Anyone considering doing GC should definately look at all the work which has been done w/ Lisp, Scheme, and the various other languages which have garbage collection built into the language design. Generational collectors (using something like mark-and-sweep or stop-and-copy methods) are probably some of the best as of now. There are also incremental (real-time) garbage collectors. On top of that are the differences of conservative and exact collectors (where conservative misses a few objects here and there and exact gets every object).

    Ideally the programmer would never have to think about memory (and generally resource) usage, but just program design. Which is probably why Lisp is looking much nicer to me these days. ;-)

    --
    Dijkstra Considered Dead
  96. Why another new language ? by mguesdon · · Score: 1

    Sun made new one (Java)

    Microsoft too (c$ oups, sorry c#)

    Why not using existing ones like Objective-C which is, like C++, based on C with OO but, unlike C++, have real dynamic capacities.

    It support Garbage collector, it has several (good) libraries like GNUstep ones, it is more flexible (for exemple, you don't have to recompile all your projects and librairies when adding a "Virtual" method).

    There's multiple implementation (gcc support it, for exemple). It's possible to make an interpretor if you dislike compilation (NeXT did this kind of thing for WebObjects).

    So, why "inventing" a new language ?
  97. Encore! Encore! by JoeShmoe · · Score: 1, Offtopic

    From the same dictionary:

    1) "!", ASCII code 33.

    Common names: bang; pling; excl; shriek; exclamation mark; factorial; not; exclam; smash; cuss; boing; yell; wow; hey; wham; eureka; soldier; spark-spot.

    pling pling, you're dead!

    - JoeShmoe

    --
    -- I wonder which will go down in history as the bigger failure: the War on Drugs or the War on Filesharing
  98. Branch prediction, etc. by Yenya · · Score: 1
    There are features which are missing on every programming language I know (and which have the ambitions to be used in high-performance computing):
    • Branch prediction: Modern CPUs (UltraSparc II, etc.) have two types of branch instruction. First one is attributed that in most cases the code continues after the instruction, and the other one is attributed that in most cases the code jumps to a different address. The GNU C has __attribute__(branch) or something like that. I think there should be two variants of the if statement.
    • Memory barrier: The ability to finish the previous store instructions, and serialize WRT write reordering and other CPUs.
    And one more thing: IMHO the ability to use the preprocessor is worth the additional complexity. And it even allows to extend the language somewhat (conditional compiles, etc).

    --
    -Yenya
    --
    While Linux is larger than Emacs, at least Linux has the excuse that it has to be. --Linus
  99. generics in ocaml? by Anonymous Coward · · Score: 0

    I have become extremely interested in ocaml for numerical analysis lately.

    However, I thought I read someplace that ocaml doesn't have generics. Is this true? I really don't know (and couldn't find the answer after a quick read of the site).

    1. Re:generics in ocaml? by Anonymous Coward · · Score: 0

      You can do 'generic' programming in OCaml with classes or functions, since the type system permits 'a 'b 'c pretty much anywhere it doesn't break typing.

      You can't achieve ad-hoc polymorphism, but you can use modules to store equally named functions.

      When G'Caml is merged into OCaml, this will be different.

      OCaml r0x, except its object system has too much in common with C++, and not enough with LISP.

    2. Re:generics in ocaml? by Chuck+Messenger · · Score: 1

      I'm unfortunately a mere beginner at Ocaml -- working through a tutorial (slowly). As I understand it, you can use the module system to achieve generic programming. But I haven't tried it out myself ... yet.

  100. G'Caml URL by auntfloyd · · Score: 1
  101. No, "Fith" is a spoken language by yerricde · · Score: 1

    Actually, there was a successor to Forth called Fifth. Forth with OO extensions, IIRC.

    Fith is a spoken language with a stack grammar. It's reported to be very hard for humans to speak in real time because humans seem to have a register architecture.

    The true successor to forth is PostScript.

    --
    Will I retire or break 10K?
  102. Re:Maybe? by Anonymous Coward · · Score: 0

    I suspect you haven't actually done much programing. It would be interesting for you to name some of these 'redundant funtions' you are talking about.

  103. There's been a "D". The next one should be "P" by Ungrounded+Lightning · · Score: 2

    There has already been a "D" language. It was written and used in an early phase of the Xanadu project, when C was still young. It compiled into C (essentially a preprocessor) to give it a number of features that were missing at the time. (One that sticks in my mind is long names, though there were several others of significance.)

    (It led to an interesting confrontation at one point. Roger Gregory was accosted by a member of one of a cult, who gave him a flower and started on the cult's conversion spiel. When the cultist got to the first question (your occupation) he said "I'm a 'D' programmer.". Of course the cultist heard it as "deprogrammer" and ran.)

    I hear that the language "BCPL" was part of the inspiration first for a language called "B" and then for "C". By that precedent the first non-superset successor to "C" should be "P".

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  104. Problems with D as I see them by Anonymous Coward · · Score: 0

    - no templates
    - no fixed size for int, double, etc (a.k.a., non-portable code will result).
    - no deterministic finalization (a.k.a. scoped object destruction)
    - no pre-processor (although it is easy enough to roll your own on top of it, as I do with javac)
    - no first class callback mechanism like C#'s delegates (don't get me started with interfaces - they do not have one quarter the flexibility of function pointers).

    It's a good start however.

    1. Re:Problems with D as I see them by Flabdabb+Hubbard · · Score: 0

      Templates are surely a bad thing ? There must be a better way to achive genericity than templates.

    2. Re:Problems with D as I see them by SpryGuy · · Score: 1

      Check out the proposed implementation of generics for Java, in the 1.4/1.5 specs.

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
  105. Still no introspection by kwerle · · Score: 1

    I'm tired of new OO languages that don't let me ask SomeClass.respondsToMethod("SomeMethod", someArgTypes).

    And also still suffers fragile base class issues in spades.

    In D, all non-static member functions are virtual. This may sound inefficient, but since the D compiler knows all of the class heirarchy when generating code, all functions that are not overridden can be optimized to be non-virtual. In fact, since C++ programmers tend to "when in doubt, make it virtual", the D way of "make it virtual unless we can prove it can be made non-virtual" results on average much more direct function calls. It also results in fewer bugs caused by not declaring a function virtual that gets overridden.

    This is great if you're compiling an entire system, but if you're shipping or using someone else's library, it's less good. Even worse if you plan on loading anything dynamically. Java does a great job of this - but people haven't figured out how to use it yet. ObjC and the Foundation&AppKit Frameworks are great examples.

  106. Re:Here's what D can't do... by RevAaron · · Score: 2

    After using C++ how can someone still want to use it???

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  107. Re:Give it a chance. by krokodil · · Score: 2
    > This sort of staement really amazes me. Are you so
    > righteous that you think Java and C++ are the answer
    > to all programming problems? Get real. They both
    > have their place, and there's nothing to say
    > that D might not have its place too.

    If he would invent something really new I would not argue. What he offers is another facelift to C++ which was extention of C. He offers it in a way very similar to Java.

    For fresh approach to OO languages take a look at
    OZ. I wish I had more time to play with it. Looks quite interesting.

    I really get disappointed when people invent pet language for their project when there are thousands of other lanugages which you could use. For my projects I am using
    GUILE.

  108. wah by Bongzilla · · Score: 1
    Features to drop include link compatibility with c++, because, according to the overview, that would make the compiler have to have a c++ compiler build in.

    No word as to whether or not it would be a good idea to be able to link to c++ modules, just a quick brush off that the c++ object spec is too complicated.

    --

    ;///////////////////////////////////////////////// /
  109. Re:Sounds like the same reasoning that lead to Jav by snatchitup · · Score: 1

    So it's just a compiled Java?

  110. This could be trivially compiled into C-- by ralphbecket · · Score: 1
    This looks like C-- with some syntactic sugar and a bit of object wobble thrown in. In fact it also smells a little bit like Oberon.

    I'm not a great fan of OO languages (just how much syntax do you really need?), but it would be wonderful if somebody would get rid of the pointless `new' keyword for object construction, add algebraic datatypes and pattern matching, and add closures as first class objects.

    But when you use genuinely modern declarative languages (Mercury, OCaml, Haskell, ...) there's no real incentive to go back. It's like good hi-fi.

  111. I Like it by hey · · Score: 1
    So many of the comments are negative so I just want to say that I like it and with I was using it now instead of dumb C++. Every time I have to declare a member or function twice (in heading and .cpp file) I curse C++ and D fixes that.

    Java isn't an option because it requires a VM (usually) and can't using the standard C APIs. On Windows you need the real APIs or you are in a "play" language. So D looks drop-i ready to replace C++ and that's fine with me.

    1. Re:I Like it by smittyoneeach · · Score: 1

      Every time I have to declare a member or function twice
      The first time it's a declaration; the second time it's a definition.
      (in heading and .cpp file)
      That's not a bug, that's a feature. You could as reasonably criticize a book for having a table of contents.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  112. Re:Convince me by Anonymous Coward · · Score: 0

    Maybe you should wait for you're 13 to start commenting on Slashdot, you illiterate piece of shit.

  113. Re:Convince me by renoX · · Score: 1

    I'm not a Java zealot at all, au contraire:
    - I hate the speed of Java and the number of bugs in the API.
    - I liked Swing API but its slowness was unbearable.

    But you're overlooking simple explanation why the Java UI is so slow:
    1) Java can be as fast as C++: I doubt it very much (except for two linersw) but anyway this require "clever" programming IMHO.
    So maybe there haven't been enough effort spent on trying to speed Java's UI..

    2) the native compiled code can use the hardware acceleration of the video card: a big help!

    Of course Java cannot (could not?) use hardware acceleration..
    I heard that the future release Java 1.4 will be able to use some hardware acceleration, maybe it'll help..

    For those who ask, no I haven't tested the beta of Java 1.4, "stable" Java librairies are (were?) buggy enough that I won't bother trying a beta.

  114. Embedding D in HTML by linuxrunner · · Score: 1

    Why can we not do this in C or C++.... Think of what we might be able to do if embedding could happen..

    I guess also think of the virii that would spread due to this ability.

    "ooo, ooooh... visit my site for great pron..." and then Wham!

    I guess there's two sides to every coin!

    Linuxrunner

    --
    www.slightlycrewed.com - Because aren't we all?
  115. Same old same old! For a change, try O'Caml by Tom7 · · Score: 2


    This language looks to be the same as everyone else's attempt to make a modern C-like language (ie, Java, C#). What is the point?

    For a fast (as fast as C, maybe faster), safe language with some really neat (and probably unfamilar) features, try O'Caml. This will cure your doldroms, and you may never want to go back...

    http://caml.inria.fr/

  116. Convince me: On (re)inventing the language wheel. by kanayo · · Score: 1

    There is already a ridiculous number of programming languages out there to do just about anything imaginable.

    Before I can be convinced to adopt another language, what I really want to know is why we absolutely need this language, and what it has to offer that other languages do not, and if it will be an openly-specified language accepted by academia and all major standards bodies.

  117. Re:Nothing special... by frleong · · Score: 1
    The thing is though, as he says in the overview, these "nothing special" things save time. Sure, they're not necessary, and we live with C's little oddities without problem at the moment. But, if we don't have to worry about those then we can be more productive, and hopefully less coding mistakes are made.

    Yeah, the new syntax breaks legacy C code. Your existing libraries won't compile. If the compiler allows dual mode, it will be even more confusing. How productive is that?

    Java took almost five years to get more or less a complete framework and library functions. OK, this D language is more C-like, but you'll still need to wait at least one year.

    --
    ¦ ©® ±
  118. Sounds Ok but needs Interfaces... by Morocco+Mole · · Score: 2, Interesting

    Here's my 2 cents: D Sounds ok. I DO like the idea that a typedef actually creates a new type. But as a C++ programmer of 9+ years who is not "terrified" of managing his own memory, and who thinks that operator overloading and templates are cool, I have some issues with the draft standard as it stands:

    1) Templates: I hope that Mr. Bright does find an answer. I agree that C++ template syntax is tough, but the power of generic programming is far too great a feature to drop for large applications!

    2) Operator overloading: I like it, many people don't. Used properly you can make some very cool looking type safe code. I don't think a very powerful feature should be dropped from a language just because some people are idiots. C++ is not a toy; and neither should it's successor be.

    3) Interfaces: Hello out there? The world has gone distributed. How about direct language support for CORBA interfaces? Now THAT would be a slick feature to add to an extended C++ language!

    4) Standardize the name mangling! Name mangling issues are what make different C++ compilers incompatible; let's fix this oversight...

    5) Garbage Collection: I'm ok with garbage collection but DO give me a way to override the collector! There will always be situations where I know I can get rid of something but the garbage collector wouldn't see it that way. DO give me a way to manually kick off a garbage collection cycle and DO give me a way to manually delete things.

    6) I'm working on a million line+ surface ship combat system right now. One thing that the old Ada programmers keep screaming about is the inability to get very fine grained control over numbers; and for this application I can see why they are complaining. What's needed is a way to enforce the domain of a numeric type, ala low bound high bound with an exception thrown for invalid values. Very fine grained control over coordinate and range values is key to a large class of military applications.

    I've been pondering my own new language too. Maybe I should go for it. My language would look alot like C++/D - with the items listed above - plus some other ideas that I've been pondering...

    --Richard

  119. Re:Convince me by Lemmy+Caution · · Score: 2

    By "Java can be as fast as C++," do you mean that "C++ can be as slow as Java?" It takes some doing, but I'm been able to code that badly.

  120. Re:Great feature, but. . . by IpalindromeI · · Score: 1

    We have a language that automatically documents itself! It's called COBOL! Write a thesis essay while trying to make a simple file sort. Woo!

    --

    --
    Promoting critical thinking since 1994.
  121. A teensy weensy little flaw in that idea by Anonymous+Brave+Guy · · Score: 1

    Of course it's too much to ask for. You're asking the impossible.

    The thing is, you can focus on certain areas of a language, make them better (by whatever definition), but you sacrifice elsewhere to do it. Java sacrifices performance for safety and ease of use. C++ does the opposite. Neither will ever equal the other on its greatest strengths.

    For example, you want a program that's easy to port across platforms, with just a recompile. However, to do that, you need to use features that are in the least common denominator only. You can't take advantage of any extra power offered by a given platform, because it wouldn't compile just like that on another. This is one of the biggest stumbling blocks a language such as Java must face.

    The alternative is to write an emulation of every feature from every platform on every other platform that does not support it. Aside from the fact that this may be far from the most efficient solution to a given problem on the second platform -- perhaps, given different strong points, another algorithm is simply more appropriate -- it's also impossible in practice.

    As another example, you want predictable behaviour, yet also high performance. You can't have both. Predictable behaviour => many tests to keep things safe. High performance => minimal tests to keep things safe, because tests take time. Are you going to check the result of every floating point calculation to make sure you're not about to divide by zero? Oops, there goes your "high performance" maths app.

    There can never be a single, ultimate language. As I've noted here before, you simply need more than one tool in the box. There may be a best tool for any given job done by any given person, but that's a different matter.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  122. Re:Convince me by Vanders · · Score: 3, Insightful

    It's unfair to compare a Java UI directly with a native UI.

    Why? Users don't care about wether your application has a slow user interface, all they'll do is complain that "This program is slow"

    Java has a place, and by extension Java UI's have their place. But saying "Oh well it's O.K for the user interface to be slow, because it will run equally slow across all platforms" is a load of rubbish. If Java code can run just as fast as native compiled C or C++, just why are the Java User Interfaces slow?

    Any Java zealots want to clear up the aparent contradiction there?

  123. Re:templates and operator overloading are good thi by karb · · Score: 2
    I agree. I've been programming for real :) for about a year now. I'm starting to get really annoyed with java about the lack of operator overloading and genericity.

    I find it humorous, because two of the 'advantages' of java were simplicity through lack of support of templates and operator overloading.

    But, now that the language is mature, and the people using it want a more mature language, they are probably going to add genericity back in :).

    Which kind of leads me to the thought that, in general, the whole idea of 'leaving features out because they aren't used' is flawed. Leaving features out for other reasons is good. But perceptions of lack of use are not.

    --

    Jack Valenti and the MPAA are to technology as the Boston strangler is to the woman home alone

  124. conservative language: java-- by jilles · · Score: 2

    I read the specs. 20 years ago it would have been impressive, but now...

    Lets summarize:
    - no generics, yet (he was 'thinking' about it)
    - I haven't spotted an interface construct like in Java, very useful and no performance penalty -> include it!!
    - no dynamic classloading, another useful Java feature
    - no reflective features, another useful Java feature.
    - no new features worth mentioning

    I would propose this language were called Java--. It removes features the author of the spec deems irrelevant and doesn't add any new ones. Java has its flaws but these flaws are tolerated because it also adds useful features.

    Incidently, the VM approach has been adopted by MS now in .Net for a very good reason: it adds a great deal of flexibility. Java has already shown that VMs can efficiently execute numerical code. HP has shown that interpreting bytecode can actually be faster than compiling it. There is no sound reason to dismiss the concept of a VM anymore. Java vms are even available on embedded machines now so size is not an issue either.

    If the author of the spec still wants to go ahead with implementing D (aka Java--), I'd strongly suggest to make it compile to .Net, the JVM or some other vm (unix currently lacks one) so that you can at least take advantage of the features and libraries offered by such environments.

    And finally, there is no market for this language. C/C++ programmers are generally so much in love with the language that they are virtually blind for its disadvantages and ignore/dismiss competing languages (of which there are many). Based on this it is safe to assume that most of them will also dismiss D, no matter how good it is. And since I already argued that the language really doesn't add anything new, programmers of other languages will also not be inclined to swap language.

    It is funny that all attempts to make a new language that looks like C++ but doesn't have its advantages end up looking like Java. Maybe the Sun guys got it right after all. It certainly is a nice language to program in.

    --

    Jilles
    1. Re:conservative language: java-- by Eccles · · Score: 1

      C/C++ programmers are generally so much in love with the language that they are virtually blind for its disadvantages and ignore/dismiss competing languages

      It's not just the language. For all the advantages of Lisp, Haskell, Eiffel, Sather, et al, there's nothing like the community and spread of C/C++. With C, I can work on the Linux kernel, Gnome, et al. C++ adds KDE, Mozilla, yadda yadda. What would I do with a "better" language? For all their warts, C and C++ are the lingua franca of programming, and trying to push other languages is rather like being a fan of Esperanto.

      --
      Ooh, a sarcasm detector. Oh, that's a real useful invention.
    2. Re:conservative language: java-- by Anonymous Coward · · Score: 0

      "Incidently, the VM approach has been adopted by MS now in .Net for a very good reason: it adds a great deal of flexibility. Java has already shown that VMs can efficiently execute numerical code. HP has shown that interpreting bytecode can actually be faster than compiling it. There is no sound reason to dismiss the concept of a VM anymore. Java vms are even available on embedded machines now so size is not an issue either. "

      Except .NET doen't use a VM, all code is compiled
      ultimately to native, the bytecode is only
      a common intermediate for binding everyone to a common starting point for native code generation.

  125. Re:First Parrot by RevAaron · · Score: 2

    Even better- I was browsing the Simtel archives, and was quite amused to find a language called B-flat. :)

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  126. Pure FTP? by cpeterso · · Score: 1


    If Forth is so great, why didn't you write your Pure FTP daemon in Forth instead of C?

  127. Re:Why would we need another language? by Rocky · · Score: 1

    Aaaaagh! Mine eyes! I cannot see! It burns us!

    --
    "I'm an old-fashioned type of guy. I worship the Sun and Moon as gods. And fear them."
  128. Re:The only thing new is the name by Anonymous Coward · · Score: 0

    I am not very familiar with Java, but is this not the same:

    try { // try
    try {
    // do something
    } catch(A a) { // catch
    throw;
    }
    } catch(...) {
    // finally
    throw;
    }

  129. class library by Pivot · · Score: 1

    I think the neatness and power of java (when not used to create applets) is the standard class library.

    It will be interesting to see what develops of this language and hopefully standard (cross platform?) class library.

  130. Re:Java's fatal flaw by Reality+Master+101 · · Score: 1

    Oops, this should be:

    short b = 0xa000;
    long a = b;

    --
    Sometimes it's best to just let stupid people be stupid.
  131. reminds me by anshil · · Score: 2

    of my project! However there are some differences.... I do plan to allow templates and operator overloads, however currently these two feature a vapor, since they are not yet supported

    I called it Dtone, since I thought calling it just D would be arrogant, claming a single letter name. However it seems others didn't disturb that :o)

    Well it's not nice to link to ones own page, and advertise on /. but:
    http://w ww.dtone.org

    --

    --
    Karma 50, and all I got was this lousy T-Shirt.
  132. Re:Maybe? by scott1853 · · Score: 1

    You're obviously not one of the ones that has had to write components and are speaking on behalf of a group that you have no information on.

    I didn't say it was impossible to do anything with objects descended from the VCL, it's just hard to do certain things that can be very important. That makes something sucky.

    Also, I haven't seen too many good 3rd party components that have been derived from the standard VCL components. :P

  133. Re:Why not completely from scratch? by Anonymous Coward · · Score: 0
    I agree. If I were to design a language today, I would make it *really* visual. When I first heard "Visual BASIC", I envisioned something like VISEO where you would just layout a diagramatic algorithm. Syntax would be minimal.

    I was very disappointed to find out that Visual BASIC was just a fancy colorful editor for a very syntax and typing intensive code.

    Wouldn't it be great to just layout the program on a giant whiteboard with drag'n'drop objects? Connect them with lines, right click on the line and set parameters, etc.

    Disclaimer: I'm a civil engineer. I've never written code in C. I know FORTRAN and I currently write Visual BASIC code for relatively simple MS Access databases. My wife programs in C and Perl.

  134. Object vs. templates by Anonymous Coward · · Score: 0

    > an industrious C++ programmer could... > use Object types instead of templating People have already tried to do this. However, there is a serious problem with this approach: Other people's classes wont extend your Object. Of course, you could easily get around that by misuse of multiple inheritance, so that class Foo; class Bar : public Foo; are supplemented by class FooObj : public Object, public Foo; class BarObj : public FooObj, public Bar; With an alternative like this, no wonder templates are so popular in C++! They are somewhat redundant in a language with a singly-rooted hierarchy, but I'd like to see them added to Java anyway, mainly because I hate writing code like int n = ((Number) myList.remove(0)).intValue();

  135. Re:Convince me by Anonymous Coward · · Score: 0

    Java machine

  136. Re:can you say "Java?" by Anonymous Coward · · Score: 0
    there seem to be some of the more useful features of C++ thrown in (typedefs, scope operator, etc.).

    Nitpicky, but java, lacking namespaces and having packages, doesn't really need the scope operator. It has ".". This language, also lacking namespaces, would presumably also not have the scope operator. Java could use typedefs though. Have y'ever seen Jasmin (write asm to java vm, generate valid byte code output), good for your point.

  137. Re:ASM ROCKS !!! :) by Old+Wolf · · Score: 3, Funny

    There used to be a guy called Stewart something on Fidonet programming board, who would argue that ASM was the most portable of any language, and he could cross-compile his project (with millions of lines of code) onto any new CPU. It was great fun

  138. Re:Interesting idea, but... by Anonymous Coward · · Score: 0

    The Java specification allowed the single case of operator overloading for + to concatenate two Strings for simplicity, especially for debugging purposes. It isn't that the + operator is inefficient, it is that the String object on which it operates are immutable.

    Concatenating two Strings actually constructs StringBuffer objects out of the original String, appends the second String, and then (finally) calls the toString() method on the resultant StringBuffer object.
    In order to handle this more efficiently, it is not the + operator that needs modifying; the String object would have to be modified so that it were no longer immutable, and this would have serious efficiency issues.

    If you need to make efficient use of String concatenation in an algorithm then you should have *always* used a StringBuffer from the start - Strings just aren't designed for it.

  139. Re:Convince me by Karmageddon · · Score: 1
    it is etched into hardware, but it is not implemented in hardware... there is software ("microcode") on the chip which executes a little program to do the equivalent of what an x86 instruction does.

    alternatively, etching the code for a Java VM into hardware in this same way would not make it any faster so the whole discussion of virtual machine vs machine would still not be meaningful.

  140. Re:Sounds like... by Sabalon · · Score: 2

    I remember trying to make the Zortech compiler work for an old project of mine circa maybe 1989 or so(?) and having problems. I think at one point or another I might have actually gotten email from Walter

    Ah...the good ole days. I think in around 1991 I was dealing with a Watcom? C compiler under VM/CMS and was having trouble with something. I posted to a BITNET mailing list - nothing too major, and someone from Watcom actually called me like 10 minutes later after reading the post.

    Back when customer service was good!

  141. D versus C# by Zeinfeld · · Score: 3, Informative
    It would be interesting to know if the guy has contacted Microsoft. Many of the features of D are in C# and vice versa. It would be a good thing if the future of programming languages was not considered the domain of Microsoft alone (bad) or Suns lawyers alone (worse).

    Many of the features look pretty sensisble. There is now pretty unanimous support for dropping Multiple inheritance. The problem with multiple inheritance being that it leads to programs only the original authors understand.

    It is disapointing that the syntax was not changed more radically. I for one am pretty bored with typing semicolons at the end of lines. Using braces for block structure is equally tedious.

    The garbage collector is of the 'stop everything and collect' type, this is not a good scheme as anyone who has seen a PET running Microsoft Basic GC will agree. The incremental GC in .NET is a better scheme, even if it is slower overall. But that is an implementation detail.

    It would be good if people would start to look at adding support for parallel program execution. The threads programming model is very clunky and hard to use, in part because there is no means for the program to perform checks on access conflicts.

    Also a persistence model should be part of any new language. The current division between programming language and database is a lot of wasted overhead.

    --
    Looking for an Information Security student project suggestion?
    Try http://dotcrimeManifesto.com/
    1. Re:D versus C# by SpryGuy · · Score: 1


      It is disapointing that the syntax was not changed more radically. I for one am pretty bored with typing semicolons at the end of lines. Using braces for block structure is equally tedious.


      And what do you propose as an alternative?

      VisualBasic is one of the few langauges I know that doesn't have a line-terminator character. And it does this by adding semantic meanings to carriage-returns. Which I HATE, because it means you can't arbitrarily format your code as you wish (breaking up long logical lines onto multiple physical lines, etc).

      I hate languages where white-space is significant. Period.

      So I'm curious what you think a BETTER alternative to semi-colons and braces would be?

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
  142. Re:Convince me by Anonymous Coward · · Score: 0
    I'm not familiar with chip design and construction but I see a conflict; please educate me if I'm wrong: I don't see anything "virtual" about machine code being executed by a processor, specially one that can't be flashed. And the fact that a Pentium MMX instruction set is a superset of that of an 80386 does not mean that a Pentium has to use its "native" instructions to mimick those of the 80386.
    Every chip since the Pentium Pro internally translates x86 code into it's own internal RISC(or at least RISC like) code. This needs to be done in order to implement features like pipelineing properly (code needs to be executed out of order).
  143. Re:Why would we need another language? by loconet · · Score: 0

    Syntax error in 'Why would we need another language?.cobol' : lowercase letters detected.

    --
    [alk]
  144. Re:Convince me by IsleOfView · · Score: 1

    Are you forgetting that Java code *is* compiled natively? (in memory when the app* is executed) This is why Java can be performant on the server-side -- there are start-up costs associated with this, but a good JIT compiler (Sun's Server HotSpot compiler is good) can identify optimizations *at run time* and compile even faster code on the fly....

  145. Re:Why another language?? by Anonymous Coward · · Score: 0

    A lot of programmers never experienced lisp. That's why!

  146. Re:Languages comparison by Elbows · · Score: 1
    D == (Java)-- Because: Java also removed all the compatibility junk. Java, like D, also added GC as a major development booster. Java added advanced programming paradigms, extensive standard API and bytecode, and D didn't.

    Some of us are looking for Java--. Not compiling to bytecode is a _good_ thing, because the program will run faster. I got the impression from the spec that D is supposed to be as fast (at least) as C++, something that java will never do.

    Also, while java's "extensive standard API" does do just about everything for you, which is nice, it is also bloated, confusing, sometimes self-contradictory (ie try iterating over the keys vs values of a Hashtable... last I checked they use completely different APIs), and annoying to use.

  147. Re:Convince me by milleniumpoet · · Score: 1

    But if it can be done, why hasn't it been done already, hmm?

    There are thinkers and doers, and very few who are both.

    The principle ideas behind designing/developing D are good. They represent years of experience programming and implementing compilers. I don't doubt that Walter Bright will release D one day. He has the obvious technical expertise to do so.

    But if you build it, will they come?

    As good as those ideas are, we must remember: the design goals for D represents Mr Bright's many years of experience developing compilers, and discipline/opinions/bias formulated from working in those languages.

    Experience and discipline.

    Exactly. You don't build better software by using a better language. You build better software by using better programmers. Building robust software with maintainable code isn't achieved by constraining the features of the language and adding features which make the programmer's life easier. There are plenty of coders out there with half-assed ideas about what "good" code is, coupled with half-hearted attempts to write it.

    Like a Dead Sea Scroll...

    D is doomed to become yet another one of those obscure languages. Certainly, as others have pointed out, there's no marketing muscle or drool-factor behind D. There will also be management resistance to a new language (i.e., for medium-to-large scale applications, on the order of a million lines of code, you don't introduce additional risk into a project by using a new language). And from what I've read, there's a lack of compelling technical reasons to switch, since much is either found in C++, or can be added to it (e.g., STL).

  148. Re:The only thing new is the name by lhand · · Score: 1

    My thoughts exactly. Do we want a guy who doesn't even know the history of the language designing the next level?
    Although if he was worried they'd run out of names, he could have called it "--P."

  149. Re:Big deal by Styros · · Score: 1

    The problem with this idea is that the software becomes too much of a black box. Since it was created using mutations and natural selection, we might not understand how it works. That is acceptable if the code was 100% bug free, but what if it's not? What if a patch is needed? How would you insert that into the code when you don't even know how it works?

  150. Re:Sounds like... by zpengo · · Score: 2

    Doesn't seem to me that D doesn't anything which can't be done perfectly well in C++ or Java, both of which are massively supported by contemporary technology. Inventing a language like this is fun and is a useful mental exercise, but is about on the same level of utility as trying to learn Klingon.

    --


    Got Rhinos?
  151. Re:Convince me by alanwj · · Score: 1

    Once you've implemented it in hardware (such as an x86 processor), wouldn't it just be a "machine", rather than a "virtual machine"?

    Alan

  152. outrageous! they have stolen my name!!! by peter.koellner · · Score: 1

    IIRC i used "D" as the name for an object persistency layer C++ compiler front end i wrote around 1994 for diploma thesis. Honouring the basic fundamentals of our great human society, I should find a lawyer and sue the hell out of them ;-)

    1. Re:outrageous! they have stolen my name!!! by peter.koellner · · Score: 1

      ah, this time they'll get away. my language was called "D++".

  153. Documentation is important by yerricde · · Score: 1

    Excess verbiage not only takes more time to type in, but more importantly, it opens more possibility for bugs.

    So does barely readable "line-noise" such as sed code and uncommented Perl code. So does any code that doesn't have comments briefly describing what it does. Good code is largely self-documenting.

    The goal is to write in the most abstract, most succinct possible way.

    You mean like Mel[?]? You have to leave an opening for seq^H^H^Hrevisions to your code.

    --
    Will I retire or break 10K?
  154. switches by Cardhore · · Score: 2

    No kididing. Anything you can do with switch statement you can do with if...elses. Even better, if...elses have way more flexibility (you can do strings, floats, objects, not just int/char). So that feature is not so important.

    Also, I like sizeof() since it's a feature of the language, not a class's function, so it shouldn't pretend to be a member function.

    1. Re:switches by Anonymous Coward · · Score: 0

      Woah, hey there's something I shall have to look into! Thanks, AC!

      ...except that I generally use Windows. From what I've seen there's no really coherent Windows ports of GNU C. I suppose I could always write a preprocessor or something, but yuck :6

    2. Re:switches by Anonymous Coward · · Score: 0

      GNU C does ranges and variable labels. Unfortunately standard C does not, so you'll have to use if statements.

  155. Re:Orthogonality by Anonymous Coward · · Score: 0

    This is not what is meant by 'orthogonality'. If you did not understand the concept from your computer language course, think of it as the same concept from your linear algebra course.

  156. Syntax Erros in Example? by Anonymous Coward · · Score: 1, Interesting
    Is it me or is there a syntax error in the example on the Overview page? Supposedly arrays are declared with the [] on the left of the variable name, but in the sample:
    bit flags[8191];
    Hmm...
  157. Re:First Parrot by Anonymous Coward · · Score: 0

    C pound? i thought it was C sharp :)

  158. Re:Convince me by Anonymous Coward · · Score: 0

    Every year, javamonkies whine: "Java was slow last year, but its fast today!" and then point to some dubious claim on the MARKETING section of sun's web page about how Java(TM) Platform Technology is 130x faster than Legacy C++ Technology.

    And the real world laughs. People use Java because it does a decent job keeping morons out of trouble, meaning you can hire cheaper programmers with less skills. They don't use it because its fast.

  159. shebang by dwhite21787 · · Score: 1
    Yeah, I've always called the fist thing in a shell script a "shebang"
    # = "she"
    ! = "bang"

    Q.E.D.

    --
    "Even if you're on the right track, you'll get run over if you just sit there" - Will Rogers
    1. Re:shebang by dwhite21787 · · Score: 1

      first thing - doh!

      --
      "Even if you're on the right track, you'll get run over if you just sit there" - Will Rogers
  160. Re:Java speed issues (was Re:Convince me) by Anonymous Coward · · Score: 0

    I was reading about an experimental IBM JVM that turned off bounds-checking and got a huge performance increase.

  161. Is D short for Delphi by Anonymous Coward · · Score: 0

    Having read the link, I am surprised he does not call it Delphi; after all a lot of what he is on about is already implemented in Delphi/Kylix plus readability :-)

  162. Re:Maybe? by Junks+Jerzey · · Score: 2

    This is not a Windows specific problem. Any modern GUI (e.g. KDE) has the same difficulties. Even when all of the crap is hidden behind an OOP veneer, it is still a mess to work with. Arguably, OOP has made things worse. What we really need are system libraries that are designed to get the job done as easily as possible and not the result of someone trying to made the world fit his own pet OO model.

  163. Re:Casting pointers to integers by Animats · · Score: 2
    Now, I'm not sure what this guy's background is, but it looks like he may have forgotton about system-level programming.

    Walter Bright wrote the Zortech C++ compiler. He's good.

  164. Re:Buggy compiler? by mamba-mamba · · Score: 1

    Someone posted earlier that the C language specification is 500 pages, and C++'s is 750. In addition to all the syntax of C, there are numerous reqired library functions for hosted environments. There is a macro processor. You eventually have to link the code, too. I guess you are right that a C compiler would be easier to implement than a java or C++ compiler, but I would hardly call it "fairly easy." Note that a cross compiler is not a program wich translates source code from one programming language to another. A cross compiler is a program or group of programs which converts source code into an executable for a platform different from the one the program is running on. For example, gcc can be built on linux as a cross compiler for DOS. To make it work you have to use the djgpp libraries. Gcc can cross-compile to many platforms. The above is the only one I have personally done. K & R 2 lists 32 reserved words in C. I think C99 may have added one or more additional key words. I doubt that any ANSI compliant C++ compiler ever was made that used C as an intermediate step. If there was such a beast, it must have been an abomination. Are you sure you are a programmer? MM --

    --
    By including this sig, the copyright holders of this work or collection unreservedly place it in the public domain.
  165. Re:D's floating-point model is dangerous by rmathew · · Score: 1
    > David Goldberg, "What Every Computer Scientist
    > Needs To Know About Floating Point Arithmetic,"
    > ACM Computing Surveys, vol. 23, pp. 5-48, 1991.
    >
    > I could not find a copy online, but here is
    > an interview with William Kahan

    A search on Google reveals that you can find a copy of this paper online via ResearchIndex.

  166. Language 'G' by Anonymous Coward · · Score: 0


    Maybe Vampire Hunter-D should have called it 'G'
    then we could have a Gi-Had optimizer.

  167. Microsoft will HATE it by beerandbj · · Score: 2, Funny

    Can you imagine the flop they would make marketting 'Visual D' - VB and VC worked ok

  168. Re:After C comes P! by RevAaron · · Score: 2
    Aside from the fact that I don't see why Forth would *need* OO, I think that calling its successor "Fifth" is far too sensible, and doesn't lead into a dead-end.

    Why would anyone need OO? They don't. Why does anyone need C? They don't. Maybe we should just all be using hexeditors and doin raw binary. Don't really need assembly, or the OO macros for assembly (yes, they exist).

    There are actually quite a few Forth object systems. MOPS and bigForth come to mind. Come to think of it, Forth plus an object system is probably about the fastest OO you can get.

    On the other hand, you could propose that "Forth" be followed by "Further". After that, you need to *think* before finding a new name.

    Ignoring the obvious fact that choosing a name like "Further" for no reason but that would be stupid, one could just as easily say "Farthest," and "Damn, we're serious about being Far now (DWSABFW)".

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  169. Re:Java is annoying by horse · · Score: 1
    Java is slower than C for most things, and Swing is the slowest part of Java. But Java has it's strengths:
    • Very portable
    • Nice libraries
    • Faster development


    I agree with you about enums, but there are many C++ features I miss more. (Stack allocated objects and destructors, templates, the STL...)

    Still, Java is a great tool for some problems.
  170. Re:Convince me by Bradee-oh! · · Score: 1

    I think he meant this, which is something I've thought about off and on since starting Java programming a year ago - What if a processor, and entire hardware platform, were developed whose "native code" was Java byte code.

    That is, instead of JIT compiling, microcode translations, or other tricks, the CPU operated directly on Java byte code with no translation of any kind.

    --
    "This is Zombo Com, and welcome to you who have come to Zombo Com" - www.zombo.com
  171. Re:Overloading? by Old+Wolf · · Score: 2

    The real reason? He couldn't get it to work in his compiler..

  172. Re:Convince me by kevlar · · Score: 1

    Java runs slow when its not executed with a JIT. When it is, the performance is far from slow.

  173. Not very good in my opinion by Achilleas · · Score: 0

    Because : 1) a good language will separate the algorithms from the implementations; such a language is C++ (only), due to template support 2) truly component-ware programming comes from multiple-inheritance and combining classes together. 3) operator overloading is a major plus for programs; I am in a development house that develops a military application which uses a lot of 3d calculations; we have made special classes which use operator overloading, so adding two CVector classes is vector1 + vector2 and not some other function. And what is operator overloading really? it is another way to express a function by putting the function name in a different position: for example, instead of writing +(a, b) we write a + b... 4) garbage collection is not good for any application where timings are critical It has some good points though, namely the extraction of an interface from the sources...

  174. Re:practical experience implementing compilers?? by SageMusings · · Score: 1

    I'm sorry. I don't understand what you mean. Sure, there are quite a few green programmers. Are they inferior because they have not learned to take the great intellectual leaps a seasoned coder does on a daily basis? Experience starts somewhere, even if you have to take a class.

    As far as languages being too easy, hey, I'm all for it! Tools should not be complicated in order to exclude non-experts. The more a language stays out of my way and lets me concentrate on the problem or algorithm at hand, the better. I believe languages still have a way to go. They definitely have not passed a point at which they are too easy. Show me the language, I'll contrive a hideous example of bad code. I'll can also strive to code beauty, itself, independent of the simplicity of the language.

    It would probably shock you to know I prefer Perl and Python to C anyday. And before you label me as ignorant and unwashed, yes, I do understand assembly and C. In fact I code for microcontroller projects as a hobby.

    --
    -- Posted from my parent's basement
  175. Re:The only thing new is the name by Eric+Giguere · · Score: 2, Informative

    The Java try-catch-finally construct is not the same as nesting a try-catch within another try-catch because the finally block is always executed. In your scenario the finally is only executed if an exception is thrown. Adding a throw at the end of the inner try will make it behave like try-catch-finally, but then you have to have code in the outer catch to distinguish between the various cases. try-catch-finally is a simpler way to do it.

  176. Re:First Parrot by SnarfQuest · · Score: 1

    C, in roman numerals, is 100. # is an abbreviation for pound. Thus the proper name for C# is the 100 pound language.

    --
    Who would win this election: Andrew Weiner vs Andrew Weiner's weiner.
  177. C--? C-- is taken by vherva · · Score: 1

    http://home.earthlink.net/~descubes/C--

    --
    -- v --
  178. Re:Overloading? by Alioth · · Score: 2
    I've used operator overloading quite a bit - it's pretty useful, and I think he's making a mistake by excluding it. Just because he doesn't use it, it doesn't mean the rest of us don't!

  179. Re:Garbage Collection vs. Virtual Memory by Bryan+Ischo · · Score: 2
    Hm ... I'll have to read up on modern GCs ...

    And the reason that I think that Java's mechanism is only a small step in the right direction is that it's simple a convention. There's very little behind it. I don't have to name my classes with a package, nor to I have to pick a package name that is reasonable. Package names actually take up a considerable amount of space in a Java file - I wrote a commercial obfuscator package and it turned out that something like 5 - 10% of a Java class file's size is just package names embedded in every reference to other classes - and it seems silly to drag all of these strings around when a more concise, robust system could be used instead ...

  180. Java is annoying by mrm677 · · Score: 1

    (begin rant)

    Is it just me, or is JAVA simply too verbose to do simple things like open a file and read lines of text?

    Also, I love enums ... why doesn't Java have them? Yeah, I know you can make a class filled with "static final", but it just isn't the same, or is it?

    Then I tried a Swing GUI on my old P166. Completely unusable! Yet QT, GTK+, etc. worked just fine on that machine.

    (disclaimer: I'm a professional C programmer who casually dabbles in Java and C++)

    (end rant)

    1. Re:Java is annoying by SpryGuy · · Score: 1

      Well, the java static final nonsense is very similar in reality to the const stuff in C++ (as opposed to #defines in C). Yeah, I wish they had a more formal notion of 'constants' in Java, but the static final stuff works just as well from what I've seen. It's just the name that I find annoying. Who thought up the word 'final' for use in that context, anyway? Bleh...

      And I'm not bothered about the Java text file handling at all. Precisely because it is so ultimately powerful. Sure, it seems like you might have to jump through a hoop to do the simplest of things, but what if you want to do data transformations as you read... it's so trivial in Java. And there are so many ways of reading text and writing files, really... it's nice to have the flexibility to do anything you really need, by just treating them as streams, and having filters handle the stream as you want (buffered or unbuffered, read by character or by line, do character translation or not, etc, etc). Just build what you want from the available options.

      And I haven't used SWING, but I've never heard anything good about it. I don't know why it doesn't utilize native widgets, instead trying to reinvent them all. Bleh. But then I never use Java for GUI programming (except for servlets, where the 'gui' is really a web browser/HTML, so that's quite different).

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
    2. Re:Java is annoying by SpryGuy · · Score: 1

      Add in dynamic class loading, no mucking with 'headers', addition of interfaces, no mucking with linkers, built in thread and synchronization primitives into the language...

      And be aware that generics/templates are coming soon to a Java near you. Very interestingly implemented too... completely backwards compatable with the existing container classes (which will be reimplemented with generics to offer type-safety, but which won't break existing code), and their use doesn't explosively grow the size of your code.

      And while I do miss destructors, the try/finally helps make up for it :-)

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
  181. Re:What are his motives? by aozilla · · Score: 2

    This is probably what everybody said about C++ when they were using C.

    The first version of C++ was a preprocessor which converted C++ into C. Thus you still had all the compiler optimizations and even the code for the compiler itself. Then you could further optimize the binary by shortcutting some of the C++ -> C -> machine code into C++ -> machine code.

    Garbage collection has already been implemented into C++, it seems silly to make a new language for it unless you can obtain some serious optimizations.

    The only real advantage of java over C++ that you can't build into C++ is the security manager. That can't be done without either hooks into the OS or an interpreted language.

    --
    ok then your [sic] infringing on my copyright! Could you as [sic] me next time before STEALING my comments for your own?
  182. Re:Casting pointers to integers by p3d0 · · Score: 2

    Well, compilers don't really amount to system-level software. They're just extraordinarily complex text filters, mapping source code to assembly. They have total control over their choice of internal data structures and so on, so the issue of converting pointers to/from non-pointers rarely arises. There's lots of low-level software where this is not the case.

    I'm not saying this guy doesn't know what he's doing; just that if he is trying to solve all the world's problems, then he may have missed the mark in this particular area. (Although in his defence, he has not yet removed unions from his language, so apparently he is aware that they may be too useful.)

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  183. Re:Convince me by IsleOfView · · Score: 5, Insightful

    I'm afraid I have to disagree. I'm a pretty strong Java advocate, but I still don't feel that it's ready for desktop use because of Swing performance issues. I spoke with several of the engineers that worked on JBuilder while I was at JavaOne this year. They spent a *LOT* of time writing custom classloaders, etc. to make their GUI so snappy. JBuilder is a spectacular example of a well written Java GUI, but I don't know if it would be reasonable to say that just anybody could write something like it in 1/10 the time of some other language.

    Now on the server...that's a totally different story. I write server apps all day in Java --- my development times are SLASHED from what they would be in C/C++, or even CGI's. Maintenance and documentation are a breeze, and performance is fabulous. Java really has done great things on the server.

  184. Re:Maybe? by Yunzil · · Score: 1
    It is extremely easy to write very crappy code that still works.

    I thought that was the *problem*. :)

  185. Re:Encore! by JoeShmoe · · Score: 2

    Nathan Hale

    1) American Revolutionary soldier hanged by the British as a spy. According to tradition, his last words were "I only regret that I have but one life to lose for my country."

    2) An asterisk ("*") Notionally, from the misquote "I regret that I have only one asterisk for my country!" of the famous remark uttered by Nathan Hale just before he was hanged ("life to give" -> "ass to risk" -> "asterisk").

    Weird, wild stuff there, Ed.

    - JoeShmoe

    --
    -- I wonder which will go down in history as the bigger failure: the War on Drugs or the War on Filesharing
  186. Re:Forth !!!! by Paul+Neubauer · · Score: 1

    Elizabeth Rather (of Forth Inc.) mentioned once on comp.lang.forth that she encountered two groups, both of which used Forth, but for radically different things. It was something like this:

    One claimed "It's great for controlling telescopes and other small obscure things, but we'd wouldn't dream on it for anything big."

    The other group claimed, "It's wonderful for our large project, but no way we'd ever use this for anything like a machinery control system."

    Forth is what one makes it, and what one believes it to be.

    I suspect the real reason Forth is not popular is that it is not popular. Other languages are taught in schools or have a certain 'coolness' to them (C, Java, Perl). As for the practicality, Forth was not originally a corporate development nor was it was it a university project. It was just Chuck Moore getting a real-world problem solved.

    The RPN scares some people (who should know better, really), and there is the false idea that there are no variables, just stack. Well, anyone who has done assembly (or uses an HP calculator..) has dealt with RPN. And the stack is a nice quick tool, but variables are there for the big work. The one real issue is that with Forth there is the assumption that the Programmer is God, and God knows WTH he is doing. So the compiler doesn't whine about every little thing, but lets you shoot yourself in the foot. The assumption is that you meant to do that, or you would not have done that.

    Sure badly written and undocumented Forth is 'write-only' and takes a great effort to decipher. Other languages can be jsut as bad, if one writes poorly. But a development group can agree on a few coding conventions and get along and generate readable Forth.

    A 100,000 line project would need to be well planned and agreed upon... but is that not true for any 100,000 line project in any language?

    One interesting comment I've seen (likely in Starting Forth) is something to the effect of "You don't solve the problem with Forth. You find out what language would make the solution trivial, and write that language with Forth."

    An admission: I do Forth for a living, for now. It has been decreed by those who do not actually program that new development will be in C. Why? Because "it's easy to find a C programmer." So I'll end up working in C soon. (And they have as much trouble finding _good_ C programmers as finding _good_ Forth programmers.)

    --
    I don't subscribe to RMS's GNUtopian vision.
  187. Re:Languages should be written for programmers by Petronius · · Score: 1

    what you're looking for is called jython

    --
    there's no place like ~
  188. Re:A critique -- macros by Chuck+Messenger · · Score: 1
    You're probably right, that if C++ had a macro system as powerful as Lisp's, that it would supplant templates.

    And so, I think a worthwhile avenue, in terms of programming language development, would be to get rid of C++ templates, and the C preprocessor, and replace them both with a suitably-powerful Lisp-style macro system.

    Easier said than done, of course!

    A development which is somewhat in the spirit of a powerful Lisp-sytle macro system is Open C++. I haven't tried to use it for anything, though. As compared to Lisp, the problem is that it is very obtuse (due to the messy nature of C++ syntax compared with Lisp). But it does let you do symbolic-level macro programming in C++.

    LISP style symbolic manipulation of code permits the construction of special purpose syntax that is closer to the problem at hand
    Exactly. In other words, Lisp macros let you program with fewer keystrokes (ultimately). That makes them a Good Thing.
  189. Re:Sounds like... by Anonymous Coward · · Score: 0
    And for the record, damn, I feel old -- I remember [blah blah blah]. In a conference call yesterday I needed to come up with a secure hashing algorithm and I said "ROT13. If we need extra security we can do it twice." and absolutely no one got it.

    S**t, you are old!

    Besides everyone knows triple ROT13 (aka 3ROT13) is way more secure than ROT13.

    Lee

  190. Re:The only thing new is the name by drivers · · Score: 2

    Anyone who really knows the origins of the language "C" knows that its successor should be called "P" and not "D".

    BCPL. But .pl is already taken. :)
    (credits to Larry Wall, I think.)

  191. Re:Convince me by mcdirmid · · Score: 1

    There is no contradiction, only ignorance. Why do people directly relate: "Java code run just as fast as native compiled C or C++" to "Java UI performance?" Granted, the speed of code can be limiting factory if it is too slow. But remember Amadhal's law, that system performance can be limited by more than one factors. In reality, the speed of the Java code is not the bottlenck here, its Swing's interaction with the graphics card. Swing does not utilize much hardware acceleration, which is desperately needed. Take a look at Swing's implementation on MacOSX for Swing "done right." They layer Swing over a hardware accelerated 2D layer. JDK 1.4 is also supposed to fix many Swing performance problems, but we will have to wait and see. Its one of the reasons why Java's performance is ok on server's but not on the client. The JIT compiler has matured enough, but the UI libraries have not - and "cross platform" has a lot to do with this.

  192. Re:Garbage Collection vs. Virtual Memory by Junks+Jerzey · · Score: 2

    Nope. Modern garbage collectors certainly don't walk around memory collecting things (and neither do modern heap allocators). All the tabular stuff that indexes memory and structures is usually contained in a small set of pages. Those refer to blocks elsewhere. No page swapping is required.

    Actually, that's not quite true. But generational collectors are set-up so you don't have to run through entire sections of memory except in rare circumstances. And you can use virtual memory hardware to alert the collector when an old generation is being written to (so you don't have to look yourself).

  193. Garbage Collection vs. Virtual Memory by Bryan+Ischo · · Score: 3, Interesting
    Something I've always wondered about Garbage Collection is, doesn't it basically add alot of VM paging overhead to a process?

    Meaning that, since the garbage collector has to periodically walk all of the heap of a process, it would seem to me that it would thus periodically force any pages that are paged to disk to be brought back in by the VM even if they didn't need to be otherwise.

    I used to do alot of Java programming, and I got the uncanny feeling that every time my program grew very large (which was very often - Java programs use *soooo* much memory, don't know if it's just a general tendency of GC or if it's Java's implementation) the system would thrash quite a bit more than if I wasn't running any Java programs ... and I came to believe that it might have something to do with the garbage collector forcing the OS to load every page of the process into memory as the GC swept through, so everything that modern OS's do in terms of trying to streamline VM kind of gets thrown out the window when garbage collectors are forcing every page of their process to be loaded in periodically.

    Just wondering why no one has ever made the point (to my knowledge, anyway) that garbage collectors may be very bad for virtual memory performance. It seems quite likely to me, anyway.

    Otherwise, I like just about every idea in the D language, especially his Name Space notion - although I didn't read too much detail of his spec, at least he's thinking about it. I hate the fact that modern languages are based on string identifiers during linking; there's no formal mechanism whatsoever of avoiding clashes in the namespace (Java's class package name idea is a small step in the right direction), and it really seems stupid to me that shared libraries should be carrying around all this string baggage, and doing all these string compares during linking ...

    Anyway, that's how I see it.

    1. Re:Garbage Collection vs. Virtual Memory by rossjudson · · Score: 3, Informative
      Nope. Modern garbage collectors certainly don't walk around memory collecting things (and neither do modern heap allocators). All the tabular stuff that indexes memory and structures is usually contained in a small set of pages. Those refer to blocks elsewhere. No page swapping is required.

      Java's class packaging is considerably more than a small step in the right direction. It supports a universal naming convention, based on the internet's naming systems, that can underlie local and remote code. D's modules are a primitive mechanism at best, similar to Delphi's. They're OK for a single organization, but problematic for integrating code on a wider basis.

    2. Re:Garbage Collection vs. Virtual Memory by p3d0 · · Score: 2

      Modern garbage collectors certainly don't walk around memory collecting things (and neither do modern heap allocators). All the tabular stuff that indexes memory and structures is usually contained in a small set of pages. Those refer to blocks elsewhere. No page swapping is required.

      GC always has to trace all the pointers in the system. So yes, it still has to walk all over memory during tracing.

      GC is bad for memory locality, in several different ways, and I have never seen any good solution to this problem.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  194. Interesting by Anonymous Coward · · Score: 0


    The author does a good job of getting rid of a lot of unnecessary crap characteristic to that big POS that is C++. Just about anything that contributes to the demise of this white elephant is welcome.

  195. D's floating-point model is dangerous by fullcity · · Score: 4, Informative
    D's philosophy about floating-point arithmetic is dangerous:
    On many computers, greater precision operations do not take any longer than lesser precision operations, so it makes numerical sense to use the greatest precision available for internal temporaries. The philosophy is not to dumb down the language to the lowest common hardware denominator, but to enable the exploitation of the best capabilities of target hardware.

    For floating point operations and expression intermediate values, a greater precision can be used than the type of the expression. Only the minimum precision is set by the types of the operands, not the maximum.

    This reflects a terrible misunderstanding of floating-point arithmetic. Decades ago, scientific programmers realized that getting a computer to "just give me the best FP answer you can come up with, I'm sure it's good enough" caused headaches. That's why we have IEEE FP standards that define EXACTLY what the results should be, to the bit.

    If you get different answers on different computers due to different roundoff errors, your software becomes unreliable. It's true!

    People get confused by Intel's 80-bit FP arithmetic. Yes, the FPU expends some effort in rounding the 80-bit result back to 64 bits, but the result is not more accurate than a 64-bit FPU. In fact the answers will be exactly the same--this is mandated by the standard.

    Anyone using floating-point arithmetic for anything serious needs to know exactly what the arithmetic model is. If Walter pursues this philosophy with his new language, he will make it unusable for numerical applications.

    Walter needs to read:

    David Goldberg, "What Every Computer Scientist Needs To Know About Floating Point Arithmetic," ACM Computing Surveys, vol. 23, pp. 5-48, 1991.

    I could not find a copy online, but here is an interview with William Kahan, the Turing award winner who co-developed the IEEE 754 floating-point standard. Language designers should notice that Kahan implicates of Java and Fortran at the end of the article.

    1. Re:D's floating-point model is dangerous by David+Roundy · · Score: 1
      I agreee that this is a problem, although not necesarily the end of the world.

      Perhaps more serious is his choice to only offer an extended complex type, making it essentially useless for numerical computation (and who else is really using complex numbers?). I suppose there are some numerical codes that don't use much RAM or libraries such as LAPACK, but I doubt there are very many of them...

      It's a shame, because it looks like his array support is quite nice, which is something that C has certainly been missing.

  196. Re:Convince me by Anonymous Coward · · Score: 0

    rofl, you wouldn't use "templates," or "other OOP" features.
    rofl

    Parametric polymorphism is more efficient and type safe than runtime type manipulation. It's also not considered an OO concept, though C++ plodges it into their object system.

    I can't say I give two shits what you'd use it for, since you were clearly meant to be a liberal arts fudgepacker, and not a computer scientist.

    Like some toothless mechanic trying to tell a group of mechanical engineers how to build cars.

  197. Re:First Parrot [OT] by Meffan · · Score: 1
    Yeah, I work for BT -

    The real reason we call it square is: "Most of the public don't understand what hash (#) means."

    Seriously. Straight up. That's the reason. If you don't believe me, try explaining it to some poor old lady who just can't follow you. It looks like this:

    "So then you press the hash key."

    "The Hash key?"

    "Yeah, the one that looks like a gate."

    "I don't know which one you mean"

    "It looks like a noughts & crosses board."

    "Eh?"

    "Don't worry about it, just press the square key instead"

    Nice people, it's just either they sound like that, or they sound like: "Heehee, the phone guy said hash, y'know - HASH, like, wow dude".

    --
    I don't think I'm very happy. I always fall asleep to the sound of my own screams.
  198. Re:First Parrot by Anonymous Coward · · Score: 0

    Way to miss the joke, dumbass. Did you have fun putting in all those links?

  199. Languages should be written for programmers by Synn · · Score: 2, Interesting

    Seems like every language is an excercise in How Things Should Be Done.

    As a programmer that's worked with about 15 languages over 18 years what I really want is a language that:

    1> Is as quick to program in as php/perl/python.
    2> Is still managable for large projects.
    3> Is as fast as C/C++.
    4> Is easy to port across platforms(porting Quake V from Linux to Windows should just be a recompile).
    5> Performs in a predictable manner(no wierd behavior out of the basic operations every language has in common).
    6> Memory management should be handled automatically.
    7> Integrates seemlessly over networks.

    Is this too much to ask for?

    1. Re:Languages should be written for programmers by smittyoneeach · · Score: 1
      Programming languages are tools. How many tools does your car require?

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    2. Re:Languages should be written for programmers by Jayson · · Score: 1

      try k at kx.com. it surpasses #1, #3, and #7; i am not sure on #2; it does #4 and #6; if you are used to array based languages, like apl or j, then #5 is there, too. the syntax may look like line noise, but it has absolutely nothing in common with perl: the syntax is harmonious and consistent.

  200. Re:Nothing special... by Anonymous Coward · · Score: 0

    Because he's not a moron like yourself. AYUK AYUK!

  201. here comes another war.... by 4n0nym0u$+C0w4rd · · Score: 1

    Langauge X is better, it runs on average about 3 times faster than slow-ass langauge Y.

    Langauge X sucks, it's not incredibly portable or as easy to use as Langauge Y, and speed is becoming less important as time marches on.

    But what about LNOU (Langauge No One Uses) it's got both the speed of Langauge X and the ease and portability of Langauge Y.

    bicker

    whine

    Seriously, I'm mostly playing arround with C++ right now (and I love it) but Java, Python, Perl, and most of the other langauges out there ALL have their uses. Yes, all of them. D will be no different, it will have a few great features that supporters will throw in the oppositions face and a few downsides that the opposition will exaggerate. I gave the specification a look over and it seems to me that D is basically what C++ would be if the designers hadn't given a damn about backwards compatability with C, except they are removing a few usefull (in my opinion) features of C++ and either replacing them or dropping them completely. The specification is still rough, but overall D looks like a decent langauge, one made to work well rather than confor to some ideal (kinda like C++, again IMO). The guy is very straight forward about what D should not be used for and gives examples of some things it would be good at.

    I guess what the whole thing comes down to is "How Good Will It Be". If the answer doesn't end up being "Wow, I Can't Live Without It" then D will fail even if it's much better than other, older solutions, simply because no one wants to port old code or learn a newer langauge when the old one still works fine. That's the reason why many of the newer langauges don't have the following their creators think they should (and they may be right), they're simply not worth the time or effort it would take to learn them and port them. Unless D is absolutely incredible I know I'll be sticking with C++. Why? Because C++ simply WORKS for what I'm doing right now, and there is no reason to all of my code or learn yet another langauge when the one I'm using is fast and easy enough to get the job done, and C++ is already a proven langauge (as is C), as widely used as it is....it's not going anywhere.

    --

    "
  202. Looks good... but by Anonymous Coward · · Score: 0
    Am I the only one who noticed the syntax error in the sample program at the bottom of the overview?

  203. Re:Java's fatal flaw by Reality+Master+101 · · Score: 1

    So is any other language that depends on heap-allocated data structures. (Assumig compiled code. "Systems programming" with a virtual machine is a contradiction in terms.)

    That's why I made a distinction between Java-the-language and Java-the-environment. My point is that even if you natively compile Java and fix some of the runtime environment issues, it still wouldn't be appropriate as a general-purpose language, particularly for system programming.

    --
    Sometimes it's best to just let stupid people be stupid.
  204. How about - open your mind to other ideas? by Anonymous Coward · · Score: 0

    If we listened to people like you than your favorite beloved Java would not exist. Nor would perl, python, Tcl, Eiffel. There is nothing wrong with new ideas, even if the language is not embraced by the community. So please continue beating off to your Java magazines.

  205. Re:Forth !!!! by vernon+nackulus · · Score: 1
    I work in a firmware shop that uses C and Forth (and assembly, duh). I like Forth, it is a very interesting, fun to work with language. For whatever reason, most programmers in our shop (~50 ppl) hate it. I mean they ardently detest it! I think I know why.
    • First of all, it has a completely different syntax than the traditional C-like languages. People just don't have time to glean the idiosyncracies from the language, they are too busy deciphering chip specs.
    • Secondly, it is much less structured than C. So what? Well, when you have 10 very individualistic ppl working on a C program, you get an obfuscated mess. That's our reality. When those ppl program in Forth, it ends up twice as obfuscated!
    • Last, the RPL notation really bothers most ppl, b/c ppl hate to truly think about what they are doing. They want the compiler to complain at them about their mistakes. So you change a line, compile, change a line, compile, repeat. That doesn't work in Forth, it's much closer to assembly in that way. It pretty much crunches everything down to byte-codes no matter what you do.
    Forth love if honk then
  206. Why would we need another language? by shine · · Score: 1, Funny

    When we have COBOL, the only language you would ever need to know.

    Identifcation Division.
    Environment Division.
    Data Division.
    Working-Storage Section.
    01 TheOnlyLanguageYoullEverNeed pic x(30) value spaces.
    01 ArgumentSettled pic x(01).
    Procedure Division.
    Move 'COBOL' to TheOnlyLanguageYoullEverNeed
    Move 'Y' to ArgumentSettled.
    Stop Run.

  207. General purpose language. by sentientbrendan · · Score: 1

    I like that someone (besides microsoft) is trying to write a be all end all language. I keep hearing about how java is the right tool for this job and c++ is the right tool for that job and objective-c is the right tool for that one (objC is my favorite tool by the way, to be fair though I don't know java or c++). I realize that these statements are true but it seems to me that they shouldn't be that way.

    I think C is an example of a really well designed language that can perform a variety of functions, I mean its a language that is used for both kernels, word processors, games, whatever. Now that C is getting kind of old and is missing a lot of feature we want a bunch of language like c++, java, C#, and objective C have come up. Those languages are all object oriented to a certain extent and all offer features that make them very useful in some situations and useless in others. I only can code in one of the listed languages so I wont list the pros and cons as I would get some wrong and inspire flames from programmers who use those languages.

    My point is that a language (maybe not D) that could implement all the features that a programmer would need for any kind of serious large scale program is needed. Further more that language needs to have compilers for both machine language and bytecode. Lastly the machine code, at least when compiled, needs to be almost as fast as C (which was designed to be almost as fast as assembler). I could list a million things that I think the language would need but you get the idea.

    We need a language that is general purpose yet can be used for any specific problem. A language which is featuresk yet very simple. We need a language that is all these impossible things the way C is.

    I don't think D is all of the things we need, not yet anyway, but it is a good expression of what as a community programmers need, a common language.

  208. Replacing our chainsaws with plastic butter knives by RockyJSquirel · · Score: 1

    Whoever these guys are, they don't understand C++ programming very well.

    I see this all the time, programmers who don't know all of the cool C++ tricks that could save them development/debugging time go on rants about how useless all of the features of C++ are.

    For instance they got rid of operator overloading saying:
    "The main applications for operator overloading seem to be implementing a complex floating point type, a string class, and smart pointers."

    Uhm, how unimaginative. Some other uses for operator overloading I've implemented:

    1. Objects that act like primitive types, but use the interlocked instructions that are necessary for multi-processor communication.

    2. Debug-build only types (replaced by primitive types in the release build) that act like numbers, pointers or arrays, but do arbitrarily complex contract testing for algorithm.
    For example, a numeric variable that in a range from a to b, who's value mod c must always be d. Of course flexible types like are best implemented with templates which they also left out.

    3. All kinds of mathematical analysis. Just because these guys are mathematical ignorami who never use mathematical objects more advanced than complex numbers doesn't mean the rest of us are so limited. For example when I was doing some sound/filter design I wanted to analyze the effect that a numerical algorithm had on a symbolic representation of my problem, so I wrote a class of objects that formed a numeric ring (you can add, subtract and multiply) but were actually polynomials in hundreds of varibles. I plugged them into my numerical code instead of using the regular "double" type and got an instant symbolic answer. Do that in "D"!

    4. Objects that act like normal primitive numeric types but automatically update the gui display when they change valuue. "Score += 100;" Dah!

    I could go on and on and on about the very important tricks that the various omissions from "D" make impossible, but the main point would be lost. The main point is that C++, for all it's problems omissions has some very very powerful general purpose tools that "D" omits. "D"'s language designers seem to be inexperienced and unimaginative. Sorry. No one is going to replace an incomplete language with another one that's even more incomplete just because it claims to be a successor.

    I predict (and hope) that "D" will sink without a trace.

    Rocky J. Squirrel

  209. Re:practical experience implementing compilers?? by statusbar · · Score: 1

    Code-within HTML documenation is a good idea, and not a new one either. It is called Literate Programming. except usually the code is within TeX with a system called CWEB.

    I believe your idea of sticking the code and documentation into XML is best however. Then, your code can live in a real database (instead of a CVS repository) and you could do much more powerful manipulations and queries of your code and versions. I use CVS all the time, but it is limited because it really does not know a language's structure.

    It is the year 2001. Why do we still write code in plain text files?

    --
    ipv6 is my vpn
  210. How to do templates by Anonymous Coward · · Score: 0

    There's easy way to do templates.

    Instead of
    template<class T, class K>
    class A { };
    template<class T>
    class A<T,int> { };
    A<float,int> aobj;

    can always do like this:
    class A_T_K { class T; class K; };
    class A_T_int { class T; type int; };
    A_float_int aobj;

    Templates are all about dividing names into symbols and doing pattern matching over them.
    Thus template syntax should be part of names. A few special characters like "_" to divide names into separate symbols could be used for all polymorphism.

    Templated variable names would be neat too:
    int a_int; <-- collection of integer variables
    a_0 = 12; // compile time use of 1st variable
    a_1 = 10; // etc..
    a_2 = 20;
    a_3 = 30;
    Everything that has a name can be grouped together
    and it is possible to handle group of them in one declaration; like templates do.

    Think of gtk+'s naming for runtime polymorphism:
    gtk_widget_show();
    gtk_widget_hide();
    gtk_dialog_show();
    gtk_dialog_hide();
    etc..
    Similar thing could be used for all polymorphism,
    templates included.

    (Renaming features like C++ typedefs are essential for polymorphism. Who would want to use std::string if its name was std::basic_string<foo,bar,zoo>...) (notice how authors of C++ noticed the proper naming for namespaces and :: :-)

  211. Re:ASM ROCKS !!! :) by syntax3rror · · Score: 1

    x86 has been around for so long that i don't fear my code could be outdated in short term. Anyway I quite agree with you. I think that asm is *absolutely* necessary to fix your bugs and optimize your code. Not only to use inline asm (which is really interesting) but also to learn how your high level language source is assembled. ASM lets u understand the inner workings of an OS and can't be compared to something like java or even ansi c: They offer a variety of APIs which hide the truth of the platform you're developing on. But that's why people use them of course...

  212. Re:Convince me by Doctor+Memory · · Score: 1

    The point is, it's not perceptible for most applications. We just switched from using J++ (native C/C++) to NetBeans (100% Java), and on a decent machine (I've just got an 850MHz P///) there's really no difference. On some of the slower machines here (400MHz PIIs), there's a sub-second delay on some operations, but it's not enough to be distracting. I wouldn't use it for real-time stuff, but then I wouldn't use C++ for real time either (unless I didn't use any templates or any of the other nice OOP features, and then it's basically just C anyway).

    --
    Just junk food for thought...
  213. Re:Languages comparison by rossjudson · · Score: 1

    D = Java + structures - (class library+remote code)

  214. Sounds like the same reasoning that lead to Java by IPFreely · · Score: 1

    The overview talks about how C/C++ has become overloaded and needs to be simplified. Isn't that the same reasoning that lead to Java. how different will this be from just using Java? (syntax aside, just object orientation and capable architecture).

    --
    There is nothing so silly as other peoples traditions, and nothing so sacred as our own.
  215. After C comes P! by vu13 · · Score: 4, Informative

    First their was BCPL, then B, then C. Logically the next language in this family would be P.

    1. Re:After C comes P! by Keith_Beef · · Score: 1

      Aside from the fact that I don't see why Forth would *need* OO, I think that calling its successor "Fifth" is far too sensible, and doesn't lead into a dead-end.

      It's far too simple to call its successor "Fifth", since that starts a trivially simple series: "Sixth", "Seventh", etc.

      On the other hand, you could propose that "Forth" be followed by "Further". After that, you need to *think* before finding a new name.

    2. Re:After C comes P! by quigonn · · Score: 1

      First their was BCPL, then B, then C. Logically the next language in this family would be P.
      No, the logical successor of C is P(er)L.

      --
      A monkey is doing the real work for me.
    3. Re:After C comes P! by heffrey · · Score: 0, Flamebait

      First their was BCPL

      Then there was spelling....

    4. Re:After C comes P! by Keith_Beef · · Score: 1

      Not the way this boy sees things. He clearly doesn't remember BCPL.

      But then, I'm still waiting for somebody to write a successor to Forth. Would it be called Further?

    5. Re:After C comes P! by Karmageddon · · Score: 1
      First their was BCPL, then B, then C. Logically the next language in this family would be P.

      well, "P" would be the logical next name for next new language based on BCPL. the naming convention requires that a new language based on "C" should be "".

    6. Re:After C comes P! by Anonymous Coward · · Score: 0

      Perl (perl scripts end with .pl ate the next two characters of BCPL, at least according to Larry Wall.

    7. Re:After C comes P! by _marshall · · Score: 1

      BCPL: B, C, PerL (or .pl) Larry Wall said so =).

  216. Re:Convince me by Bradee-oh! · · Score: 1

    My 2 cents is this - everyone up to know has been talking about Swing, which albeit much more complete and useful than AWT, has the problem of speed due to being written entirely in Java.

    An AWT UI uses native peer components - it's basically Java wrappers around native GUI objects. Personally, I'm an advocated of using pure AWT in my applications and I've developed quite a library of my own AWT components which fill in some of the functionality that's missing.

    A complex PURE AWT gui is no slower than a native gui, minus startup overhead.

    Oh yeah, a comment on that, too. Restart your machine. Start up a Java app. It takes a few seconds. Quit it and restart it. It's almost as fast as native equivalent the second time around as the VM and related stuffs are already cached. If you do alot of Java devel and run alot of Java apps, the startup overhead is negligable at best.

    --
    "This is Zombo Com, and welcome to you who have come to Zombo Com" - www.zombo.com
  217. can you say "Java?" by dobratzp · · Score: 5, Insightful

    from the overview page...

    features to keep:
    • compile/link/debug development model
    • Exception handling
    • Runtime Type Identification
    • link compatibility with the C calling conventions

    All except the last is contained in Java.

    features to drop:
    • C source code compatibility
    • Link compatibility with C++
    • Multiple inheritance
    • Templates
    • Namespaces
    • Include files
    • Creating object instances on the stack. In D, all objects are by reference.
    • Trigraphs and digraphs
    • Preprocessor
    • Operator overloading
    • Object oriented gradualism
    • Bit fields of arbitrary size
    • Support for 16 bit computers

    This seems to be precisely the parts of C++ that Java also does away with. Furthermore, the C preprocessor is not strictly part of the C language and in fact many other programming projects use cpp for simple cut and paste includes of their favorite language. When I first read about trigraphs, I couldn't wait to try them out to make some extra obfuscated code, but alas the C compiler I was using didn't support them. In fact the lack of standards compliance is one of the main drawbacks to programming in C++ and C. If my Java code compiles on sun's compiler, then I can be assured that it will also compile on any other compiler claiming to compile Java code.

    The author also mentions that D will not have any bytecodes. From a strict perspective, the Java programming language and the Java VM are two different standards and just because you typically compile Java code into (confusingly named) Java byte codes, doesn't mean you can't use one without the other. For example, anyone (who is insane) can pick up a copy of the Java Virtual Machine Specification and a hex editor and make some syntactiacally correct class files. More realistically though, java bytecodes are often targets for compiler construction classes. Also, if you use the GNU Java Compiler you can compile programs written in the Java programming language directly into machine code.

    While 90% of the description of this language screams Java, there seem to be some of the more useful features of C++ thrown in (typedefs, scope operator, etc.). The only way for this to be successful, is to finish standardizing the language as soon as possible and get a reference compiler for it so it leaves the realm of theoretical vaporware. Perhaps Java might have looked more like this if the language design was revisited. However, Java has lots compilers which are much much more likely to conform to the standard than the C++ equivalents.

    1. Re:can you say "Java?" by jallen02 · · Score: 1

      I wonder if D will continue to have parameterized types? Hmmmn.

      Jeremy

  218. Re:First Parrot by JoeShmoe · · Score: 4, Funny

    From the dictionary:

    1. "#", ASCII code 35.

    Common names: number sign; pound; pound sign; hash; sharp; crunch; hex; mesh; grid; crosshatch; octothorpe; flash; square; pig-pen; tictactoe; scratchmark; thud; thump; splat.

    Personally, I like "C-octothorpe"

    - JoeShmoe

    --
    -- I wonder which will go down in history as the bigger failure: the War on Drugs or the War on Filesharing
  219. Re:Convince me by chris_mahan · · Score: 1

    So what you're saying is that it's undeniably slower. It may not be noticeably slower to the user, but it will be slower in cpu cycles.

    Everybody listen up: When saying that Java is slow, qualify that statement thus:
    "Java is slow, when compared to natively compiled software."

    Is that fair to say, mister Convince Me ?

    BTW, PHB likes that. Now he goes around saying: "Java is slow, java is slow". He never qualifies his statement (or he wouldn't be a PBH).

    --

    "Piter, too, is dead."

  220. Re:Convince me by uid8472 · · Score: 2, Funny

    Silly rabbit, if you want to do a fourier transform as fast as possible, you find a FORTRAN nut and lock them in a room with a card punch.

  221. This guy has no clue. by Anonymous Coward · · Score: 0
    From his descriptions in the overview of what he wants to put into D, he does not sound educated enough to me to write a compiler at all, let alone design a workable programming language from scratch. First of all, he says he conceived the idea in December 1999. That's two years ago. What's he been doing with it? Second of all, if the guy had any clue about compilers for as long as he claims to, he'd have known that 'D' was already being used as a name for a programming language more than 10 years before he picked the name (Watt's book on programming language syntax and symantics used a derivative of it, iirc). Not only is the name unimaginative, but it's also unoriginal.

    This comment struck me as interesting... It's frustrating that a language with 750 pages of specification [referring to C++] cannot do basic things like resizing arrays. He shows his ignorance of the STL here... hasn't he ever heard of vector? It's been part of the draft standard for a number of years now.

    Additionally, about the features of C++ he wants to drop... Not that I necessarily think that C++ is the perfect language (far from it, but at least the D&E of C++ explains a lot about why it is the way it is), but the guy's rationale for excluding certain features is just plain ridiculous. Let's look at a couple of them:
    Multiple inheritance. It's a complex feature of dubious value. It's very difficult to implement in an efficient manner, and compilers are prone to many bugs in implementing it. Translation: it's too hard for me to write, and I never had much of a use for it anyways, so I can't imagine why anyone else would really need it. Heck, even Java supports a form of multiple inheritance by using interfaces.
    Operator overloading. The main applications for operator overloading seem to be implementing a complex floating point type, a string class, and smart pointers. Translation: I've never heard of matrices, radicals, rational numbers, or symbolic algebra, all of which are completely _valid_ reasons to implement operator overloading [there are probably at least a dozen others, but you get the idea]. Didn't he say that his language was good for numerical programmers? How can that be if you are overlooking something like this?

    Then there's his so-called "features" section of the page where goes on about such things like natived string support, briefly commenting about C++, he shows his ignorance of the fact that C++ has had full fledged string support as a _standard library_ for a number of years now.

    What kind of programming language considers it an _error_ to have unreferenced variables in a local frame? It's only a maintenance nightmare if the people who wrote the code didn't choose intuitive names for the variables. Second of all, sometimes portions of code, not necessarily whole functions, are temporarily commented out so that specific features can be tested more easily. Having to also comment out the now unused variable declarations as well would be a far bigger maintenance hassle than trying to identify whether or not a variable is used. Besides, in maintenance, the concentration is on the variables that _are_ being used in the code fragments that you are maintaining... why should you worry about variables that _aren't_ used?

    What's up with this? defined behavior for NaN's and infinities. Is he out of his mind? The whole point of those values is that they _ARE_ undefined. If one imposes a uniform mechanisms for handling these "values", then invariably, well meaning programmers will exploit it, and depend on those mechanisms. The result will be code that is obfuscated by depending on the results of something which should, by mathematical definition, be _UN_defined.

    One final thing: I believe that it is a mistake to make one language look too much like another that one has no intent of being compatible with. The problem with having syntax being too similar is that when looking at a printout of the code, one cannot necessarily tell at a glance exactly which programming language is being used. This ambiguity can be the source of some confusion when the project specification included portions written in several different programming languages (since we should know that no single programming language will be the best one to use for all types of tasks). Printouts of code are almost invariably needed during code reviews, so one will not be able to rely on conveniences such as filename extension to convey that information.

    </flame>

    I did find one thing I liked about the language, btw: the bit datatype. Too bad the rest of the language sucks.

  222. Re:First Parrot by Anonymous Coward · · Score: 0

    As any real musician knows, C# and Db are only tonally equivalent; they have expressly different meanings in music theory. On top of that, players of stringed instruments (such as violas and 'cellos) usually will play the Db a few cents higher than a C# as a stylistic device. So no, they aren't equivalent, once you go beyond your elementary-school-level music training.

  223. Re:Java's fatal flaw by Reality+Master+101 · · Score: 1

    Double oops!! Too much talk about C++ today. How about "System.out.println()".

    --
    Sometimes it's best to just let stupid people be stupid.
  224. Re:Maybe? by avail · · Score: 1

    I so strongly agree with the first comment. The whole point of programming is to embody a solution to a problem in a language the computer can understand. Writing a language to conform to "ease of compilation" is regressive. If we did that we'd all still be coding assembler, OS's would all be command line based, and computers would only be used in scientific institutions by a select few people who can master them.

    As for your complaint about windows. I have the misfortune of writing windows code occasionally, and it's not that bad. If you use the ClassWizzard and Resource Designer of MSDev, then all the skeleton code is written for you. I downloaded a Resize-Manager library that allowed me to make my dialogs/windows fully resize-friendly in another 15 lines of code.

    The problem is that you use API calls. Use MFC classes, MUCH EASIER. If you are coding for windows, you might as well take advantage of every ease of use feature you can (given you know your code is not going to be cross-platform).

    Otherwise, use QT. It's really no better other than being cross platform.

    --
    five fingers make a fist amalgamate and resist
  225. Re:What are his motives? by deppe · · Score: 1

    >This is probably what everybody said about C++
    > when they were using C.

    Probably, but remember that C++ is as close to 100% backwards compatible with C as you can possibly get while it added a lot of useful features to the core C languages such as classes, inheritance, templates and inline functions.

    Considering that this is a /new/ language (without a working standard library besided the POSIX C API) there's just way to much time and development overhead in turning your projects to a new language.

    Besides, if people make the transition to D, I guess most of them will come from C++ and not from C, thus rendering the C backwards compatibility layer useless to those developers and projects.

  226. Walter Bright . . . by dpinckard · · Score: 1

    is also the author of "Empire". For those of you old enough to remember, this was a great game. I remember playing on the VAX all weekend during college. It wasn't graphical or real-time, but it was addictive. I keep watching his site hoping someone will port it to the Palm platform, but no one has yet.

    1. Re:Walter Bright . . . by jguthrie · · Score: 1
      Yes, and he wrote his original C compiler so he could port Empire to the PC.

      I, too, have spent many hours playing VAX Empire. For addictive, though, it's tough to beat BSD Empire"

  227. Seems like some isses are confused by Anonymous Coward · · Score: 0

    Maybe I'm alone in this, but I don't consider the abandonment of the preprocessor good news at all. How exactly should one go about making code that conditionally compiles on different architectures?

    Also, D seems complete to snub the idea of seperating interface from implementation. Its specifically tauted that you needed only declare once. Well, I'll say this much, I'd rather *look* at a header file for interface than to dig through the C++ to find the name of a method I need. .h files may be unnecissary but they make good coding much easier and I'm pretty sure they make my programs easier to read.

    D's reliance on modules seems also to imply that all of the symbol information is going to be available at compile time. Maybe I'm confused about the Compile-Link interaction, but it sounds as though to get any reasonable error messages at compile time about missing functions/classes the complier will have to look into system libraries!

    Just moving through the overview, I don't see why he's surprised that C array's can't be resized. He's right about needing a more complex base class for a stack (Well, sort of ... you can make a fixed size stack in an array without any difficulties) but thats besides the point. In order to make an array resizeable you have construct a more complicated base class anyway! The dynamic array might end up being a linked list or hash table, but even then you probably don't want to base your Stack implementation off of something that heavy. C Array's are simple and fast, but if you want something heavier, then by all means include one of the many excellent Classes already designed for exactly that purpose.

    When the author says "Arrays are not first class objects" its not clear why he finds this troubling. Yes, you can deal with an array as a pointer, but you don't have to. Tell your function to expect an array of ints, and magically, thats what they are.

    I agree about the need for String support in the language...see String class and C99

    What is so clumsy about operator overloading in C++? And are we really so sure that "There really appear to be only three significant uses for operator overloading: string manipulation, complex floating point numbers, and smart pointers" I know that I've overloaded operations for more different reasons than this, and I sort of suspect I'm not alone in this.

    Not to even begin to address templates, how can this designer hate them so much that he'll do without, even without a better solution?

    Somehow I begin to feel that D is just what this language would get as a grade.

  228. Re:practical experience implementing compilers?? by nels_tomlinson · · Score: 2
    A language that implements context sensitive comments that can be compiled into various types of documentation would be, IMHO, a very good thing.

    Doesn't FWEB already do this? In arbitrary languages?

  229. Re:Single inheritance by rossjudson · · Score: 1
    So you feel that design by interface isn't practical? Millions of Java programmers would like to disagree with you. You almost never need MI if you have interfaces.

    There's behavioral inheritance and structural inheritance. Structural inheritance just isn't very necessary, and needing it generally indicates that you did something wrong.

  230. Re:No templates? by jesup · · Score: 1

    Lack of templates or some equivalent is a real problem. I'd sent Walter some email, but his address seems to be well hidden on that website.

    I'd suggest he take a look at Ada Generics, which is part of where C++ templates came from. That might show a way to include the important functionality without too many funny interactions or complexities.

  231. Re:Convince me by melee70 · · Score: 1

    Show me one complex mathmatical program where performance is a consideration that has been implemented in Java. Java is interpreted and will never be able to compete directly with the speed of a C program. Why are there no video games or simulations written in Java? Speed bro.. it ain't there in Java

  232. Re:Pathetic by Anonymous Coward · · Score: 0

    The great thing about C was the syntax was simple and small; the power was in the standard libs. Smalltalk has a very simple and regular syntax; the power is in the class library. C++ grotesquely expanded the C syntax, making it much harder to read. The problem isn't that the language designers are too focussed on previous languages. It's that they're too focussed on C. They keep making mistakes that were solved 20+ years ago in languages like Smalltalk. For example, constructors in Java. Constructors should be simply another class method. You call a method on the class to get an instance. Instead of: Foobar aFooBar = new Foobar(); it should be: Foobar aFooBar = Foobar.new(); The syntax would be more regular. And this fellow completely misses the point with his insistence that built-in types are not objects. That's what makes Smalltalk so easy to read. Everything is an object that you send messages to. Java's attempt at being half-pregnant when it comes to built-in types makes the language more complex. But the biggest problem with Java is that the classes are not first class objects. The whole reflection-api abortion is a tape-and-baling wire attempt to clean up the mess they made. And inheritance on the class side is basically broken in Java (and C++).

  233. A few suggestions by bockman · · Score: 2
    After a quick read of the specs:
    • Make the compiler generate an human-readable (ASCII and properly indented) version of the symbol table of a module/class, so that programmers don't have to dig in a thousand lines of code only to discover the interface of a public method;
    • BTW, I hope there is some provision for public/private methods/attributes (did not find it, but did not read the whole specs); large projects cannot rely only on programmers 'sense of responsibility';
    • Borrow ruby's accessors, but with a less mangled syntax: something like 'readwrite int foo' that generates automatic 'int getFoo()' and 'void setFoo(int)' methods, while a 'readonly int foo' generates only 'int getFoo()', meaning that the attribute is only changed inside the class.
    • A doc tool a la javadoc, which helps generating consistent documentation from code (main goal: the developer should not be forced to repeat in the documentations things which are already stated in the code). Maybe an optional 'description { text }' clause after the definition of main items.
    --
    Ciao

    ----

    FB

  234. Re: Oberon by red_crayon · · Score: 1

    In fact it also smells a little bit like Oberon.

    Agreed.

    --
    "Never bullshit a bullshitter" All That Jazz
  235. Re:Convince me by Anonymous Coward · · Score: 0

    > Im not sure that Java is a long term sucsessor but it certanly can do anything C can but better.

    Riiiight. And what language is Java's VM written in?

    Now quite trolling.

  236. Give it a chance. by Psiren · · Score: 2

    No need to invent a new language.

    This sort of staement really amazes me. Are you so righteous that you think Java and C++ are the answer to all programming problems? Get real. They both have their place, and there's nothing to say that D might not have its place too.

    This guy's trying something new. If you see a particular problem with his approach, by all means let him know. We all value constructive criticism and suggestions. But don't just say it's no good before its even been given a chance. I for one think he has some good ideas in there, and I look forward to being able to try it out some time.

  237. Re:SECURITY BY DEFAULT by Old+Wolf · · Score: 2

    It's called "Visual Basic" (seriously, no joke here).

    Builtin security = slower runtime. If you know how to program then you don't write code with buffer overruns. If you don't, then you can use a bounds-checking coddle langauge like VB.

  238. Re:templates and operator overloading are good thi by David+Greene · · Score: 1
    I agree with you. This guy obviously wants a language that is easy to compile. Unfortunately, that misses the entire point of having a compiler in the first place.

    As soon as I saw that he got rid of automatic objects, operator overloading, templates and multiple inheritance, I knew that he does not have much knowledge about the use of these features in large projects. Most complaints I hear about C++ usually focus on these items and are made by people who do not fully understand the power and flexibility they provide. They are stuck in the 2-D world of simple datatypes and containers of X.

    Automatic objects are absolutely essential for the "resource initialization is acquisition" paradigm. Mutex locks, for example, are trivial to use with this technique. And they work automatically when exceptions are thrown. This is why automatic variables are a pain to implement with exceptions, but with D the programmer will have to clean up manually, writing the code that C++ compilers generate automatically.

    Operator overloading is used for a lot more than complex, string and smart pointer objects. The [] operator is used on anything that acts like an array or map. The () operator is essential for nice functors, callbacks and generative programming. Operator overloading and templates has been used to create parsers that allow users to write BNF-style grammars directly in C++. I once used them to easily build ASTs for C expressions.

    Which brings us to templates. Templates are a crucial element of C++. So much so that most experts now advise less inheritance and more template specialization. They are used for much more than "container of X." The whole C++ generative programming movement is based upon them. They in turn require things like operator overloading because templates are a weaker form of binding. Rather than conforming to the "isa" relationship, a template argument need only implement the syntactic interface of the operations used in the template.

    Templates are so important that even Java is going to get them.

    Multiple inheritance does have a performance penalty and certainly is complicated for implementors, but it is incredibly useful. Again, generative programming along with advanced generic programming with design patterns uses MI mixins to add features to objects. See books by Andrei Alexandrescu and Krzysztof Czarnecki and Ulrich Eisenecker for what I'm talking about. This is very cool stuff.

    Be very suspicious of languages developed by and for compiler writers.

    --

  239. Re:Convince me by Anonymous Coward · · Score: 1, Informative

    ahem.. yes, java can be faster doing an fft. http://www.aceshardware.com/Spades/read.php?articl e_id=153 also another article comparing speeds: http://www.javaworld.com/javaworld/jw-02-1998/jw-0 2-jperf.html too many people have preconceptions back from the days when the only runtime was a byte code interpretor. Try the latest JIT and you may be surprised..

  240. Re:Maybe? by Lord+Omlette · · Score: 1

    Windows Forms? Or perhaps you would prefer Delphi's VCL?

    --
    [o]_O
  241. Re:weirdness by eXtro · · Score: 1
    I love the way there's a reserved word "imaginary" heh...
    This would be for defining imaginary numbers. An imaginary number is some multiple of the square root of -1. They are used very frequently in science and engineering.
  242. Re:The only thing new is the name by mooneyguy · · Score: 2, Informative
    Anyone who really knows the origins of the language "C" knows that its successor should be called "P" and not "D".

    --
    Mooney Guy N4074H
  243. Re:Forth !!!! by jotaeleemeese · · Score: 1

    Perhaps when all the "popular" implementations adhere to a same standard that allows code portability?

    Or when some good Forth references (not some lost web pages here and there) are published?

    --
    IANAL but write like a drunk one.
  244. semicolons by burris · · Score: 2
    Good lord, folks, it's 2001 so why are we still putting semicolons at the end of every line?? Parsers have come a long way in thirty years. It turns out that terminating a line with anything more than a carriage return is completely unnecessary.

    Burris

    1. Re:semicolons by SpryGuy · · Score: 1

      Bullshit.

      What about long lines? What about breaking up long lines to be more readable?

      I hope to GOD that whitespace never becomes significant in any programming language I have to code in.

      Whitespace is significant in VB programs right now, and we all know how much VB *sucks*...

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
  245. Re:Convince me by reflective+recursion · · Score: 1

    Didn't Sun or someone do this already? I remember reading something about it once.

    --
    Dijkstra Considered Dead
  246. Re:Maybe? by Lord+Omlette · · Score: 1

    See, before this morning, I would have derided you as a complete moron. But here I am, writing MFC code trying to do something as simple as providing multiple extension filters for an SDI app, and MFC doesn't let you do it! You can't derive from existing classes to do it, you have to cut and paste and point to your own stuff... Ridiculous

    Since you've clearly already 'been there, done that', have you heard of anything that sounds even remotely better (whether you've had a chance to check out yet or not)?

    --
    [o]_O
  247. Big deal by Pedrito · · Score: 2

    Sorry, but as a long-time C++ programmer, I find this only a marginal improvement in the language. Granted, it is an improvement, but how many people are going to rewrite legacy code for a marginal improvement?

    Personally, I think we need a radically different way of programming. I don't know what it is, but we need it. We're really in the bronze-age of programming. We've got a long way to go. Right now, writing software is more art than engineering. The few groups that do it like engineering pay a heavy premium to do it (i.e. the Shuttle Software group)

    There was a guy a while back that wrote a program that emulated a bunch of CPUs. He then wrote a language for those CPUs and had a "goal" for the program. He then introduced the idea of mutations and spawning child programs. He would start off writing a program to acheive the goal, and then feed it into the "CPUs". After several generations and mutations, and a "natural selection" type process, the computer ended up generating better code than he originally did.

    I've had it in the back of my mind that that's what we really need to do in software. Come up with a way for computers to put our software through some sort of "mutation" and "natural selection" process and in the end we get better code. Obviously in the real world, this is a much more complex problem than the simulation this guy wrote. Wish I could remember where it was and what the link was. Very cool stuff.

  248. Re:Convince me by Furry+Ice · · Score: 1

    Startup time is almost negligible if you do it frequently? I'm afraid that's a load of hogwash. Yes, it's faster than the first time, but it's still unbelievably slow. Check out the Hello World benchmark in Bagley's language shootout. It just runs a hello world program in each language from a shell script to measure the relative startup times of languages. Java comes in dead last because it's startup time is pathetic.

  249. Re:Nothing special... by RevAaron · · Score: 2

    Those who are suffeciently annoyed with the cornecopia of evil known as C++ will use another language. Then there are those that think the many gotchas that make up C and C++ are fun. Those are the people that are still C++ programmers today, and have no use for this D language.

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  250. No! The cool thing about forth is... by Anonymous Coward · · Score: 0

    the threaded interpreter. It makes for tight (space-wise) code but is flexible enough to be extended to do amazing stuff. Unfortunately, everyone gets bogged down in all the rpn stuff - I think it mostly sucks to. But you're free to write a completely new forth compiler and call it D or fifth or whatever. In conclusion: The Threaded Interpreter is what makes forth a cool environment.

  251. Re:A critique -- macros by J.Random+Hacker · · Score: 2

    While I generally agree that you need macros in some form, I'll observe that once you have macros with the same expressive power that lisp macros have, you don't need templates anymore. On the other hand, it may be that LISP style macros would prevent the compiler from handling the sort of type matching that C++ templates have (which both lend power, and make them the very devil to implement correctly).

    LISP style symbolic manipulation of code permits the construction of special purpose syntax that is closer to the problem at hand, making the code easier to write and understand, provided that the macros are written to make things more clear rather than less. It is certainly true that you can take things too far with LISP-style macro expansion, but you can also go much much farther than you can with any text-preprocessor scheme.

  252. Where's the win? by dacron · · Score: 1

    Many of the "shortcomings" of C++ noted in this spec have already been overcome through the use of features which the author claims are too complicated to be useful. Templates and operator overloading make dynamically sized, first class array types fairly straightforward to implement, and the standard library even provides one. Many programmers have been using various forms of garbage collection for years using the same features. And the vague assertion that C++ is bad at string proessing is completely absurd; C++ not only provides basic string classes (which are easily user-extendable to allow for any locale or character set), but also offers all the features necessary to code your own string library which is as efficient as the hardware allows. There is no perfect string implementation- all have strengths and weaknesses and the ability to pick the right one for the job at hand is crucial. The whole criticism of C++ seems to have ignored that fact that while C++ *is* a fairly large language, the vast majority of the spec is talking about the standard library- a library which can be completely ignored or completely reimplemented by the user.

    Certainly there are features that I think would make sense in C++, try-catch-finally and (if a convincing case were made for their usefulness) nonaliased typdef-style constructs, but throwing out the features that have been scrupulously analyzed, optimized, refined, and finally only included when they were deemed absolutely necessary is just absurd.

    Multiple inheritance can cause huge maintainability problems, but used judiciously it makes it much easier to customize class interfaces and reduces code duplication. In many cases a design can increase a magnitude in complexity if multiple inheritance is not available.

    Templates and stack-based objects are not strictly necessary in many cases in C++, but they provide the primary mechanisms to write high-level, well structured, and maintainable code that runs at near-optimal efficiency. With these features you can write extremely robust and flexibly interfaces that compile down to only a few instructions. Removing them would mean requiring writing any code which needs to run efficiently in the old monolithic C style which has proven so expensive to debug, maintain, and extend. And if you can come up with a type safe zero overhead way to write container classes with no code duplication at all, it's probably more complex than the (admittedly new and not-well-understood, but inherently straightforward) template system in C++.

    Operator overloading is the only way to write user-defined types with interfaces similar to those of built-in types. To disallow this feature would be to put up a wall between what the language provides and what libraries can offer.

    Overall, I just don't see anything which even comes close to outweighing the huge costs and problems that come with moving to a new language. C++ was a major step forward from C; D is at best a step sideways.

  253. enough? a real change? by Anonymous Coward · · Score: 0

    The improvements, beside simplification of teh specification brought by D aren't stellar.

    Garbage keeping is nice. And so far it feels like this was one of the only real attemps at making D a higher level language than C++.

    Nothing bold in there really. I am however curious about typing. Well, they still use non-object types for comon data types. They use only single inheritance. I only browsed through the specification so far but I am still asking myself about a couple of things that don't seem to be menmtionned anywhere.

    Object Delegation, since we only have single inheritance and a couple of constraints from C++ and Java, does the language offers delegation mechanisms? Of course it can be programmed but it's stupid that everyone has to roll out his own using interfaces (in java at least). Delegation, in case some people don't know, is when you can asing a delegate to an object, when an object can't answer to a message (method call) it sends it over to it's delegate.

    Which brings me to this quote from teh spec overview:
    "Runtime Type Identification. This is partially implemented in C++; in D it is taken to its next logical step. "

    Alright, what do they mean? It is not clear so far according to what I have read. But if the language uses dynamic typing, that would be awesome. It would in part contribute to make up fr the loss of templates.

    Dynamic binding would also be great. But I haven't seen anything hinting it is coming...

    Ok, sinoce some of these ideas are some of the nice things in Objective-C, I aadd just one comment about one thing that is extremely usefull but is always overlooked for some reason: Categories.

    Categories allow you to define something that is a bit like a subclass but that only introduces new methods (including their implementations). The good thing is that if you define a categopry on a class, any object of that class can be considered as part of this category... it is great when extending frameworks and the like without having to play with subclassing and object types problems.

    D seems a good idea, but for it to be really relevant they should be pushing teh high level language aspect. NOt just C++ made easy in a couple of spots like dynamic arrays.

  254. Portable assembly language by yerricde · · Score: 1

    who would argue that ASM was the most portable of any language, and he could cross-compile his project (with millions of lines of code) onto any new CPU

    It's not as far-fetched as you may think. "Portable assembly" refers to mnemonic languages that represent a bytecode that can be recompiled into a CPU's native bytecode. For example, Jasmin is an assembler for JVM bytecode. The new Amiga OS comes with a virtual machine and an assembler for its bytecode. Heck, even x86 bytecode is beginning to be thought of as somewhat high-level; Transmeta's Crusoe processor dynamically recompiles ("Code-Morphs") x86 code into its own asm.

    --
    Will I retire or break 10K?
  255. Re:Convince me by BinxBolling · · Score: 1

    It's a very heartwarming idea - he's attempting to conjugate C's performance, speed, and low "levelness" with Java's "oh-my-god-did-I-just-finish-writing-that,-boy-it- only-took-me-3 minutes... but-it-runs-slow" beauty.

    But if it can be done, why hasn't it been done already, hmm?

    It has been done already. The language is called C++. It's a big language, but it's considerably more powerful than Java (multiple inheritance, templates), while also being faster.

    Unfortunately, it doesn' t have Sun's marketing engine behind it.

  256. Delphi VCL by Anonymous Coward · · Score: 0
    I use Delphi without the VCL, using my own my own home-brew classes to write my own Window controls. The VCL is easy to use on its own terms, but the minute you need to develop a custom control (like a control that displays a scrollable bit-map gray-scale image that you can modify on the fly), all the ease-of-use goes out the window, you are going to have to understand the API as well as what the VCL is doing on top, and it is simpler just to program the whole app using the API.

    I also think the VCL is gross -- its use of global variables, all the obscure Windows API stuff it is doing, all the house keeping it needs to do for features you may not even use.

  257. Re:Convince me by scrytch · · Score: 2

    > What you've learned is that shitty programming can run slow anywhere

    Yes, such as properly written swing. I saw a scheduling applet using a swing GUI that was running damn fast ... until I realized that it wasn't using any widgets on the main screen. The "flat" looking interface was a big canvas object and they wrote their own code to deal with user clicks on the canvas. Probably didn't even deal with the event model beyond the initial mouse events. Certainly no widget tree to have to traverse.

    Moral of the story: if you want decent performance, do it yourself, because the stuff you get out of the box will produce crap. Meanwhile, every whipped-up VB and Delphi app I've seen has at least had a responsive interface.

    --
    I've finally had it: until slashdot gets article moderation, I am not coming back.
  258. Re:Useful? Not Really. by Unknown+Lamer · · Score: 2

    D'oh, I really am a lamer. I never thought about that. Thanks. And it does seem to make sense to not allow an object to be constucted twice (bad things may happen). In fact, when I think about it, even though D says that calling a constuctor from a constructor is a good thing, it puts more responsibility on the programmer (you have to make sure the two constructors don't walk over each other).

    --

    HAL 7000, fewer features than the HAL 9000, but just as homicidal!
  259. Re:Convince me by melee70 · · Score: 1

    Unfortunately there are few programmers that take advantage of even half of the capabilities of C++ because of the complexity that is present in the language. Most revert to functional C programming instead of actually implmenting a well designed OO program.

  260. SECURITY BY DEFAULT by zenray · · Score: 2, Insightful

    One thing in this new programming language that needs to be designed in from the ground floor is SECURITY BY DEFAULT. Make buffer overruns impossiable for starters. I'm very weak as a C programmer and just a student of computer security but it woluld go a long way to solve most of the security problems in appliacations if the programming language enforced proper security codeing practices. Maybe everything would be as secure as OpenBSD. Theo should help design D language to be SECURE BY DEFAULT rather than doing a security review after the software is written. Just my opion, I might be wrong.

    --
    zenray
  261. Interesting to compare it to Java... by dwalsh · · Score: 1

    Some of the features dropped from C++:

    Multiple Inheritance
    Templates
    Operator Overloading

    Some of the features added/retained:

    Garbage Collection
    Exception handling

    I've seen criticism of Java because of these choices from certain quarters at various times. It is interesting to see the same decisions being made again 6 years on, which I believe vindicates Mr. Gosling.

    --
    ${YEAR+1} is going to be the year of Linux on the desktop!
  262. Re:Forth !!!! by markmoss · · Score: 2

    Forth is a very good language for small embedded systems -- it's portable, and the object code is sometimes more compact than assembly. But it's designed for easy and compact compiles, not for readability. I would not recommend doing a 100,000 line project with it.

  263. Make lang prgrmr-friendly, not cmplr-wrtr-frndly by Tablizer · · Score: 0

    >> Maybe its time for a new language born out of practical experience implementing compilers." <<

    That is like letting ONLY engineers design cars and not drivers.

  264. Re:Forth !!!! by stokes · · Score: 5, Funny

    I've got an idea... let's hybridize a postfix language like Forth and natural language processing. We can call the new programming language "Yoda." Here's some sample code:

    Variable x to 10 be setting.
    1 to x you add.
    This times 10 you be repeating.

  265. Re:Sounds like... by Anonymous Coward · · Score: 0

    > If, on the other hand, all he wants to do is
    > sell compilers, and therefore he needs to
    > convince the rest of the world of the
    > language's benefit, then fooey.

    Goodness me. Its not enough that comes up
    with the idea of a new language and writes
    a compiler - he has to write killer apps too!
    Does he have to kiss your ass too?

  266. Re:First Parrot by Dun+Malg · · Score: 1

    and here i thought ! was the generally accepted 'splat'.
    Nah, that one's called "bang".

    --
    If a job's not worth doing, it's not worth doing right.
  267. Oberon! Damn then yes, easy compiler writing by sethdelackner · · Score: 1

    Hell, my compilers class had us implement an Oberon compiler in 20 weeks (most of it spent learning how to write a compiler in general).

    If D is that easy to implement, then why not add templates ;)

  268. Re:Forth !!!! by scrytch · · Score: 2

    > Why aren't new languages based on Forth?

    You just don't hear about them. Check out Joy and Chaos. (the link for chaos points to Coldstore, Chaos is a toy that comes with coldstore and is used to test it). Chaos has perhaps more in common with postscript than forth. The cold fact is, people don't like to program everything in rpn.

    Personally, I like the idea of Intentional Programming, where you code to an AST, creating higher levels of abstract AST nodes called "intentions". In IP, the language is merely an intermediate tool to reach that end, and the runtime is a particular implementation of it, both expressed in terms of transformations on the tree (simonyi's colorful term for such transformation functions is "enzymes").

    --
    I've finally had it: until slashdot gets article moderation, I am not coming back.
  269. Why another language?? by Anonymous Coward · · Score: 0

    Common lisp has already all the features of D. and a lot of more! Where are the macros?? Why re-inventing the wheel again and again? Then we will learn "D in 21 days". How about learning our existing languages in 10 years?

  270. Re:Convince me by guinsu · · Score: 2

    Lets rephrase that:

    Well, I don't believe C++ will ever reach the speed of assembly, but then again 'good enough' will usually do: Just look at Windows ;-)

    Now will you people give up this silly argument?

  271. Re:Convince me by Quietust · · Score: 1

    What environment were you running the Java/C programs from?
    Also, what C compiler are you using?

    If you were running them from a command prompt, let's not forget that running 32-bit programs from a 16-bit command prompt is rather slow; it takes 1-2 seconds just for the program to start.
    Also, the C compiler used is important (as it determines the type of EXE produced); DJGPP produces 16-bit executables (which use a 32-bit extender, or just switch to 32-bit if they detect Windows running), which runs very quickly from an MS-DOS prompt; if you use a Win32 compiler like VC++, you'll get 32-bit programs which exhibit the startup delay mentioned above.

    I'd be interested to see a *true* benchmark, i.e. one that does actual computations and which takes atleast several minutes in either language; that'd get rid of any delays from overhead.

    --
    * Q
    P.S. If you don't get this note, let me know and I'll write you another.
  272. Re:No templates? by Kawaii+Failure · · Score: 1

    If I'm not mistaken, Java's Object superclass makes any template system redundant. Of course, an industrious C++ programmer could just declare all of her classes inherited from an Object class, and have any libraries just use Object types instead of templating. (I never liked wrapper files)

  273. Re:Sounds like the same reasoning that lead to Jav by Anonymous Coward · · Score: 0

    This doesn't use a vm like java does. Read the spec.

  274. Re:practical experience implementing compilers?? by hey! · · Score: 2

    I really don't like his ".html" file idea: code inside a html file is compiled by ignoring everything but tagged bits. The concept is to use html to document and compile the code right in the documentation. Personally, I prefer to generate documentation from the code.

    I read the ".html" thing slightly differently from you. Rather than compiling code into the html file, source is included in the HTML file. If the volume of source is high relative to the volume of text, then it looks a lot like generating documentation from code.

    It looks to me a lot like being able to use HTML markup for your comments, which seems pretty harmless. What I'd really like to see is an XML schema which is custom crafted for helping with programming problems -- in essence adding semantic distinctions to various kinds of comments:

    [section name=init_foo]
    [remarks] Our foo unit must be instantiated and helper objects initialized [/remarks]
    [modification by="Alice" date="1/1/01"]Created[/modification]
    [modification by="Bob" date="7/4/01"]Added code for foo-2 hardware[/modification]
    [modification by="Alice" date="7/15/01"]Fixed GPF in new foo-2 code, still problems in Win95[/modification]
    [TBD assigned-by="Alice" assigned-to="Charlie" for-release="2.1" due-by="9/1/01" applies-to="WIN32"] Fix random GPFs under Win95 OSR2 [/TBD]
    [code]
    foo my_unit = new foo(something);
    init_bar(foo);
    etc.;
    [/code]
    [/section]

    The point would be to take just plain old comments and structure them so tools could do useful things with them (e.g. find out what Charlie was supposed do for release 2.0 on Win32). Of course you wouldn't want to see all this detail all the time; perhaps the default editor view could be just the code and the remarks, with little glyphs to indicate change history or pending tasks.

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  275. But wait, there's more! by kmj9907 · · Score: 1
    From the overview:
    D's object oriented nature comes from classes. The inheritance model is single inheritance enhanced with interfaces. The class Object sits at the root of the inheritance heirarchy, so all classes implement a common set of functionality. Classes are instantiated by reference, and so complex code to clean up after exceptions is not required.

    Also, synchonization is pretty much exactly the way java's works... at least in the vague way they describe it in the overview.

    --

    kmj
    The only reason I keep my ms-dos partition is so I can mount it like the b*tch it is.

  276. SUHWEEEET by theneo · · Score: 0

    sweet.

  277. Floating Point RelOps by vrmlguy · · Score: 1
    Am I misreading something, or is there a contradiction in the specs? Compare this:
    Equality for floating point types is more complicated. -0 and +0 compare as equal. If either or both operands are NAN, then both the == and != comparisons return false. Otherwise, the bit patterns are compared for equality.
    to this:
    Useful floating point operations must take into account NAN values. In particular, a relational operator can have NAN operands. The result of a relational operation on float values is less, greater, equal, or unordered (unordered means either or both of the operands is a NAN). That means there are 14 possible comparison conditions to test for:
    [...]
    != unordered, less, or greater
    [...]
    The first says quite plainly that "5 != NAN" returns "false", but the second (if I'm understanding the meaning of "unordered") indicates that "5 != NAN" should return "true".
    --
    Nothing for 6-digit uids?
  278. Orthogonality by Bart+Botma · · Score: 1

    Languages should respect orthogonality. Well, at least programming languages should. C and its derivatives do not. Just look at the difference between function parameter declarations and variable definitions. E.g. char a,b; int c; /* legal definition */ /* both a and b are of type char */ int f(char a,b, int c){} /* legal function definition */ /* but b is of type int! */ My suggestion: borrow ';' from Modula [Wirth] to seperate function parameter declarations! E.g. int f(char a,b; int c){}

    1. Re:Orthogonality by SpryGuy · · Score: 1

      Better yet, stop the annoying habit of ASSUMING types when they aren't specified (i.e. in the function parameter case, assuming *int* when nothing is specified). That is one of the most annoying features of C, responsible for lots of bugs and errors, all because some programmer was too damn lazy to write "int main" instead of just "main"...)

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
  279. A little bit of solfege by Anonymous Coward · · Score: 0

    C# = Db Do Sostenido = Re Bemol C,C#,D,D#,E,F,F#,G,G#,A,A#,B Then D modern than C#

  280. Re:Forth !!!! by Anonymous Coward · · Score: 0

    Yeah Forth is nice. But the only company I have seen pushing it is IBM.

    Mmmh... well... and I remember that some Macs based on the first generations of PowerPC chips used Forth in OpenFirmware, it actually allowed a couple of cool things. I beleive it was also the case fopr Prep boxes.

  281. Re:Nothing special... by Dr_Claw · · Score: 1

    The thing is though, as he says in the overview, these "nothing special" things save time. Sure, they're not necessary, and we live with C's little oddities without problem at the moment. But, if we don't have to worry about those then we can be more productive, and hopefully less coding mistakes are made.

    It looks nice enough in my opinion (main thing I'm sceptical about is the documentation in HTML thing). Whether it'll turn out to be successful who knows - let's see.

  282. Re:Forth !!!! by mustafap · · Score: 1

    Because Forth is bollocks, thats why.

    --
    Open Source Drum Kit, LPLC deve board - mjhdesigns.com
  283. Re:D already exists.. by gatkinso · · Score: 1

    That was it! That software was the WORST!

    --
    I am very small, utmostly microscopic.
  284. Re:sizeof by frleong · · Score: 1
    I don't see how sizeof (and it's sizeof, not sizeof(); sizeof is an operator, not a function or macro) is inconsistent or unpretty. Personally I think "sizeof foo" is prettier than "foo.size", and more consistent since I would expect "foo.size" to refer to a member. I can see the switch() thing, though.

    IIRC, sizeof is the only C operator that uses English alphabets == inconsistency!

    Also, as dynamic arrays and strings have a length property, having foo.size makes the syntax more consistent and makes foo look like a first-class variable, similar to other OOP languages (not C++).

    --
    ¦ ©® ±
  285. Re:Convince me by Anonymous Coward · · Score: 0

    >Java GUI apps _are_ slower, because Swing is basically all written in Java and it can't really take advantage of platform-specific tricks to run faster.

    Except on MacOS X where Swing is hardware accellerated.

  286. Re:Encore! by Anonymous Coward · · Score: 0

    "Nathan Hale"??

  287. Maybe? by scott1853 · · Score: 3, Interesting

    "Maybe its time for a new language born out of practical experience implementing compilers."

    Maybe it's time for a new language to be born out of practical experience writing software.

    I don't know how it is in Linux, but I really hate having to write several hundred lines of code for a single window w/controls in Window API calls. Personally, I'd like to see MS get rid of those API calls (and don't replace it with ActiveX until ActiveX works). Between the ones that don't work as documented and the rest of them being overly cumbersome, it's just a hassle. Especially when you have to create your own encapsulation objects for those things. I like Delphi because of its encapsulation of the visual components, but their base library sucks in itself in that it doesn't expose all the functionality. And since they saw that it was so important to declare everything as PRIVATE methods, you can't get descendent object to do everything you want either because you don't have access to all the base functionality.

    Simplicity shouldn't be taken to the extreme either, and gear a new language towards the non-programmer crowd like MS tries to do.

    Of course MS is just making things worse right now by implementing these new Luna APIs for XP. I'm sorry, but I don't know of anybody thats been really dying for the ability to use API calls to put a gradient on a button. In my opinion, this is just MS's attempt at trying to get developers to waste time, so they don't work that hard on developing new products that may compete with MS.

    1. Re:Maybe? by rossjudson · · Score: 1
      So all those thousands of people who've written Delphi components very successfully over the VCL base classes are just smoking crack, and really didn't do that at all?

      Sometimes you need to modify the VCL, but it's pretty rare. Every once in a while something you need is buried in a private section. I suggest you educate yourself a little more on the VCL and what it can do for you. There's probably another way to do whatever it is that you're trying to do.

    2. Re:Maybe? by WNight · · Score: 2

      Re: Making compiles easier to write

      I agree, mostly.

      It makes a compiler easier write if you don't ever need forward-lookup, so to call a routine defined later, you need to pre-define it (ie, header files.) But it's a pain, and all it really saves is one pre-scan of the file for names.

      It is also a pain to properly support some of the C++ spec, but much more of a pain, enough so that few people have properly implemented it.

      In the first case, the compiler writer should btie the bullet and make it easier for the users. In the second case, the "right" thing to do is properly implement the spec, but if nobody does, you need to accept it and design a spec people will follow.

    3. Re:Maybe? by Karmageddon · · Score: 2
      oh, boy do I agree, it's why I quit working on Windows stuff. I would describe the problem as a little worse, though: it's not too difficult to write a little class that encapsulates the Windows API ugliness and cruft as you encounter it. Then you could just use the pretty wrappers, right?

      Wrong! The vast majority of Windows programmers, and I'm talking about many otherwise intelligent people, are completely addicted to "cut-and-paste inheritence" and they don't "see" the beauty of a one-line call to ecapsulate a dozen lines of in-lining that accomplishes only a couple of measly Windows messages passed.

      I truly don't get it. And the MSDN CDs just make the problem worse because they don't really indicate what is deprecated and what is not so you can generate tons of new cruft without even realizing it.

      Don't think that Microsoft does not understand this, and don't think that they don't do it on purpose. What better way to defend a monopoly than by deeply embedding Microsoft proprietary stuff in everything you do.

    4. Re:Maybe? by scott1853 · · Score: 2

      I use Delphi's VCL (as stated). Delphi's VCL sucks as soon as you realize that it's not even a complete encapsulation of all the functionality of standard Windows controls.

      Try to derive a component from an existing one and make it do something new. Forget it. All the base functionality is declared in PRIVATE segments which cannot be accessed from descendent classes. So you can either modify the VCL code youself (stupid), or cut-and-paste the entire VCL code (almost as stupid), or start from scratch writing your own encapsulation (complete pain in the ass).

    5. Re:Maybe? by Amokscience · · Score: 2

      Ditto for Delphi and C++ Builder. There you get to use "real" languages as well.

      --
      Fsck cluebie moderators. I'll say what I want, offtopic or not. And fsck having to qualify every bloody statement just
    6. Re:Maybe? by SpryGuy · · Score: 1

      Check out the .Net libraries. They pretty much do what you ask. The whole .Net programming environment is light-years ahead of using Win32 APIs to try and get anything done. Or MFC for that matter. The new common language runtime object library is pretty comprehensive and relatively well designed.

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
    7. Re:Maybe? by SpryGuy · · Score: 1

      It's also very easy to write code that LOOKS like it should work, but which doesn't. The fact is, while VB (and Vbscript) shield you from what's going on underneath, sometimes you NEED to know what's going on in order to have your code work correctly. For instaince, in Vbscript, there's a WScript object that has a StdIn method member. However, if you call "WScript.StdIn.ReadLine()" over and over, you WILL miss data! You have to use the SET command to assign WScript.Stdin to a variable, as in "set StdIn = WScript.Stdin" first, and then ONLY use that variable from then on. Otherwise data WILL be dropped. Similarly, you MUST know what things are objects and what things are not, as you use the 'set' command to assign objects to variables, and you cannot use 'set' to assign other things to variables. It's all very fractured, inconsistent, and insane if you ask me. A totally crappy language.

      I'm glad to see it getting 'cleaned up' some in VB.Net, but frankly, I think that it'll die, with C# taking over on the Wintel platform. Oh, how I will celebrate the day when that abortion of a language called "VisualBasic" actually dies!

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
  288. Octothorpe by streetmentioner · · Score: 0, Flamebait

    Apparently it was named octothorpe because it looked like the street pattern of an English village. Can't remember where I read that.

  289. Why not completely from scratch? by Badgerman · · Score: 2

    Improving languages? More power to the people doing it. C++ is daunting as hell even to experienced programmers coming from other languages, and has some pretty odd legacies.

    However, to play Devil's Advocate, why base a language on anything pre-existing? Is anyone creating languages completely (or mostly) from scratch?

    Admittedly a from-scratch language would be up against a higher learning curve, but I wonder if the benefits would outweigh this.

    Just a thought from a person who's had to learn a lot of languages.

    --
    "The Sage treasures Unity and measures all things by it" - Lao Tzu
  290. Re:ASM ROCKS !!! :) by IpalindromeI · · Score: 1

    Don't get me wrong, I love coding in assembly too. The control you get is like a powertrip. The problem with assembly, obviously, is that it's architecture specific. While that isn't necessarily a bad thing, it is nice to have the broadest possible user-base, which means cross-platform. That's why everyone's been infected with this Java disease. Of course, if you're not worried about that, more power to ya. I personally think programmers should be required to know some kind of assembly, so they have a concept of what their code actually gets turned into. "Look, this vector search only takes one line of code! That's way faster than trying to use this array that would take at least 5 lines." I'm not exaggerating here.

    --

    --
    Promoting critical thinking since 1994.
  291. Re:Forth !!!! by Anonymous Coward · · Score: 0

    There has been a FORTH developed that places the code between code /code tags in HTML pages see: coldforth.teegra.net/ The web pages are the source. You code can include nice HTML comments, images etc. The FORTH in question has also done a decent job of implementing local variables so there is no need to do return stack manipulation.

  292. Re:practical experience implementing compilers?? by hey! · · Score: 3, Insightful

    "Declaration" is an overloaded term in this context.

    If you look at the source files, you see that you still have to declare variables (e.g. "int i;").

    What you don't have to do is to declare classes in a separate header file, when all the information about the class's public interface could have been gleaned from source file in which the class is actually defined.

    The purpose of this, I guess, in C++ is to allow the compiler to layout an object in memory prior to the constructors being called, and generate assembly for class member access, without necessarily knowing where the class is defined or even having access to source at all. Secondarily the class's interface can be determined for compile time checking. I say secondarily, because clearly that isn't the main purpose of class definition headers since they also reveal information about private members and methods, which are of no interest to the client modules.

    D is more like Java in that the compiler can do all this without any special help (in the form of header files) from the programmer.

    Perhaps somebody who knows java better than I can comment, but I expect that the Java compiler does all its checking by looking for .class files in the CLASSPATH and poking around in them, and presumably the byte compiled files. So you don't need access to source code to use a class. If you wanted to do something like this in C++, you couldn't, because the necessary information probably isn't in the object file format. You would need a new format that performs some of the functions of the ".class" files, or perhaps the compiler could generate the header files for the programmer as his classes are compiled.

    In any case, I've never found the C++ way of doing things much of a problem, but if you think about it, it is rather unnecessarily complicated. Every little bit counts.

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  293. Re:Convince me by Tim+C · · Score: 2

    Well, on my measely little P3 450 with 256meg of RAM, I can't, except when CodeInsight pops up for the first time on a class. Then, it's slow. (And yes, I can type fast :) )

    If you're really having problems with typing in JBuilder on your machine, I'd say it demonstrates an underlying problem with your machine, not with JBuilder or Java.

    Cheers,

    Tim

  294. Re:Forth !!!! by chrysalis · · Score: 2

    C and Perl are often hard to read, too. And OO languages are an horror when you have to walk through dozens of classes to find a function.

    --
    {{.sig}}
  295. Re:practical experience implementing compilers?? by Syberghost · · Score: 2

    for instance, there are no headers, as declarations are lifted from the source.

    That sounds like a step backwards; declarations were put there on purpose. It helps other people figure out what the code does, including you six months later when you forget.

  296. Re:First Parrot by FatHogByTheAss · · Score: 1
    How is C# pronounced? As a musician I've always thought it was "See Sharp"

    It is "See Sharp". As a musician, you should know that it is equivlant to "Dee Flat."

    Oooh. I made a funny...

    --

    --
    You sure got a purty mouth...

  297. D - not C compatible? by TangoCharlie · · Score: 1

    One of the reasons C++ was C++ and not D, was that it was supposed to be a superset of C, such that any C that compiled using a C++ compiler should work and do exactly what it should have done if compiled using a C compiler. The idea being that C++ programmers would have a good place to start from (i.e. C). However since the early days of C++, C++ has grown such that the subset of C++ which is C is a rather small subset. The problem is that C++ suffers many limitations which stem from its C heritage. It might be a good time to write a *new* language which is similar to C++ but where in cases where backwards compatibility with C conflist with clarity, that clarity should win-over. If D does this, then it is a welcome addition to the tool set of programmers.

    --
    return 0; }
  298. Re:Convince me by gavlil · · Score: 1

    So your contention is that a program can run just as fast on a virtual machine as one that is compiled natively?

    your kidding, right?
    seriously...why dont we all go back to using machein code - its faster than C, C++ and Visual Basic, it can do webstuff (all webservers on the planet talk to the cpu) and all the current compatibility issues we have will look like tiny ants.
    Im joking (no realyl I am) but come on C++ has its uses sure but its definately go onefoto in the grave, Im not sure that Java is a long term sucsessor but it certanly can do anything C can but better.
    --

    Do Unto Others As You Would Have Others Do Unto You - ONLY HARDER!
  299. Absolutly not! by Anonymous Coward · · Score: 0

    Practical experience designing compilers? No way! The programming language is the human interface. The compiler's job is to translate that into what a computer can recognize. If 10 people spend 1 year crafting a compiler for a language that is especially difficult to translate to assembly so that a million people can save a day coding a project. Tailor the language to the humans, make the compiler as large and nasty as is necessary. I'm one of those people that would rather spend 1 hour compiling a small program if it would run 10% faster than if I spent 10 mins compiling it.

  300. Re:Eiffel by captredballs · · Score: 1

    I was wondering the same thing. If you are experienced in Eiffel, it would be great it you would read some of the spec and try to get more insight on the D vs Eiffel and make some additional comments.

    Or anybody else who has used eiffel...

    --

    I suppose I'm not too threatening, presently, but wait till I start Nautilus
  301. Buggy compiler? by thejake316 · · Score: 1

    I should think as compilers go a C compiler would be fairly easy to implement, aren't there just like 14 reserved words, and aren't several of them obsolete/never used? And weren't c++ "compilers" really cross-compilers that converted c++ to plain old c? Giving us that delightful "name mangling"?
    I wish people would stop dreaming up new languages and concentrate on enhancing existing languages, Java in particular. As a programmer, I'm not going to keep more than 2 or 3 languages handy on the top of my head and I doubt many other programmers are so inclined either. Java at the moment does the most for me, even if it does compute a FFT slower than asm, perl is nice when you don't have a plan and don't want to think too much, and C is the common tounge of *nix. What's in it for me to learn C#, D, Python, etc. that isn't already covered by perl, C or Java? (That's rhetorical, the answer is nothing.)

    --
    AC's cheerfully ignored
  302. Useful? Not Really. by Unknown+Lamer · · Score: 3, Interesting

    From what the draft specs says, D doesn't look like a very good language. It ditches (arguably) useful features like multiple inheritance, templates, and operator overloading; and then it adds features like resizable, bounds checked arrays...in the language. In C++, there is a very nice resizable (optionally bounds checked using vector::at()) that is implemented in the Standard Library.

    What D will implement in the core language is really meant for the standard library. Not everyone needs resizable and bounds checked arrays (the bounds checking is the one with the real overhead). If you are coding a kernel or something low level, the overhead isn't neccesary. If I don't need to resize my arrays, I just don't #include <vector>. Simple as that.

    Also, there are no prototypes. Now, tell me, how does one get the source for a 3rd party proprietary library and read the source for the documentation? Often times, I document my code by putting a 3 or 4 line description of what the class [member|function|data type] does below its declaration in the header. If I forget what a function does, I just open the header in another frame in emacs and read its description (which has such useful information as what it uses its arguments for, what exceptions it may throw, what it returns, and whether or not it will modify an argument). It is also much easier to see what members are in a class when you can look at a simple declaration with the outline of class, instead of having to wade through 50 line members to see the next member. That just makes the class look messy, unless each function was only 1 line long.

    The lack of operator overloading also makes it harder to implement something like, say, a complex number in a library. With C++, you have the standard complex type in the standard library. If there was no operator overloading, using complex would be more difficult (which is easier: complex foo, bar; foo.i = 1; bar.r = 2; foo.add(bar); OR complex foo, bar; foo.i = 1; bar.r = 2; foo += bar;).

    I do see some good qualities. One is the ability to call a constuctor from a constructor. This results in less duplicated code, and makes it easier to keep two constructors of a class synced. Say you had a class with two constuctors: one that takes no arguments (default) and one that takes an int argument. The int argument one can't call the default constructor (this creates a temporary, contructs it, and then deletes the temporary). D allows you to do that. Maybe the next C++ specification will fix that.

    D does seem to have a lot of flaws. It doesn't seem very useful. Maybe some people will find it useful. But it seems to me to be yet another language written for someone's personal usage. It makes sense to that person, but not to anyone else. C is a good language because its creators made it useful for other people as well as themselves, same for C++, lisp, Objective-C, and countless other languages.

    --

    HAL 7000, fewer features than the HAL 9000, but just as homicidal!
    1. Re:Useful? Not Really. by asincero · · Score: 1

      > constuctors: one that takes no arguments
      > (default) and one that takes an int argument.
      > The int argument one can't call the default
      > constructor (this creates a temporary, contructs
      > it, and then deletes the temporary). D allows
      > you to do that. Maybe the next C++ specification
      > will fix that.

      Probably not, because all you have to do is put the common code in a private helper member function and have both of those constructors call it. Make said private helper function inline if you don't want the overhead of a function call.

      - Arcadio

    2. Re:Useful? Not Really. by p3d0 · · Score: 1

      Often times, I document my code by putting a 3 or 4 line description of what the class [member|function|data type] does below its declaration in the header.

      Thank you! I got in some trouble at my last job because I put most of my comments in the header files. The only comments that went into the .c files had to do with implementation details; all usage instructions went into the headers. The other two programmers on this job--one of which was my boss--thought this was laughably ridiculous.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  303. Re:Convince me by Ashran · · Score: 1

    And I can still type a lot faster in JBuilder than it can display the text.
    Even on a 1GHZ Athlon with 400 megs of ram.

    --

    Before you email me, remember: "There is no god!"
  304. You have a point but.... by Da+VinMan · · Score: 1

    I don't think we can reasonably expect every large scale change that Microsoft makes will result in little or no change for developers. And I see this as a good thing in the software design sense. In the software maintainability sense, yeah, it's bad (if not horrible). But at least Microsoft doesn't make us wait forever for these kinds of improvements. To use the original example: I personally have done Winsock code using VB. And it sucked. Big time. So much of the work I did should have been completely unnecessary.

    But the new API? I'll take that with a shake please! I'd gladly dump all of that old code to be replaced with a few lines the new stuff; it's not a one to one translation anymore. VS.NET will help developers function with the OS at a much higher level semantically than was possible before. That increases productivity. Hell, I'll take two!

    --
    Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
  305. Re:Convince me by Anonymous Coward · · Score: 0

    congradulations! you completely missed the point!

    It's unfair to compare a Java UI directly with a native UI.
    No it isn't, that's the discussion. Java is slower than c unless it is compiled specifically for the platform. For anyone arguing the JIT bullshit: Benchmark it using 1000 of the same program executing in parallel. What's that? The native programs kicked the crap out of the java ones? No shit!

  306. Re:weirdness by Anonymous Coward · · Score: 0
    Tut tut. Maybe it's just an omission on his part.

    ???

    yeah, it's not like any code can ever be added after you realease a version or anything...

  307. Re:Single inheritance by Canyon+Rat · · Score: 1

    I think you are making my point with "almost", "generally" and "practical."

    I think interface can be made to work but fairly frequently at a the cost of introducing complexity with inner classes that is worse, in terms of code maintainability, than the problems with MI. I think the problems with MI are daunting in theory but trivial in practice.

    I know about the dreaded diamond inheritance tree, bane of students and compiler writers, but I have never met it in the wild.

    People really just want to use mixins and for that MI is more straightforward than using interface.

    So I categorize languages like this:
    Support for Mixins
    Forwarding -- best
    MI -- good
    Interface -- acceptable
    None -- not acceptable

    It was really the last line that motivated my rejection of D.

    BTW I do think the C++ committee made a mistake. They should have just banned diamond inheritance outright rather than making arcane rules for it. If you see it, it means your design is flawed.

  308. Java speed issues (was Re:Convince me) by AJWM · · Score: 2

    Why, oh, why must people propogate the myth that Java is slow?

    First, I do a lot of coding in Java. Also in C and C++. Right tool for the job and all that.

    But Java -- even compiled Java -- is slower than C/C++ code, it just tends to be more correct and less likely to fail in mysterious or security-threatening ways. There are reasons for this.

    The startup time is one of the obvious "slow" areas of Java -- particularly so to folks just doing a quick "Hello World" to try the language out, rather than for apps that once running keep going for days or weeks at a time. This is because Java defers linking until run time -- and links every class separately. The equivalent in C++ would be for every class to be in its own .so library.

    Contributing to relative run-time slowness is the fact that Java bounds-checks every array access and every memory reference (and may have more indirection on those references depending on the implementation). C/C++ doesn't. Now, a good C/C++ program should do a heck of a lot more such bounds checking than most programs do (we'd have a lot fewer buffer-overflow exploits), but there are cases -- such as in an array initialization loop -- where a C/C++ programmer can get away without checking every access because of the limits imposed by the loop code, whereas Java will bounds check regardless.

    Note that one of the features of the gjc Java compiler is an option to omit a lot of this runtime checking. As this compiler matures (gets better optimization) I'd expect gjc compiled-to-native Java to be just as fast as C++ code.

    Of course, considering the state of today's typical hardware (1.5 GHz CPU, 133 MHz memory, etc), even an interpreted Java program running on that will be faster than a compiled C++ program running on the hardware available at Java's introduction (1995-ish, 100 MHz CPU, 16 MHz memory). If C++ programs were fast enough on that hardware (some were, some weren't), then the equivalent program in Java on today's hardware will also be fast enough -- and likely more quickly developed and less prone to mysterious bugs.

    --
    -- Alastair
  309. Pathetic by chris.bitmead · · Score: 1

    Does anybody else find it pathetic that almost every
    language that comes out is some varient of C? We've
    got C, C++, objective-C, C#, D, Java and a whole
    bunch of others I can't think of at the moment.
    Where's the imagination folks? Things like Sather,
    Scheme, ML and other interesting progressive
    ideas. Very sad.

  310. The Best Of Both Worlds? by Zarjazz · · Score: 1

    Well this guy definetely seems to have the right idea. C is lean and mean, C++ is OO but way to complex. Didn't one of the K&R guys say that in any decent C program 90% of the C syntax could be used, while in a C++ program its only 10%?

    Speaking from personal experience, I find it much easier to write good, clean, portable & efficient code in C. I find that coding in C++ tends to produce worse performance (guess the compilers have more to worry about which effects optimization). Also each C++ compiler tends to implement the C++ language in its own unique way and I spend more time working around those quirks aand the C++ syntax than actually writing useful code! :)

    Just picking the really useful stuff from C++ and improving on the missing features from C would produce a language that I could see myself using all the time. A bit more higher level functionality to C can hardly be a bad thing.

    So when can we expect the Linux Kernel in D then? ;p

    1. Re:The Best Of Both Worlds? by Anonymous Coward · · Score: 0

      Agreed.

  311. Re:Java's fatal flaw by StormyMonday · · Score: 2
    And my pet peeve: No unsigned data types. Java is completely useless as a system programming language without them.

    Java is completely useless as a systems programming language anyway. So is any other language that depends on heap-allocated data structures. (Assumig compiled code. "Systems programming" with a virtual machine is a contradiction in terms.)

    Systems programming depends on having deterministic runtime. "new" and "free" type operations are simply not deterministic. Their execution time depends on what else is going on at the time.

    A bit of definition -- device drivers are "systems programs". Mailer daemons are not "systems programs", they're background applications.

    --
    Welcome to the Turing Tarpit, where everything is possible but nothing interesting is easy.
  312. Java's fatal flaw by Reality+Master+101 · · Score: 2

    And my pet peeve: No unsigned data types. Java is completely useless as a system programming language without them.

    Don't get me wrong -- I like Java-the-language (while detesting Java-the-environment), and it's very useful in specific applications. I should also say that I dislike the "weight" of the C++ language. But there's a lot that Java would need before it could be a replacement for C++, even natively compiled.

    --
    Sometimes it's best to just let stupid people be stupid.
    1. Re:Java's fatal flaw by Reality+Master+101 · · Score: 2

      The following is broken:

      short b = 1;
      long a = b;

      short a = 65000;
      (will give an error)

      short a = 10000;
      a *= 5;
      cout << a;
      (will output a negative number)

      short a = 0x8005;
      a /= 5;
      cout << a;
      (will output a positive number)

      short a = 0x8000;
      short b = 0x4000;
      if (a > b) { cout << "This fails\n"; }

      On and on. Modulo is broken, too.

      --
      Sometimes it's best to just let stupid people be stupid.
    2. Re:Java's fatal flaw by p3d0 · · Score: 2

      It's ironic that the JVM specification uses unsigned numbers everywhere, yet they're not in the language.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  313. Yes: a descent IDE by Morocco+Mole · · Score: 1

    A good IDE like Visual C++ or {dare I say it} Multi will do the sorting for you. You just add files to the project and write code... --Richard

  314. Re:practical experience implementing compilers?? by pmz · · Score: 1

    I agree. For example, if one avoids the temptation of using "*" in Java "import" statments, one can look at the code and immediately see a class' dependencies. All of them. Additionally, well laid out declarations in the methods, etc., can give an immediate idea of what sort of data is present and can give insight into what sort of algorithms to expect.

    Declarations are good. Wildcards in declarations are bad, and no declarations are even worse.

  315. Take a look at Ada95 by RussP · · Score: 1

    I just recently started looking at Ada95, and I am impressed. I don't like the klunky syntax much, but the language is fundamentally sound and powerful. It is widely used in safety-critical systems such as ICBMs, air traffic control systems, and airplanes. Some have claimed that it cuts development time in half compared to C/C++. I don't understand why Ada gets so little attention.

    Incidentally, I proposed on comp.lang.ada that the syntax could be cleaned up, without breaking backwards compatibility, with a relatively simple preprocessor. This would essentially create a new, cleaner dialect of Ada. It got a lot of resistance, but I think it has potential.

    --
    I watch Brit Hume on Fox News
  316. Re:practical experience implementing compilers?? by Anonymous Coward · · Score: 0

    I don't understand what your problem with using import java.util.* or similar is...Only the used classes get loaded. You could potentially cause some name clashes, but only if your programming is relatively sloppy.

  317. History by fm6 · · Score: 2
    It's an interesting proposal, and I look forward to seeing what happens with it. But if we're going to make real progress, we need to get our history straight:
    [Omit] support for 16 bit computers. No consideration is given in D for mixed near/far pointers and all the machinations necessary to generate good 16 bit code. The D language design assumes at least a 32 bit flat memory space.
    Someone like Walter Bright should know better. The weird memory models associated with DOS and Win16 have nothing to do with 16-bit chips. It was just a case of kludgy memory architecture, and Intel's desire to make their 16-bit chips run legacy 8-bit code. Motorola got it right (at least technically) when they abandoned all their 8-bit concepts and went to a flat memory model in their first 16-bit chip, the 68000. I've always seen IBM's choice of the 8086 over the 68000 as one of technology's great lost opportunities.

    Since Bright wants to make the same kind of break with the past, he should be asking himself why segmented architecture (8086, 80286) persisted long after better alternatives were available.

  318. Re:Convince me by Anonymous Coward · · Score: 0


    It's really quite simple.

    JAVA IS SLOOOOOOOOOOOOOOOOWWWWWWWWW

  319. Needs work by horse · · Score: 2, Interesting

    I long for a better C++ but I don't think this is it.

    • Operator overloading is useful beyond the cases mentioned, e.g., for matrices.
    • Stack-allocated objects with destructor semantics are a must for convenient general resource deallocation. Garbage collection is nice but doesn't address deallocating resources other than memory.
    • Some kind of multiple inheritance (even if only of interfaces with delegation) is a must.

    But maybe he will accept feedback and improve his proposal?

  320. Convince me by Anonymous Coward · · Score: 2, Interesting

    It's a very heartwarming idea - he's attempting to conjugate C's performance, speed, and low "levelness" with Java's "oh-my-god-did-I-just-finish-writing-that,-boy-it- only-took-me-3 minutes... but-it-runs-slow" beauty.

    But if it can be done, why hasn't it been done already, hmm?

    1. Re:Convince me by CmdrPinkTaco · · Score: 2, Interesting

      one of my programming languages (go figure) professors has an old LISP machine (the name escapes me right now) from the 80's that he still uses. The architecture was deisgned to use lisp as the native language. It was a pretty slick machine, and from what he says (Im only 24 and wasn't really a hardcore programmer back in my wee laddie days) it was considerably faster than running things in an interpreted manner. The machine had a very limited run since there really wasn't a whole lot of demand for a pure LISP machine, but it is still a neat concept none the less.

      I don't see a pure Java machine as practical since on the web Java is typically used in conjunction with other languages (HTML, XML etc). This would leave such a machine to go the way of the pure LISP machine. It would be a novel concept, especially in academia, but not necessarily practical in the real (read: business) world.

      However, having an embedded JVM that worked at the hardware level and could easily be worked in with current hardware (think math coprocessor on old [3|4]86DX machines) might be something a little more practical. However, since I am a programmer, I could very well be talking out of my ass, so take this post worth a grain of salt.

      cheers

      --
      Please give your mod points to others, Im at the cap. They will appreciate it more
    2. Re:Convince me by rossjudson · · Score: 3, Insightful
      What you've learned is that shitty programming can run slow anywhere. A well-written Java UI can fly. Do yourself a favor and download JBuilder from Borland. That's a nicely written Java UI, and it's pretty much the same speed as a native UI.

      It's unfair to compare a Java UI directly with a native UI. How well does that native UI run on other platforms? Oh yeah, it can't. How well does it run from a web page? It doesn't.

      Properly written Java code can approach the speed of pure C, be done in a tenth the time, and be significantly more maintainable and portable.

    3. Re:Convince me by xtremex · · Score: 1

      I use IBM Java VM (It's on IBM's site somewhere...look under developers)
      I notice it's faster on Linux than Sun's, but it's still slow. We use IBM WebSphere at work (Java Servlet Server), and IT is written in Java...Takes at least 5 minutes to START the damn thing on a dual 64-bit CPU IBM RS/6000 AIX Server.
      It's true, servlets ARE quick as a whip, once they are compiled the first time.

      --
      If you're not a Liberal in your 20's, then you have no heart.If you're still a Liberal in your 30's you have no brain.
    4. Re:Convince me by Axe · · Score: 1
      I've heard about benchmarks showing Java to be slower than C++ (my favourite) by a factor of less than 2, but the litmus test, for me, is to write some stuff and run it, and my experience has been that it is much slower, maybe by a factor of 5 or more.

      Also, it very possible to be your programming technique. Lot of people going to Java feel that they do not need understand what is going behind the scenes anymore and end up writing very inefficient code. A good line-by-line profiler session may be an eye opener.

      Factor of 5 is often the case for floating point intensive code though, and for unoptimized string processing..

      --
      <^>_<(ô ô)>_<^>
    5. Re:Convince me by Paladin128 · · Score: 2

      I don't know if this is still true, but Java's AWT toolkit is implemented with Motif on UNIX platforms. I haven't looked at the Java sources in a long time, so this may or may not be true for Sun's JVM.

      If this is true, even Swing will be slowed down by the beastly Motif; Although Swing is written in pure Java, javax.swing.component inherits java.awt.containter! This means that in addition to being a widget completely rendered with Java code, it's sitting on a blank Motif widget as well! Lots of overhead.

      Again, if this data is inaccurate or out of date, please let me know.

      --Aaron

      --
      Lex orandi, lex credendi.
    6. Re:Convince me by JanneM · · Score: 2, Informative

      I run one Java program today (PCGen). It is really a menu interface to an internal database. My machine is no slouch (600Mzh, 128Mb memory). Lists are _slooow_ to scroll, everything 'hesitates' a moment whenever you do something, and I can sometimes actually see the redrawing. It's like being back on using a graphical shell on my C64... And no, it's not an old Java interpreter either, it's the latest Sun offering for Linux.

      I use that program simply because ther is (to my knowledge) no other option under Linux, but it is a pain to use, when such a (computationally) light program simply shouldn't be.

      Other Java programs I've tried has suffered from the same agonizing effects. I'd need a whole lot of convincing to ever use a Java application if there was _any_ other option.

      Disclaimer: Just my personal experience (but that's the one that counts for me...)

      /Janne

      --
      Trust the Computer. The Computer is your friend.
    7. Re:Convince me by RevAaron · · Score: 2

      ImageJ also uses AWT, not Swing. They are different UI toolkits. Swing is supposed to be nice and fancy, but it's huge, bloated, slow and uses even more memory than your little ImageJ program.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    8. Re:Convince me by andrewscraig · · Score: 0, Troll

      Because it is slow...take a simple Hello World app - java takes 2 seconds just to start up, whereas C starts immediately - winner == C.
      Ok - so the VM overhead accounts for that. So how about GUI apps - hmmm - which would win there? I've yet to see a Java GUI run as fast as C -- therefore the winnder is C again. (Anyone like to come up with a like-for-like example of where a C GUI is slower than the equivelant Java one)?
      Next let's compare File I/O - load a 10 MB file in both....last time I did this the Java app took several seconds, whereas the C version performed

    9. Re:Convince me by Anonymous Coward · · Score: 1, Insightful

      With a smart JIT compiler it's actually possible for it to be _faster_ under some cirumstances as it has runtime information :-) It might seem impossible, but computer performance is so complex to determine that it's possible.

    10. Re:Convince me by JohnA · · Score: 4, Informative

      Read again. Nowhere do I compare the speed of a VM executed program to a native compiled one. Java is not the end all, be all of languages, but it is much more than the applet creation toolkit it was in 1995. Will fourier transforms ever run as fast in a VM as they do in optimized native code? Probably not. But, then again, how many of your programs are doing fourier transforms

      It's simply a right tool for the right job issue. Plain and simple

    11. Re:Convince me by Anonymous Coward · · Score: 0

      Yes, Java rusn faster now. But so does C. Computers have gotten faster. Native compiled machine code will run faster than interpereted. Stop using advances in hardware to hide the weakness in software.

    12. Re:Convince me by Narcissus · · Score: 1
      There's always the option of gcc-java, which provides support for compiling Java to native code.

      I don't think the comparison should be "Java Vs. C++", but "Java in a VM Vs. C++". I know that's where the thread is leading to, but that's not how it started...

    13. Re:Convince me by kurokaze · · Score: 1

      So your contention is that a program
      can run just as fast on a virtual machine
      as one that is compiled natively?

      I'd like to see that please.

    14. Re:Convince me by JohnA · · Score: 2, Insightful

      Why, oh, why must people propogate the myth that Java is slow? While that may have been true in 1995, it is hardly the case today.

      If you're going to make comparisons, at least get your facts straight

    15. Re:Convince me by horse · · Score: 2, Informative

      Java GUI apps _are_ slower, because Swing is basically all written in Java and it can't really take advantage of platform-specific tricks to run faster. The trade-off here is that Swing is very, very portable. For many applications this is a good trade-off, but it's not a 100% solution. I don't think Quake is going to be written in Java real soon. On a 800 mHz machine, you will seldom notice the Swing slowdown in Windows. On Linux it's a little more noticeable. The next JDK has some performance enhancements for running on X, I think.

    16. Re:Convince me by Pengo · · Score: 1


      You are right to a degree. it's hard to compare apples and oranges, and bad code can be written in any language... but let me use a case example.

      We have a medium sized and medium traffic and take 1-2 million hits a day. The system is extremely dynamic and quite heavy.. (we do on the fly translations and skins...). The servers definately work their money.

      We are using IBM's jdk1.3 on all the servers, which seem to be 2-3x faster than the SUN jdk1.3.

      All the app servers are running on Resin.

      Each machine is 2proc 800mhz PIII's w/a gig of ram.

      Now, generally the cluster works great.. but this is the overall trend I am seeing. The server will work fine until 10-11 pages are trying to be rendered at the same time. When this happens each page slows down to a point to where the system seems to get backlogged with requests. it's not too much time until there are 30-40 pages trying to render at the same time. We have a hefty database (running on an SGI Origin class server) and it doesn't seem to really be the bottle neck.. but the CPU's on that machine are at 100% and creeping..

      The strange thing is when we are running in a low concurrency environment the pages are lightning fast...

      Now there are always optimizations that one can do to speed things up.. for us caching was a save all (see http://www.opensymphony.com/ OSCache product... fine grain JSP TagLib caching classes).

      I have had a lot of experience programming in Perl/FastCGI, mod_perl, mod_python and PHP and they seemed to deal with heavy loads a bit better than JAVA, but looks like IBM's jdk is leaps and bounds ahead of Sun's. (In our experience we get the performance of 30 SUN JDK servers on 10 IBM servers).

      We can't even afford to look at running JAVA on a risc system. In our tests , any advantage to running on a risc system is dashed by the overhead and abstraction of the JVM.

      I would love to see how our app would run on a dual processor Athlon 4.

      anyway, $.02

    17. Re:Convince me by SpryGuy · · Score: 1

      No, you missed the point again. The SWING class library is slow. I've done lots of server-side Java work (no UI), and it's pretty damn fast. In fact, one of our java servers was achieving higher through-put rates than the C++ version it was replacing. I was impressed...

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
  321. Re:Forth !!!! by steveha · · Score: 4, Informative
    You could extend FORTH easily to do what you describe. FORTH is very extensible. Here is FORTH code to make the first line work:

    : Variable ; IMMEDIATE
    : to SWAP ;
    : be ; IMMEDIATE
    : setting ! ;

    "Variable" and "be" do nothing and compile to nothing; they are just syntactic sugar. "to" does a SWAP so you can say "x to 10 !" rather than "10 x !". "setting" just does a ! (store) operation.

    Actually, you could make "to" and "setting" IMMEDIATE words; you would just need to make them compile in the words they implement. I'm very rusty on my FORTH, but I think you can do it this way:

    : to COMPILE SWAP ; IMMEDIATE

    Then "to" compiles a reference to SWAP, instead of creating a subroutine that calls SWAP and then returns. The IMMEDIATE version saves one subroutine call and one return.

    This would make a nice short article to publish in Dr. Dobb's or some similar magazine, right around April Fool's Day.

    I have fond memories of an April-Fools article on FORTH, describing how to add GOSUB to FORTH. He went through several versions, before finally arriving at this very efficient solution:

    : GOSUB ; IMMEDIATE

    In other words, GOSUB does nothing and compiles to nothing. FORTH is all subroutine calls anyway; it never really needed GOSUB in the first place.

    steveha

    --
    lf(1): it's like ls(1) but sorts filenames by extension, tersely
  322. Looks cool by StrawberryFrog · · Score: 1

    After 1/2 an hour reading his specs, D looks a bit raw but quite cool. C++ is the foundation, Java is an influenece & I am sure there are others. Object properties work rather like in Delphi or C#, enums remind me of Pascal.

    D will probably be good fun to use when it's ready.

    --

    My Karma: ran over your Dogma
    StrawberryFrog

  323. Pronounce the name right! by Anonymous Coward · · Score: 0

    It's not cee pound for crying out loud! It's See Sharp!!! Get it straight!!

  324. Re:What are his motives? by aozilla · · Score: 1

    You can use garbage-collecting class libraries -- which only work with those classes.

    Or you can use D, which doesn't have any classes yet.

    --
    ok then your [sic] infringing on my copyright! Could you as [sic] me next time before STEALING my comments for your own?
  325. Encore! by JoeShmoe · · Score: 2

    From the dictionary:

    1) "*", ASCII code 42.

    Common names include: star; splat; asterisk; wild card; gear; dingle; mult; spider; aster; times; twinkle; glob; Nathan Hale; multiplication operator; Kleene star.

    Intrigued, I looked up "splat":

    1. A smacking or splashing noise.

    2. Name used in many companies (DEC, IBM, and others) for the asterisk ("*") character.

    3. Name used by some Massachusetts Institute of Technology people for the pound ("#") character.

    3. Name used by some Rochester Institute of Technology people for the feature (alt) key on a Mac.

    4. Name used by some Stanford/ITS people for the extended ASCII circle-x character, or an obsolete name for the semi-mythical Stanford extended ASCII circle-plus character.

    Pretty wacky, huh? I think the first definition must have come from a party college. :)

    - JoeShmoe

    --
    -- I wonder which will go down in history as the bigger failure: the War on Drugs or the War on Filesharing
  326. Re:First Parrot by Anonymous Coward · · Score: 0

    and here i thought ! was the generally accepted 'splat'.

  327. Eiffel by thebatlab · · Score: 1
    I haven't read the specs for this language yet but after reading most of the posts I've got a bit of an idea about it.

    But now that this discussion is down to mainly language vs other language, I was wondering why nobody had mentioned Eiffel.

    In terms of a pure object-oriented language, Eiffel is right up there. It supports polymorphism(while still being strongly typed), multiple inheritance(through a very thorough mechanism which can even allow you to undefine a feature if you don't want to inherit it), all types are objects(even primitive such as INTEGER and REAL), garbage collection(I know it isn't necessarily an object-oriented concept) and the list could go on.

    It also provides operator overloading in the form of infix or prefix feature definitions.

    Now I realize that there are other languages that support feature A or feature B that I listed but what other ones support all of them?

  328. Re:practical experience implementing compilers?? by gurgel · · Score: 1
    He's talking about making the compiler do all the work - for instance, there are no headers, as declarations are lifted from the source. For that matter, modules and libararies and source are treated the same. I think that he *might* be talking about features that would require a new object format, and thus a new linker.
    I don't know what he is thinking about (nor what you are thinking about), but I don't think a new linker is needed. Fortran (NO, I'm not talking about FORTRAN 77) has these same features, and most Fortran compilers (all that I have used) uses the standard linkers.
  329. Re:Sounds like... by angel'o'sphere · · Score: 1

    No,

    Walter Bright worked long for Symantec and the former Zortech Compiler was then known as Symantec C++.

    I worked with the 6.x and 7.X versions.

    Walters C++ compilers where the only ones ever implementing templates right.

    I found about 100 compiler bugs in Borland and Microsofts compilers by porting my code from Symantec C++ back to Micosoft C++ and gave up check compiling with Borland. (Most bugs where in MS, I only discontiued using Borland because it got to time consuming and I had to clutter to many vendor specific #ifdefs into the code)

    Some yielded Syntax Errors and a lot yielded simply bad object code (found out in nights of debugging).

    IMHO, Symantec C++ was the FASTEST compiler and the one creating fastest code (in benchmarks Borland often yielded faster code but my real world application, a geodesic CAD System, was faster with Symantec)

    Microsoft compiled the same code in about 4 times the time (over 2 hours on an 66MHz 486).

    Od is: on my actual Pentium Visual C++ 5.0 still needs 45 minutes while Symantec C++ 7.2 needs some 15 minutes.

    Basicly I went over to Java because of fiddeling with so many C++ compilers which costed me so much time, I went mad over it ....

    Templates I miss but if you search on java.sun.com you find under jsr14 the asctual Java implementation with templates.

    It is sceduled for JAVA 1.5 AFAIK.

    Regards,
    angel'o'sphere

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  330. Agree! by Anonymous Coward · · Score: 0

    One thing i want to add: multiple inheritance.

  331. Java is not the do-all and end-all by Anonymous Coward · · Score: 0
  332. Re:What are his motives? by scrytch · · Score: 2

    > Garbage collection has already been implemented into C++

    If it ain't in the spec, it ain't in C++. You can use garbage-collecting class libraries -- which only work with those classes. You can use a conservative gc, which usually makes running finalizers a rather laborious process. And none of them have a standard library API or predictable behavior. Just because you can grovel the stack looking for pointers, that doesn't make the runtime garbage collected. Just because you can glue gc on does not make C++ garbage collected. Take Ada95 on the other hand, which does have standard garbage collection that you can turn off when you don't want it.

    --
    I've finally had it: until slashdot gets article moderation, I am not coming back.
  333. Re:First Parrot by guuyuk · · Score: 1
    Actually, instead of reading the name of C# as "C-Sharp" or "C-Pound", try: "C-plus-plus-plus-plus".

    Hey, it's twice as many pluses as C++, so it has to be good! :-)

    --
    We're sorry, the phone number you have reached is imaginary. Please rotate your phone 90 degrees and try your call again
  334. templates and operator overloading are good things by sanermind · · Score: 5, Interesting

    It seems this guy really dosen't like c++. Now, being that he is a compiler implementor, I can certainly understand that! *grin*

    Templates and stack instantiation of of objects with semantics [i.e. constructors/destructors] is a royal pain in the a** for compiler writers. In fact, only somewhat more recently is g++ even able to handle templates in a decent way; it took a long time to get it right. C++ was a very ambitious language, hard as hell to implement, but that's what makes it so usefull. Give up templates and multiple inheirantance? He suggests this is a good thing?! D is clearly not a language innovation, he should have called it C--.

    Besides, you don't actually have to use such features extensively [or at all, really] in a C++ program. You could always avoid iostream and just #include old stdio.h, for example, only choosing to use classes with constructors for some usefull/neccessariy/labor-saving part of the code, while all the rest of it is essentially no different then C [aside from stricter compile-time type checking, which ANSI C has been moving towards anyway, lately]

    This is no innovation.

    A few other random points:
    Ohh! Garbage collection, you can link to a garbage collecting malloc in a C++ program anyway. [If you really care to look into it, C++ allows a whole range of complex underlying storage classes for custom memory management of different parts of a project.]

    Arrays are not first class objects?!
    Well, this is true, sort of. But you can choose to use vectors, [or other more efficient representations [such as maps, etc] depending on your data type, and with inlining, they will be as efficient as if they were 'native language syntax' features. You don't even have to use the STL, you can write a custom implementation of dynamicly resizable vectors of your own [with automatic bounds checking and resizing, for example] quite trivially. I did it once, and it took, what, 2 pages of source. That's the power of C++, it's so expressive for implementing custom manipulations of low level data, packaged nicely into classes.
    No on stack variables? All data as dynamic references?
    Yech. Generally too inefficient. I still suspect that he just dosen't want to tackle the hairness of writing such a complex compiler. Remember, you can use only dynamic memory in C++ easily enough, with garbage collection too.

    Overall, I think D is too lenient. I give him an F.

    Still, I strongly respect the desire to attempt to implement a novel language. Not that there aren't hundreds out there, but it's a noble effort. Still, publishing without even demo code? Yeesh.

    --

    ---
    the pen is mightier than the sword, the sword is mightier than the court, the court is mightier than the pen.
  335. Maybe not... but... by squaretorus · · Score: 1

    I can't help thinking that too many languages spoils the broth. Focus should be on ease and speed of development, error handling, development tools that enable the 'simple' problems to be auto detected as far as possible, that assist in testing loops, that FORCE you to document, and produce readable documentation on the fly. Get all that working WELL and I'll write in bloody VB if I have to.
    Fundamentalism is for church or TV shows - lets just all agree to compromise - stick to C++ and develop better TOOLS for C++. Yeah it sucks in areas, yeah we all have things we hate about it - but NO we aren't going to be rid of it any time soon - so lets make life with C++ easier.

  336. this isn't progress by mj6798 · · Score: 1, Insightful

    D looks like a stripped down version of C++, limited to the features that an application programmer who grew up in the Windows environment might find useful. But we already have simplified, limited, easy-to-use languages: Java and C#. C++ is a complex language, and it isn't a particularly well designed language, but the complex features that it has are useful and powerful. Language design should go more in the direction of figuring out how to simplify providing those features, not in stripping C++ down to something from the 1960s again. Two thumbs down.

  337. Programmers man your stations! by slasho81 · · Score: 2, Funny

    The montly programming language holy war is about to begin!

  338. Re:ASM ROCKS !!! :) by Anonymous Coward · · Score: 0

    That's why I program in Java ASM, portable ASM.. Eat that!

  339. Re:No templates? by MarkCC · · Score: 1

    A universal object type is *not* a substitute for a proper parametric type system. (Not that templates are a proper parametric type system - template are, pretty much, the most bone-headed, brain-dead way that I've ever seen of implementing parametrics.)

    To give a real-world example... I'm working on a software configuration management system, implemented in Java. (webpage). In our system, switching from Java to GJ (java with parametric types) literally took about 25% off the size of the code, made it easier to read, and eliminated several bugs.

    What bothered me most about this guys proposal is that he doesn't seem to have a clue about much of anything outside of the C/C++/Java language family. His argument for leaving out templates is correct, but he follows it with "I'm looking for a solution". Wake up pal, the solution is out there, and it's been there for over twenty years. It's just not in any of the C++ family languages.

  340. Interesting idea, but... by Richard+Bannister · · Score: 1

    I've read the D spec and I like a lot of it. It certainly would not be difficult for a C programmer to start developing in D as specified.

    However, I have to wonder about the string concatenation code. Specifically, I've noticed that it does the same thing as java - namely a + b = c for strings. In Java, this is mindblowingly inefficient - a StringBuffer does the job with far less memory wasteage and so on - BUT, as the + operator is easier to use, it tends to be the chosen solution. I wonder if these string concatenations are efficient...

    --
    http://www.themeparks.ie
  341. idjit by Anonymous Coward · · Score: 0

    it is pronounced 'see-sharp'

  342. Re:First Parrot by IpalindromeI · · Score: 1

    I think you missed the subtley that your parent post was going for. Try reading it again, keeping in mind who produced it.

    --

    --
    Promoting critical thinking since 1994.
  343. Re:There alreaby is a [CENSORED] language by seizer · · Score: 1

    Boes someboby alreaby have copyright on the letter [CENSORED]? Bamn. Coulb make it bifficult....

    ;-) use yer brains, matey

  344. Re:practical experience implementing compilers?? by steveo777 · · Score: 1
    I don't know about you, but I think it would be a great idea to code straight assembler. Macros replaces most of the general functionality of the compiler. You get a lot better choice of what you want to do, and most of the good algorythms are accessable.

    Being partial to the dirtiest part of programming (that isn't just bits or hex...), the more control, the better!

    --
    This sig isn't original enough, it's time to come up with something witty...
  345. Re:The only thing new is the name by JabberWokky · · Score: 2
    It's a nice name. I like "D" as a name better than C#.

    Yes, but it just occured to me that "dc" is already taken:

    dc (1) - an arbitrary precision calculator

    --
    Evan

    --
    "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
  346. Here's what D can't do... by d3l3t3_m3 · · Score: 1, Redundant
    from the original text

    There is no:
    • C source code compatibility. Extensions to C that maintain source compatiblity have already been done (C++ and ObjectiveC). Further work in this area is hampered by so much legacy code it is unlikely that significant improvements can be made.
    • Link compatibility with C++. The C++ object model is just too complicated - properly supporting it would essentially imply making D a full C++ compiler too.
    • Multiple inheritance. It's a complex feature of dubious value. It's very difficult to implement in an efficient manner, and compilers are prone to many bugs in implementing it.
    • Templates. Templates are a way to implement generic programming. Other ways are using macros, or having a variant data type. Using macros is out. Variants are straightforward, but the loss of type checking is a problem. The difficulties with C++ templates are their complexity, they don't fit well into the syntax of the language, all the various rules for conversions and overloading fitted on top of it, etc. What's needed is a smoother way to integrate them into the language, so they have a much more natural and obvious feel to them. I am searching for this solution.
    • Namespaces. An attempt to deal with the problems resulting from linking together independently developed pieces of code that have conflicting names. The idea of modules is simpler and works much better.
    • Include files. A major cause of slow compiles as each compilation unit must reparse enormous quantities of header files. Include files should be done as importing a symbol table. Creating object instances on the stack. In D, all objects are by reference. This eliminates the need for copy constructors, assignment operators, complex destructor semantics, and interactions with exception handling stack unwinding. Trigraphs and digraphs. Unicode is the modern solution to international character sets. Preprocessor. Modern languages should not be text processing, they should be symbolic processing.
    • Operator overloading. The main applications for operator overloading seem to be implementing a complex floating point type, a string class, and smart pointers. D provides the first two natively, smart pointers are irrelevant in a garbage collected language. When using operator overloading for non-trivial purposes with multiple non-trivial classes, the interaction complexity of the overloading coupled with user-defined conversions, overloading in general, leads the person maintaining the code wondering whether it was all worth it.
    • Object oriented gradualism. Class instances in D are object oriented, the other data types are not.
    • Bit fields of arbitrary size. Bit fields are a complex, inefficient feature rarely used. Support for 16 bit computers. No consideration is given in D for mixed near/far pointers and all the machinations necessary to generate good 16 bit code. The D language design assumes at least a 32 bit flat memory space. D will fit smoothly into 64 bit architectures.
    After using C++ how can someone want to use this???
    1. Re:Here's what D can't do... by Doug+Merritt · · Score: 2
      He's incorrect in saying that include files are a major cause of slow compiles. Actually, well-implemented preprocessors (like the ancient Reiser one out of Bell Labs) are blindingly fast. The idea of precompiled headers became popular in environments with (a) slow media like floppies and (b) with poorly written preprocessors.

      In addition to studying the Reiser source code, which was very clever in a bunch of different ways, I also once timed it as actually being *faster* than "cat file1 file2 file3 > junk". Admittedly this was under Xenix on a 286 with a badly implemented stdio package, but still...

      As for operator overloading, it's pretty monstrous, however it's indispensible for new numeric types. A lot of programmers don't ever seem to need new numeric types, but it depends on your work. I've created easily a dozen unusual numeric types over the years (e.g. floating point with a floating point exponent). Don't assume that you can ever provide 100% of all numeric types that anyone will ever need; can't be done. Therefore, support overloading for numeric types only, somehow; *that* would fix the C++ problem without crippling the language.

      Other data types are not object oriented? It's already a major pain in C++ that e.g. int and char* etc aren't classes. Make everything a class.

      Delete bit fields? Give me a break. Promote them to first class, and then they'd really be useful. A large part of the reason they're not used heavily is that they not fleshed out in the language.

      (I realize I'm simply replying to someone who quoted the D author, but it was a handy springboard.)

      --
      Professional Wild-Eyed Visionary
  347. Re:D already exists.. by Gill+Bates · · Score: 1

    I've had the (mis-)fortune of working with 'D' scripts on a project some years ago. The product is (was?) TeleUSE. I don't recall the company name.

  348. ASM ROCKS !!! :) by syntax3rror · · Score: 1

    goddam ! what's your problem with assembler ?
    it simply rocks !
    Maybe Joe Coder prefers using his good old VB6 but i can do much more than what he does (and pretty fast) using TASM or MASM and a resource editor (to create user interface..)
    And it can be PRETTY fast too !!!

    Linux asm can be really interesting too !
    Regards.

  349. Not exactly on topic... by JEmLAC · · Score: 1

    but if you like Foxtrot, take a look at this

    Salut!

  350. Re:First Parrot by Anonymous Coward · · Score: 0

    See sharp. See sharp code. See sharp compile. See sharp run. Oh! Access Violation.

  351. Sounds awfully lot like Object Pascal by marcovje · · Score: 1


    - Decent typing
    - C++ features minus full multiple inheritance/templates
    - No more includefile system (Delphi/FPC import symbol tree like structures from .DCU)
    - Good numeric support. (like Pascal)

  352. Re:No templates? by Anonymous Coward · · Score: 0

    The only reason for templates is to make up for the fact that C++ is strongly typed. With a weakly typed language like Smalltalk, there's no need for templates.

  353. Languages comparison by slasho81 · · Score: 2, Interesting

    D == (C++)++

    Because:

    you take all the backward compatibility junk out.

    but retain the old libs and development model.

    D == (Java)--

    Because:

    Java also removed all the compatibility junk.

    Java, like D, also added GC as a major development booster.

    Java added advanced programming paradigms, extensive standard API and bytecode, and D didn't.

    D == C#

    Because:

    D is Yet Another C++ Successor.

    it was developed by another i-want-a-better-c++ that didn't like Java.

    it didn't introduce any innovations over existing languages

    Besides, the name "D" is completely unoriginal (just like language concept itself). Dozens of next-worldwide-languages-wannabes had that name.

    -Omer

    1. Re:Languages comparison by Anonymous Coward · · Score: 0

      Please look at the GNU Compiler Collection...find the Java to native code compiler. You have your wish.

  354. Oh dear, I'm getting old... by Anonymous+Brave+Guy · · Score: 2

    Must'a clicked Submit twice or something, but I just got this back from /.

    Easy does it!
    This comment has been submitted already, 277218 hours , 37 minutes ago. No need to try again.

    Oops... :-)

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  355. Re:Overloading? by Vic+Metcalfe · · Score: 2, Informative

    Not to mention the whole c++ i/o system with cout and cin, etc.

    I couldn't help but chuckle when I saw the example code using printf.

    Also I don't think c++ should be put down for lack of a high level string type or safe associative arrays. One needs only look so far as the Standard Template Library for these things.

    This seems to almost parallel UNIX/Windows. UNIX consists of lots of little tools, and each does its job well. Users can choose the best tool for the job. Windows includes all-in-one, where every application has every feature the way the developer wanted, and the user doesn't have to worry about knowing how to make the pieces work together. C++ lets the user (of the language) decide which string class to use, and whether or not to include garbage collection. D appears to provide these as decided by the developer (of the language), removing the burden from the user, and aiding in consistancy across different projects.

    I'm not saying one way is better than the other, but I like UNIX and c++ myself. Most people like Windows, maybe they'll like D too.

  356. Single inheritance by Canyon+Rat · · Score: 1

    I'm not interested in a statically bound language without multiple inheritance. Experience shows that it just leads to abortions like MFC. Every language needs either MI like C++ or forwarding like ObjC.

    1. Re:Single inheritance by General888 · · Score: 1
      So you feel that design by interface isn't practical? Millions of Java programmers would like to disagree with you. You almost never need MI if you have interfaces.
      Ah, you said it yourself.. ALMOST never. From experience with C++ and Java I can say I very very rarely need multiple inheritance, and interface do the job. But my god, when I do need the multiple inheritance I'm really cursing at Java and blessing C++. I'm all for multiple inheritance. I frankly don't understand why people oppose them. They don't lead into messy interfaces, experience with C++ has already shown it.
  357. There already is a D language by Anonymous Coward · · Score: 1, Informative

    Everyone : When I was doing desktop database programming back in the mid 80's, there was already a language named "D". It was sort of DBase clone that ran on the PC, VAX, UNIX, etc. Hope Mr. Bright doesn't have any copyright problems with his choice of name.

  358. Sounds like... by dmorin · · Score: 5, Interesting
    ...just a case of a guy who knows what he doesn't like about C/C++, and has the capability to do something about it, doing it. More power to him. Hey, if it generates traditional binary executable code so the end result is independent of the D language, and it really does have the advantages he says, then what does he have to prove to anybody? Create his own little company doing D development, crank out better product faster than anybody else, and take over the world. It could happen. If he's managed to create the language that he would prefer to work in, go for it. His only problem would be getting programmers. But it's not like D would be the first proprietary language out there.

    If, on the other hand, all he wants to do is sell compilers, and therefore he needs to convince the rest of the world of the language's benefit, then fooey.

    And for the record, damn, I feel old -- I remember trying to make the Zortech compiler work for an old project of mine circa maybe 1989 or so(?) and having problems. I think at one point or another I might have actually gotten email from Walter. Wow, names from the past. In a conference call yesterday I needed to come up with a secure hashing algorithm and I said "ROT13. If we need extra security we can do it twice." and absolutely no one got it.

    Anyway, back on topic: No templates? Oooooo, I have a C++ friend who is gonna be pissed....

    duane

    "In C++, you can look at your friend's privates."

    1. Re:Sounds like... by Karmageddon · · Score: 1
      nope, that was Wizard C that Borland took over.

      Zortech bought theirs too, but I don't recall what it was before.

      Microsoft bought Lattice C as their first.

      eventually, all of them rewrote them, but that's probably more having to do with the siren-song of the second-system fallacy (phallusy? ;-)

  359. Nothing special... by frleong · · Score: 3, Informative
    • Dynamic arrays - Some juicy stuff that frees the programmer from using malloc, realloc. Copied from Java or Ada or _________________ ( fill in the blank, strip out unused characters)
    • Fixing some inconsistency issues of C's syntax - some purification to make it prettier - like switch/case accepting strings, using something.size, instead of sizeof(). Nothing by itself is absolutely necessary. Syntactic sugar.
    • Unicode character support - Interesting, but usually people just got used not to embed Unicode strings in the source code. Besides, they simply renamed wchar_t to unicode just to make sure that D supports Unicode.
    --
    ¦ ©® ±
  360. Re:Forth !!!! by JanneM · · Score: 2, Interesting

    Well, I like Forth - I used it for years. It has _many_ good qualities; readability is unfortunately not one of them. You can write readable Forth, but you have to really work at it, and it's still a pain to understand something you wrote months previously. Understanding someone elses code is even worse (especially once people start doing nifty things to the return stack :-P)

    /Janne

    --
    Trust the Computer. The Computer is your friend.
  361. Great feature, but. . . by alnapp · · Score: 2, Insightful

    I like the fact that you can embedd code in html and still compile it

    Apparently this means "The code and the documentation for it can be maintained simultaneously, with no duplication of effort"

    Unfortunately until its "the documentation is automatically created and maintened with no effort" it still won't prevent the junk I'm often buried in

  362. I would rather eat my E pills. by GunnarR · · Score: 1


    The E programming language :

    http://citeseer.nj.nec.com/richardson89design.ht ml

    And another for the Amiga :
    http://wouter.fov120.com/e/index.html

    Think I'll rather stick to Java as that provides me with a robust framework for creating scalable
    server side applications.

    1. Re:I would rather eat my E pills. by Per+Wigren · · Score: 1

      Amiga-E rocked hard! I loved that language!! It is by far the nicest language I've ever coded in! And I've tried most of them... :) For example Photogenics is (was) written 100% in E with some inline assembly... It was (is?) a fully compiled language as fast as C and the compiler could compile 100000 lines of code in just about 3-5 seconds (!!!) on a 14Mhz M68020 processor !! I think that is because all include-files were pre-compiled.. I'd love to see an implementation of AmigaE in the GNU Compiler Collection! :-)

      --
      My other account has a 3-digit UID.
  363. Floating Point by Root+Down · · Score: 1

    He discusses at length the 80 digit precision of Intel x86 architecture and how he intends to speed this up. Last I checked, the S-Float floating point representation used by most PCs is still only valid (accurate) to the 6th decimal place, and other floating types are not much better, if at all. Perhaps I am confused, and if so, please illuminate.

  364. Re:practical experience implementing compilers?? by grey1 · · Score: 2, Interesting

    He's making a more important point, and it's not the wrong way around - he says the specs for C or C++, for example, are so big that the compilers that implement those specs will contain bugs. And the programmers will have problems writing code that's bug free and uses the best features of the language. If he can find the right set of features to include in "D" then it'll be easier to learn, easier to write code in, and very importantly, easier to produce compilers for.

    --
    "we demand rigidly defined areas of doubt and uncertainty!"
  365. Garbage collection and all that by Animats · · Score: 2
    Bright is proposing to put garbage collection in "D". This has good and bad points.

    With manual allocation or reference counts, you can have destructors that are called at some well-defined time. With garbage collection, you have Java-like finalizers that are called at some random time, maybe even from a separate thread. So, while you can use destructors to release various resources such as files and windows, finalizers can only be used to release memory.

    Finalizers thus have very different semantics from destructors. And finalizers don't fit well with C++, although Microsoft, with their new "Managed Objects" system, is trying. ("Managed Objects for C++" have very wierd semantics, involving "resurrection" and multiple finalization. That's an indication of where finalization in C++ leads.)

    Still, there's a growing consensus that memory management has to be automated. C and C++ program designs obsess on memory allocation, and usually get it wrong. Almost every new language announced in the last ten years has automated memory management. So there's a clear trend.

    My own proposal in this area is Strict mode for C++. The idea is to retrofit C++ with safe reference-counted objects, and offer a mode that limits you to the safe subset. (The model here is "strict mode" in Perl.)

  366. Re:First Parrot [OT] by andrewscraig · · Score: 2, Funny

    and given that hash is another name for cannabis - it can be interpreted as C on drugs :-)

  367. Re:practical experience implementing compilers?? by the_ph0x` · · Score: 1

    At this stage, languages are meant to make thing easier for the programmer.

    Keep up _this_ thinking and we'll all be de-spaghettifying _your_ code.

    Languages are already way too easy and bloated - I think it's time for more hardcore languages to come out. All these /easy/ languages are letting in too many Joe Schmoes, ya know the type. Mr. Hey-I-took-a-class-once comes in and look hes got your job now. I for one am tired of people that just haven't the ability to write or think outside of the box and I'm also tired of floating on a fluffy cloud of tangled pasta code. I want streamlined, fast-as-hell code and people that can write it.

    .ph0x

    --

    ---
    ps -aux | grep mind
  368. No templates? by Anonymous Coward · · Score: 2, Informative

    I opened up the link, read as far as the section on "things to leave out", saw "templates", and closed the link. Now, this might seem a bit hasty, but hear me out. Templates are the single greatest feature of C++, and the reason that I like the language at all. Yes, they are complicated to implement, and compilers initially failed on them, but they've gotten a lot better now. Yes, they can be tricky to use, and you can get trapped with them. But for writing libraries, there's just nothing like templates. As a matter of fact, lack of templates is probably the one thing that annoys me most about Java (excessive verbosity being the other). There are people trying to fix this, with Generic Java. (Didn't want to unfairly malign an area of Java that is obviously being worked on.) Anyway, this comment has gotten rather far afield of D, so I'll just say what you all know to be true: there are hundreds of C or C++ like languages out there. Few of them attain widespread use for a simple reason: lack of backing from large entities, be they commercial or open-source supporting (or both!). D will likely be the same.

  369. Finally blocks by Anonymous Coward · · Score: 0
    Java needs "finally", but it isn't inherently a good thing. C++ doesn't strictly speaking need it because it provides the same functionality through destructors.

    Consider:

    void f()
    {

    OpenResource();
    DoSomething();
    CloseResource();
    }

    If DoSomething throws an exception, CloseResource won't be called and we'll have a leak. From what I understand of Java, you'd solve this problem with a finally block. C++ doesn't have finally. However, in C++ you can have objects on the stack, so you can do:

    class Resource
    {
    public:

    Resource() { OpenResource(); }
    ~Resource() { CloseResource(); }
    };
    void f()
    {
    Resource resourceobj;
    DoSomething();
    }

    Now the resource is opened when the object is constructed, and closed when it is destructed (whether this happens because an exception is thrown or because the function returns normally). So the problem is solved. You could argue that this kind of scheme is over-complicated compared to a "finally" block, but it gives you the good habit of encapsulating resources into objects, and makes it impossible to forget to close the resource. Also, using templates, you don't have to go to the trouble of writing a whole new class declaration every time, so it isn't as painful as it looks.

  370. Define "Systems programming" by Eric+Green · · Score: 2
    Granted, you aren't going to write an OS kernel in Java or any other language that depends upon heap-allocated data structures. But there's no reason why you could not write, say, inetd, cron, tar, or any number of other programs in something like Perl that depends upon heap-allocated data structures. (What? You mean someone is actually doing that?!)

    --
    Send mail here if you want to reach me.
  371. Re:Forget O'Caml by LQ · · Score: 0

    Academics love OCaml because it's closer to a mathematical expression of functionality. But for big programming, forget it. Obscure syntax and wildly unhelpful compilers will make your life a misery until you give up and adopt a real language. Any real language. Anything but FP.

  372. Interesting ... by benspionage · · Score: 1
    I must admit, the specifications sounded impressive, interestingly the D language uses garbage collection and has exception handling. From the article:

    D memory allocation is fully garbage collected. Empirical experience suggests that a lot of the complicated features of C++ are necessary in order to manage memory deallocation. With garbage collection, the language gets much simpler.

    and ...

    The superior try-catch-finally model is used rather than just try-catch. There's no need to create dummy objects just to have the destructor implement the finally semantics.

    No VM though, so languages Java, Smalltalk et al would still have portability advantages I'd imagine.

  373. Re:First Parrot by doob · · Score: 1

    ahem... here, here, and here say different.
    Or just look here.

    --
    In the spoon, there is no Soviet Russia!
  374. Re:practical experience implementing compilers?? by alanwj · · Score: 1

    I write this at the risk of "posting 'me too', like some brain-dead AOLer", but I must say I couldn't agree more.

    People who can write "streamlined, fast-as-hell code" are a dying breed. I'm not saying that the new solve-any-problem-in-under-45-seconds languages don't have their place. There are certainly lots of situations where getting the program done fast is a lot more important than making the program run fast, but colleges are teaching students these languages as a substitute for low level programming, and that is just sad.

    There are certainly plenty of situations where I need to have a pretty tight reign over what the processor is doing. In those situations, I don't WANT a language with garbage collection. I don't WANT a language that stores bound information with my arrays (and certainly not one that checks those bounds every time I access an element). What I want is a language that puts me just a few levels of abstraction away from the machine for the general purpose code, and lets me snuggle right up next to the hardware when I need to. Nearly everything I want is embodied in C (and to a lesser extent, C++).

    That being said, I'm certainly open to many of his ideas. Importing symbol tables rather than making header files, for example, sounds to me as if it could be a significant improvement to my favorite language. I also like the strong type checking on the typedef'ed types.

    Anyhow.. D, Java, C#, Visual Basic, they have their place, that place just isn't anywhere near the type of programming I do.

    Alan

  375. The only thing new is the name by seldolivaw · · Score: 4, Insightful

    It's a nice name. I like "D" as a name better than C#. But that's all. From the description of the language, it's just Java without bytecodes -- but with "the option" of bytecodes. The major things it does is throw away legacy C compatibility -- making for faster compilers that are easier to write, but not a whole lot of gain for the programmer. However, maybe it would be good to have C++ updated and throw away unnecessary features, and more structured ways of defining things (like the try-catch-finally structure instead of try-catch, which I like the idea of).

  376. D already exists.. by gatkinso · · Score: 4, Informative

    It is a scripting language for a X Window based RAD tool called Telesys(? - maybe that was the name of the company that made the software).

    --
    I am very small, utmostly microscopic.
  377. What are his motives? by deppe · · Score: 2, Insightful

    Go ahead and flame me, but I really think this is silly.

    I think this is the work from someone who has worked so long with C and C++ that he thinks Java is useless, and now he's going about trying to write a language that looks so much like Java that it's just ridiculous.

    Plus, Java can be compiled without a VM with GJC.

    Besides, it's going to be a really hard time implementing a full suite of standard libraries for this kind of language when the C APIs are available because legacy D code will probably have just the same problems as older C++ code has (i.e. not using the std::string etc.).

    But hey, if he can pull it off and it works out then why not. But I can't see large organizations adopting this anytime soon.

    1. Re:What are his motives? by CaptIronfist · · Score: 0
      But hey, if he can pull it off and it works out then why not. But I can't see large organizations adopting this anytime soon.

      mmm

      This is probably what everybody said about C++ when they were using C. I'm not flaming, i'm arguing...

  378. sizeof by Anonymous Coward · · Score: 0

    I don't see how sizeof (and it's sizeof, not sizeof(); sizeof is an operator, not a function or macro) is inconsistent or unpretty. Personally I think "sizeof foo" is prettier than "foo.size", and more consistent since I would expect "foo.size" to refer to a member. I can see the switch() thing, though.

  379. Re:First Parrot by jumpinin · · Score: 1

    How is C# pronounced? As a musician I've always thought it was "See Sharp"

    --
    Verbing wierds language --Calvin
  380. Overloading? by luckykaa · · Score: 1
    According to the overview, there are "only three significant uses for operator overloading", and since these are all supported internally, there is no need to support it.

    Is this wise? I can think of many uses - Vector arithmetic, area intersections and combinations, list concatenation. All of these can be achieved without operators, but matematical syntax is considerably faster.

  381. A C/Java programmer's take by Sir+Runcible+Spoon · · Score: 1
    This looks like a cleaned up C++ with some features from Java (garbage collection, unicode strings).

    I see the synchronize keyword but not see an explaination of threading. Getting the syntax for threading sorted out has been a big plus for Java.

    One of the big benefits of Java over C, is the reliable presence of a standard library that includes so much useful stuff (Hashtable, BigDecimal, etc.). Where does D stand in this respect?

    I like the garbage collection in Java. A lot of the time this is fine, but sometimes it would be useful to be able to explicitly delete objects just as the D spec suggests. However, I would also like an optional method to be called when the reference count hits zero, so I can close files or shut down servers etc.. I see D has destructors, but like the finalize method on Java objects it becomes next to useless as there is no guarantee that it will be called any time soon (if at all). When building publish and subscribe objects it would be useful to have access to the reference count, or even have an optional method that is called when it changes.

    I have yet to use a language that supports delegation without the programmer putting a load of stubs into the delegating class. D, it seems, will be no exception.

    I wish Walter luck. It's a great idea. Java is still pretty slow and C++ is still pretty ugly, but he has got a lot to catch up.

  382. Casting pointers to integers by p3d0 · · Score: 2
    Seems like this guy has a real problem with casting pointers to integers and vice versa.

    In the types section, he states:

    Casting pointers to non-pointers and vice versa is not allowed in D. This is to prevent casual manipulation of pointers as integers, as these kinds of practices can play havoc with the garbage collector and in porting code from one machine to another. If it is really, absolutely, positively necessary to do this, use a union, and even then, be very careful that the garbage collector won't get botched by this.
    Ok, fine, I guess I could live with that. But later, in the declarations section, he states:
    Note: perhaps we should do away with unions entirely, or at least unions that contain pointers.
    Now, I'm not sure what this guy's background is, but it looks like he may have forgotton about system-level programming. For instance, I'd like to see him write an efficient JVM without the ability to interchange pointers and integers. Besides, if the garbage collector is conservative, it doesn't matter much whether the program thinks a pointer is an integer, since the GC will have to assume it's a pointer anyway. (Of course, this rules out compacting collection, which seems to be a goal of his.)

    Why use a C-type language if not to get bit-level control over the machine? For any other purpose, there are better languages out there. I'm afraid that if a descendant of C loses C's bit-twiddling ability, it won't be very useful.

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  383. Re:practical experience implementing compilers?? by JabberWokky · · Score: 5, Insightful
    At this stage, languages are meant to make thing easier for the programmer.

    He's talking about making the compiler do all the work - for instance, there are no headers, as declarations are lifted from the source. For that matter, modules and libararies and source are treated the same. I think that he *might* be talking about features that would require a new object format, and thus a new linker.

    I really don't like his ".html" file idea: code inside a html file is compiled by ignoring everything but tagged bits. The concept is to use html to document and compile the code right in the documentation. Personally, I prefer to generate documentation from the code. A language that implements context sensitive comments that can be compiled into various types of documentation would be, IMHO, a very good thing. As it is, systems like doxygen seem to work okay, but if it were built into the language, you could even dump documentation out of modules on the fly. Nifty in an IDE environment, or makefile driven dev when you want to check that version 2.2 of openfoo() does the same thing that 2.1 openfoo() did.

    --
    Evan

    --
    "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
  384. oh Lord, please help by Anonymous Coward · · Score: 0

    those compulsively thinking and programming Gurus from themselves and us from their creations.

  385. Re:First Parrot by Dashslot · · Score: 2, Funny

    You're both wrong. Cee Hash, pronounced Cash.

  386. Re:First Parrot by Anonymous Coward · · Score: 0

    Don't confuse me now - isn't C# read cee sharp. Not my area, but that's what I thought leastwise...

    Mike
  387. Re:First Parrot by Anonymous Coward · · Score: 0

    I'm pretty sure its pronounced "C Sharp" not "Cee Pound"

  388. Re:First Parrot [OT] by seizer · · Score: 1

    In the UK, we call # "hash".

    And bizarrely, the phone company (BT) calls it "square"

    Sea Square or Sea Hash. The UK's gonna LOVE MS.

  389. Re:First Parrot by doob · · Score: 1

    Actually, I think you'll find it's "Cee sharp" (as in opposite of flat)

    --
    In the spoon, there is no Soviet Russia!
  390. weirdness by seizer · · Score: 3, Interesting

    I love the way there's a reserved word "imaginary" heh...

    He doesn't have any post-code gen optimization? I know you can perform elementary optimization onthe intermediate rep, (such as folding, etc), but he'll really need another phase if he wants to optimize for pipelines, which will vary from architecture to architecture? Tut tut. Maybe it's just an omission on his part.

  391. Many advantages. by Leimy · · Score: 1

    A complex datatype is becoming one of the reasons many people are considering C# over java these days. C++ doesn't as of right now have such a type but you can write the class. Supporting it natively in the language could probably yield many improvements.

    I think the language still needs templates like or better than C++. I have been dabbling in generative programming and template metaprogramming in C++ is one way to get the job done.

    Essentially a meta language telling the compiler how to write code for you is really useful in some cases. Loops get unrolled some computation gets done at compile time and it incurs no run-time cost.

    If this guy can improve on the templates in C++ and make them better for generative programming practices I'd be sold on using it.

  392. Forth !!!! by chrysalis · · Score: 2, Interesting

    Why aren't new languages based on Forth ? Forth is very fast, because you can work at very low level with it. Forth applications can be portable, while staying extremely optimized. Forth can be easily extended to fit any sort of application, and you can have the feeling of a very high level language, while keeping the control of things that needs special optimizations.

    --
    {{.sig}}
  393. practical experience implementing compilers?? by kisrael · · Score: 2

    Born out of practical experience implementing compilers?

    Seems to be the wrong way 'round...keep up this thinking and we'll all be coding in assembler language! At this stage, languages are meant to make thing easier for the programmer.

    Of course, being a programmer I might be somewhat biased...

    --
    SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
  394. First Parrot by HerrGlock · · Score: 2, Funny

    Then C#, now "D"?

    Could we get languages that actually have some semblance to a name, please?

    I must say, though, that D is actually pronouncable instead of "Cee Pound" which sounds like you are putting sand up where the SUN don't shine (errr, maybe that's the reason it's called that?)

    Or maybe it's "Look at me I'm language Dee" from Grease...

    Okay, coffee time.
    DanH

    --
    Cav Pilot's Reference Page
    UNIX - Not just for Vestal Virgins anymore
  395. Oh, you're mistaken, all right by Anonymous+Brave+Guy · · Score: 1
    If I'm not mistaken, Java's Object superclass makes any template system redundant.

    You are not only mistaken, you are woefully ill-informed. Sorry, but it's true; what you wrote is pure FUD.

    Templates are used for way more than just typesafe containers. Here a few examples of well-established template techniques...

    1. typesafe generic containers;
    2. typesafe generic algorithms;
    3. traits;
    4. metaprogramming techniques, leading to expression templates, leading to high performance pseudo-generated code.

    A broken object hierarchy where you insist that everything implements some artificial interface allows precisely one of these, and it doesn't even do that very well.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  396. Why not Sather? by jefu · · Score: 1

    Rather than a new language, I'd like to see a good implementation of Sather really take off.

    Sather is a wonderful language that provides a simple inheritance model, constrained genericity, good support for preconditions and postconditions and class invariants (I didn't appreciate these immediately, but once I figured them out my debugging time dropped by two thirds), and support for iterators (a rather different model than the C++ one), and some other features that would take a while to describe.

    There is a GNU sather, but I'm not sure that its really active and I'm not enough of a compiler wonk to do much on it myself.

  397. *ahem* by Lord+Omlette · · Score: 1

    "Maybe its time for a new language born out of practical experience implementing compilers"

    http://www.blitzbasic.com/

    --
    [o]_O
  398. Great... by segfault7375 · · Score: 1

    Great, just what I need.. another D in programming.

  399. Java Realtime Spec changes this by Stu+Charlton · · Score: 1

    In the RT spec, memory allocation is guaranteed to have linear allocation time (in terms of the size of the object).

    Embedded systems programmers have been dreaming of a safer and more productive means of developing systems... Java RT is very promising.

    --
    -Stu
  400. Re:Buggy programmer? by thejake316 · · Score: 1

    Considering my job description has "programmer" in it, and I got paid on schedule last week, I'd say there's strong circumstantial evidence pointing in that direction. I should probably qualify "programmer" with "mostly Java," and then perhaps you'd feel even better about trying to make me sound foolish.

    Anyway, at&t I believe had a product called cfront which according to my about 1989 C class was "a practical tool for coding in C++ because it actually generates C code" and I believe back in the day g++ did something similar except that it did two passes of preprocessing (preprocessing to something the C preprocessor would understand) instead of using C as an itermediary language. It's possible both were abominable to some degree, I never used either.

    About that time, there were a few ANSI C compilers (and one interpreter) floating around the math department on floppies, all of which were copyright one guy (not the same guy), which leads me to the conclusion that writing an ANSI C compiler, at least for DOS, must be fairly easy, as I would define fairly easy. Not trivial, not really easy, but fairly easy. Getting bent out of shape about subjective statements is a little silly anyway.

    Congratulations on cross-compiling something to DOS from a linux install of gcc, I guess that makes you a "programmer."

    --
    AC's cheerfully ignored
  401. Re:Replacing our chainsaws with plastic butter kni by BitwizeGHC · · Score: 2

    A simple little 3D engine I was working on abstracted vectors and matrices. I overloaded the +, -, *, and % operators and their assignment kin to perform addition, subtraction, and two flavors of multiplication on 3D vectors, and did something similar with matrices. Updating the position vector of an object was a simple matter of "Position += Motion;".

    Not quite as l33t as your mega-polynomials, but yes, operator overloading is cool, and I missed it in Java.

    I have become a big fan of Smalltalk recently, where everything is an object and every operator is a method.

    --
    N4st0r, trixx0r h0bb1tz0rz! Th3y st0l3 0ur pr3c10uzz!
  402. Best sentence on the whole discussion... by smittyoneeach · · Score: 1
    I don't think a very powerful feature should be dropped from a language just because some people are idiots.
    Preach it, brother.

    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  403. Re:Replacing our chainsaws with plastic butter kni by smittyoneeach · · Score: 1
    I see this all the time, programmers who don't know all of the cool C++ tricks that could save them development/debugging time go on rants about how useless all of the features of C++ are.
    Yes, but who hasn't attacked that which they do not understand?



    4. Objects that act like normal primitive numeric types but automatically update the gui display when they change valuue. "Score += 100;"
    Given a third-party library, you hope there would be time to savor all the nuances, but you hint at operator overloads that could mask some 'interesting' surprises...

    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear