Slashdot Mirror


The D Language Progresses

xsniper writes "D made its debut here on Slashdot in August 2001. Since then, many new features have been implemented, to include: operator overloading and slew of additional functionalities. It was featured as a cover story for the February 2002 issue of Dr. Dobb's Journal, and has been ported to the UNIX environment. I encourage programmers to revisit the specs to see how Walter Bright has addressed their concerns. A copy of the compiler is also available for testing. I'm sure some would be surprised by the achievements made thus far."

484 comments

  1. What is D? by Anonymous Coward · · Score: 5, Informative

    What is D?
    D is a general purpose systems and applications programming language. It is a higher level language than C++, but retains the ability to write high performance code and interface directly with the operating system API's and with hardware. D is well suited to writing medium to large scale million line programs with teams of developers. D is easy to learn, provides many capabilities to aid the programmer, and is well suited to aggressive compiler optimization technology.
    D is not a scripting language, nor an interpreted language. It doesn't come with a VM, a religion, or an overriding philosophy. It's a practical language for practical programmers who need to get the job done quickly, reliably, and leave behind maintainable, easy to understand code.

    D is the culmination of decades of experience implementing compilers for many diverse languages, and attempting to construct large projects using those languages. D draws inspiration from those other languages (most especially C++) and tempers it with experience and real world practicality.

    Why D?
    Why, indeed. Who needs another programming language?
    The software industry has come a long way since the C language was invented. Many new concepts were added to the language with C++, but backwards compatibility with C was maintained, including compatibility with nearly all the weaknesses of the original design. There have been many attempts to fix those weaknesses, but the compatibility issue frustrates it. Meanwhile, both C and C++ undergo a constant accretion of new features. These new features must be carefully fitted into the existing structure without requiring rewriting old code. The end result is very complicated - the C standard is nearly 500 pages, and the C++ standard is about 750 pages! The reality of the C++ compiler business is that few compilers effectively implement the entire standard.

    C++ programmers tend to program in particular islands of the language, i.e. getting very proficient using certain features while avoiding other feature sets. While the code is portable from compiler to compiler, it can be hard to port it from programmer to programmer. A great strength of C++ is that it can support many radically different styles of programming - but in long term use, the overlapping and contradictory styles are a hindrance.

    It's frustrating that such a powerful language does not do basic things like resizing arrays and concatenating strings. Yes, C++ does provide the meta programming ability to implement resizable arrays and strings like the vector type in the STL. Such fundamental features, however, ought to be part of the language. Can the power and capability of C++ be extracted, redesigned, and recast into a language that is simple, orthogonal, and practical? Can it all be put into a package that is easy for compiler writers to correctly implement, and which enables compilers to efficiently generate aggressively optimized code?

    Modern compiler technology has progressed to the point where language features for the purpose of compensating for primitive compiler technology can be omitted. (An example of this would be the 'register' keyword in C, a more subtle example is the macro preprocessor in C.) We can rely on modern compiler optimization technology to not need language features necessary to get acceptable code quality out of primitive compilers.

    D aims to reduce software development costs by at least 10% by adding in proven productivity enhancing features and by adjusting language features so that common, time-consuming bugs are eliminated from the start.

    1. Re:What is D? by -strix- · · Score: 5, Insightful

      I understand the goal of D, but personally I like the idea in C and C++ where the base laguage is simple (especially C) and all the complicated stuff is in libraries. It makes it easy to get started with the language and learn the more powerful stuff as its needed. It seems to be the goal of D to toss a bunch of stuff in the language itself and let the programmer sort it out. I could imagine it being a real pain for a new programmer to learn a language like that.

    2. Re:What is D? by Anonymous Coward · · Score: 0

      So it wasn't a joke?! I remember reading the Dr. Dobb's article and noticing that Walter never mentioned Java. Well, no big deal you say, Microsoft never mentioned Java when they were touting C#, but they have a market to capture. So what is this language about other than being a non-interpreted Java?

    3. Re:What is D? by Anonymous Coward · · Score: 0

      D sounds like a complicated Java but without as much power. There's a reason people still use C today, even though it designed with the computers of 30 years ago in mind. In an industry where the technology doubles every 18 months, for a language to last 30 years is an accomplishment.

      It's also important to remember that as more ``features'' are added to languages, more overhead and complexity are added as well. I can't think of any new low level languages that have come about lately, only scripting languages and high level languages. We aren't so far removed from the processor yet that we can forget it exists.

    4. Re:What is D? by Anonymous Coward · · Score: 0

      me?

    5. Re:What is D? by Anonymous Coward · · Score: 0

      y?

    6. Re:What is D? by $$$$$exyGal · · Score: 0, Offtopic
      I only know one thing about D. It sure isn't my cup size! Haha! That's all for tonight folks, I'm outta here.

      --naked

      --
      Very popular slashdot journal for adul
    7. Re:What is D? by Anonymous Coward · · Score: 0

      Java isn't interpreted. It's compiled to bytecode classes. Then those classes are pre-compiled to native code when run.

      But whatever that's just pedantic. "Being a non-interpreted Java" would be an interesting enough feature on its own, except that GCC provides a java compiler that does just that.

    8. Re:What is D? by ObviousGuy · · Score: 1

      Java isn't interpreted. It's compiled to bytecode classes. Then those classes are pre-compiled to native code when run.

      You are really talking about a specific VM when you say such a thing. It is widely known that Java VMs do not have to turn anything into machine code as a prerequisite to running Java code. It is specific implementations of the Java VM that compile everything to native code before running.

      Several VMs do not compile the bytecode at all and simply run the program from an internal command tree. Several other VMs only compile frequently-used code regions into native code. Others turn the whole shebang into a giant binary executable before running.

      It all depends on the VM. You can't really make such broad statements.

      --
      I have been pwned because my /. password was too easy to guess.
    9. Re:What is D? by russellh · · Score: 2, Interesting
      I understand the goal of D, but personally I like the idea in C and C++ where the base laguage is simple (especially C) and all the complicated stuff is in libraries. It makes it easy to get started with the language and learn the more powerful stuff as its needed. It seems to be the goal of D to toss a bunch of stuff in the language itself and let the programmer sort it out. I could imagine it being a real pain for a new programmer to learn a language like that.

      A language feature is an assumption about the problem domain. Perl for instance has great regex capabilities built right in; C++ doesn't. Doing text manipulation in C++ is harder and although one can get libraries to do everything, it is not native to C++ and therefore requires significantly more code.

      A key C++ assumption is that one may wish to do OO programming. This is much easier in C++ than in C, if only from a syntax standpoint; pointers to functions in various structures are painful and illogical in C, whereas in C++ there is essentially no need for them given the classes, inheritance, polymorphism built into C++. This is not library functionality. So if you want to do OO programming, you start with C++ and not C. If you want, say, auto memory management (but no VM), maybe you go download a C++ garbage collector, or maybe you consider D.

      --
      must... stay... awake...
    10. Re:What is D? by aminorex · · Score: 3, Interesting

      When the functionalities in question are basic
      functions of any utile development environment,
      I have to disagree. Java is enormously simplified
      by integrating thread handling and synchronization
      into the language itself. Would you rather
      write regex code in Perl or in C? Associative
      arrays, likewise. I think the choices made were
      good ones, in this regard.

      --
      -I like my women like I like my tea: green-
    11. Re:What is D? by macrom · · Score: 5, Funny

      D aims to reduce software development costs by at least 10% by adding in proven productivity enhancing features and by adjusting language features so that common, time-consuming bugs are eliminated from the start.

      You know, the above little blurb had me going until this statement. For Chrissake, why don't you just prefix it with "The following marketing fluff statement was divined specifically so non-technical, pointy-haired managers could force yet another programming language on already overworked developers." I would have expected more from computer scientists than this. How is the world can you design a programming language, assume that it will automatically meet my needs, then assume that it will reduce my costs for development, which are completely unknown to you? I'm afraid in this case, ASSUME makes an ASS out of U and not me.

      I mean, you'll never hear (nor have you heard in the past) Bjarne claiming that C++ will solve your development ills. Hell, I don't even think Microsoft has claimed that C# will reduce your costs by a specific amount.

      Wait...what did you say? The D programming language will get me laid? Not laid off? Where's that compiler again...?

    12. Re:What is D? by SecretAsianMan · · Score: 5, Insightful
      I like the idea in C and C++ where the base laguage is simple (especially C)

      While I won't dare disagree with you on C, C++ is not simple! Perhaps you should read a little more about it to understand. Things I personally object to in C++ are:

      • The multiple casting notations: ( type ), foo _case< type >
      • Excessively arcane template system
      • Every design-of-syntax error listed in the D site's overview
      • Retarded naming scheme, small size, and wierd design of standard library. The damn thing's almost useless.
      So basically, C++ is anything but simple. It's a big, bloated monster and is loaded with nasty cruft.

      One final bitch: I want the person pulled into the street and shot who was responsible for the font used in the Stroustrup C++ book's code examples. Who the hell writes code in an italic, proportional, serif font?! The only thing more painful than programming in C++ is reading about programming in C++.

      --

      Washington, DC: It's like Hollywood for ugly people.

    13. Re:What is D? by be-fan · · Score: 4, Insightful

      Retarded naming scheme, small size, and wierd design of standard library. The damn thing's almost useless.
      >>>>>>>>
      I love the C++ STL naming scheme. Nice and concise, but still clear and memorable. Java and many other languages suffer far too much from name bloat. And the C++ STL is probably one of the last things a C++ programmer really understands, and it can be years before people truely appreciate the power of the STL.

      --
      A deep unwavering belief is a sure sign you're missing something...
    14. Re:What is D? by mgv · · Score: 4, Insightful

      In an industry where the technology doubles every 18 months, for a language to last 30 years is an accomplishment.


      If longevity of a language means much, then both Cobol and BASIC (Darmouth '66) must be even more fantastic.

      Seriously, C is a powerful language, but I think its longevity relates more to the difficulty in porting legacy code than as a triumph in itself

      Michael

      --
      There is no cryptographic solution to the problem where the intended receiver and the attacker are the same entity.
    15. Re:What is D? by voodoo1man · · Score: 1
      Java and many other languages suffer far too much from name bloat.

      Maybe someone should get an editor with name completions? That takes care of conciseness, while saving you from memorizing new, exciting and totally useless pseudo-acronyms.

      --

      In the great CONS chain of life, you can either be the CAR or be in the CDR.

    16. Re:What is D? by jdkane · · Score: 2
      A D text referencing C++ states: It's frustrating that such a powerful language [C++] does not do basic things like resizing arrays and concatenating strings[snip], however, ought to be part of the language.

      The C/C++ languages are written by programmers for programmers. They are base-level for a reason and successful at what they are meant for. I haven't read all the info about D, but I'm going to go out on a limb and assume that D is probably written in C/C++ or at least partially. So that would be one good reason not to discredit C/C++ in favor of D.

    17. Re:What is D? by yeti+(dn) · · Score: 1

      It's much easier to use regexps or associative arrays (just use the right library function), than to cope with complex struct-like and tree-like stuff in Perl -- there's no way how to write the code readably.

      --
      Life is the slowest way to death.
    18. Re:What is D? by Anonymous Coward · · Score: 0

      If a language becomes popular it stays around for a long time(for a number of reasons). COBOL, BASIC, and C were already mentioned. Lisp has been around since the late fifties. Fortran has as well.

    19. Re:What is D? by the_Speed_Bump · · Score: 4, Funny

      It seems to be the goal of D to toss a bunch of stuff in the language itself and let the programmer sort it out. I could imagine it being a real pain for a new programmer to learn a language like that.

      Sounds an awful lot like C++ to me. C++ is a mish-mash of C, and everything that entails, object oriented programming constructs, and a standard library that is often quite functional in nature. The syntax is convoluted (due in no small part to templates) and the compilers are convoluted beyond human reason.

      Don't get me wrong, I love C++'s sheer semantic flexibility, but if you've ever done anything in C#, Java, or Python, it becomes clear just how long it takes to get stuff done in C++. (and it becomes apparent how annoying the Java OOP obsession can be ;)

      --
      "Break out the gin, and the small violin, I'm a raging success as a failure." --Firewater
    20. Re:What is D? by SN74S181 · · Score: 1
      the base laguage is simple (especially C) and all the complicated stuff is in libraries.


      To add to this, it takes the standards committees considerable work to hammer out what the standard should be just in a 'small simple' language like C. I can't imagine how a proper standard can be hammered out, let alone how vendors can be hoped to comply with said standard.

      Or is this one of those single sourced projects?
    21. Re:What is D? by alonsoac · · Score: 1

      I understand the goal of D, but personally I like the idea in C and C++ where the base laguage is simple (especially C) .... It makes it easy to get started with the language and learn the more powerful stuff as its needed.

      You call concatenating strings and resizable arrays powerful stuff? On the contrary I would argue that not having those features make it more difficult to get started in the language.

    22. Re:What is D? by orthogonal · · Score: 2

      One final bitch: I want the person pulled into the street and shot who was responsible for the font used in the Stroustrup C++ book's code examples. Who the hell writes code in an italic, proportional, serif font?! The only thing more painful than programming in C++ is reading about programming in C++.

      Well, I code in a proportional font. I started doing it after reading Stroustrup's The C++ Programming Language.

      While I agree that reading proportionally spaced code is difficult at first, as Stroustrup comments in the (?) foreward, it quickly seems natural, and becomes easier to read that code in a m o n o s p a c e d font.

      Honestly, at this point I hate having to use a monospacing editor, so I'm lucky that SciTE, a free and GPL'd editor with customizable symtax highlighting is available. Apparently, the SciTE programmer feels as I do, as a proportinal font is the standard for must of languages supported by the built in SciTE lexers.

    23. Re:What is D? by Anonymous Coward · · Score: 0

      This guy expresses some opinions about C++ and he is marked up as insightful? Where is the reasoning? It's nothing but a bunch of loose assertions.

    24. Re:What is D? by ebyrob · · Score: 5, Informative

      C is a powerful language

      Whenever I think about language utility I always think of the gallery of CSS descramblers. Here we see a CSS descrambler in C that is 434 bytes long and runs at better than 10 times the speed of the next smallest implementation (472 bytes of perl code).

      Is there another general purpose language around that can solve this problem with equivalent portions of simplicity and performance?

      I think incompatability, lack of design work and other general language misuse are more to blame for problems in most C code than the language itself. Nearly any language can be used successfully and effectively and nearly any language can be abused.

      Will C be the most widely used programming language for the next 20 years? Hopefully not. Will C continue to be used effectively in the next 20 years when appropriate? Hopefully so.

    25. Re:What is D? by pyrrho · · Score: 1

      and what by chance do you prefer?

      --

      -pyrrho

    26. Re:What is D? by jjoyce · · Score: 2

      Proportional fonts for code look good if done right, like Stroustrup did (note how he used a monospaced font for operators). For an example of it looking horrible, see the code examples in Andrew S. Tanenbaum's Computer Networks.

    27. Re:What is D? by FrostedChaos · · Score: 1
      Perl isn't a real language. And the incompatibilities, security problems, and memory leaks seen in many programs are a direct consequence of the many flaws in C.

      --
      "Any connection between your reality and mine is purely coincidental." -Slashdot
    28. Re:What is D? by RockyJSquirel · · Score: 2

      Yeah, it gives me the hebegeebies that they've got bullshit marketing blurbs before they've even finished the language.

      I remember older marketing blurbs from them that completely contradict what they're saying now.

      After my experience working for overly corporate customers, the HELL I want to try a new language that's an alpha from a commercial company.

      It probably won't be usable till version 2 or 3 and since it's proprietary it will never be affordable.

      No thanks.

    29. Re:What is D? by Anne+Thwacks · · Score: 2
      If longevity of a language means much, then both Cobol and BASIC (Darmouth '66) must be even more fantastic.

      Damn right - Fortran is fantastic, and Cobol is the greatest!

      --
      Sent from my ASR33 using ASCII
    30. Re:What is D? by oliverthered · · Score: 2

      C++ is beauty in a language.
      Well apart from not having dynamic functions on classes (but Borlands compiler fixes that problem with closures)

      Ok there's a lot of old 'depriciated' junk kicking around,
      like several different styles of declaring the paramiters for a function. the horrible ++a syntax (checkout decss for a a=(++a) ... bit of code)

      And unless you really get a 'feel' for what your doing then the code can end up quite nasty.

      I think they should have taken base C++, removed some of the crap, added dynamic class members, added threading/locking 'hints' for the compiler (or a universal locking/threading system),and COM/ADO style functionality in the basic C++.
      languange.

      --
      thank God the internet isn't a human right.
    31. Re:What is D? by captaineo · · Score: 1

      Ah yes, the true power of the STL - the ability to make your binaries ten times bigger and compile times ten times longer without warning :) :)

      Yes, for really tough problems (multimap of lists of strings to sets of ints...) STL is the only way to go. But for everyday stuff like lists, arrays, and strings, you are much better off with a simpler solution.

    32. Re:What is D? by aled · · Score: 1

      Really? How many computer languages do you know written by marketing guys for programmers?
      I'm thinking that written by programmers means that its all screwed all, but easy to write one-liners, and helps the programmer push less keys, like K&R intented.

      --

      "I think this line is mostly filler"
    33. Re:What is D? by aled · · Score: 1

      CPUs may double processor power each 18 months but language seems to last a livetime, which in programmers is about 20 years.
      I don't love too much any language, because other than syntactic sugar they all amount to a Turing machine. What I would like is to stop hearing these religiuos wars from people unable to accept change. "Mine language is better than yours!", "language XXX is perfect and so can be perfected", "every one that uses other than XXX is going to hell" are the most common comments when there is language talk.

      --

      "I think this line is mostly filler"
    34. Re:What is D? by jdkane · · Score: 2
      Really? How many computer languages do you know written by marketing guys for programmers?

      None. However FORTRAN was written by programmers for engineers, and COBOL by programmers for Business. C/C++ is written by programmers for programmers, to build the UNIX OS, etc. Your question would be closer to the mark if it were reversed: "How many computer languages do you know written by programmers for marketing guys?" I should have provided more context. Thanks for the laugh.

    35. Re:What is D? by Anonymous Coward · · Score: 0

      Obviously you dont know how to calculate true COST.

      If I can purchase something for 200 bucks which saves me like a man-month of productivity, what is the affordability issue?

      Im not saying D is all that ( and a bag o chips ), but you statement is a troll, or just gnu propagandish.

    36. Re:What is D? by charleschuck · · Score: 1

      How many computer languages do you know written by marketing guys for programmers?

      C# ? :-)

      -Charles

    37. Re:What is D? by Anonymous Coward · · Score: 0
      I love the C++ STL naming scheme. Nice and concise, but still clear and memorable.

      Ok, I must give it to you; you are the first person ever I remember claiming STL naming convention to be good. I remember it being inconsistent (both internally and externally, ie. usually not using 'obvious' terms most other frameworks and libraries use) and weird.

      As to Java, I don't see much name bloat in Collections framework, which could be considered STL counterpart (less extensive one but still).

      Btw, do you also consider MS DOS 8+3 naming convention to be simple, elegant and efficient?

    38. Re:What is D? by HiThere · · Score: 3, Insightful

      The blurb does sound strange, but read the specs and see if you don't think it a reasonable guess. If you don't, then this isn't the langugage you want, obviously.

      Personally, I think it may be conservative. My only qualm is with linking to other languages like Java, Python, and Ruby. Everything seems to depend on C routines to manage the interlanguage calling.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    39. Re:What is D? by djmurdoch · · Score: 4, Funny

      Here we see a CSS descrambler in C that is 434 bytes long and runs at better than 10 times the speed of the next smallest implementation (472 bytes of perl code).

      You're right, this is a model of clarity and good programming:

      #define m(i)(x[i]^s[i+84])
      unsigned char x[5],y,s[2048];main(n){for(read(0,x,5);read(0,s,n= 2048);write(1,s ,n))if(s[y=s[13]%8+20]/16%4==1){int i=m(1)17^256+m(0)8,k=m(2)0,j=m(4)17^m(3)9^k
      ...

    40. Re:What is D? by aled · · Score: 1

      No, that's in the "programmers for marketing" class (read above post).
      There's nothing plain bad about c#. After all is just a clon of Java :-)

      --

      "I think this line is mostly filler"
    41. Re:What is D? by swdunlop · · Score: 2


      And the C++ STL is probably one of the last things a C++ programmer really understands, and it can be years before people truely appreciate the power of the STL.
      </quote>

      I think you just identified the reason many casual programmers have trouble with C++; the barrier of entry for learning the STL is so high, they often just implement their own less efficient lists, hashes and other data collections, often without proper bounds checking and other necessities. The STL is certainly powerful, but it is rather thorny for someone coming from a saner OOP language to learn.

      It doesn't help that many of the early C++ STL books were entirely too involved in fascination with the nature of the template system and spend less time discussing the actual usage of STL.

    42. Re:What is D? by scrytch · · Score: 2

      > I'm going to go out on a limb and assume that D is probably written in C/C++ or at least partially. So that would be one good reason not to discredit C/C++ in favor of D.

      No, it's a bloody stupid reason. Would you refuse to use a hammer because it wasn't made with nothing but hammers? My computer is made, at a basic level, with transistors, but I'm not forcing myself to wire CMOS logic circuits in order to make my program run (this incidentally is the counterargument to the popular canard that asm is required to truly grok programming. Might be to grok a von neumann architecture, but that's not the aim of programming)

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    43. Re:What is D? by pVoid · · Score: 2
      While I agree with you, I would remind you that templates are one complex mother.

      Very few compilers truly implement templates as they have been specced out.

      On another note, I believe templates are the greatest invention since the bit.

    44. Re:What is D? by pVoid · · Score: 2
      I think what contributes to C's longevity is the fact that there is no other language that can be used in K-mode programming, apart from asm (which isn't a language per-se).

      And as such will never go into oblivion. C does not do *any* behind the scenes action... which is why it attracts to many people.

      That can be an advantage, or a disadvantage... up to you to chose it properly.

    45. Re:What is D? by ConceptJunkie · · Score: 1

      Not to mention error messages that are as hard to read as binary dumps.

      STL is an efficient, but inelegant and needlessly cryptic solution that solves a problem without utilizing the reason C++ exists: object-oriented programming.

      I have to declare a different iterator object type for every object type I want to iterate? Yeah, that's as elegant as the place I worked at that printed out Excel spreadsheets, and sent the printouts to India to be keyed in.

      My experience with STL leads me to believe that it owes its existence more to the fact that the people who made it and understand it can tell you how clever they are than it being a good solution.

      I've been refining a C++ collection library for years, and while it may be slightly less efficient than STL, and it certainly isn't as flexible or complete when it comes to some of the really obscure and complex needs that can come around, it's orders of magnitude easier to learn and use.

      And it doesn't use templates, which only exist because apparently true and proper OOP is just too hard for some people. There is nothing you can do with templates that you can't do without them, just as well and just as efficiently, making the feature, in my opinion, unnecessary and redundant.

      --
      You are in a maze of twisty little passages, all alike.
    46. Re:What is D? by lemonjelo · · Score: 1

      After reading about a quarter of the spec for D at digitalmars.com D feels like a chance to write efficient, compiled C-like code but with some of the conveniences of Perl.

      I like that the size is part of an array for example. It's also interesting that the compiler is supposed to error on ambiguous expressions that depend on the order of operation... this could be a pain, but these are examples of how D is intended to reduce programming errors.

      --

      pimtamf
    47. Re:What is D? by Anonymous Coward · · Score: 0

      I know you're joking but it's missing the point. Yes, you can write highly arcane line-noise in C. You can also write a huge framework like GNOME in C. The point is, C scales from all but the very lowest to all but the very highest levels. No other language has an equally broad scope.

    48. Re:What is D? by cpeterso · · Score: 1


      You mean like Scheme or Lisp? You can't get much simpler for a core language.

    49. Re:What is D? by cpeterso · · Score: 2


      I've tried using a proportional font for C++ before, but it didn't work out. How do you deal with tab/space alignment? I do Win32 coding, so I often have to use those Win32 APIs that have 17 parameters and must be spread across multiple lines. ;-)

    50. Re:What is D? by cpeterso · · Score: 2


      but were those C and Perl implementations optimized for speed or program length? Perhaps the Perl implementation could be faster with a few extra lines of code.

      However, I mostly agree with you. I think less code is always better because there is less to read and "hold in your head".

    51. Re:What is D? by be-fan · · Score: 2

      I find it different. I find it impossible to remember the totally bland, generic, and similar sounding names in Java, while I find the C++ names very concise and memorable.

      --
      A deep unwavering belief is a sure sign you're missing something...
    52. Re:What is D? by be-fan · · Score: 2

      In proper implementations, the STL doesn't add all that much overhead to a binary. A good linker will remove a lot of redundant code caused by the STL, and a good compiler will process STL code quite quickly. Intel C++, for example, handles the STL quite well. My first STL project was a physics simulation that was extremely data structure intensive. It took me at most a day to get the hang of things. The STL really is quite straightforward. Praytell, how would you simpify the STL string or list classes?

      --
      A deep unwavering belief is a sure sign you're missing something...
    53. Re:What is D? by be-fan · · Score: 3, Informative

      Ha ha. Even the Java folks realized the power of generics. There are lots of things (take a look at Loki or Boost) that simply cannot be done in static languages like C/C++ and Java without something like the template mechanism. Remember, C++ isn't an OOP language, it is a multi-paradigm language. There are lots of cases (and data structures is a big one) where "proper OOP" sucks. Just look at the cast-fest that is the Java collection classes. One of the major powers of the template mechanism is that it allows high level design with low-level performance. And there are *lot's* of people (especially in graphics, science, systems-programming) that really do need low-level performance. Generic data structures without templates usually require either abandoning type safety (by using void pointers, the C way to do it) or abandoning performance (by using inheritence and virtual functions, the Java way to do it). With templates, you don't have to abandon either. In practice, the STL list class is about 50% the speed of a single-type C data structure. Very impressive considering the C structure has embedded link nodes and no copy on insert while the STL does. Vector and matrix classes using templates in scientific applications are often 100% the speed of an equivilent C structure, because of the fully optimizable nature of templates. Of course, like everything else in C++, templates are easy to abuse and use the wrong way. But they are hardly unnecessary and redundant.

      --
      A deep unwavering belief is a sure sign you're missing something...
    54. Re:What is D? by captaineo · · Score: 1

      Yes, STL implementations vary greatly in overhead - the GNU STL seems to add about 10x and STLport, which I like better, adds only 2x-4x. (this is compared to my own little out-of-line collections library).

      I have an inline List class that takes less than one page of code, compiles instantly, and does everything I need (including proper management of Lists of objects with constructors and destructors). It is better than the STL list because you can embed the list pointers in a class or struct if you want, to avoid the overhead of allocating a new list node for each item.

      Practically any string implementation is going to be less heavy than STL's string :). I think the approach of having string be a generic template is the wrong path - the only use I can think of is strings of u16s or u32s for Unicode - but in that case you are probably just as well off using UTF-8. Practically all C++ programs need some kind of self-allocating string, and it's stupid to penalize them all just to handle one rare corner case.

    55. Re:What is D? by Anonymous Coward · · Score: 0

      I must agree, although unfortunately I'm less inclined to use the STL for certain things since there is (or at least seems to be) a lot of overhead from using it. Could be wrong though.

    56. Re:What is D? by Paradise+Pete · · Score: 1
      I think less code is always better because there is less to read and "hold in your head".

      When I read code I don't memorize it line by line, I remember the ideas behind it. The amount of code doesn't have much to do with it, for me at least.

    57. Re:What is D? by macrom · · Score: 2

      Retarded naming scheme, small size, and wierd design of standard library. The damn thing's almost useless.

      Tell me about it! I really hate all of those useless C++ apps like, oh, most any modern game. I mean, it's so useless that people are making millions of dollars a year with software written in C++. They really need to invent a different language.

    58. Re:What is D? by spinkham · · Score: 2

      Except he can. Java bytecode is what your .class files are, and the VM runs. Native code (or Machine code) is what a JIT VM might turn your commonly executed routines into.
      Every VM uses Java bytecode. Some use native code.

      --
      Blessed are the pessimists, for they have made backups.
    59. Re:What is D? by spinkham · · Score: 1

      Unless of course I'm retarted and half read what you wrote and basically said the same thing as you... My bad ;-)

      --
      Blessed are the pessimists, for they have made backups.
    60. Re:What is D? by Anonymous Coward · · Score: 0
      Sounds like Delphi.


      Sorry for the AC :)

    61. Re:What is D? by SecretAsianMan · · Score: 3, Insightful
      I mean, it's so useless that people are making millions of dollars a year with software written in C++.

      That's a logical fallacy. Just because C++ is commonly used successfully doesn't mean a certain part of C++ is commonly used successfully. Nor does it tell whether the success is due to the language's design or to the ingenuity of the programmers using the language. It's a very common thing for the cout identifier to be the only part of the standard library used by a C++ programmer. Other libraries provide similar functionality. So you can't assume that STL, for instance, is in use in each and every C++ product out there.

      really need to invent a different language.

      The D site provides a very good justification of the language's invention.

      --

      Washington, DC: It's like Hollywood for ugly people.

    62. Re:What is D? by Grab · · Score: 2

      Not really.

      The general concensus in CS (last time I looked) is that a language with fewer rules is easier to learn. The language should just specify the important requirements: maths, comparisons, type/class definitions/declarations, etc. The concepts are then easy. After you've got the concepts down solidly, it's easy to understand the libraries where much of the reusable functionality lives.

      Grab.

    63. Re:What is D? by Anonymous Coward · · Score: 0

      One of the stated design points of D is to make both the parser & the compiler simple. The idea is that D compilers will be more standards-compliant while still supporting the same functionality as C++ (expressed in a different syntax).

      I've used both DMD (the Windows compiler) and DLI (the port to Linux) and it's amazing how much they already support, even though there is only one guy behind the compiler.

      Example: I've written a Bison equivalent from scratch in D; it produces D code as output...I'm currently in the process of testing compilers built with this utility.

      Don't underestimate the power of built-in dynamic arrays, the concatenation operator, and associative array. They made my code IMMENSELY easier to write!.

    64. Re:What is D? by ebyrob · · Score: 3, Insightful

      Actually that code is a work of art as far as I'm concerned.

      Obviously, it wasn't originally written in the form that it shows up on that web page. In fact, the author wrote it in a much cleaner way and then used well known techniques for shrinking code size in C (with the help of a second author) to make a point.

      The main point was: This is not a tough probably to solve, in fact 434 bytes is enough! ("lines" has always been a poor measure of complexity, so he chose bytes...)

      A secondary point may have been: If Perl is supposed to be a compact and general language, C seems to beat the pants off of it in this problem space.

      If you actually want to read the code and understand what it does, I'd suggest running it through a beatifier and then possibly changing variable names as you feel is appropriate. Or you could email the author and ask him for the original version...

    65. Re:What is D? by ebyrob · · Score: 2

      I work on medium to medium-large (100,000 to 1,000,000 line) programs written by other developers. Most of my time is spent fixing problems in other people's code. Believe me, when you get into this environment less is far, far more. Less, components, less code per component, more flexible and powerful, yet small and efficient components... Basically the fewer operations the better. Don't get me wrong, when coding for fun or education, do exactly as you please, or whatever is most useful, and write as much code as you like. It's only getting into a "production environment" that I'm a minimalist.

      For me personally, "ideas" work well at the fundamental language level, or at the well established library level. However, when the "ideas" come from comments or the author's intent, they are too often not what they seem.

      As to operations per page (or fitting a lot on one "screen"), I tend to like to see as much in one shot as is reasonable, but that's a personal preference not shared by all of my collegues...

      When I read code I don't memorize it line by line, I remember the ideas behind it. The amount of code doesn't have much to do with it, for me at least.

      When I go into "hack mode" I begin building a mental picture including all the significant pieces of the system I'm working on. I often get into a state where I'm fairly un-interruptable, my breathing pattern changes and just recently I've had problems with my monitor hurting my eyes as the pupils dilate (which I don't notice till afterwards). I haven't ever hit a "limit" in complexity yet, but the number of operations and general complexity of the code I'm reading tends to directly effect how much time it takes me to build a picture of what's going on. Hence, the amount of time before a hack session ends can be a limiting factor.

      I think that's enough random rambling for now.

    66. Re:What is D? by ebyrob · · Score: 2

      Perl isn't a real language.

      Well, I certainly agree with that statement, but I hear there are those who wouldn't...

      incompatibilities, security problems, and memory leaks seen in many programs are a direct consequence of the many flaws in C.

      If those problems are slowing (or will slow) a particular project down, then C may not be the right choice.

      All languages have good and bad sides.

      One of the most important features in C#, Java, and D (garbage collection) is also one of the biggest drawbacks. How can you seriously write a program and call what you release professional if it pauses unpredictably for indeterminate amounts of time every so often?

      Of course, the low level, power and flexibility of C is also one of its greatest drawbacks. How can you seriously write a program and call what you release professional if it leaks memory, crashes, and/or needs frequent retrofitting to handle larger data spaces?

    67. Re:What is D? by ebyrob · · Score: 2

      I could talk for hours about the good and bad points of any of several langauges...

      If you think that C is merely "obsolete" and "needs to be replaced" you are quite simply uneducated.

      If you think that C is inappropriately pushed on projects that would better be served by more modern and higher level languages, or if you think that its niche is ever shrinking and that it is less relevant than it was 20 years ago, then you're absolutely correct.

      I don't love too much any language, because other than syntactic sugar they all amount to a Turing machine.

      I, by contrast, love different things about every language I use. I should also point out that a Turing machine, quite simply, does not exist.

      What I would like is to stop hearing these religiuos wars from people unable to accept change.

      Well, getting involved is about the worst way to get them to go away... Personally, I'm tired of people who blindly think that "newer=better" without any hard assesment to go along with it.

    68. Re:What is D? by aled · · Score: 1

      I was exagerating. In general I agree with you. But I didn't say C is "obsolete" or "needs to be replaced".
      That makes me ask: let's supose that it is not obsolete or broken, but can't we think something better? usually we can, but nobody wants to rewrite gigallons of lines of code (hint: cobol, fortran).

      getting involved is about the worst way to get them to go away
      May be, but I like to ask... and "reductio ad absurdum" :-)
      The slogan of the press syndicate of my country is "Silence is the worst opinion" and they have good reason for it.

      I'm tired of people who blindly think that "newer=better" without any hard assesment to go along with it
      Of course, easy enough:
      C++==C+1 > C
      win 95 < win 98 < win 2000
      etc

      --

      "I think this line is mostly filler"
    69. Re:What is D? by orthogonal · · Score: 2

      I've tried using a proportional font for C++ before, but it didn't work out. How do you deal with tab/space alignment? I do Win32 coding, so I often have to use those Win32 APIs that have 17 parameters and must be spread across multiple lines. ;-)

      SciTE deals with this tolerably well. Tabs are a certain size, and I use however many I need to get the text to align.

      That's not a problem. The problem is that SciTE allows you to magnify/shrink the text (much as you can in a web browser). At magnifications (shrinkages) other than what you've used to align the text, the text becomes misaligned. (I other words, the whitespace doesn't grow at exactly the same rate as the non-whitespace; I assume the problem lies in the system fonts.)

      Of course, you can always tell SciTE to use a monoface font, or you can use some mix of fonts (different fonts bases on syntax highlighting).

    70. Re:What is D? by ebyrob · · Score: 2

      Well, keep speaking up. I'll be careful not to sound too much like a language biggot...

    71. Re:What is D? by daniel_yokomiso · · Score: 1

      D isn't proprietary. Currently it's one man's job (Walter Bright http://www.walterbright.com/) doing the dmd compiler (from Digital Mars http://www.digitalmars.com) and designing the language. There's also a port to linux on www.opend.org and some people working on a gcc frontend. It's usable now (somewhat), if you don't push it too much (e.g. templates are still tricky). Version 2 or 3 will probably be standardized, but IMO version 1.x will be stable and usable enough to be a complete language.

      Best regards,
      Daniel Yokomiso.

      --
      Disclaimer: If I disagree with you I'm probably trolling...
    72. Re:What is D? by daniel_yokomiso · · Score: 1

      Every language's first compiler must be written in some other language. D's compilers use C, because most D developers like C, but want more safe and expressive features. In D arrays are safer and faster than C arrays via pointers, because the compiler can do some optimizations, knowing it is working on a array, not some bare pointer. But current version is good enough for rewriting the compiler in D. Best regards, Daniel Yokomiso.

      --
      Disclaimer: If I disagree with you I'm probably trolling...
    73. Re:What is D? by FrostedChaos · · Score: 1
      How can you seriously write a program and call what you release professional if it pauses unpredictably for indeterminate amounts of time every so often?
      I never said garbage collection had to be done in the same thread as everything else. It's true, threads are difficult to implement in C, but there are other languages out there.


      If those problems are slowing (or will slow) a particular project down, then C may not be the right choice.
      The problem is that these flaws don't slow most projects down, and they continue on to create a crappy final result. There's no reason why most open-source development shouldn't be done in a fault-tolerant and high-level language. Period.


      But instead, we have thousands of lines of hackish and brittle C code, and a macho attitude that higher-level languages like Java and Lisp are for sissies. Yawn.

      --
      "Any connection between your reality and mine is purely coincidental." -Slashdot
    74. Re:What is D? by ebyrob · · Score: 1

      I never said garbage collection had to be done in the same thread as everything else. It's true, threads are difficult to implement in C, but there are other languages out there.

      How much do you know about garbage collection? Do you realize that it's a requirement that the whole VM (or at least all code that potentially has access to the data being cleaned up) must be "paused" throughout the process? Threads don't help one little bit here because you can't find which are stale references when some are being passed around. Perhaps you've met a garbage collector that begins to solve some of these issues, I certainly haven't.

      As to the rest, You're the one that seems to think dictating languages to other developers is a good idea. I'm merely trying to point out that both sides have a lot to learn from one another.

  2. D? by Anonymous Coward · · Score: 0

    I thought the next one was supposed to be called P. First came B, then came C, in the order BCPL, which was an older language.

    1. Re:D? by Jason1729 · · Score: 2, Informative

      P and L got used up by APL though. This is BCD..Binary Coded Decimal.

      Jason
      ProfQuotes

    2. Re:D? by GimmeFuel · · Score: 1

      So wouldn't L-- work just as well as P? Then after that we could have P++, just to confuse people.

    3. Re:D? by Anonymous Coward · · Score: 0

      Good idea! I approve fully!

    4. Re:D? by einhverfr · · Score: 4, Funny

      I thought PL was short for Perl.

      Sorry, couldn't resist ;)

      --

      LedgerSMB: Open source Accounting/ERP
  3. Shouldn't it be 'E'? by aerojad · · Score: 4, Funny

    Before C came B, before B came A, and after C came C++, ++ meaning +1, or in other words, D. So if the next language is D does C++ become C 1/2? or C.5? ...someone had to sacrifice the karma to say it

    --

    SecondPageMedia - Wha
    1. Re:Shouldn't it be 'E'? by NoMoreNicksLeft · · Score: 2

      Thought there already was an E, for the amiga. A scripting language or something?

      Off-topic: C.5 sounds cool. When I design a C knockoff language with ill-considered features, I think I will call it this, with your permission. There aren't nearly enough C-based programming languages that use C in the name, if you ask me. C/C++/ObjC/C# and the best of all, C.5!

    2. Re:Shouldn't it be 'E'? by leroybrown · · Score: 2, Funny

      silly geek, it depends what C was initialized to

      --
      Founder, Americans Allied Against Alliteration
    3. Re:Shouldn't it be 'E'? by bolverk · · Score: 2, Funny

      Actually, the Camel book says that it all started with BCPL.

      The next language was simply B, and after that, C. No-one knows whether the idea was that C came after B in the alphabet or that it came after B in "BCPL", but C++ dodged the issue with a neat play on the auto-increment operator.

      Perl takes up the last two letters and settles the issue. There should be no-more BCPL derivatives! :)

    4. Re:Shouldn't it be 'E'? by tfinniga · · Score: 5, Funny

      Actually, C++ is being post-incremented, so this iteration C++ is the same as c, but next time around it'll be great!

      --
      Powered by Web3.5 RC 2
    5. Re:Shouldn't it be 'E'? by AvitarX · · Score: 1

      That's really funny 'cause it's true.
      Probably the must insightful thing on slashdot ever.

      --
      Wow, sent an e-mail as suggested when clicking on "use classic" banner, and got a fast response that addressed my msg
    6. Re:Shouldn't it be 'E'? by travail_jgd · · Score: 2

      IIRC, there already is (well, was) a C-variant called "E". It had most of the features of C++, with one change: persistent variables. I can't recall the specific method for declaring the variables to be persistent, or the mechanisms for storing the data.

      Anyway, this was about 10 years ago, and my memory isn't what it used to be.

    7. Re:Shouldn't it be 'E'? by Anonymous Coward · · Score: 0
      A didn't come first. BCPL begat B which begat C. The family tree becomes sordid after this point. C hooked up with Simula to create C with Classes, which later went through an identity crisis, came out as multiparadigm ("Mom, dad, I'm multiparadigm"), and--in a move reminiscent of Prince--incorporated a symbol in its name, becoming C++. C subsequently had an affair with Smalltalk and Objective C was born (but prematurely, as it's rarely seen outside the incubator that is Apple).

      With that screwed up childhood, it's no wonder that C++ turned out to be complex and having a lot of issues. And -- let me tell you -- a chick with problems gets around town really fast. It wasn't long before C++ gave birth to Java (father unknown), C# (with the brother of Java's father, hence the family resemblance), and a bunch of other minor and niche dialects.

      It hardly ends there. The old philanderer, C, is still bar-hopping and skirt-chasing to this day. Having recently received a facelift and a Viagra prescription from ISO, C's been hitting the hardware and has sired a couple of shader languages, C--, SpecC, and God only knows what else...

      C refuses, however, to claim responsibility for the E programming language. While the similarity is at times striking, C insists that it would never give rise to an expression-based language.

      ... hello, shakkur :) ...

    8. Re:Shouldn't it be 'E'? by Corrado · · Score: 2
      It was designed & built by Wouter van Oortmerssen in the early 90's. See more info here.

      The version I was familiar with was known as Amiga E. Here is the blurb from the Amiga E home page:
      "For those who don't know: E is an object-oriented/procedural/unpure functional/whatever language with quite a popular implementation on the amiga. It's mainly influenced by languages such as C++, Ada, Lisp etc., and features extremely fast compilation, inline assembler, large set of integrated functions, powerful module concept, flexible type-system, quoted expressions, immediate and typed lists, parametric and object polymorphism, exception handling, inheritance, data-hiding, methods, multiple return values, default arguments, register allocation, fast memory management, unification, LISP-Cells, macro-preprocessing, a very powerful source-level debugger, gui-toolkit, library linker, and then some. (oh yes: and it was designed and implemented by me :-)"
      --
      KangarooBox - We make IT simple!
    9. Re:Shouldn't it be 'E'? by bryane · · Score: 1
      after C came C++, ++ meaning +1, or in other words, D

      Not so, oh fellow programmer. A post-increment expression is equivalent to the original, but the lvalue is changed beyond recognition.

    10. Re:Shouldn't it be 'E'? by ecc0 · · Score: 1

      After 'B', 'C', 'P' and 'L' comes '\0'.

    11. Re:Shouldn't it be 'E'? by lahi · · Score: 1

      "There should be no-more BCPL derivatives!"

      In fact there is at least one more. Martin Richards - who BTW designed BCPL (as a derivative of Christopher Strachey's CPL language, which I believe was never really implemented, being something of a crossbreed between LISP and Algol) - has written "MCPL, a typeless language with features taken from BCPL, C, ML and Prolog."

      MCPL itself is actually written in BCPL.

      -Lasse

    12. Re:Shouldn't it be 'E'? by GregWebb · · Score: 2

      E's not really a scripting language but I don't know it well so why not have a look at the author's web page over at http://wouter.fov120.com/e/

      You'd never sell C.5 in the UK, though, because of Clive Sinclair's efforts. Have a look over at http://www.nvg.ntnu.no/sinclair/vehicles/c5.htm

      --

      Greg

      (Inside a nuclear plant)
      Aaaarrrggh! Run! The canary has mutated!

    13. Re:Shouldn't it be 'E'? by Simon+Brooke · · Score: 2
      Before C came B, before B came A...

      Not so. Sorry to be boring.

      Before C came B, before B came BCPL, before BCPL came CPL (except it was never finished), and (arguably) before CPL came Algol.

      --
      I'm old enough to remember when discussions on Slashdot were well informed.
    14. Re:Shouldn't it be 'E'? by scrytch · · Score: 2

      E is also used as the name of a language for the Java VM. Has distributed parallelism built in much like Obliq, but with java-like or VB-like syntax (your choice) and based on static closures like scheme. Wonderful research language, though it lacks some library support to make distribution easy, documentation is sorely lacking, and it's just too slow for general purpose work.

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    15. Re:Shouldn't it be 'E'? by scrytch · · Score: 2

      I'm such a doofus. link to the E Language here

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    16. Re:Shouldn't it be 'E'? by Almost-Retired · · Score: 1

      There is in fact an E language, written by Wooter Van Oortmanson although that spelling is probaby highly fubar. More or less typeless, like arexx, I found my arexx experience getting in the way of getting anything done.

      It ran on the amiga, and I don't know if it was ever ported to a *nix environment or not. I've a copy of the docs laying around here someplace and they pretty well fill a 3.5" "D" ring binder.

      --
      Cheers, Gene
      99.22% setiathome ranking, what are you doing with your spare cpu cycles?

    17. Re:Shouldn't it be 'E'? by Anonymous Coward · · Score: 0

      Hey, we can do better than that..... 'D' and 'E' would be successors to C, no? But C++ already HAS successors: 'Java' and 'C++++', rearranged to C#, and pronounced 'C-sharp'. So-- not caring particularly for 'Borneo' or 'Sumatra' (although 'Bali' has possibilities)-- my choice for the next name is Eb-- pronounced 'E-flat'-- the next black key.....

    18. Re:Shouldn't it be 'E'? by smallstepforman · · Score: 2

      This shows how old I am. The sequal to C should've been P. All old timers know this.

      --
      Revolution = Evolution
    19. Re:Shouldn't it be 'E'? by Keithel · · Score: 1

      Actually, the story of C and C++ goes as follows:

      Before C there was B, before B there was 'BCPL'...
      sometime after B, 'A' was being developed at UWaterloo (early 70s)(per my father's memory)

      BCPL was/is a fairly simple language without types... it was designed in '66 by Martin Richards, and implemented in spring '67 by people at MIT

      B and C, and C++ were all real languages that came out of Bell Labs..

      It was always wondered whether the next language in the series would be called 'P' or 'D'

      ~Keithel

    20. Re:Shouldn't it be 'E'? by Anonymous Coward · · Score: 0

      Should be P. The first language in the family was BCPL, then B, then C. So the next is P. I understood that C++ was so called because no-one could decide between P and D.

  4. Is this a setup? by Anonymous Coward · · Score: 0

    The next one is obviously DD.

  5. Of course not by autopr0n · · Score: 5, Funny

    The next language should be named C+=2!

    --
    autopr0n is like, down and stuff.
    1. Re:Of course not by Anonymous Coward · · Score: 0

      nah it will be: (C++)++

      And of course the creators will make sure that's valid code in their new language.

      That's a good way to design languages I guess .. come up with a name, and then make sure the name compiles....................

    2. Re:Of course not by Anonymous Coward · · Score: 1, Funny

      Why would they do that? ++C++ is good enough for government work.

    3. Re:Of course not by T-Kir · · Score: 2

      Nooooooo!

      Until the language becomes more popular and depending on the stability, etc.. it should be C/=0 !!

      But then again, it could have been called E, but that letter on it's own might have evoked images of a certain little pill... remember Intel upheld it's PC (political correctness, not personal computer) brigade when they decided to "re-number" the 666Mhz P3 chip as being 667Mhz (AFAIK) so you can never tell with companies these days.

      Oh well, at least *nix creators had a sense of humour when creating commands so that you could "finger user" ;-)

      --
      Are you local? There's nothing for you here!
    4. Re:Of course not by Anonymous Coward · · Score: 0

      Or perhaps (C++)++ !

    5. Re:Of course not by fredrikj · · Score: 2

      C++; C++; might be more efficient.

    6. Re:Of course not by chtephan · · Score: 1
      The next language should be named C+=2!
      No. The equivalent to C+=1 is ++C, not C++. The result of C+=1 (apart from increasing C by 1) is C+1, while the result from C++ is still the old C. You can write that as an expression using a comma: (C+=1,C-1) - that means that C is increased by one but the whole thing returns the new value decreased by one again (thus the old value of C).

      So it should be: (C+=2,C-2)
    7. Re:Of course not by Anonymous Coward · · Score: 0

      So it should be: (C+=2,C-2)

      Reads like Perl to me.

    8. Re:Of course not by GMontag451 · · Score: 1
      remember Intel upheld it's PC (political correctness, not personal computer) brigade when they decided to "re-number" the 666Mhz P3 chip as being 667Mhz (AFAIK)

      No they didn't. 667MHz is the correct number. The actual clock speed is 2000/3 MHz, or 666.6 repeating. Rounded to the nearest whole number, its 667.

    9. Re:Of course not by Anonymous Coward · · Score: 0

      or ++C++

    10. Re:Of course not by Ignominious+Cow+Herd · · Score: 1

      So you're saying that C++ is only better than C after you've already stopped using it? Sounds right to me.

      --
      Lump lingered last in line for brains, and the ones she got were sorta rotten and insane.
    11. Re:Of course not by Anonymous Coward · · Score: 0
      ++C+++++C++


      Read that as ++C++ + ++C++


      (It is, of course, totally invalid in any compiler today).

    12. Re:Of course not by Anonymous Coward · · Score: 0

      Then it might actually have value. I've always found if funny that

      project = C

      and

      project = C++

      Give the same value to project.

  6. And tomorrow.. by Anonymous Coward · · Score: 0

    D LANGUAGE RELEASED

  7. So Is Their Motto... by long_john_stewart_mi · · Score: 3, Funny

    "The D Language: It's C! With Implants!"

    --
    ...oOOo..'(_)'..oOOo...
    1. Re:So Is Their Motto... by Anonymous Coward · · Score: 0

      Reverse C and put a line down.

    2. Re:So Is Their Motto... by Anonymous Coward · · Score: 0

      That would be the DD language.

    3. Re:So Is Their Motto... by colzero · · Score: 2, Funny

      Nah that's Double D!

  8. Does D work with with .net? by Anonymous Coward · · Score: 2, Funny

    If not, it's obsolete already.

    1. Re:Does D work with with .net? by Anonymous Coward · · Score: 0

      i would agree its obsolete already, but not because of .NET compliance. .NET is a big joke and will never catch on main stream, even Microsoft has renamed their latest server away from .NET because its causing confusion. IN other words, people dont know nor care about wtf .NET is or ever will be.

  9. I'm ready for F! by Anonymous Coward · · Score: 0

    I've already got the grades for it.

  10. almost up my alley.. by gothamNY · · Score: 5, Funny

    As soon as they get to F, which I am intimately familiar with, I might pick it up..

    1. Re:almost up my alley.. by Anonymous Coward · · Score: 0

      "F" is already a language--a simplified version of Fortran 90.

  11. MOD PARENT DOWN!!!, -1 Redundant by Anonymous Coward · · Score: 0
  12. Contracts by The+Bungi · · Score: 4, Informative
    Nice to see contracts were added to D. They are one of the cooler things in Eiffel. And I'd wish they would have added them to C#.

    And of course, generics.

    Now all it needs is some community support and ECMA goodness. I think it has a good chance of being widely used.

    1. Re:Contracts by __past__ · · Score: 3, Interesting

      Contracts in D seem to suffer from the problem that the language doesn't have a way to enforce that pre- and postconditions are side-effect free. Given that the conditions won't be executed in "production" code, this may introduce ugly heisenbugs itself, when the correctness depends on some (accidental) changes made in the conditions - bugs that are not reproducible in debug mode.

    2. Re:Contracts by aled · · Score: 1

      "heisenbugs". Someone please mod up above post as insightful. The other day tried to put that as short as I can, but heisenbugs is perfect.

      --

      "I think this line is mostly filler"
    3. Re:Contracts by Tony-A · · Score: 2

      Given that the conditions won't be executed in "production" code

      Hmmph. The hardware equivalent would be using like using IBM's stunts of parity traces on all lines and CPU comparators ON THE TEST BOX and NOT ON THE PRODUCTION MACHINE.

      The hardware giveth and the software taketh away.

      If something goes bump in the night, I am much more concerned with discovering it on the production system than the test system. Of course the debuggery stuff exposes the system source so closed-source people won't like it.

  13. Golly by xagon7 · · Score: 2, Insightful

    Aside from the garbage collector and foreward declarations..

    1. interfaces instead of multiple inheritance

    2. Cross platform (somewhat at the moment)

    3. compiled and the ability to go down to assembly

    4. use of try..finally and try..except exception handling. ...damn ...smells like Object Pascal (Delphi) to me..except with "{" instead of "begin"

    1. Re:Golly by lsdino · · Score: 1

      smells like Object Pascal (Delphi) to me..except with "{" instead of "begin"

      That's interesting. I was thinking it smells like C# - except for compiled instead of JITed. The common things being attributes, declaration syntax, & keywords for in/out parameters.

      But really I think what I listed, and what you listed, are just some of the many features of modern languages. What I find strange is that there's just so many different modern languages. It just seems like C/C++ have been dominant for so long, and now there's just a large number of modern languages to choose from.

      But as far as modern languages go, this certainly seems like a nice enough language. It's good that they have included contract support (given that there's no preprocessor support, which is a good way to do contracts in C/C++).

      Unfortunately, given the vast number of modern languages out there, I wonder if this language will ever catch on. Large companies like Sun, Microsoft, and IBM just have so much more money to throw at marketing languages and I don't see them supporting this.

    2. Re:Golly by NortWind · · Score: 2
      That's interesting. I was thinking it smells like C# - except for compiled instead of JITed.

      You knew that MS bought Anders Hejlsberg away from Borland (where he was the main force behind Delphi)so he could architect MS Java^H^H^H^H C# for them, right? So D and C# may have an ancestor in common.

    3. Re:Golly by Anonymous Coward · · Score: 0

      It smells more like Modula-3 to me, and once I figured that out, I lost interest.

    4. Re:Golly by Anonymous Coward · · Score: 0
      It's good that they have included contract support (given that there's no preprocessor support, which is good way to do contracts in C/C++).

      Could you elaborate on this (C preprocessor being a good way to do contracts)? I didn't think preprocessor was bit of a left-over from the ancient times of programming, and more often lead to ugly solutions than not?

  14. bad for FSF by yourmom16 · · Score: 0

    gdc (GNU D Compiler) sounds too much like GDB

    --
    "We have got to make Stan understand the importance of voting, because he'll definitely vote for our guy." - South Park
  15. A Religion by bahwi · · Score: 5, Interesting

    "It doesn't come with a VM, a religion, or an overriding philosophy."

    Not a religion? Neither was C. Neither was Java. Neither was C++. Neither was vi. Neither was Emacs. I think we all know where this is going and that that statement should be considered pure FUD. And a new language covered in FUD is not a good thing, even if it look like a good thing(tm).

    1. Re:A Religion by Anonymous Coward · · Score: 0

      just wait until D becomes popular among a small sect of users. it will become a religion. See, languages don't "come" with religions, their users create a religion.

      I can just see the snobbish comments on slashdot:

      "Well, you wouldn't have that problem if you used D"

      "...and that's how you solve that C++ template problem. Of course, since I use D, I don't have to deal with it."

      "Just use an interface. Oh wait! C doesn't have design-by-contract. I was thinking of D, my bad."

      Whatever.

    2. Re:A Religion by The+Bungi · · Score: 2
      And a new language covered in FUD is not a good thing

      My memory fails me at the moment... I can't recall a language that doesn't have an associated Jihad, Syntax Crusaders, Grammar Flame Corps and a comp.lang.?.advocacy or similar Usenet newsgroup.

      I think what he means is that he's not trying to fight anyone, he's not hyping it and he's not interested in any of those things.

      But as with most languages, eventually it will gain a following and corresponding showdowns at the Usenet Corral. I think there's a Murphy Axiom that covers this.

    3. Re:A Religion by cant_get_a_good_nick · · Score: 2

      I know your point is that none of these were intended to be a religion, just ended up that way. I think Emacs might not quite fit that. Stallman wrote Emacs as the essential first tool in the quest to make the HURD a full OS that could compete and eventually replace UNIX. Granted, a lot of the religion that grew up with EMACS was more functionality and scriptability (and the accompanying bloat) vs. vi, but there was a religion nonetheless.

    4. Re:A Religion by Anonymous Coward · · Score: 0

      forcing an object orientation philosophy is a religion. C can do object oriented programming but it doesn't have to.

    5. Re:A Religion by Billly+Gates · · Score: 1

      I believe emacs emulates the old ITS commands in which the editor was originally written for.

      Many Emacs users get use to the reflexes and commands of emacs so much that unix/linux itself begans to feels awkwards in comparison. This is why many vi users do not like emacs and why emacs users do not like vi or sometimes anything with unix scripting. They just use Emacs macro's instead. For example why go to a shell to use FTP when you can use the internal ftp client?

      Hurd was designed to be unixlike with a few differences in which the os does things. There is no Emacs like shell.

    6. Re:A Religion by bahwi · · Score: 2

      So Emacs is kind of like the second coming of Jesus? =)

    7. Re:A Religion by bahwi · · Score: 2

      *Sigh*
      C vs. C++ vs. D vs. Perl vs. Python

      I'm still waiting for the guys that invented Python to finally say it was really meant as a joke.

      I'm kiddind, I've used Python, it works well.

      As for PHP programmers, of which I mostly do, it's a lot of people coming from the "I learned the tag so now I am a professional web designer" side of it, whereas I came from the C to Perl to PHP side (and actively use all 3). In that way I can imagine complex applications where-as many others are barely learning what an object is. Asking for help is a pain in the ass. At least the programmers of PHP are good, now with built in RTFM support. =)

    8. Re:A Religion by the_Speed_Bump · · Score: 1

      I'll agree with you that C and C++ don't have an overriding philosophy, (and that's one reason why they got where they are today) but it's pretty hard to say that Java isn't designed with object oriented design in mind.

      The most obvious example is goto. It may be "evil" most of the time, but every now and again it's the best way to solve a problem. C, C++, and now D trust that the coder knows when it's time to break the rules.

      --
      "Break out the gin, and the small violin, I'm a raging success as a failure." --Firewater
    9. Re:A Religion by the+gnat · · Score: 2

      Actually, I've heard far too much from whiny Java advocates who seem blind to the language's flaws. I've never heard anyone recommend C because they feel it's the ultimate programming language; they always have some specific reason for it and don't try to be apologists as well. Even the Perl fanboys I've read or talked to don't pretend that it's the only language you'll ever need, though they're far too nonchalant about spaghetti code. Vi and Emacs are usually just things people snipe about for fun.

      Java advocates, on the other hand, seem to think that everything other than a kernel should be written in Java. I've had people who didn't even understand the programs I was trying to write tell me I should be using Java. Lots of people recommend Java for high-performance computing now. Sorry, that's religion.

      Actually, functional programming seems to inspire the same emotions in many people...

    10. Re:A Religion by __past__ · · Score: 2

      No, Emacs is just the Prophet of the New Genera.

    11. Re:A Religion by orthogonal · · Score: 2

      I'll agree with you that C and C++ don't have an overriding philosophy

      C++ has, if not a "overriding philosophy", very well and rigorusly thought out principles of design. If you're interested in what those are, or the question, in general, of what factors must be considered in language design, there's a whole book about it: Stroustrup's The Design and Evolution of C++.

      D&E (for short) can be read almost as a novel; it's engaging and instructive, as it takes the reader on the journey from C to C with Classes to C++ circa 1993. Along the way, many of the questions you might have about why C++ has or does not have some feature are answered.

      If C++ does have an overriding philosophy, a key element of it is that the programmer should not have to pay for any feature he does not use. This is why, for example, all functions are by default not virtual (as in Java and D).

      Another key element is that, for good or ill, C++ had to be backward compatible with C, if it was to gain acceptance by enough programmers.

      Perhaps most importantly, C++ gives the programmer as much control as he needs to do the job as he thinks best (so for example, unlike Java, potentially unsafe pointer operations are available to the programmer), but also attempts to protect the programmer from his inevitable mistakes by means of a more stringent compiler than C's (especially by means of strong type checking and new style casts).

      The fact that so many styles of programming (among them structural, object oreiented, and generic) are supported for so many programming goals (low level drivers to GUIs to some embedded projects) on so many target architectures (how many architechtures/OS are not targeted by least a C++ cross compiler?) is a strong indication the C++'s design has worked, and worked very well indeed.

    12. Re:A Religion by Duncan3 · · Score: 1

      Lets see...

      Perl came with a religion - "do it any way you want, as long as noone else can read your code"

      Java came with a corporation - "do it, just pay us"

      C++ comes with with a paternity test because it's a bastard of C and something, and ended up in need of therapy.

      Of course, every language I know of, and all the sourcecode on the net is written in C, so... as long as I can go Touring with it, I dont care.

      --
      - Adam L. Beberg - The Cosm Project - http://www.mithral.com/
    13. Re:A Religion by aled · · Score: 1

      Shakespeare Programming Language doesn't.
      You know, when someone denies so much what nobody asked, well...

      --

      "I think this line is mostly filler"
    14. Re:A Religion by aled · · Score: 1

      So we can say that Windows is on so many machines is a strong indication that Windows 1.0 design has worked very well?

      --

      "I think this line is mostly filler"
    15. Re:A Religion by scotch · · Score: 2
      I'm no fan of windows, but you could make a statment similar to what you propose. Design and business goals of the windows product line, circa 1988:
      • Abstract interfaces to computer resources (drivers)
      • Run multiple programs at once
      • GUI + windowing metaphor to simplify operation of computer
      • (business)Use and extend monopoly of dos product line

      This are just an example, but I think it's valid. Windows 1.0 did these things poorly, but the design principles were at least partly sound, leading/continuing the dominance of their OS products on desktop computers.

      For C++, the amount and variation of its usage is surely a testament to the philosophy of its design.

      Nice troll, though.

      --
      XML causes global warming.
    16. Re:A Religion by oh · · Score: 2

      There was actully an article I read some time ago on using Java for high performance computing. Basically it tried to show that with a few tweeks to the JVM you could get more then 90% of the performance of C or FORTRAN for a variety of different problems.

      It was really simple stuff, don't do array bounds checking when your compiler could show that it wasn't needed, and change the exception model that forced you to be able to roll back executed instrucitons. It may not have been fully java-spec, but they claimed it delivered the goods.

      I'm not a big fan of Java myself, but it looked legit.

      --
      Democracy isn't about no one telling you what to do. It's about everyone telling you what to do.
  16. Java sans VM? by Dougthebug · · Score: 1

    I took a look at the sample code on the page and have too say it looks alot like Java too me. If it can do everything it says it can then cool, maybe I'll play around with it. But untill some large corperation adopts it and makes it a standard I don't think I'll have the motivation to really learn it.

    1. Re:Java sans VM? by Anonymous Coward · · Score: 1, Informative
      From the D faq:

      Why should I use D instead of Java? D is distinct from Java in purpose, philosophy and reality. Here are some of the ways, in no particular order:
      D has Design by Contract.
      D has unit testing.
      D has lightweight arrays.
      D has lightweight objects.
      D has enumerated types.
      D has typedefs.
      D has function delegates.
      D has inline assembler.
      D has direct access to hardware I/O ports.
      D has a considerably smaller executable size (no VM needed).
      D has out and inout function parameters, i.e. functions can return multiple values.
      D has code execution speed that is as fast or faster than C.
      D has direct support of all C types.
      D has support for complex and imaginary floating point types, ASCII, unsigned types, etc.
      D has arrays of bits.
      D has associative arrays.
      D supports direct interfacing to C and operating system APIs.
      D has version control as part of the language.
      Debug D programs with common, existing C debuggers.
      D has a minimal learning curve for C programmers.
      D has turn-offable array bounds checking.
      D has support for assert()s and debug statements, and other tunable runtime error checking.
      D has no need for external C functions.
      D's full library source means complete control over generated app.
      D's floating point is the best available on the target machine.
      D has strings implemented as arrays, not objects.
      D does not do dynamic class loading.
      D works with your other existing dev tools (make, linkers, debuggers, etc.)
      Java is designed to be write once, run everywhere. D is designed for writing efficient native system apps. Although D and Java share the notion that garbage collection is good and multiple inheritance is bad , their different design goals mean the languages have very different feels.

    2. Re:Java sans VM? by WetCat · · Score: 1

      Looks promising... but
      On my opinion, garbage collection is generally bad, but probably it's because i spent a lot
      of time on projects in which real time was important...
      The language should allow both GC and non-GC
      style of programming.
      That's it. Then you'll be able to polish
      the critical real-time sections and turn off
      GC for them and leave GC for other parts
      for which the execution times are non-essential.

    3. Re:Java sans VM? by Anonymous Coward · · Score: 0

      Actually, you can disable garbage collection in D for parts of your code that you need to run faster. Additionally, the GC can be replaced with a different sort if need be.

    4. Re:Java sans VM? by WetCat · · Score: 1

      Yes, but can I do manual alloc and free in that
      part of the system where GC is disabled?

    5. Re:Java sans VM? by Dougthebug · · Score: 2, Funny

      We'll ya know thats all good, but my point is that if nobody adopts this language, it will not be worth my time to learn it, even if it washes my dishes, does my homework and sucks my... actualy thats about the point I would learn it, even if nobody adopts it.

    6. Re:Java sans VM? by Anonymous Coward · · Score: 0

      Are you really arguing that because D is not a standard, you're going to use Java (another proprietary language)? That makes a lot of sense.

  17. No, it is not. by Anonymous Coward · · Score: 0
  18. Doubles are good... by cperciva · · Score: 2

    now where are the library functions?

    One of the changes since the last time we heard about D is the addition of floats and doubles (32 bit and 64 bit floating-point types, respectively) in addition to the "extended" type (as much precision as available). This is absolutely a Good Thing -- extra precision can be just as bad as insufficient precision, and adding these types allows people to ensure that they're using the right precision.

    It would have been really nice to see the same thing for the math library functions; as it is, the only sin function is an extended -> extended function. IEEE doesn't require determinism on transcendental functions the way it does for arithmetic functions (which, I'm guessing, is why it isn't provided here), but there are times when it would be quite helpful.

    Remember, there are times when getting the right wrong answer is more important than getting the right answer.

    1. Re:Doubles are good... by Ninja+Programmer · · Score: 2
      • One of the changes since the last time we heard about D is the addition of floats and doubles (32 bit and 64 bit floating-point types, respectively) in addition to the "extended" type (as much precision as available). This is absolutely a Good Thing -- extra precision can be just as bad as insufficient precision, and adding these types allows people to ensure that they're using the right precision.
      This is very x86-centric. Most RISC CPUs don't have an extended precision, and some super computers have multiple extended precision modes. x86s are rather unique in their support of exactly one extended precision mode. Oh yeah, and older ARM and x86 processors don't even have FP built-in. So much for "portable".

      • It would have been really nice to see the same thing for the math library functions; as it is, the only sin function is an extended -> extended function. IEEE doesn't require determinism on transcendental functions the way it does for arithmetic functions (which, I'm guessing, is why it isn't provided here), but there are times when it would be quite helpful.
      The reason the IEEE 754 standard does not specify exactness for transcendentals is because there are no provably known finite algorithms for computing them. It is even very difficult to state the bound for how many steps are required for any non-trivial finite set of inputs without computing them all.

      The IEEE 754 standard makes the choices which delivers as much as is possible within reasonable practical limits. When the Java committee foolishly tried to establish their own FP standard ... well, you can read about it here -- once explained, the Java committee backed down and adopted IEEE 754.

      I believe the D guy has probably taken this lesson to heart but probably overstepped by considering the x86 model as the most legitimate model.
    2. Re:Doubles are good... by cperciva · · Score: 2

      This is very x86-centric. Most RISC CPUs don't have an extended precision, and some super computers have multiple extended precision modes.

      You misunderstand. "Extended precision", in D, means "the highest precision type available". For most RISC processors, this would just be double precision; for some others, this might be quadruple precision. Of course, this means that extended precision should only ever be used if you don't plan on moving data between systems.

      The reason the IEEE 754 standard does not specify exactness for transcendentals is because there are no provably known finite algorithms for computing them.

      Of course. But consistency is more important than accuracy -- I'd like to see a standard which says "sin(x) is defined to be the result of running algorithm xyz, and will be within 1.5ulp of the mathematically correct value".

    3. Re:Doubles are good... by SN74S181 · · Score: 1

      Oh yeah, and older ARM and x86 processors don't even have FP built-in. So much for "portable".


      Unless you can point to a current processor, or even a large install base of older processors with this 'problem' I think you're raising a pretty obsolete point there.
    4. Re:Doubles are good... by Ninja+Programmer · · Score: 1
      • Of course. But consistency is more important than accuracy -- I'd like to see a standard which says "sin(x) is defined to be the result of running algorithm xyz, and will be within 1.5ulp of the mathematically correct value".
      Then you can write a taylor series (or any other approximation) for yourself. Either way, you can't leverage the hardware if you want consistency. Different x86s (even different *INTEL* x86s) have used different algorithms which lead to slight differences.

      Since this is an area of open research it seems a little silly to dictate a choice right now, in the standard. In the future mathematicians may prove that sin maps Q\{0} solely to irrationals (probably true), in which case we can at least know that 0.5ulp algorithms are finite. They may state more that can help us implement 0.5ulp within exact bounds. I.e., creating algorithms which are ideally accurate might just be a matter of research. Consider the rather poor choice of "quick sort" as the standard C sorting algorithm (and the initially chosen algorithm for the C++ STL) when "introsort" has now reared its head as a technically superior algorithm.

      Now, lets say you want something that is consistent, yet fast? It may turn out (and its certainly quite possible) that Intel and AMD's transcendentals *are* consistent once rounded down to 64 bits. I think that this is a rather difficult thing to check (unless there are numerous obvious counter examples) and so it probably could not be used. We could choose some taylor or rational series today, and in a few years/decades be laughed at by people who manage to prove/check that AMD and Intel's trancendentals are all identical once rounded down to 64 bits.

      Writing algorithms in software that are within 1.5ulp might be very difficult. The way that AMD and Intel do it, is by actually implementing more than 80 bits FP numbers internally, and just picking rational series with enough terms (and rotating the results from a given specific range, of course.) It may not be possible to match the performance of these routines at 1.5ulp ... maybe we can only get within 10 ulps with these high performance algorithms (if you don't have extra bits in HW, I mean.) Who would ever use such functions?

      The IEEE gives consistent +, -, *, /, sqrt. If you need consistency that badly, then chances are you can compromise on your accuracy, which means perhaps you can accept more than 100ulp in error. That would allow you to use taylor or rational series that are even more truncated, and perhaps even faster than the HW algorithms.

      But perhaps you need other properties like convexity, or something like that -- in which case, perhaps the rotational thing might not work for you. Perhaps you need for the value to never be *over* estimated, in which case a truncated taylor series may be more appropriate than other algorithms.

      In any event, I think the IEEE people have made the best choice. They have created a standard where any other changes to the spec (such as favoring consistency, to speed and accuracy for trancendentals) the ensuing controversy would have prevented the spec from being so widely adopted.
  19. KILL HIM!!!! by DAldredge · · Score: 1

    EMACS not a religion?

    It has most, if not all, the qualities of a religion. :->

  20. The grade the inventor got for the language? by Anonymous Coward · · Score: 0

    Legend has it that C was named after the grade that Brian Kerighan and Dennis Ritchie got for it after they submitted an early spec as a project for a programming languages course.

    Is it the same for the 'D' language, I wonder? =)

    1. Re:The grade the inventor got for the language? by Anonymous Coward · · Score: 0

      I'm personally holding out for T.

      Testicles?

  21. no value classes == no go by g4dget · · Score: 4, Insightful
    Creating object instances on the stack. In D, all class objects are by reference. This eliminates the need for copy constructors, assignment operators, complex destructor semantics, and interactions with exception handling stack unwinding. Memory resources get freed by the garbage collector, other resources are freed by try-finally blocks.

    The reason why C++ is so popular nowadays for numerical, engineering, graphics, and scientific applications is that it supports value classes: classes allocated on the stack, passed around by copying, and represented without any additional overhead. They are used for things like points, points with small coordinate ranges, vectors, 3D rotation matrixes, rectangles, and lots of other types. I don't believe any systems or applications language for which efficiency is a consideration can do without them.

    Why the creators of D think that providing value classes is a problem, I don't understand. Sure, C++ fell all over itself with initializers, but lots of other languages have managed just fine. Pascal has value classes, and so does C#. JavaGrande recognized the lack of value classes as one of the biggest deficiencies in the Java language.

    And it's not something a compiler can just optimize automatically, no matter how good it is: the use of value classes has user visible effects on interfaces and data structures.

    1. Re:no value classes == no go by Anonymous Coward · · Score: 0

      That's what structs are for. It's cleaner to separate structs (data) and classes (objects). In my opinion.

    2. Re:no value classes == no go by Anonymous Coward · · Score: 0
      The reason why C++ is so popular nowadays for numerical, engineering, graphics, and scientific applications is that it supports value classes: classes allocated on the stack, passed around by copying, and represented without any additional overhead.
      You think that all that stuff you mentioned doesn't have overhead? C++ just hides all the overhead, which may or may not be the best for your application. If you use C, at least you know what's going on behind the scenes. If you're going to use C++ for the above mentioned reasons, you'd might as well use Java.
    3. Re:no value classes == no go by ergo98 · · Score: 1

      Structs and classes are the same thing in C++ apart from the fact that the default visibility of structs are public, whereas classes are private.

      Man I miss C++: I've been so caught up in database and higher level language stuff. C++ is definitely my favourite language.

    4. Re:no value classes == no go by Anonymous+Brave+Guy · · Score: 2
      You think that all that stuff you mentioned doesn't have overhead? C++ just hides all the overhead, which may or may not be the best for your application.

      No. In C++, calling a non-virtual method involves no indirection. In languages such as Java, calling any method involves at least one level of indirection, and if you're calling that method all the time but it doesn't actually get overridden in derived classes, that's a potential performance killer.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    5. Re:no value classes == no go by Anonymous Coward · · Score: 0

      wow, you crystallized my thoughts exactly.

    6. Re:no value classes == no go by macshit · · Score: 4, Interesting

      Why the creators of D think that providing value classes is a problem, I don't understand.

      `Value classes' as you term them, amazingly complicate the language; they're one of the reasons that C++ is such a ball of hair.

      If you've got GC, then a reference-only design is a lot simpler. Whether this results in a lot of inefficiency is something of a controversial (in general; I guess that in fields such as embedded/real-time systems systems, perhaps less so).

      However it's clear that many people think that `value classes' are `needed for efficiency,' so arguably they were necessary simply to convince a skeptical and conservative (in the real sense, not the political sense!) audience to switch to C++.

      --
      We live, as we dream -- alone....
    7. Re:no value classes == no go by Anonymous+Brave+Guy · · Score: 2
      Why the creators of D think that providing value classes is a problem, I don't understand.

      Providing what you're calling "value classes" isn't a problem. Nor is providing polymorphic behaviour with virtual functions. However, combining the two is a problem, and probably a top-5 cause of bugs in C++ programs.

      As an aside, the term "value class" is slightly misleading, IMHO. I suspect what you mean is a class that can be stored in-place and accessed without indirection via a pointer, which isn't necessarily the same: you could implement value semantics quite sensibly for a class that is really always accessed via a (hidden) pointer. It would look the same in code, but the implementation would have the same increased flexibility and performance penalty assoicated with pointers to base classes and the like in today's C++.

      Why they couldn't make structs a simple value type that didn't allow virtual methods, and classes a full-blown object type that always looked up a v-table before calling (even if it appeared to have identical value/reference semantics to a struct otherwise) I'll never know. That way, you could have most common uses available trivially, but guarantee safety without nasty things like slicing going on.

      (Yes, yes, some classes have some virtual and some non-virtual methods, and you call the non-virtual ones a lot, so you'd take a performance hit making all of them virtual. However, falling back on the old-but-still-true cliche, this is almost always indicative of a misjudged design, IME. If you took away the ability to do it -- in exchange for removing some of the more horrible behaviour you can inadvertently get in C++ -- then people would simply design around it, with no great loss of expressive power than I can see.)

      And he's wrong about removing the need for copy c-tors and assignment operators, of course (as he is about several other things he wants to change, such as the need to differentiate between . and ->, which breaks down in data structures that use more than one level of indirection). Fundamentally, you can copy a reference/pointer/other indirection to an object, or you can duplicate its value (whatever that means in context). If you choose to make the = operator of your language do the reference one, you just wind up needing a clone() method of some sort for the other case. It might have a different name, but it's still there.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    8. Re:no value classes == no go by Anonymous Coward · · Score: 1, Informative

      Non-virtual methods in Java also involve no indirection. A non-virtual method is one that is private, final, or static. The only difference is:

      in C++, a method is non-virtual unless declared virtual
      in Java, a method is virtual unless declared non-virtual

    9. Re:no value classes == no go by Burton+Radons · · Score: 1

      You're a little confused. D has struct and class, which just makes explicit what C++ does implicitly - to create an object on the stack or in the heap depending upon whether it has virtual methods and is thus a candidate for polymorphism. class are on the heap, struct are on the stack. It also inverts the default protection of class fields and methods (public instead) and defines virtual methods by default - you define a nonvirtual method by using the final keyword. So this part of D is more or less a literalisation of what was in C++. What D lacks here is struct inheritance and constructors.

    10. Re:no value classes == no go by Anonymous Coward · · Score: 0

      I've been so caught up in database and higher level language stuff. C++ is definitely my favourite language.

      You are a sick, sick man.

      I had to use C++ on a project once.. *wince*

      C for low-level stuff.

      High-level languages like PErl for everythign else.

    11. Re:no value classes == no go by Anonymous Coward · · Score: 0

      >you just wind up needing a clone() method of some sort for the other case. It might have a different name, but it's still there.

      Yes, it is still there, however, the compiler can generate it automatically for you.

      It's been a while since I played with it, but I seem to recall that Eiffel had two automatically generated methods called clone() and twin(). One was a shallow copy and the other was a deep copy.

    12. Re:no value classes == no go by rabidcow · · Score: 1

      You think that all that stuff you mentioned doesn't have overhead? C++ just hides all the overhead,

      C++ does not hide overhead. C++ allows the programmer to hide overhead. (If you're using premade libraries, that may be someone else.)

      If you take the raw language, there is a rough correlation between the time complexity of a task and the complexity of the code to do it.

      You can pile tons of code into constructors and destructors and have (sort of) invisible bottlenecks, but in the base language there are very few things like this, and they're well known and easy to avoid.

    13. Re:no value classes == no go by g4dget · · Score: 2
      `Value classes' as you term them, amazingly complicate the language; they're one of the reasons that C++ is such a ball of hair.

      C++ implements them poorly. Lots of other languages don't.

      If you've got GC, then a reference-only design is a lot simpler. Whether this results in a lot of inefficiency is something of a controversial

      It isn't controversial at all: reference counting is ridiculously inefficient for this purpose, and it is quite inefficient even relative to a GC.

      Consider something like "struct { unsigned char x,y; } Pt;". Now, a "new Pt[1000000]" ends up taking 2 Mbytes (2 bytes per element) with value classes and at least a whopping 12 Mbytes (3 words per element) with reference counting.

      However it's clear that many people think that `value classes' are `needed for efficiency,'

      It's clear that many people don't have a clue when it comes to memory management. That includes people who think that garbage collection is inefficient as much as people who think that value classes are not needed.

    14. Re:no value classes == no go by g4dget · · Score: 2
      Providing what you're calling "value classes" isn't a problem. Nor is providing polymorphic behaviour with virtual functions. However, combining the two is a problem, and probably a top-5 cause of bugs in C++ programs.

      I didn't ask for virtual functions on them. These kinds of classes go with overloading and templates.

      As an aside, the term "value class" is slightly misleading, IMHO.

      Well, it's what people have started calling them recently.

      you could implement value semantics quite sensibly for a class that is really

      No, you couldn't. You can emulate immutability through an interface, but immutability is not the point. I actually prefer my "value classes" to be mutable, although that doesn't seem to be the recent trend. What really matters is that they are call-by-value, return-by-value, and copy-on-assignment, as opposed to being passed around as object references. And, pragmatically, what matters is that these kinds of classes or records are packed into arrays, as opposed to involving arrays of heap references.

    15. Re:no value classes == no go by macshit · · Score: 2

      It isn't controversial at all: reference counting is ridiculously inefficient for this purpose, and it is quite inefficient even relative to a GC.

      I certainly agree that reference counting is inefficient -- but I didn't say `reference counting,' I said `reference-only' -- that is, pointers to objects, instead of the objects themselves.

      --
      We live, as we dream -- alone....
    16. Re:no value classes == no go by Mark+J+Tilford · · Score: 1

      <in Java, a method is virtual unless declared non-virtual>>

      That's not necessarily true in Java; I've heard the HotSpot VM has some tricks so that a method is non-virtual unless it is overridden by a class which has been loaded.

      --
      -----------
      100% pure freak
    17. Re:no value classes == no go by Anonymous+Brave+Guy · · Score: 2
      Non-virtual methods in Java also involve no indirection. A non-virtual method is one that is private, final, or static. The only difference is:

      ...that in C++, you can have non-virtual methods that aren't one of the above? :-)

      I see your point, but the difference is more than just whether methods are virtual by default. In C++, you can have a public (or protected) non-virtual method, for example, and a few OO idioms some people are currently experimenting with rely on this.

      Derived classes can also override a non-virtual method; you then have different behaviour depending on whether your object is addressed directly or via a pointer-to-base, for example. Sometimes this can be useful, but it does provide for some unfortunate loopholes in the type system as well.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    18. Re:no value classes == no go by vlad_petric · · Score: 2
      And it's not something a compiler can just optimize automatically

      All local variables whose references are not passed/copied can very easily placed on the stack by the compiler (bypassing the GC altogether). This has to be done conservatively, of course, so quite a few optimization oportunities would be missed this way. But I believe it's a very good compromise (efficiency is only one of the design goals of most programming languages, power and clarity are IMHO more important)

      --

      The Raven

    19. Re:no value classes == no go by Anonymous+Brave+Guy · · Score: 2
      I didn't ask for virtual functions on them. These kinds of classes go with overloading and templates.

      Sure, I appreciate that. I was just pointing out the big drawback to providing these types in an OO language if the rest of the feature set isn't geared up to work with them, not challenging the usefulness of the types themselves.

      And yes, I realise that "value class" is a recent term. It goes along with "boxing" and such. They're all equally misrepresentative and horrible! :-)

      you could implement value semantics quite sensibly for a class that is really
      No, you couldn't. You can emulate immutability through an interface, but immutability is not the point.

      Of course you can:

      MyType x;
      MyType y = DoSomethingWith(x);

      Unless I tell you, you can't possibly know what the underlying model is for MyType, even if I tell you that all of the above uses pass/return-by-value and copy-on-assignment semantics. MyType could be a simple pair of co-ordinates on a stack, or a (hidden) pointer to a full-blown OO type with polymorphism and all the trimmings.

      Immutability really has nothing to do with this, AFAICS. As you say, that's just a property of the interface you give your type, and it's orthogonal to the reference/value distinction. The point about arrays is well-taken, but that also relates to the underlying implementation of your type, and not to whether it has reference or value semantics.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    20. Re:no value classes == no go by Anonymous+Brave+Guy · · Score: 2
      Yes, it is still there, however, the compiler can generate it automatically for you.

      No it can't!

      How can my compiler possibly know what a "deep copy" is for my particular data structure? How does it know which references are to be duplicated, and which are to a common database that all objects of this type share? How does it deal with circular data structures?

      There is no generic way to write a deep copy operation, which is why you have the concept of this function in the first place. If all you want is trivial deep copying of everything, just use suitable smart pointer classes instead of raw pointers in C++ (which is almost always a good idea anyway) and then C++ will generate these things for you as well.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    21. Re:no value classes == no go by Major+Woody · · Score: 0

      > You're a little confused. D has struct and class,
      > which just makes explicit what C++ does implicitly
      > - to create an object on the stack or in the heap
      > depending upon whether it has virtual methods and
      > is thus a candidate for polymorphism.

      There is nothing implicit about where C++ creates objects. If you instantiate it using new, it's generally on the heap (unless you override the default behavior of operator new). Otherwise it is on the stack. It doesn't matter if it has virtual methods or not.

    22. Re:no value classes == no go by Anonymous Coward · · Score: 0
      Yes and no. It does not become non-virtual semantically, but HotSpot may be able to determine it can still be inlined for objects of certain type. This may require "un-inlining" later on (if a new class is loaded in that does override methods previously 'speculatively' inlined).

      So, from performance POV, the virtuality overhead can sometimes be removed, with enough analysis.

      Interestingly enough, it is also possibly to do something similar to do stack allocation (instead o heap), if enough control flow analysis is done to make sure no pointers 'escape' current scope (which could lead to dangling pointers to stack). It's just that both kinds of optimizations are fairly advanced and intricate to implement.

    23. Re:no value classes == no go by Burton+Radons · · Score: 1
      I spoke confusingly - I should have said "to add the vtable pointer and the implicit layout change this results in" instead. In addition, D ties virtual objects with heap allocation.

      Whether objects with virtual methods on the stack are necessary is an issue unrelated to the original post.

    24. Re:no value classes == no go by bratmobile · · Score: 2, Informative
      `Value classes' as you term them, amazingly complicate the language; they're one of the reasons that C++ is such a ball of hair.


      Wrong. You are confusing local-scoped (stack) value types with explicit memory management (malloc/free new/delete). The thing that makes life so difficult in C++ is explicit memory management -- the programmer has control over when memory is freed, and therefore, usually gets it wrong.

      Look at the value type system in C# / .Net. It's very, very simple, simplifies a lot of the base class library (common classes like Point and Rectangle), and just makes sense.

      I love garbage collectors. However, putting undue pressure on them will reduce their performance. And memory management performance is one of the hot issues between traditional unmanaged execution (C/C++ malloc/new/etc.) and managed memory (GCs).

      Value types do not complicate GC design. They are completely orthogonal to GC design -- by definition, they simply don't involve GC at all.

      Again, look at value types in C# / .Net. Very simple, very effective, and with absolutely no penalty for use.
    25. Re:no value classes == no go by g4dget · · Score: 2
      Unless I tell you, you can't possibly know what the underlying model is for MyType

      First of all, in Java, that's not true because Java allows me to compare and hash object references. So, I can actually tell whether two objects are "the same" even if I can't change either of them. (Of course, via reflection, I actually can.)

      MyType could be a simple pair of co-ordinates on a stack, or a (hidden) pointer to a full-blown OO type with polymorphism and all the trimmings.

      Again, the point behind value classes is not abstraction or implementation flexibility or anything like that. The point is to provide something that allows me to run programs that otherwise wouldn't fit into memory because they take an order of magnitude more memory and an order of magnitude longer to run.

      The point about arrays is well-taken, but that also relates to the underlying implementation of your type, and not to whether it has reference or value semantics.

      No, it does not. You cannot even come close to the efficiency of a value class by fiddling around with the internal implementation of an object.

    26. Re:no value classes == no go by g4dget · · Score: 2
      Sorry, I misread that. However, as you can read from my response, I responsed to both cases.

      Language designers have thought that it doesn't matter or that they can just optimize it away over and over, and it's been a flop every time. Either they've had to add the feature after the fact, with much pain, or numerical users have abandoned the platform quickly. Eiffel has had to add "expanded classes". JavaGrande has recommended value classes for Java. And languages that don't have it end up being as bad as Fortran 77 for numerical programming.

    27. Re:no value classes == no go by SpryGuy · · Score: 1

      I used to love C++

      I've been using Java for two years now, and don't want to ever go back. The tools are vastly superior, and the productivity boost I gained is phenominal. Hell, just getting rid of having to muck with header includes and include ordering in large projects is a huge win. The rest was sauce for the goose.

      Now I'm hoping I never have to go back to C++.

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
    28. Re:no value classes == no go by Anonymous+Brave+Guy · · Score: 2
      The point about arrays is well-taken, but that also relates to the underlying implementation of your type, and not to whether it has reference or value semantics.
      No, it does not. You cannot even come close to the efficiency of a value class by fiddling around with the internal implementation of an object.

      Um... Sorry, you've lost me. Manipulating an array of pointers-to-objects instead of objects in-place -- which is all that's required to support value semantics but an underlying indirection for polymorphism purposes -- requires exactly one extra indirection per array access. In isolation, that's negligible. If you're accessing the objects large numbers of times in a loop, it's potentially significant, but in that case it's possible to optimise away most of the overhead on the major processor architectures in use today. Claims of massive overhead due to polymorphism have been greatly exaggerated, and you certainly can get very close to the performance of your "value classes" while maintaining that level of indirection.

      The expensive thing with polymorphic class types is the use of virtual methods (because they typically require at least two levels of indirection to look up, which is harder to optimise away in high frequency code) and multiple/virtual inheritance (where you potentially have a much larger number of indirections). Even then, though, it would require fairly contrived code for this to be a particularly significant overhead.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    29. Re:no value classes == no go by g4dget · · Score: 2
      Um... Sorry, you've lost me. Manipulating an array of pointers-to-objects instead of objects in-place -- which is all that's required to support value semantics but an underlying indirection for polymorphism purposes -- requires exactly one extra indirection per array access.

      The indirection may or may not be significant (it can kill you on cache effects), but all those objects need to be allocated and deallocated, all that extra space needs to be initialized, etc. Most instances of value classes are created, their fields accessed once, and then they become garbage instantly. The other place where value classes matter, inside arrays, they are packed tightly and use up a fraction of their reference equivalents.

      If it didn't matter, as you contend, then we might as well use heap allocated "Integer" and "Float" classes for everything in Java or C#. We don't because it's too slow and eats up way too much memory.

      If you don't believe me, try implementing your own "Complex" class with heap allocation and compare its performance to C/C++ "complex".

    30. Re:no value classes == no go by Anonymous Coward · · Score: 0

      Now, a "new Pt[1000000]" ends up taking 2 Mbytes (2 bytes per element) with value classes and at least a whopping 12 Mbytes (3 words per element) with reference counting.

      Languages that are stupid enough to reference-count chars deserve to go down like a lead balloon.

    31. Re:no value classes == no go by Anonymous+Brave+Guy · · Score: 2

      Before I post this, let me start by saying that I've never disagreed with you that value classes are useful and more efficient than their reference equivalents. I'm simply contending that the difference isn't nearly as wide as you make out for most purposes.

      The indirection may or may not be significant (it can kill you on cache effects),

      Theoretically, yes, under some circumstances. In practice, it's unlikely.

      but all those objects need to be allocated and deallocated, all that extra space needs to be initialized, etc.

      Just as it does with value classes on the stack. The overhead is comparable in each case.

      Most instances of value classes are created, their fields accessed once, and then they become garbage instantly.

      Where you're using a declarative programming style and this occurs a lot, there's nothing to stop an optimiser from playing the same tricks with a reference class. Chances are neither ever makes it outside of registers and into RAM in many of these cases anyway.

      The other place where value classes matter, inside arrays, they are packed tightly and use up a fraction of their reference equivalents.

      But that's simply not true. It's very likely that your array will be padded so the offset of each element coincides with the natural alignment of the processor, for example. Many low-level-friendly languages explicitly provide for this (and/or a similar form of padding within structs/classes themselves) in their specifications.

      As I said, I'm not contending in any way that value classes don't have their place. Obviously they do, particularly for trivial data types such as the integer, floating point or complex numbers you mentioned. However, there are usually relatively few such types in a program, even quite a large one. In contrast, if the program is built around a reasonably pure OO design, there will be many more complicated classes. It often makes sense to force these to be indirected for future-proofing purposes, rather than pretending they are used in the same sort of way as a genuine value class, which they typically are not.

      Of course, that can improve performance as well. You no longer need to remember to pass a const MyType & in C++ just to avoid an implicit copy construction every time you pass a parameter by value, for example.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    32. Re:no value classes == no go by g4dget · · Score: 2

      "Just as it does with value classes on the stack. The overhead is comparable in each case."

      "It's very likely that your array will be padded so the offset of each element coincides with the natural alignment of the processor, for example."

      How many heap space the following C++ code end up using on a standard 32bit machine? How many function calls does the allocation take? How much memory gets written to?

      struct { signed char x; signed char y} P;
      P *ps = new P[1000000];

      (Hint: each P takes up 2 bytes inside the array.)

      Now, how many bytes does the following Java code end up using on a standard 32bit machine? How much time does it take to allocate and clear those objects?

      class P { public byte x; public byte y; }
      P ps = new P[1000000];
      for(int i=0;i<1000000;i++) ps[i] = new P();

      (Hint: each P takes up at least 16 bytes of heap space, plus the 4 bytes to hold the reference to it.)

      Get it?

      "However, there are usually relatively few such types in a program, even quite a large one."

      There are also relatively few uses of "main()"; however, that doesn't make that language feature any less important.

      "Where you're using a declarative programming style and this occurs a lot, there's nothing to stop an optimiser from playing the same tricks with a reference class."

      Sorry, but you're wrong. A really smart, global optimizer can eliminate some heap allocations from some expressions, but it can't change array representations and it can't optimize this across most method or function calls.

      "It often makes sense to force these to be indirected for future-proofing purposes,"

      You can force whatever you like on your fellow programmers on your own projects. However, if a language wants to be suitable for modern, high performance numerical, graphics, and systems software development, it must support value classes. D and Java don't. C, C++, and C# do.

    33. Re:no value classes == no go by Anonymous+Brave+Guy · · Score: 2

      I'm confused by your arguments. I thought we were discussing whether UDTs could be value types, not some strange rule that even a lowly int must be accessed by reference. I will also repeat, since you seem to maintain that I'm disagreeing with you, that I think value types are very important in a language, and my only disagreement is your assessment of the performance penalty associated with using reference types.

      How many heap space the following C++ code end up using on a standard 32bit machine? How many function calls does the allocation take? How much memory gets written to?
      struct { signed char x; signed char y} P; P *ps = new P[1000000];
      (Hint: each P takes up 2 bytes inside the array.)

      If you actually believe that hint to be true, I suggest you check again. On almost any current 32-bit platform, sizeof P will be 8 bytes, not 2. You will need around 8MB to store the array, as opposed to 12MB to store the equivalent data using an array of pointers/references to such objects. That's only a 50% addition, and you've carefully chosen the worst possible case: a large array of objects that are as trivial as they can possibly be without being built-ins. Once again, I don't disagree that it's better to have a value type available in such cases, but claiming some sort of radical performance difference in either memory footprint or execution time seems... excessive.

      There are also relatively few uses of "main()"; however, that doesn't make that language feature any less important.

      Of course it does. It means you should place far less emphasis on how to get main right than on how to write other functions, since you'll be writing other functions far more often, and consequently it requires more effort to repeatedly work around any problems with the mechanism.

      Sorry, but you're wrong. A really smart, global optimizer can eliminate some heap allocations from some expressions, but it can't change array representations and it can't optimize this across most method or function calls.

      You were talking about simple value types that were essentially created, accessed once, and then destroyed. Nothing in your paragraph above fits in that context. Value types that are placed in arrays or passed to functions typically do not fall into this category.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    34. Re:no value classes == no go by g4dget · · Score: 2

      "If you actually believe that hint to be true, I suggest you check again. On almost any current 32-bit platform, sizeof P will be 8 bytes, not 2."

      Ummm--you don't have a clue. Try it out yourself.

      $ cat foo.cc
      #include <stdio.h>
      struct P { signed char x; signed char y; };
      int main(int argc,char **argv) {
      P x[16];
      printf("%d\n",sizeof x);
      }
      $ g++ foo.cc
      $ a.out
      32
      $

      "you've carefully chosen the worst possible case: a large array of objects that are as trivial as they can possibly be without being built-ins"

      Yup, and that's exactly the case that value classes and structs are used for in C, C++, and C#. Together with overloading, it lets me implement numerical types that look like built-ins and work just as efficiently: fixed point numbers, small vectors, etc. Those are the meat of a lot of numerical, signal processing, and graphics code.

    35. Re:no value classes == no go by Anonymous+Brave+Guy · · Score: 2

      That's why I said "almost any": the GCC C++ compiler is one of the few exceptions that appears to avoid padding out to natural alignment by default, at least in any version I've seen. However, in my experience, it is in a small minority. Further, by failing to align the data members on natural boundaries, you typically take a performance hit.

      By the way, I'm about to go into the office, where I work on an industry-leading, mathematically-intensive product whose whole purpose in life is the efficient manipulation of complex data structures to implement advanced mathematical algorithms with minimal run-time overhead. It's written in C++, and ships on a dozen different platforms (mostly 32-bit) using 15+ different compilers. So before you go telling people that they don't know what they're talking about, perhaps you should ask where their information came from, or consider checking more than a toy g++ program yourself if you're going to generalise. :-)

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    36. Re:no value classes == no go by g4dget · · Score: 2
      the GCC C++ compiler is one of the few exceptions that appears to avoid padding out to natural alignment by default, at least in any version I've seen. Further, by failing to align the data members on natural boundaries, you typically take a performance hit.

      The elements are bytes and the whole structure is 2 bytes. The packed representation is fully aligned, both as a whole and in terms of its elements. Some C++ compilers may well pad this anyway, but if they do, they have a quality of implementation issue (even if they are nominally within ANSI specs).

      In any case, you are getting hung up on a minor point. Even if the structure contained a single 32bit word, there would still be severalfold space and time overhead.

      People have tried for more than thirty years to make heap allocated objects like this fast enough and they have never succeeded. Language design would be a lot easier if they head.

      By the way, I'm about to go into the office, where I work on an industry-leading, mathematically-intensive product whose whole purpose in life is the efficient manipulation of complex data structures to implement advanced mathematical algorithms with minimal run-time overhead.

      Oh goodie.

      It's written in C++, and ships on a dozen different platforms (mostly 32-bit) using 15+ different compilers

      Well, that is just too bad for you. I lost my ambition to cater to the idiosyncracies of more than one C++ compiler more than a decade ago. My code is portable, but it's tuned only for GNU C++. That has turned out to be quite sufficient for all commercial and non-commercial purposes I have ever encountered.

    37. Re:no value classes == no go by Anonymous+Brave+Guy · · Score: 2

      OK, I give up. You claim to be concerned about performance, you worry about cache misses and indirections, yet you ignore one of the most common but subtle performance issues of most contemporary architectures. You obviously don't understand the issue of padding on modern architectures: we're talking about 32-bit boundaries on 32-bit systems here, not byte alignment, and the reason we're talking about that is the slow access times to memory that is not so aligned. The QoI issue with compilers is with those that don't align this way for good performance where appropriate, not with those that do.

      You maintain that using indirection can cause a "severalfold space and time overhead" when on most systems, it only doubles the space overhead even in the worst possible case. Looking it up involves a single extra indirection, and that only the first time under typical conditions, which is hardly a "severalfold" performance hit.

      And you tell me all about how no-one has solved this problem well enough in thirty years, yet Java is sitting here as one of the most successful (in terms of industry penetration, volume of code written, etc.) languages of the past decade.

      You tell me that you write code that's portable, but tuned only for GNU C++. If performance mattered to you that much, you'd surely be aware that the price you pay for keeping GCC portable is that its output code can run several times slower than that generated by a compiler that's aware of the issues we've discussed and accounts for them properly.

      Finally, you belittle the job that I do and attack me personally over my knowledge of this subject, in spite of the fact that these issues are directly relevant to me, day in and day out, whereas you clearly aren't working in a performance-driven environment at all.

      If it pleases you to post such comments, you go right ahead, but it doesn't make your facts any more correct or your arguments any more sensible, no matter how many times you repeat yourself, how often you provide demonstrably incorrect information, or how often you insult the person disagreeing with you.

      The facts remain that while value types are certainly useful, and faster than reference types, they are not essential for most work, and not having them is not a sufficient reason to rule out a particular programming language for most developments.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    38. Re:no value classes == no go by g4dget · · Score: 2
      You claim to be concerned about performance, you worry about cache misses and indirections, yet you ignore one of the most common but subtle performance issues of most contemporary architectures. You obviously don't understand the issue of padding on modern architectures: we're talking about 32-bit boundaries on 32-bit systems here, not byte alignment, and the reason we're talking about that is the slow access times to memory that is not so aligned.

      Even if alignment did result in faster execution in this case, I don't need the compiler second guessing me. If structure members are packed to their natural alignment, like GNU C++ does, I have an easy choice. If structure members all start on word boundaries, I don't. Of course, loops involving the default GNU C++ layout are at least twice as fast (just measured it on both Athlon and PPC).

      You see, on modern machines, memory bandwidth matters a whole lot more than alignment within a word: it takes a long time for the processor to get a word from memory. Once loaded, the processor can manipulate bytes and shorts in it quickly. What is costly is non-aligned loads that cross word boundaries because they result in two words being loaded from memory.

      You maintain that using indirection can cause a "severalfold space and time overhead" when on most systems, it only doubles the space overhead even in the worst possible case.

      No matter how you do it, it costs more to allocate a word on the heap than just the word on the heap and the pointer to it, even in C++. And in languages like Java, each heap object has a three word header (well, maybe they got that down to two by now).

      If performance mattered to you that much, you'd surely be aware that the price you pay for keeping GCC portable is that its output code can run several times slower than that generated by a compiler that's aware of the issues we've discussed and accounts for them properly.

      I don't "pay a price" for keeping GNU C++ code portable. In any case, 4 Gbytes is not a lot of address space these days, and space often matters much more than time anyway: if the data structures don't fit, it doesn't matter how fast it runs on small problems. Even a factor of 2 in space makes a huge difference.

      Finally, you belittle the job that I do and attack me personally over my knowledge of this subject, in spite of the fact that these issues are directly relevant to me, day in and day out, whereas you clearly aren't working in a performance-driven environment at all.

      I have no idea what job you are doing because you haven't told us. And trying to pull authority while being anonymous just is silly, in particular when you are also wrong.

      OK, I give up.

      No need for you to give up programming over this. But you might seriously consider writing some test cases for your "interesting" theories. Maybe you'll even improve your company's mathematical software product; there is probably a lot of room: most commercial numerical software is awful.

  22. so it's like.. by russellh · · Score: 0

    so it's like C++ but without the stuff that gives compiler writers keyboard indentations on their foreheads.

    --
    must... stay... awake...
  23. ECMA goodness? by Anonymous Coward · · Score: 0

    I don't see what adding Javascript support to the language will help.

    1. Re:ECMA goodness? by The+Bungi · · Score: 2

      Uhhh... ECMA doesn't just do JavaScript. I meant registering the language with ECMA so it can become standardized.

    2. Re:ECMA goodness? by Anonymous Coward · · Score: 0

      I don't understand how Javascript fits into this equation at all. It seems to me that trying to graft ECMAScript onto D is a huge hack.

    3. Re:ECMA goodness? by The+Bungi · · Score: 2

      Thanks for playing.

  24. Re:Shouldn't it be 'E'? (new language idea!) by Anonymous Coward · · Score: 0

    Hello World in "porn":

    10. Jizz "Legs Spread!";

  25. Thou shalt use objective-C by jpt.d · · Score: 4, Interesting

    Maybe off topic, but 'yet another language'? Where c++ may do too much: Templates Operator Overloading Go back to a simpler time... then giveth objective C! It has the 'named' parameters (in its own way), arbitrary message handling (methods to everybody else), hell even a traceback! Not even java has operator overloading, there maybe a reason.... (reduce ambiguity?) We need simpler languages, not progressively 'general purpose' languages... a 'CISC' language vs. 'RISC' lange... Objective C is just that... simple.

    --
    What we see depends on mainly what we look for. -- John Lubbock Now search for that bug slave!
    1. Re:Thou shalt use objective-C by aminorex · · Score: 2

      D has usable associative arrays and regex built in.
      D is capable of running fast. D doesn't weld
      two alien syntagma into one rough beast.

      --
      -I like my women like I like my tea: green-
    2. Re:Thou shalt use objective-C by inerte · · Score: 1

      We need simpler languages

      You can only say this because you know other complicated languages.

      Simple is subjective. Python and PHP are simple, yet, they can't run a fullscreen animation. The simplicity of any task depends of your goal.

      Why another language? Because it might solve your problem. "YAL" is a mutant which might lead us to evolution.

    3. Re:Thou shalt use objective-C by bahwi · · Score: 2

      Hallelujah! Hallelujah! Praise the Obj-C!

    4. Re:Thou shalt use objective-C by Anonymous Coward · · Score: 2, Interesting

      I realize that you Mac zealots were just recently introduced to Objective-C and all, but it's really not that impressive. If you really want linguistic simplicity why don't you just use Smalltalk? Why all of those senseless complexities of C? Why not all of the reflective and introspective power of Smalltalk with the simplicity of garbage collection, transparent persistency, and perhaps one of the easiest languages ever created?
      If you're going to go for the slow-ass dispatch of Objective-C methods, you might as well just leverage decades of optimizing VM work and get blocks and all of the other powerful concepts ignored by Objective-C.

    5. Re:Thou shalt use objective-C by Anonymous Coward · · Score: 0

      Because everything done in between those method dispatches is really, really fast.

    6. Re:Thou shalt use objective-C by Anonymous Coward · · Score: 0

      What, you mean sending other messages?

      Objective C is not a performance language, and it's not a powerful dynamic language. It's a half-assed mixture of both.

    7. Re:Thou shalt use objective-C by RetroGeek · · Score: 2

      Not even java has operator overloading, there maybe a reason

      Operator overloading is a "BAD THING" IMHO.

      Which is more readable:
      newCar = oldCar + dealerCar;
      or
      newCar = oldCar.cloneWithOptions(dealerCar);

      Yes the first takes less time to type in, but the second is MUCH more self-documenting.

      --

      - - - - - - - - - - -
      I am a programmer. I am paid to produce syntax not grammar. Deal with it.
    8. Re:Thou shalt use objective-C by j7953 · · Score: 2
      Operator overloading is a "BAD THING" IMHO.
      Which is more readable:
      newCar = oldCar + dealerCar;
      or
      newCar = oldCar.cloneWithOptions(dealerCar);

      Well, duh. You're not supposed to misuse operator overloading simply to safe yourself from some typing. You can also get unreadable code by using stupid method names, e.g. when you want to clone a Car object and your language of choice doesn't permit overloading the "+" operator, you could just as well use a method called "add" instead of using the "+" operator, but that won't make your code any more or less understandable. When you aren't adding things, you shouldn't use something that makes your code look as if you did.

      newCar = oldCar.add(dealerCar);
      doesn't use operator overloading, but when what you're really doing is cloning things, it's still less readable than
      newCar = oldCar.cloneWithOptions(dealerCar);

      However, operator overloading can be useful when used correctly, i.e. use the "+" operator for adding only, use the "*" operator for multiplying only, etc. For example I think that
      matrixC = matrixA + matrixB;
      is more readable than
      matricC = matrixA.add(matrixB);

      Oh, by the way, Java does have operator overloading, but only in predefined ways. E.g.the "+" operator is used both for adding numbers and for concatenating strings.

      --
      Sig (appended to the end of comments I post, 54 chars)
    9. Re:Thou shalt use objective-C by jbolden · · Score: 2

      Operator overloading offers the ability to create very natural looking operations on complex data.

      Say for example you are working with polynomials over a finite field:
      polynomial_over_finite_field a,b,c

      Which more is natural:

      c = a+b or
      c = finite_polynomial_add(a,b);

      alt: c=finite_polynomial_multiply(a,b);
      c = a*b;

    10. Re:Thou shalt use objective-C by wfrp01 · · Score: 2

      Or perhaps Objective CAML. I don't know as much about it as I'd like, but looks very interesting. Supports both functional and imperative programming, objects, etc. You can run code interactively, compile machine independant bytecode, or for speed, architecture specific binaries.

      And check out it's position on this performance shootout.

      --

      --Lawrence Lessig for Congress!
    11. Re:Thou shalt use objective-C by Anonymous Coward · · Score: 0

      Funny, I'm using Python to run fullscreen animation right now. Fancy that.

    12. Re:Thou shalt use objective-C by Anonymous Coward · · Score: 0

      I like O'Caml. Pattern guards, currying, GC, fairly efficient, modules, you can easily extend the syntax, and other such things. The syntax is a bit icky, but you adapt. I don't particularly like the C++-like class model, but I'm sure there are a lot of people that would. It's type system can be sort of restricting, and I look forward to modern G'Caml.

      Another really nice language, which is much easier to read and write is Haskell. None of the compilers are nearly as good as OCaml's, and some people will find the means of programming imperatively in it offensive, but I'm rather fond of its type system, and the proposals for Haskell revisions.

    13. Re:Thou shalt use objective-C by Anonymous Coward · · Score: 0

      Exactly, that's why I rarely use operators at all.

      I have a template class called add.

      like:

      x = add(5, 6)

      or

      blah = multiply_return_double(12.566, 3)

  26. D Language by Anonymous Coward · · Score: 0

    A
    B
    C
    [D]
    E
    F

    Almost there! Only two more innovations and the developers will finally have run out of alphabetic excuse for their shitty software...oh wait.

  27. Re:So it's... Java. by The+Bungi · · Score: 2

    Every time someone comes up with a new GC'ed language that has C-ish syntax and a VM someone has to say it's a Java rip-off. Look at the specs, understand the differences, give it a rest.

  28. D has already been taken... by fidget42 · · Score: 1

    TeleSoft/Alsys/Aonix have had, for quite some time, a language called D that is used to describe the operation of events and manage dialogs (D = dialog) in TeleUSE. Its been around for 10 years, so so.

    --
    The dogcow says "Moof!"
  29. The difference between a runtime and VM by ObviousGuy · · Score: 2, Insightful

    A runtime is a binary library that exports certain functions. The Win32 and glibc runtimes are a couple that Slashbots are probably somewhat familiar with. They have specialized routines that facilitate some kind action that the language itself does not directly support.

    A VM is a completely different beast. It is a complete runtime environment for your program. Whereas a program that uses a runtime is typically compiled into machine code, a program that uses a VM is typically compiled at runtime from source (Perl) or parsed into memory from bytecode (Java).

    It has become fashionable to call runtimes "VMs", especially in the Unix world where multiple APIs are supported on the same kernel, but it is a misnomer. (You'd expect the pedantry that is so prominent in the Unix culture to correct this, but I digress.)

    --
    I have been pwned because my /. password was too easy to guess.
  30. Blasphemer!! by Billly+Gates · · Score: 4, Funny
    VIM is the one true editor you pagan!

    EMACS= Emacs Makes A Computer run Slow. Didn't they teach you that in seminary!

    VIM is the one true religion grrr editor because its just an editor and does not conflict with the way unix does things.

    May you burn in the utmost pits of hell for your statement of such blashpemic purporations.

    1. Re:Blasphemer!! by MalleusEBHC · · Score: 2

      Pff, the only reason vim keeps believers in its "religion" is because if you accidentally start it you won't be able to figure out the damn command to quit it!

      Also, as an avid emacs user I must correct the FUD in your post. Even the most die hard of my kind know that emacs stands for Escape Meta Alt Control Shift.

    2. Re:Blasphemer!! by Alioth · · Score: 2

      I prefer

      emacs = Eight hundred Megs And Constantly Swapping
      or
      Eventually Mallocs All Core Storage :-)

    3. Re:Blasphemer!! by larien · · Score: 1

      Of course, it use to be "Eight Megs And Constantly Swapping", but given that most people have considerably more than that in their graphics cards, it's a little outdated.

    4. Re:Blasphemer!! by tijnbraun · · Score: 1

      of course it should be: Escape Meta Alt Control Shit.

    5. Re:Blasphemer!! by Anonymous Coward · · Score: 0

      Bah, y'all know emacs is the one true editor. You are just having sour grapes about using an inferior program. A user interface slapped onto a line editor, that's what vi is. VI = visual interface, LOL. I wouldn't be caught dead using it. They should have named it :q! so that people who accidentaly start it easily remember how to quit :^)

    6. Re:Blasphemer!! by Anonymous Coward · · Score: 0
      Emacs Makes All Computing Simple.


      VI VI VI: The editor of the beast.

    7. Re:Blasphemer!! by Anonymous Coward · · Score: 0

      vi is the only true editor.
      vim is to vi what D is to C.

  31. Re:Steelers suck! by The+Bungi · · Score: 1, Offtopic
    Only coach in the NFL who lives in a trailer park

    Wow. It must be exciting to have an NFL coach as a neighbor!

  32. D Language from early 80's by MichaelCrawford · · Score: 5, Interesting
    A friend of mine at CalTech named Mike Roberts created a language called D when he was in high school, because his parents wouldn't shell out for a BASIC compiler for his DOS PC. We were both in the high school class of '82 so this would have been around '81 or so.

    Unfortunately, his original D compiler was written in BASIC, which he ran interpreted, so compilation was slow. In order to speed up the interpreter, he used the sort of "source code compression" that is illustrated at Chuck's Power Koding - removing any unnecessary spaces, using long source lines and having as few actual lines as possible.

    (This kind of ancient interpreter didn't use byte codes - if you looped ten times, you'd parse the loop's source code ten times!)

    We suggested that he rewrite his D compiler in D so he could get it to compile faster. He decided to do that, and worked really hard at it but got it working after some time.

    As a complication he improved the language, but it meant that his old compiler wouldn't compile the newer kind of D code. I think what he did was make two revisions of the D-written compiler, one written in the old syntax that would understand the new, but could be compiled by the BASIC version and then an update that was written in the new D that could compile itself.

    It was a sort of mix of Pascal but with lots of convenient stuff like BASIC string handling mixed in. I don't think the language would have made any computer scientists happy - D was designed to suit Mike's personal style.

    He used it at first to write an Adventure-style game (a text adventure) that he and another friend designed.

    Later he wrote a text-adventure compiler, where he could write a specification file for a text adventure, process it, and an executable file for a text adventure would be generated.

    He didn't have to get a real summer job because he was selling these generated games to game software publishers!

    Mike was an amazing programmer. He taught me a lot of what I knew about C and x86 assembly early on.

    This was all on 640 kb 8088 DOS PC's that were outfitted with whizzy 10 MB hard drives. The students in the computational physics lab were expected to use the hard drives only during class, and to store their personal files on floppy when we weren't actively working at the PC's.

    So his D language compiler would fit on a floppy. The old 5 1/4" inch kind, that really flopped. I think they stored 360kb.

    I wonder whether we would all be better off if programmers designed their own personal languages just to suit their own personal styles. Yes, there would be portability problems but wouldn't we be more productive?

    I got my own chance to hack a whacky compiler. This was a team effort though and I was just a contributor. Star Sapphire Common Lisp manages to run a complete common lisp environment with MicroEmacs on a 640kb DOS 8088 PC.

    The way it does that is by swapping to an 8 MB backing store file. But the 8088 doesn't have an MMU, you say? That's right - we operated the virtual memory manually, by writing C code that would explicitly get or put each lisp cons from or into the VM system with a function call.

    It made it ... interesting ... to operate on complicated data structures. I designed the implementation of the lisp scoping rules, among other things.

    Oh yeah, and I was the source code control system and project manager. We didn't have a network - networks were way too expensive in 1986. What I did was wait until late when all the other programmers went home, copy the changes off all their machines onto floppy, integrate them on one machine and then copy the new release onto everyone's PC.

    Kids these days. Don't know when ya got it good.

    --
    Request your free CD of my piano music.
    1. Re:D Language from early 80's by Anonymous Coward · · Score: 0
      If you want to see what Mike's up to these days, have a look at:


      http://tads.org/

    2. Re:D Language from early 80's by Alioth · · Score: 2

      I wonder whether we would all be better off if programmers designed their own personal languages just to suit their own personal styles. Yes, there would be portability problems but wouldn't we be more productive?


      No we wouldn't. I have a little experience of writing a language (quite recently in fact). It was just a macro language to add macro features to a legacy terminal emulation program. It was written using flex and bison to make the parser (so writing the parser was actually quick and easy) compiling to a bytecode. It has simple conditions, loops etc. - anything I though would be useful in a terminal macro language. The problem was that I kept thinking of new things to tweak or add, and spent much more time than necessary on the macro language :-) It was fun though.

    3. Re:D Language from early 80's by ralphclark · · Score: 2

      You had me going there for an instant. I took a look at that 'Chuck's Power Koding' page and it was clearly meant as a (bad) joke.

    4. Re:D Language from early 80's by julesh · · Score: 1

      ...run a complete common lisp environment with MicroEmacs on a 640kb DOS 8088 PC ... The way it does that is by swapping to an 8 MB backing store file

      I've heard emacs described as 'Eight Megs And Constantly Swapping', but I didn't realise it was based in this kind of truth...

  33. No more excuses! by Anonymous Coward · · Score: 0

    "Not having the right programming language" is a poor excuse.

    It isn't the programming language, it's all the shortcomings of developers that cause software to be poor. Only some will receive the TAO, it is upto those few to write it down into software. Linux has the TAO. GNU HURD is waiting for the TAO. Microsoft's .NET is trying to mimick the TAO, but there can be only one and it will be evident, through their failures, that they lack the TAO.

    In freedom, you don't find the TAO, the TAO finds you!

    1. Re:No more excuses! by Anonymous Coward · · Score: 0

      Either you or I are on drugs, and I haven't had any drugs today. What the hell are you talking about?

      Waste of space...

    2. Re:No more excuses! by binford2k · · Score: 1

      Uh, you didn't take GENED 110, did you?

      The Tao is "the Way."

  34. Quote from Dilbert by SAN1701 · · Score: 4, Funny

    As I recall...

    Dilbert: No! C is not the grade of the project. It's the programming language I'll use on it.

    PHB: (After a few seconds) OK. But why don't you program at least with B?

  35. The evolution of languages by DarthWiggle · · Score: 5, Interesting
    You know, I've spent a lot of time thinking about the proliferation of languages. We have Assembly. We have C. We have C++. We have Java. We have Cold Fusion, PHP, and ASP.NET. We even have iHTML or whatever that bastard offspring of HTML was called.

    What's the purpose of creating entirely new languages? Is a new language even entirely new, or is it an evolution of older languages incorporating new concepts and methodologies? Or is the creation of a new language just a way of leaving a mark? Or, even worse, is it a manifestation of that damnable desire to start from scratch every time? (I'm afflicted by it... most coders I know are afflicted by it...)

    Here's what I'd like to know, in my limited knowledge of languages: What languages out there are truly modular? Are there any languages that encompass basic logic principles and which are then able to be augmented by blackboxed modules? So, if you had a language that needed string concatenation, you could whip up a string concatenation module that would then become part of the language.

    Now, I'm walking a semantic line here, because you can presumably do all that by writing header files, includes, classes, etc. that contain new logic within the structure of the language. But what I mean is a language that by its nature is abstracted and modular, even to the point where the syntax of, say, control structures could be modified in a module?

    And, if the answer to my question is "Well, hell, you can do that in C!" then why do we need to bother writing a new language? Is it just to keep things fresh and interesting?

    It just seems that with all the many languages I've learned and used, there's very little that I can think of that one language can do that another language can't. Where doing something in one language is harder than in another because the structure of the language makes it awkward, maybe that points to a language that needs to be made obsolete.

    I guess the root question I'm asking is: Are there any truly novel languages out there, or are they all just variations on a common theme, with shared shortcomings and much duplication of effort?

    Be gentle. :)

    1. Re:The evolution of languages by aminorex · · Score: 5, Interesting

      There are three fundamentally good reasons to design
      a new programming language:

      (1) A new model of computation or machine. Lisp,
      Prolog, Algol, Forth, SNOBOL, ML, BLISS-32,
      APL, SETL, Parallation Lisp, Smalltalk, Self
      are examples.

      (2) A new kind of progamming methodology or
      application domain. Bourne/Korn shell, Perl,
      C++, Eiffel, Sather, Logo, PHP are examples.

      (3) Incremental improvement derived from
      practical experience. Java, C#, Kylix/Delphi,
      Visual Basic, Haskell, D are examples.

      Each of these can make serious contributions to
      the state of the art. The innovations of the
      first type are more fundamental, more profound,
      but also more academic in nature, and take some
      time to provide practical improvements in the
      art of practice. Those of the second and third
      kind can provide more immediate and accessible
      improvements in reliability, productivity, and
      feasibility of practical development.

      Yes, there is a tendency to create vanity
      languages. If D ever was that, it has progressed
      far beyond, if a half-hour's reading has not
      deceived me regarding it's design. Whether it's
      implementation has or will ever have progressed
      to the point where it can fulfill its potential
      as an innovation of the third kind... I just don't
      know.

      --
      -I like my women like I like my tea: green-
    2. Re:The evolution of languages by Anonymous Coward · · Score: 0

      I believe a language known as "PERL" can do all of this..

    3. Re:The evolution of languages by coreyb · · Score: 4, Insightful

      Well, once you have a language that is Turing-complete, it can do anything that any other Turing-complete language can do. Basic theorem of computer science (in the sense as a field of mathematics). And there aren't any languages (that I know of anyway) that are more than that, so yes, all languages are variations on a common theme in that anything you can do in one, you can do in another. It comes down to the question of which one is better for the task at hand.

    4. Re:The evolution of languages by wcbarksdale · · Score: 1
      To answer your question about the modification of control structures:

      The language that comes closest to what you want is probably Scheme. This is because the language is extremely small, and the syntax is trivial. The level of freedom the language gives you is such that you are not able to tell whether the form "if" is implemented as part of the "language" (whatever that means) or as a procedure in the same way any user could write it.

    5. Re:The evolution of languages by Anonymous Coward · · Score: 1, Insightful

      What languages out there are truly modular? Are there any languages that encompass basic logic principles and which are then able to be augmented by blackboxed modules?

      Most Lisp variants will fit that description (this includes Scheme btw). Legend has it that the creator first wrote a lisp parser in lisp (and it was pretty short), then it was first implemented when someone else converted that to machine code.

      It's fairly common practice in lisp to have a program write subroutines on the fly because the code is made of lists, which is the basic data type.

      Any function you add will look exactly like builtin ones from the outside, they're all called the same way (even math operators, like +). Macros for lisp are written in lisp. You can define a function then, in the same file, use that function *during compilation* with identical syntax to runtime code. Thus you can extend lisp with lisp.

    6. Re:The evolution of languages by Sri+Lumpa · · Score: 3, Insightful

      "you are not able to tell whether the form "if" is implemented as part of the "language" (whatever that means) or as a procedure in the same way any user could write it."

      IIRC, "if" in Scheme cannot be implemented as a procedure because all the arguments to a function/procedure are evaluated before calling the function/procedure so that both the "then" part and the "else" part would be evaluated each time which would be bad if they cause any side effects.

      However, Lisp and Scheme have very powerful Macro systems (Scheme's standard macro system trades some flexibility and power for security and ease of use) that allow one to rewrite much of the language using it.

      I think that in most Schemes implementations "if" and many other control structures are not primitives but macros, but then, you cannot really tell the difference between a primitive syntactic form and a macro in Scheme/Lisp or, seen from the other side, you can extend Schem/Lisp with new syntax very easily and with nobody knowing that it isn't part of the base interpreter/compiler.

      --
      "The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers." Bill Gates,
    7. Re:The evolution of languages by Sri+Lumpa · · Score: 2

      "Legend has it that the creator first wrote a lisp parser in lisp (and it was pretty short), then it was first implemented when someone else converted that to machine code."

      You probably want to read http://www.paulgraham.com/icad.html for more information, it's quite long but very interesting. The part that interest us here is:

      BEGIN EXCERPT
      As McCarthy said later:

      "Another way to show that Lisp was neater than Turing machines was to write a universal Lisp function and show that it is briefer and more comprehensible than the description of a universal Turing machine. This was the Lisp function eval..., which computes the value of a Lisp expression.... Writing eval required inventing a notation representing Lisp functions as Lisp data, and such a notation was devised for the purposes of the paper with no thought that it would be used to express Lisp programs in practice."

      What happened next was that, some time in late 1958, Steve Russell, one of McCarthy's grad students, looked at this definition of eval and realized that if he translated it into machine language, the result would be a Lisp interpreter.

      This was a big surprise at the time. Here is what McCarthy said about it later in an interview:

      "Steve Russell said, look, why don't I program this eval..., and I said to him, ho, ho, you're confusing theory with practice, this eval is intended for reading, not for computing. But he went ahead and did it. That is, he compiled the eval in my paper into [IBM] 704 machine code, fixing bugs, and then advertised this as a Lisp interpreter, which it certainly was. So at that point Lisp had essentially the form that it has today...."

      Suddenly, in a matter of weeks I think, McCarthy found his theoretical exercise transformed into an actual programming language-- and a more powerful one than he had intended.

      So the short explanation of why this 1950s language is not obsolete is that it was not technology but math, and math doesn't get stale. The right thing to compare Lisp to is not 1950s hardware, but, say, the Quicksort algorithm, which was discovered in 1960 and is still the fastest general-purpose sort.
      END EXCERPT

      Paul Graham's website (www.paulgraham.com) is very interesting and gives a lot of insight into the beauty of Lisp.

      You said:
      "Any function you add will look exactly like builtin ones from the outside, they're all called the same way (even math operators, like +). Macros for lisp are written in lisp. You can define a function then, in the same file, use that function *during compilation* with identical syntax to runtime code. Thus you can extend lisp with lisp."

      It seems a bit confused. In Scheme (can't say about Common Lisp) you have two type of invocations, functions and syntax (macros are syntax defined by the software). For each type of invocation it is the same wether it was written by the language implementor or by the programmer, which is why a macro written in Lisp/Scheme is in fact extending the language, because it is syntax and the program cannot know if it is language defined syntax or user defined syntax.

      As for the "during compilation" sentence it would make more sense if you were talking about a macro, given that a function will of course be using the Lisp syntax but functions are not executed during compilation whereas Macros are expanded at interpretation/compilation time and use the whole Lisp syntax (in Common Lisp and some Schemes) or a macro transformer syntax* (in standard Scheme).

      *The macro transformer syntax, while less powerful than a classic Lisp macro offers most of its power without the trouble of dealing with the possibility that you macro and the code using your macro may use the same symbol that would create a conflict and cause you a headache (unless you are a Lisp God of course).

      --
      "The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers." Bill Gates,
    8. Re:The evolution of languages by Simon+Brooke · · Score: 2
      Well, once you have a language that is Turing-complete, it can do anything that any other Turing-complete language can do. Basic theorem of computer science (in the sense as a field of mathematics). And there aren't any languages (that I know of anyway) that are more than that...

      .. and why not? Because if it's turing complete it can by definition (give or take the limitations of finite memory) compute all computable functions, and as uncomputable functions are uncomputable, there aren't any programming languages which allow you to compute them. You need to read up on the Entscheidungsproblem.

      --
      I'm old enough to remember when discussions on Slashdot were well informed.
    9. Re:The evolution of languages by nels_tomlinson · · Score: 4, Informative
      Here's what I'd like to know, in my limited knowledge of languages: What languages out there are truly modular? Are there any languages that encompass basic logic principles and which are then able to be augmented by blackboxed modules? So, if you had a language that needed string concatenation, you could whip up a string concatenation module that would then become part of the language.

      Lisp.

      Now, I'm walking a semantic line here, because you can presumably do all that by writing header files, includes, classes, etc. that contain new logic within the structure of the language. But what I mean is a language that by its nature is abstracted and modular, even to the point where the syntax of, say, control structures could be modified in a module?

      Lisp.

      I guess the root question I'm asking is: Are there any truly novel languages out there,

      Lisp.

      or are they all just variations on a common theme, with shared shortcomings and much duplication of effort?

      Everything else.

    10. Re:The evolution of languages by jefu · · Score: 2
      "...a language that by its nature is abstracted and modular, even to the point where the syntax of, say, control structures could be modified in a module?"

      Lisp.

      On the deeper question of "why bother writing a new language?" there are lots of answers. Some are mentioned in a response in this thread.

      But there are a couple others as well.

      One common one is that people are solving a closely related set of problems (say programming neural nets, or doing discrete event simulations). One approach is to build a set of libraries in a language you have and just thread those together. Works fine. But if you build your own language where the stuff you're doing a lot is easy to do - because you designed the syntax that way - (and the stuff you don't need to do much can be harder), you can gain quite a bit. Compare APL's array handling syntax to that in Fortran.

      Another reason for new languages is incremental change to an existing language. C++ started out as a C preprocessor (of a sort) and has evolved to the point where it is now a very different language.

      And as for novelty, there are some nicely novel languages - if you've never programmed in a functional language try Haskell, SNOBOL isn't well known these days, but has some very intriging notion. Self is quite an elegant language based on very different OO principles than you might find in C++ or Java. Then we have APL (quite a nice language once you figure out how to read it), J, Prolog, Clips, XSLT and so on. These may share some bits with more familiar languages, but also have a good deal that is different and novel.

      Of course, if you really want novelty, no language discussion would be complete without Intercal.

    11. Re:The evolution of languages by cakoose · · Score: 1
      Now, I'm walking a semantic line here, because you can presumably do all that by writing header files, includes, classes, etc. that contain new logic within the structure of the language. But what I mean is a language that by its nature is abstracted and modular, even to the point where the syntax of, say, control structures could be modified in a module?

      I am interested in exactly this. It would be nice if regular expressions were simple a syntactical plugin to the language. Extensions could make it easier to specify things that don't quite fit the existing function/expression syntax.

      So far, the only example of this I have found is Perl. Though I'm not sure exactly how it is done, I believe that the interpreter just delegates control to a custom parser. The Perl 'Switch' statement is/was implemented this way. You may also have heard of the extension that lets you (kind of) code Perl using Latin (written by the same guy).

    12. Re:The evolution of languages by Anonymous Coward · · Score: 0
      First, if you've only done C/C++/Java and the like, you're really missing out. Go learn some real languages. :-)

      As to why to design new languages, I think Paul Graham put it rather nicely, so I'll leave it at that.

      ...presumably do all that by writing header files, includes, classes, etc...

      In a language like C, that's not true at all. Suppose you wanted to make a new control structure -- like Pascal's do-while loop. There's really no way to do it (short of writing your own interpreter, or embedding a C compiler in your program).

      But in other languages, it's not only possible, it's common. If I want a new loop construct in Lisp, I can just write it. Lisp is written in Lisp, so my control structure will feel just as "native" as the standard ones. There are some things I've seen in Lisp (like anaphoric macros) that I couldn't even imagine how to begin writing in any other language.

      I recall Chuck Moore saying something to the effect of "Imagine if in your OO programming language, you had to do a function call to access a member variable; that's how clumsy a lot of languages feel to a Forth programmer."

    13. Re:The evolution of languages by wcbarksdale · · Score: 1
      You are entirely right, I was just trying to explain this principle in a way that would be understood for someone unfamiliar with the language.

      (if a b c)
      can be thought of as syntactic sugar for

      (cond (<I>a</i> <i>b</i>)
      (else <i>c</i>))
    14. Re:The evolution of languages by Anonymous Coward · · Score: 0
      Here's what I'd like to know, in my limited knowledge of languages: What languages out there are truly modular? Are there any languages that encompass basic logic principles and which are then able to be augmented by blackboxed modules? So, if you had a language that needed string concatenation, you could whip up a string concatenation module that would then become part of the language.

      You've just described Forth.

    15. Re:The evolution of languages by Anonymous Coward · · Score: 0
      Here's what I'd like to know, in my limited knowledge of languages: What languages out there are truly modular? Are there any languages that encompass basic logic principles and which are then able to be augmented by blackboxed modules? So, if you had a language that needed string concatenation, you could whip up a string concatenation module that would then become part of the language.

      Lisp.

      Smalltalk. Self. Ruby?

      Now, I'm walking a semantic line here, because you can presumably do all that by writing header files, includes, classes, etc. that contain new logic within the structure of the language. But what I mean is a language that by its nature is abstracted and modular, even to the point where the syntax of, say, control structures could be modified in a module?

      Lisp.

      Smalltalk. Self. Ruby?

      I guess the root question I'm asking is: Are there any truly novel languages out there,

      Lisp.

      Smalltalk. Self. Ruby. Python. Perl. EcmaScript (one of the most widely used prototype-based OO languages). C++ (object-functional programming for the masses). E. Lua. Dylan. Io. Cecil. OCaml...

    16. Re:The evolution of languages by Sri+Lumpa · · Score: 1


      Yeah, I guess that when all you know are CPP macros you might get scared at the idea of having "if" defined using macros ;)

      I knew about that way of defining IF but personally I find it more natural to define COND using IF than the other way around (and so does R5RS). Of course it doesn't gives the point as well that way.

      One thing (among other) that blew my mind when I read about it was the Y operator. It's a way of creating an _unnamed_ recursive function (so guess how a function that has no name can invoke itself). It's not practical (at least I can't think of any practical use for it) but it is really neat and it may interest you to read about it for the mind expanding and jaw dropping effect it has. It also has a humbling effect because I don't think I would ever have thought of something like this.

      --
      "The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers." Bill Gates,
    17. Re:The evolution of languages by wcbarksdale · · Score: 1
      I believe cond is older than if, being part of the original syntax of Lisp. (This is back in the day when programs were written in a different language than data.)

      The Y operator has an essential function in that it is the only way to have recursion in pure lambda calculus. If you've ever tried to write an interpreter for a functional language, you run up against the problem that a recursive call essentially forces you to refer to the function before it is defined. So one way of doing it is to put in a pointer to nothing, and later modify it to point to the function itself. But assignment is annoying because it is temporal (see chapter 3 of SICP for more).

      Also see this lecture, which does about as good of a job explaining Y as can be.

    18. Re:The evolution of languages by Sri+Lumpa · · Score: 1

      Especially given that strictly functional language shouldn't have assignments or other side effects IIRC.

      I just checked "The Root of Lisp" and you are right about cond preceding if, which I find an interesting tidbit of trivia (he probably omitted a if construct because it was subsumed in cond IMHO).

      For reference the seven primitive operators of Lisp were "quote atom eq car cdr cons cond" and were sufficient to write "eval", quite amazing.

      BTW, thanks for the link.

      --
      "The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers." Bill Gates,
    19. Re:The evolution of languages by nels_tomlinson · · Score: 1
      Members of the Lisp family, such as Common Lisp, elisp and Scheme, definitely aren't the only languages which fill the bill, but they are the only ones I am at all familiar with.

      So far as I know, the Lisp family is the only element of this class of languages which is >>30 years old. That means that there are people who've been writing large, production systems with Lisp for their entire careers. Lisp is time-tested for serious use.

      When Ross and Ihaka (spelling?) started to write R, they began with a Scheme interpreter, and simply wrote the code to change its syntax to the S syntax, which is standard, infix, no-parentheses-except-around-function-arguments. In Scheme, that's simple, because it's a lisp (sort of).

  36. Re:Steelers suck! by Anonymous Coward · · Score: 0


    Somewhat. At least they don't allow niggers or faggots to live here. Bungi = Bunghole + nigger. Queer.

  37. What about structs? by Ghoser777 · · Score: 2

    I don't know much about D, but if it supports structs, isn't that essentially the same thing as a value class (save the instance methods and such)?

    I personally prefer passing pointers instead of having to remember if the object is being copied behind the scenes or is the original object because I used an ampersand (pass by reference). If I wanted to make a copy, I'd call the "copy" instance method and poof, one has a copy. If I'm worried about my objects being changed, then just make the object immutable.

    But that's just me,
    F-bacher

    --
    James Tiberius Kirk: "Spock, the women on your planet are logical. No other planet in the galaxy can make that claim."
    1. Re:What about structs? by Anonymous Coward · · Score: 1, Informative

      Value classes by definition are always copied and never passed by reference. Values classes have no identity, only values, so the use of pointers or references with value classes is forbidden. If your classes have references, then they are not value classes but some bastard hybrid between value and interface classes.

  38. Uh... NO! by kzinti · · Score: 2, Redundant

    C++, ++ meaning +1, or in other words, D

    Since when does the ++ operator increment the variable name and not its value? Duh?

    --Jim

    1. Re:Uh... NO! by aerojad · · Score: 1

      a = 1, first
      b = 2, second
      c = 3, third
      c++ = 3 + 1, or 4, fourth
      d = 4 as well, fifth
      increment c by 1, should get the fourth, also known as d. c++ = fourth = should be the letter d. so if d really comes after c, then what would c + 1 be?

      duh?

      --

      SecondPageMedia - Wha
    2. Re:Uh... NO! by moyix · · Score: 2

      It works because characters are really integers in C. So:

      someVar = 'C';
      someVar++;
      printf("%c", someVar);

      Would, in fact, give "D"

    3. Re:Uh... NO! by scotch · · Score: 2

      Well, char constants are really integers in C, but not in C++. In both languagues, chars are not the same size (typically) as ints, but they are automatically promoted to ints in expression, when required.

      --
      XML causes global warming.
    4. Re:Uh... NO! by kzinti · · Score: 2

      NO. I repeat: when does the ++ operator increment the variable name and not its contents? Answer: never. See original post.

  39. Did Java rip off UCSD Pascal? by Anonymous Coward · · Score: 0

    So there!

    1. Re:Did Java rip off UCSD Pascal? by Anonymous Coward · · Score: 0


      Yes it did. Niklaus Wirth (together with Kathleen Jenssen responsable for Pascal) was involved in the Java VM, and later in native Java compilation.

      A few searches on Java + wirth will confirm this

  40. Mike Roberts? by Watts+Martin · · Score: 2

    (Goingware? Hey, I remember you from BeOS days.) I'm guessing this is the Mike Roberts of TADS? I bought that program when it was shareware--and never really got around to finishing the text adventure I wanted to write with it, although that wasn't the language's fault. It was really well-designed.

    1. Re:Mike Roberts? by MichaelCrawford · · Score: 2
      Yeah, that's me from the BeOS days.

      I haven't booted BeOS in a while but I'm about to, to hopefully help roll out a new release of ZooLib soon.

      I would also like to add support for BeOS PowerPC to ZooLib, but probably won't for this release. It doesn't work with my PowerLogix CPU upgrade, but you can still get Newer Technology CPUs that are supposed to work.

      I'm still using the 8500 I used to port Spellswell to the BeOS. I'm typing into it right now in fact. But mostly these days I run Debian on it. I managed to install OS X on it, but it doesn't work too well. For OS X I have an iBook.

      I don't recall what Mike's text adventure compiler was called, but what you describe sounds like it.

      I have lost touch with Mike over the years.

      --
      Request your free CD of my piano music.
    2. Re:Mike Roberts? by Anonymous Coward · · Score: 0

      posting your e-mail again?

    3. Re:Mike Roberts? by Sargent1 · · Score: 2

      I'm guessing so. TADS is indeed the language he developed. It's still being developed, in fact, though these days it's available for free.

      The original C source for TADS used 8-character variable and subroutine names, in order to compile on an old and restrictive C compiler. (Watcom, perhaps?) So maybe Mike learned more from Chuck's Power Koding than you mentioned.

  41. I would like to have something else.. by mystran · · Score: 2, Interesting
    And that would be a compiled language with Ruby-style syntax and programming model.

    Implementing things in Ruby is really fast, and what makes it fast are the objects and blocks. I really don't understand why so few new languages have efficient block-handling (to allow nice and easy-to-write visitor partterns and things like that).

    I wrote a small application server few my website (with it's own HTTP implementation and all) initially in about 10 hours while just learning Ruby. The downside is that Ruby is a bit slow.

    Well, fortunately this is free world, and I can still dream of doing a compiler for a Ruby-style language in the future.

    --
    Software should be free as in speech, but if we also get some free beer, all the better.
    1. Re:I would like to have something else.. by Anonymous Coward · · Score: 0

      I agree with you about Ruby. I've been learning it and it seems really great.

      There are some compiler type thinsg lsited in the app archive, but I don't know how well they work.

  42. D does have stack based values by Anonymous Coward · · Score: 0

    called structs.

  43. Strange floating point constants by Anonymous Coward · · Score: 0

    For one, they keep decimal (which binary floating point can't represent). Then they mix bases on the hexadecimal floating point, with mantissa in hex, and a binary exponent expressed in decimal. I guess they couldn't find a way to put in balanced ternary.

    1. Re:Strange floating point constants by Anonymous Coward · · Score: 0

      It's the same way C99 does it.

  44. Re:More importantly... by mrjah · · Score: 0, Offtopic

    "Score a touchdown 1,2,3?"

    Is that really the Eagles fight song?

    Was it selected in a contest among eastern Pennsylvania elementary schools?

  45. D is too close to Java by Animats · · Score: 4, Insightful
    D is interesting, but it's conceptually close enough to Java that it's not likely to get much traction. Because it's garbage-collection based, you can't use D for low-level programming.

    C++ needs an overhaul; the cruft has gotten too thick. But, sadly, D isn't it.

    Walter Bright is a good compiler writer; he did the Zortech C++ compiler, years ago. So D is not a paper language.

    1. Re:D is too close to Java by Simon+Brooke · · Score: 3, Insightful
      Because it's garbage-collection based, you can't use D for low-level programming.

      Errr, sorry? Why not? I learned my trade on computers which ran LISP right down to the bare metal, with incremental GC. Dammit, the fist WIMP interfaces and the first Ethernet (among other things) were developed on those machines, and, lets face it, a Xerox 1186 in 1986 with 4Mb of core and 80Mb of disk ran complex WIMP programs better and faster than MS Windows does on 2GHz pentium boxes now.

      There's nothing wrong with writing low-level stuff in a GC language, although it may be necessary to mark bits of code with a pragma saying don't GC while you're doing this (which is, after all, much what an interrupt routine does on more conventional architectures).

      --
      I'm old enough to remember when discussions on Slashdot were well informed.
    2. Re:D is too close to Java by Oswald · · Score: 1
      ;; signal/noise ratio is getting worse; I now read posts at +3 or above

      It's hopelessly OT to reply to your sig, but sadly it is true. I am at +2 now, but there are so many people posting sincere, but half-baked, crap at Score:2 that I fear I'll be pushing it up soon myself.

    3. Re:D is too close to Java by Animats · · Score: 2
      Why not? I learned my trade on computers which ran LISP right down to the bare metal, with incremental GC. Dammit, the fist WIMP interfaces and the first Ethernet (among other things) were developed on those machines...

      Ah, LISP machines. Now that was a dead end. I briefly used the Symbolics 3600, the refrigerator-sized turkey of the 1980s.

      The original PARC machine, the Alto, mostly ran Smalltalk, not Lisp, and the system software was written in BCPL and Mesa. I've programmed an Alto at the Mesa level, and used the original Bravo text editor, the first WYSIWYG editor.

      You're talking about the second-generation PARC systems, which eventually came out as products, and later populated Silicon Valley surplus stores. Great work was done on those machines, but they never went mainstream, either. Nor did the Mesa/Safe Mesa/Cedar family of languages.

      PARC was never that big on LISP. Their in-house languages were preferred.

  46. D == Java? by hebble · · Score: 5, Interesting
    1. No multiple inheritance
    2. All objects accessed by reference on the heap
    3. Not source-compatible with C
    4. No namespaces
    5. All member functions are virtual (unless the compiler figures out they don't have to be)
    So basically, we'll still need C++ for a bunch of things. At least it's got templates, I guess.

    Also, it's a bit funny that the preprocessor is mentioned twice under "Features to Drop." This guy must really hate the preprocessor. :)

    1. Re:D == Java? by Anonymous Coward · · Score: 0

      Java 1.5 *will* have templates. And there's GJ allready, adding
      templates to current Java.

    2. Re:D == Java? by Leimy · · Score: 2

      Pretty sure Walter has listed in his FAQ that he will have templates or something like them as well

    3. Re:D == Java? by Ataru · · Score: 0
      while (!(dead&&hands.cold))
      /*wait*/ ;
      hands.pry (preprocessor);
    4. Re:D == Java? by Anonymous Coward · · Score: 0

      Templates are in D and are implemented in the D compiler.

    5. Re:D == Java? by Anonymous Coward · · Score: 0

      shouldn't you have thrown in a #define or two just to prove your point?

    6. Re:D == Java? by zBoD · · Score: 1

      > At least it's got templates, I guess.

      By the way, the next version of Java (1.5) will have templates. (see http://developer.java.sun.com/developer/technicalA rticles/releases/generics/)

      --
      BoD
    7. Re:D == Java? by Ataru · · Score: 0

      Good comeback.
      I don't use it much anyway, and to be honest most things can be done in a different (better) way. I have a feeling I would miss it if it were gone.

  47. Hello World by Monkey-Man2000 · · Score: 1

    Can someone post some example code of D, like a Hello World program?

    --
    This post was generated by a Cadre of Uber Monkeys for Monkey-Man2000 (603495).
    1. Re:Hello World by Burton+Radons · · Score: 2, Informative

      void main ()
      {
      printf ("Hello, World!\n");
      }

      Not exactly informative, although note that "void main ()" is explicitly a well-formed main, and could be:

      void main ();
      void main (char [] [] args);
      int main ();
      int main (char [] [] args);

      The OOP version:

      class HelloWorld
      {
      char [] string = "Hello, Class!\n";

      /* Called at the start of the program before main */
      static this ()
      {
      printf ("Hello, Program!\n");
      }

      /* Called after main or an unhandled exception. */
      static ~this ()
      {
      printf ("Bubye, Program!\n");
      }

      /* The constructor - C++ would have "HelloWorld ()" here */
      this ()
      {
      string = "Hello, World!\n";
      }

      /* The destructor - C++ would have "~HelloWorld ()" here */
      ~this ()
      {
      printf ("Goodbye, World!\n");
      }

      void print ()
      {
      printf ("%.*s", string);
      }
      }

      void main ()
      {
      (new HelloWorld).print ();
      }

    2. Re:Hello World by ShadowDrake · · Score: 2, Insightful

      I'm not sure if I should feel comfortable with the idea of code "called before main" combined with OOP.

      What stops someone from writing a malicious routine called before main is run, and slipping it into a tainted version of a popular (how do you say library in OOPese?) A truly paranoid programme could run MD5SUMs on each library it requested functions from and say "okay, this is the libc.so.6 that came with Slackware 8.1, so it's good"... but it couldn't do that until it got to main, and the damage was done.

      I can also see a problem with race conditions. Library A sets things up how it needs them before execution, and so does Library B. Is the order in which the pre-main code is run standardised? Even if it is, it seems to open the door for a lot of confusion, especially if you add a library in and suddenly things break because of non-immediately-obvious changes to the pre-main sequence.

      OTOH, I appreciate that you aren't forced to do OO. I'll believe OO is a panacea when it buries me knee-deep in gold sovereigns, and smites my enemies with heavy objects. I don't think those functions are in the Java spec yet.

      --
      It's just like a fascist dictatorship, without the punctual rail service!
    3. Re:Hello World by Anonymous Coward · · Score: 1, Informative

      C++ allows code to be executed before main() is called, they're called static constructors. The problem is, as you pointed out, there is no specified order in which libraries (modules in D) get their static constructors run. In D, however, the order in which they (the module initializers) is called is determined by how the modules import each other.

    4. Re:Hello World by Burton+Radons · · Score: 2, Informative

      Nothing. D is not a safe language; making it safe would change the language (no pointers, union restrictions), what it can do (no direct interaction with other languages), and what it can be applied to drastically.

      The calling order of static constructors is not defined. Anyone trying to use static constructors as their only tool is going to get burned, same as with destructors. So:

      class Foo
      {
      private bit initialised;

      static void init ()
      {
      if (initialised)
      return;
      initialised = true;
      ...
      }

      static this ()
      {
      init ();
      }
      }

      Is still a necessary construct.

    5. Re:Hello World by Burton+Radons · · Score: 1

      "private static bit initialised;" instead. IMO this is all the language should provide, as trying to do such a vitally important thing as dependent static constructor order automatically is bound to be more confusing than doing it explicitly. Also, there are cases where each constructor is codependent on one another, where you need to do fairly complex intermingling.

    6. Re:Hello World by Anonymous Coward · · Score: 1, Informative

      This is no more of a problem for D than it is for C. With ld.so, each DLL's _init() function is called first. Under Windows, something similar is done for DllEntryPoint() or whatever.

      Of course there is code called before main(). On Linux and BSD, the _start symbol is jumped to, and that sets up argc and argv, then calls main().

  48. Re:What is 'the D'? by caino59 · · Score: 2, Funny

    well, the d is tenacious of course, the ragekage show!

  49. practical by jdkane · · Score: 2

    After C/C++ give me C# before D.

  50. No, we already have E! by Anonymous Coward · · Score: 0

    check out this link for the E homepage: http://wouter.fov120.com/e/index.html

  51. +1 funny by einhverfr · · Score: 1

    dsarn I wish I had the moderator points to spend, That was funny...

    OTOH, maybe I should connect with other people rather than by geeks....

    --

    LedgerSMB: Open source Accounting/ERP
  52. operator overloading? by YE · · Score: 1

    Hmmm, last time I checked out D, operator overloading was deliberately left out on grounds of being "evil" and "used only for vectors, strings and smart pointers anyway".

    Goes to show that some people actually _DO_ learn.

  53. D# by CySurflex · · Score: 4, Funny
    Company Press Release

    REDMOND, WA 10:39PM PST - Microsoft Corp is pleased to announce our new state of the art language, D# . Additionaly, Microsoft is anouncing our own VM which will run regular D code plus our own set of WDE (Windows D Extensions) which will improve the usability of D and decrease development times. Microsoft corp would like to stress that there will be a D-VM for other platforms soon (within 20-30 years).

    1. Re:D# by maunleon · · Score: 1
      Why D#? Why not F#?

      To quote:


      F# is an implementation of the core of the Caml programming language for the .NET Framework, along with cross-language extensions. The aim is to have it work together seamlessly with C#, Visual Basic, SML.NET and other .NET programming languages. In particular it is the first ML language where all the types and values in an ML program can be accessed from some significant languages (e.g. C#) in a predictable and friendly way.

    2. Re:D# by deblau · · Score: 2

      In related news, next week Microsoft will begin work on the Microsoft PIANO framework. The PIANO framework will support applications written in C, C#, D, D#, and Microsoft's just-announced language Bb (pronounced "be-flat", as in "if you don't buy Microsoft, we'll send someone around and you'll be flat on your ass").

      --
      This post expresses my opinion, not that of my employer. And yes, IAAL.
  54. Re:More importantly... by Anonymous Coward · · Score: 0

    No, Eagles' fans can only count to three.

  55. You kids these days... by JeanBaptiste · · Score: 4, Funny

    B is all you should need to write a good app. C++ with that newfangled OOP, but that was too hard so now they have this 'D'... whatever happened to pascal anyways?

    Why back in my day, I would write b++ code on my 25lb laptop while trudging through the snow on my way to the coal mine (uphill both ways). And I thought I had it easy! My dad used to 'program' with oscilloscopes and huge racks of patch cables (actually thats true) when punch cards came out he thought that was the best method that would be for a while... All you young curmudgeons with your D this and visual that and open source hullabaloo. Twenty three skidoo to all of you!

  56. Connective C++ by zephc · · Score: 2

    I haven't seen any development in a while, but Connective C++ is a rather interesting language, reminds be of VeriLog sorta, but compatible with C and C++ source (being a C++ extension)

    check it out

    --
    "I would say that 99 per cent of what my father has written about his own life is false." - L. Ron Hubbard Jr.
  57. Oh, really. by sp!keball · · Score: 0
    I am writing *beeep* this#^C^C answer in *beep* vim (damn *beep* what was the ^C^X f****** command??) ^f^f^f^ GRR

    Oh yeah VIM does not conflict with *nix standards, but since I am with GNU/Linux (GNU's _not_ UNIX) I prefer a
    • logical,
    • easy-to-learn,
    • beautiful and
    • powerful
    editor. If I just want to type some text into a file I can still use
    cat >> foo.bar << "EOF"
    and -WOW!- I don't even need to know some dumb *beeeeep* commands no one is able to remember.
    Forgot a command in EMACS? [F10] and all your problems vanish. Because EMACS has a menu (WOAH! must sound frightening for you!)

    Btw RMS rulez. And sorry for the bad English.
    --
    "Karma: Bad (mostly affected by moderation done to your comments)" Mods@/. != geek?
    1. Re:Oh, really. by scotch · · Score: 2

      Vim has a menu, too, FanBoy. Also, what if you forget [F10]?

      --
      XML causes global warming.
    2. Re:Oh, really. by frozencesium · · Score: 1

      admit it...you really use pico or nano...

      --
      I'm not always the brightest pixel in the stream
    3. Re:Oh, really. by sp!keball · · Score: 0

      To be honest, I used to use vim (it comes with many GNU/Linux distributions as a standard) and never really liked it - it's really just not my flavour. Some time ago I've spent some minutes trying emacs, and I was really amazed.
      It's just that vim is too big for a simple editor (better use pico or similar) and too simple for an allrounder editor.

      I just can't stop flaming ^.^

      --
      "Karma: Bad (mostly affected by moderation done to your comments)" Mods@/. != geek?
  58. Ruby compiler by Colonel+Panic · · Score: 2

    It would be wonderful to have a Ruby compiler...
    But I'm not sure it's possible to compile a language as dynamic as Ruby where you can:
    - add methods to objects or classes at runtime
    - Do things like conditional inheritance or conditional mixins
    - mixin modules to objects or classes at runtime (extend)

    Ruby is extremely dynamic... I'm not sure how you compile something like that down to static object code...

    1. Re:Ruby compiler by __past__ · · Score: 2
      I strongly doubt that it's impossible. I didn't hear about a Smalltalk compiler, wich would be the obvious thing to look at, but Lisp for example is as dynamic as Ruby (allows building/changing classes at runtime, adding/replacing methods etc.), yet there are lots of native-code compilers for it.

      In fact, I only know of one implementation that "only" has a bytecode compiler, CLISP. Last I heard, there are about 15 Lisp systems altogether.

      So you need a better excuse for not writing a Ruby compiler right now. :-) Go look at the source code of CMU CL, it has one of the fastest Lisp compilers around, and most of it is in the public domain. (The compiler is called "Python" btw., that may be concern for Ruby people ;-))

  59. Shouldn't we start... by Anonymous Coward · · Score: 0

    By submitting english to ECMA?

    After all, a language can't be a "standard" without ECMA! No Sir! Just look at where Perl would be without ECMA backing!

    I think it might be a tad premature to seek out D "standards" when D only comes from one location...

  60. Menage Theory by Scotch+Game · · Score: 5, Funny

    Eh. The way I see "D" is this:

    C++ was alone for the night when Eiffel stopped by, noticing C++ was by itself, "just for a few drinks". Well, things started to get out of hand and just then Java walks in. Tense moment. Awkward silence. But to C++'s relief, Java joins in.

    Well, as luck would have it, Java gets pregnant but the three of them have found they really enjoy each other's company, they balance each other out in certain areas, so they buck convention and all move in together and raise the kid under an "alternative" family, and hey, there's nothing wrong with that. They call their kid D, and while he's still young and has a lot to learn, he's got features, interfaces, delegates and assertions built in. He might just turn out all right after all.

    Watch for the movie, starring Richard Gere as C++ (he's older and has a rumored past, but he'll give the rest of the case a few pointers), Catherine Zeta Jones as Java, and Renee Zellweger as Eiffel (she's hot, but underappreciated). Lil' Bow Wow will guest star as D.

  61. Functional programming? by jyasskin · · Score: 2, Insightful

    I don't see any features that would enable the use of functional programming techniques. I don't see any mention of function pointers or overloading (), so how does he expect to write, for example, a general sorting function? (i.e. Sort array a of strings case insensitively)

    1. Re:Functional programming? by SpryGuy · · Score: 1

      Instead of function pointers, there are delegats.

      Arrays have a built in sort method anyway. But you could easily use delegates to implement functional programming, and of course implement your own sorting routines.

      So what you want is in there. Go back and look at the spec a bit more deeply.

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
    2. Re:Functional programming? by daniel_yokomiso · · Score: 1

      D supports both function pointers and delegates, and a general sorting function exists both in the Phobos Standard Library (come with dmd compiler)and Deimos Template Library (or DTL, it's LGPL'd)http://www.minddrome.com/d/deimos/deimos-0. 0.1.zip. Phobos version is similar to C quicksort and the version in Phobos is a simple mergesort with no optimizations (later versions of the library will have faster algorithms).

      Best regards,
      Daniel Yokomiso.

      --
      Disclaimer: If I disagree with you I'm probably trolling...
  62. So Microsoft's version... by marciot · · Score: 1

    ...will be called D flat? No, wait, they already have that since C# is the same as Db.

  63. Question? by Billly+Gates · · Score: 2
    How did he write a compiler to compile itself in basic? He had to use some assembly code to do such a task. I was only in elementry school when I played with basic and if I recall the only way to do anything advanced was to "peak" and "poke".

    1. Re:Question? by Anonymous Coward · · Score: 0

      > How did he write a compiler to compile itself in basic? He had to use some assembly code to do such a task. I was only in elementry school when I played with basic and if I recall the only way to do anything advanced was to "peak" and "poke".

      Nope. He only have to ouput a .exe/.com file, which is something basic have no problem to do.

      No need to peek()/poke()/call() for that.

    2. Re:Question? by jbolden · · Score: 2

      I don't know about the original IBM PC but on the Apple II such a thing would have been very easy. Every machine operator had a simple hex code and these were well known (since the assembler was built right in). Using char functions you could generate specific hex values; and you could poke these values into memory. Memory was flat. You could write raw memory blocks to disk with BSAVE.

      So for example if you had compliled a function to memory location 8230 and the variables went in location 20,21,22,23,24

      then you'd have something like
      LDA (hex code say 45) abc
      STA (hex code say 53) 20
      LDA def
      STA 21
      LDA ....
      JSR (hex say 78) 28 80

      and this would just be a string:
      45 (value in abc hex) 53 20 45 (def in hex)... 78 28 80.

      And since you have a pokes you just write this to memory and BSAVE it.

      IMHO Apple II was the best environment for learning programing:

      a) Simple enough that you can understand everything
      b) Complex enough that once you understand everything you would actually know something

  64. I don't see it being used by Kupek · · Score: 3, Insightful
    A lot of the comments in the Overview I find to be either unverifiable conjecture, or just plain silly. A sampling:
    • C++ programmers tend to program in particular islands of the language, i.e. getting very proficient using certain features while avoiding other feature sets.
    • A great strength of C++ is that it can support many radically different styles of programming - but in long term use, the overlapping and contradictory styles are a hindrance.
    • It doesn't come with a VM, a religion, or an overriding philosophy.
    • D aims to reduce software development costs by at least 10% by adding in proven productivity enhancing features and by adjusting language features so that common, time-consuming bugs are eliminated from the start.
    The first two I am not able to counter at all - I simply don't have the experience. I don't know if he does, either, so I don't buy it. The last... why 10%? Why not 11%, 15%, or 11.38%? It just seems silly.

    As for philosophy, every language has a philosophy. D adheres to the object oriented paradigm - that's a philosophy. Beyond that, it seems to me that it tries to attain simplicity in use while trying to force good programming standards. That's most definitely a philosopy.

    I've read a bit about the language itself, and I am interested in the unittest and contracts in particular. Those features would be great additions to any language, I think.

    But I don't see a need for the language itself. It seems like Walter Bright looked at the current OO languages and decided they weren't adequate for his needs. So he designed and implemented his own. This is commendable, but I don't see the result as being different enough from the other available OO languages to make any sort of switch or adoption advantageous.

    I think that languages get adopted widely when they offer something that other languages can't do, or do very poorly. Fortran allowed an abstraction higher than assembley. C++ allowed object oriented design using notation many people were familiar with and at high speeds. Perl allowed easy text manipulation. Java allowed platform independence (yeah, yeah, with the JVM, but that I think is what sold it). All of the feature additions and deletions are nice (well, not all of them, I like some of the things he decided against including), but I don't think they add up to something that people really need. And if you can't produce that, I don't think the language is going to catch on.
    1. Re:I don't see it being used by Tumbleweed · · Score: 2

      > So he designed and implemented his own. This is commendable, but I don't see the result as being different enough from the other available OO languages to make any sort of switch or adoption advantageous.

      I think the simplified syntax, addition of real string handling, etc., would be more than worth it for programmers in certain situations such as not having any legacy code, not worrying about others having to take over the code, etc. ANY new language is going to have those kind of problems, though, so that's hardly a reason to dismiss the language as having no future.

      What I'd like to see is something like simple syntax of D, but with the abilities of Objective-C, and without the backward compatability of Objective-C (I think it holds the language back). Not that that'll happen, but that's what I'd like. :)

    2. Re:I don't see it being used by Anonymous Coward · · Score: 0
      D aims to reduce software development costs by at least 10% by adding in proven productivity enhancing features and by adjusting language features so that common, time-consuming bugs are eliminated from the start.

      The first two I am not able to counter at all - I simply don't have the experience. I don't know if he does, either, so I don't buy it. The last... why 10%? Why not 11%, 15%, or 11.38%?

      Luckily, 11%, 15% and 11.38% are all covered by the statement "at least 10%" so you've nothing to worry about. That's almost the last thing I'd expect to see someone pick on when it comes to D (only slightly less weird than complaining of him not providing translations into any or all foreign languages).

      I'm not really up for yet another discussion on a programming language but I'll say that the main reason a language gets adopted is because of convenience - whether the convenience of certain functions in it, the convenience of having a great compiler for it, the convenience of it being the only one an API supports, or what have you. I write in Java at work because that's what the boss requires and C/Obj-C at home because that's the best choice for me as an interface to OS X. Both of them have good qualities and both have drawbacks I absolutely despise - I think there are very few people truly satisfied with their programming language of choice. Lack of major differentiation does hurt but it's not a sole determining factor in adoption of a language.

    3. Re:I don't see it being used by Kupek · · Score: 1

      Luckily, 11%, 15% and 11.38% are all covered by the statement "at least 10%" so you've nothing to worry about. That's almost the last thing I'd expect to see someone pick on when it comes to D (only slightly less weird than complaining of him not providing translations into any or all foreign languages).

      I think you missed the point I was attemtping to make. The statement is rubbish. The number used is arbitrary. It is not a criticism of D itself, but how the author has presented it.

    4. Re:I don't see it being used by JudasBlue · · Score: 2

      I think that languages get adopted widely when they offer something that other languages can't do, or do very poorly.

      I don't know about this. Python has reached the point where you can safely say that it is in wide adoption. And it doesn't really offer much that Perl doesn't. There are legions of Perl coders who aren't going to switch to Py for just this reason. They have invested a lot of time in learning and becoming comfortable with Perl idiom and they don't feel they are going to get much bang for the buck by changing over.

      On the other hand, a more modern design with much more natural object support and a number of other features make it much easier and faster for many people to code in, particularly for implementing GUI's and larger programs.

      The point being that a second language in the same space, implementing not that far from the same general feature set of an overwhelmingly dominant language can still provide a good enough design to get a lot of coders to start using it. I code in Python every chance I get becuase it makes more sense to me and for my personal style it makes me a lot more productive.

      D might be able to do the same thing. It doesn't have to be all that different from what is out there, if the way it is structured strikes a chord with the personal style of enough developers.

      --

      7. What we cannot speak about we must pass over in silence.

    5. Re:I don't see it being used by obi · · Score: 2

      Well come on. I don't know of any language to which this applies as much as C++.

      C++ is truly a multi-paradigm language. I've seen codebases that used C++ in completely different ways, all of them valid.

  65. No reflection? by r4lv3k · · Score: 1

    Modern languages like Java and C# support the use of reflection, where classes can access what they are made of which can sometimes greatly simplfy design. Unf. I did not see any mention of reflection on the website...

    Now if D had templates AND reflection, that would be unique and awesome! Haven't seen any language pull that one off (I think C# has it in the works). IMHO they are both necessary to develop truly elegant code.

    ralvek

    1. Re:No reflection? by Burton+Radons · · Score: 1

      My Linux port has reflection with a serialisation module. All that this is waiting for is more time on the part of the compiler author - he's not opposed to adding introspection. What is available now (in both the port and the original) is accessible through the TypeInfo and ClassInfo classes, which you get through .typeinfo and .classinfo properties.

  66. Oh great... by ttfkam · · Score: 5, Insightful

    Yet another way to write and manipulate ints, floats, struct, and classes.

    Why don't people put as much effort into designing standardized interfaces for networking, threading, forking, database access, distributed logic, graphics, etc.

    He goes on and on about how we need unified syntaxes for unit testing, inline assembly, assertions, etc., but is curiously silent with regard to the above issues.

    What are the killer apps? Apache? OpenLDAP? OpenOffice? Mozilla? Konqueror? Photoshop? Gimp? Quake? Neverwinter Nights? Crystal Reports? Gaim?

    Now with that list in mind, how does D make anyone's life simpler? Need a TCP/IP socket? Sure! Just use the POSIX one...unless you're on Windows...or coding for BeOS... What about talking to a database? Well there's ODBC implementation #1, ODBC implementation #2, native database-specific API #1, etc. Well at least there's graphics right? OpenGL all the way...except when you need DirectX...or the framebuffer interface... And for GUI libraries, we have GTK+, Qt, FLTK, MFC, XUL, etc. Along those lines, do you use Gnome or KDE for your object model? Do I write to libxml or use some COM wrapper for MSXML3.DOMDocument?

    What good is uniformity in a complex type when anything I want to do with the language that implements it requires an unending list of non-D libraries that throw uniformity out of the window? Please explain to me how my life is enriched by this language? Please explain how solves more problems than it creates?

    Sure Java, Python, et al have their share of problems, but at least I can open a socket or a filehandle without doing market research on libraries first. At least code written in those languages is readable by someone who knows the language. Database calls look the same no matter your operating system. That's what I want. Not just some new and exciting method for representing imaginary numbers.

    And while we're talking about data types, he writes at length about how ints, longs, floats, etc. are all well-defined sizes unlike in C even though saying int16, int32, and int64 would be much easier to read and helpful. In addition, while the other types are well-defined and char is well-defined as a single 8-bit byte, wchar is sometimes 2 bytes, sometimes 4 bytes, and could be something else in the future depending on the wind. Ask the i18n coders about their experiences with wchar_t. Most end up using an avalanche of #ifdefs or just sidestep it altogether with their own array of bytes. Why? Because sometimes they're using UTF-16 and other times it is UCS4. You need to know how big the character type is! It's not something you leave up in the air! char16...char32... Are these too much to ask for?

    I hope to god that no one actually adopts D for real work in the near future. If they do, they will run into the limitations I mentioned above and figure out some hack to get it to work. Hack begets hack begets hack and you are left with another bloated language lacking uniformity that people will bitch about on tech discussion boards. And then some person will say, "Hey! I've got this new language that fixes all of those inconsistencies with D that we all hate."

    1. Wash
    2. Rinse
    3. Repeat

    --

    - I don't need to go outside, my CRT tan'll do me just fine.
    1. Re:Oh great... by Anonymous Coward · · Score: 0
      And while we're talking about data types, he writes at length about how ints, longs, floats, etc. are all well-defined sizes unlike in C even though saying int16, int32, and int64 would be much easier to read and helpful. In addition, while the other types are well-defined and char is well-defined as a single 8-bit byte, wchar is sometimes 2 bytes, sometimes 4 bytes, and could be something else in the future depending on the wind. Ask the i18n coders about their experiences with wchar_t. Most end up using an avalanche of #ifdefs or just sidestep it altogether with their own array of bytes. Why? Because sometimes they're using UTF-16 and other times it is UCS4. You need to know how big the character type is! It's not something you leave up in the air! char16...char32... Are these too much to ask for?


      Actually, what I'd really like to see would be a "precision operator" that would allow one to declare some primitive type (and complex types as well, perhaps -- interesting possibilities come to mind at the thought of overloading such an operator) that has some arbitrary precision, e.g. int:32, float:45, complex:345, etc. The compiler can map small precision variablies into the usual types (bytes, words, ...) for efficiency reasons, but where larger precision is necessary it is provided transparently through recourse to underlying multiple precision runtime library support.
    2. Re:Oh great... by Tumbleweed · · Score: 5, Insightful

      Okay, then, we should just never make any other computer languages until someone can come up with one that solves every one of those problems you listed.

      If someone finds that D solves problems they have, or if they just plain like the syntax better (and how can you NOT, compared to C and C++ (and Java)??), then there's nothing wrong with someone using D. Hell, I'd use D just for the string-handling alone (one reason why I think C is pretty ridiculous for a general purpose language).

    3. Re:Oh great... by Burton+Radons · · Score: 1

      This has been requested (and is partially in Ada95, for example), but nobody has shown why this would be necessary in any real work. Can you give an example?

    4. Re:Oh great... by RockyJSquirel · · Score: 2

      Eek! They left standardization of threading/multiprocessing?

      I must really be out of it to not notice!

      I wish I could say that at least that means they won't fuck it up as badly as Java...

      But beyond have an OS independent way to write multithreaded/multiprocessor programs, there's another problem that needs to be solved for multiprocessor platforms:

      basically, the "volatile" keyword isn't quite enough. For most processor designs, you need to use interlocked instructions to make data "globally visible" as intel calls it.

      For most purposes, a "volatile" keyword that tells the compiler to always use interlocked instructions when storing/altering a variable would work for most things.

      Some symantics of the language would have to change. For instance "++variable" is defined in C as returning a reference to the varible that's been incremented. This would be wrong for interlocked access where (for various reasons) you need it to return the incremented value instead.

      Rocky J. Squirrel

    5. Re:Oh great... by RockyJSquirel · · Score: 2

      Oh and forgot to mention that there's no getting around the fact that you need a compare-exchange operator for multiprocessor systems.

    6. Re:Oh great... by scrytch · · Score: 1

      Okay, then, we should just never make any other computer languages until someone can come up with one that solves every one of those problems you listed.

      Solving just one would be a good start. I'd be okay with no one ever writing a half-assed language again and calling it mother's milk to programmers everywhere. Learning projects are one thing, but the D emperor still has no clothes.

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    7. Re:Oh great... by dcmeserve · · Score: 1

      > I hope to god that no one actually adopts D for real work in the near future. If they do, they will run into the limitations I mentioned above and figure out some hack to get it to work. Hack begets hack begets hack and you are left with another bloated language lacking uniformity that people will bitch about on tech discussion boards.

      Er, it looked like the vast majority of the limitations you mentioned have to do with the fact that one must resort to using a C library to get to various standard functionalities, since D doesn't have all those libs fleshed out.

      I don't see how this will cause the language *itself* to be subjected to hacks upon hacks, etc. Rather, as each major function is implemented in a native-D library, you simply won't have to "do market research on libraries" for it anymore. Isn't that natural for a language? Isn't it better to provide for this kind of legacy-code-reuse than not allowing for *any* of those available functionalities until it's native-written?

      --
      "Orthodoxy is unconsciousness" - Orwell
    8. Re:Oh great... by Anonymous Coward · · Score: 0
      This has been requested (and is partially in Ada95, for example), but nobody has shown why this would be necessary in any real work. Can you give an example?


      The rationale is similar to that underlying the existence of the GiNaC library (for instance). This paper (PDF) explains in more detail, but from my perspective the crux is that there are no de facto standard mathematical programming languages -- or maybe there are too many such standards -- and that any programming language can benefit (even "systems programming" languages) from strong, integrated support for sophisticated numerical computation. This isn't intended to be a "beginner" language, so I don't see any obstacles stemming from pedagogical reasons...

      One other feature I'd like, in order to complement the built in support for unit testing, would be a mechanism for automatic test generation by specifying a "statistical usage model" directly in the code itself. This idea underpins Cleanroom Software Engineering, and I think it could be successfully adapted for inclusion directly into this language. The basic idea is to tag method parameters with probability distributions describing the likelihood of various values of that type being passed into the method as arguments. The distributions can be used to automatically generate random tests reflecting the most likely "real-world" usage patterns of the software, and meaningful quality metrics (such as MTTF, MTBF, etc.) can be extracted from the test results.

      If wishes were fishes, we'd all eat for free... :)
    9. Re:Oh great... by rastos1 · · Score: 1
      >Well there's ODBC implementation #1, ODBC implementation #2, native database-specific API #1, etc. Well at least there's graphics right? OpenGL all the way...except when you need DirectX...or the framebuffer interface... And for GUI libraries, we have GTK+, Qt, FLTK, MFC, XUL, etc.

      Right you are, sir. We should design a language with ultimate database access (UDC) and ultimate graphic library (UGL).

      The nice things about standards is, that there is so many to choose from.

  67. Observation by Anonymous Coward · · Score: 0

    Just an observation:

    C to C++ took 16 years.
    C++ to C# took 14 years.
    C++ to D took 16 years.

    C to C++ and C++ to D are equal.

    Conclusion: C# sharp won't suceed. D will.

  68. I have no legacy code... by The_Dougster · · Score: 2, Insightful

    And right now, any new binaries which I need to write, I do them in Ada95. If D is somehow better than Ada then I will start using it when possible. Obviously if you are doing something which relies on c++ libs then just stick with that, but if you have the luxury of a new project, then hey what the heck use the new D compiler. Why not, anyways.

    --
    Clickety Click ...
  69. We need a secure system programming language by niftyzero · · Score: 1, Insightful

    There are some basic system facilities that have to be secure. This includes SSH for example.

    Because of pointers and lack of bounds-checking, C++ is not it. Java doesn't interface with low-level system facilities very well. If this newfangled D language does all that, this may be the security Holy Grail.

    1. Re:We need a secure system programming language by Tumbleweed · · Score: 2

      Perhaps if there was a true compiler for stackless python... *sigh*

    2. Re:We need a secure system programming language by Wickie · · Score: 1

      Cyclone is an existing safe dialect of C.

  70. The Bell Labs answer by devphil · · Score: 5, Funny


    There's an axiom at Bell Labs (where C and C++ came from, for those who don't know):

    Some languages are designed to solve a problem. Others are designed to prove a point.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  71. slick C++ with Ada-like techniques? by Anonymous Coward · · Score: 0

    Hi,
    did i get the point? It's a slick C++ (without C) and some Ada-like techniques?
    Did really sound nice to me, hope, it's going to be used in OSS development heavily.
    (gcc will provide a backend soon, i think :)

    1. Re:slick C++ with Ada-like techniques? by Burton+Radons · · Score: 2, Interesting
      It borrows from lots of languages. I haven't looked too hard at Ada95, but what I've seen indicates to me that there's far more differences than similarities.

      Here's the state on the GCC backend. That project is run by Jan Knepper, who at this time and for the forseeable future has no time to spare for it. GCC is the most amazingly opaque piece of software internally, which makes this a pretty serious project needing someone who can make a pretty serious commitment. Once that time comes, I figure it will be three months after that point for the GCC port to be well-functional.

      It is probable that there soon will be a better solution for Linux than my crap-generating port, which is also missing more recent D features. Let's just say that in my opinion it will meet the needs of every Linux i386 user, and being far faster than GCC while producing high-quality code will be a good advantage in that market.

  72. And don't forget... by the+cobaltsixty · · Score: 1

    When a silver bulet for the next decade comes, consider using Ook# to keep yourself employed!

  73. Re:Steelers suck! by Anonymous Coward · · Score: 0

    You're obviously stupid - the Browns already beat the titans once this year

  74. No need for new C-like languages by chneukirchen · · Score: 2, Insightful
    I think, there's really no need to develop another C-like language.

    You always can use C, or Objective-C if you want to program object-oriented.

    You can use C++ if you think, programming C would be to easy. And you can use Java if you think, C would be too fast. :)

    If you want to write a really big and complex application, you better add support for a scripting language (as Guile, Ruby, Perl or Lua).

    And finally if you don't like that C doesn't has GC, just use some GC-lib.

  75. Here's a game by willw · · Score: 2, Insightful
    On the D website, there is an overview of the D programming language which includes a list of C/C++ features that have been deliberately dropped. My game comprises thinking of your own favourite programming language - be it Perl, Java, Eiffel or Visual Basic - and seeing how many of these features have been 'dropped' from it. My favourite language is the Object Pascal in Delphi. 'Yes' means 'Yes Pascal doesn't have this feature'.
    • C source code compatibility - Yes. Wow, gosh.
    • Link compatibility with C++ - No, can be linked to C++ Builder modules
    • The C preprocessor - Yes
    • Multiple inheritance (ie Full not Java-style) - Yes
    • Namespaces (use modules instead) - Yup
    • Tag name space - Yup
    • Forward declarations (compiler searches whole module for name definition) - Nope
    • Include files - Mostly 'Yes' but a little bit 'No'. Delphi does allow includes, but it doesn't use them in the C/C++ sense; it imports binary symbol tables like D. Score 1/2.
    • Creating object instances on the stack as opposed to the heap - Yes, dropped when Turbo Pascal became Delphi
    • Trigraphs and digraphs - Yes
    • Preprocessor - Yes
    • Non-virtual member functions - No, but the Delphi syntax copes better than C++ with the cited problem (no error messages when you fail to supply a virtual base class) by using an extra keyword - override - to signal programmer intent. Score 1/2.
    • Bit fields of arbitrary size - Yes
    • Support for 16 bit computers - I suppose 'No' since Delphi 1 was 16-bit.
    • Mutual dependence of compiler passes - I think 'Yes', but I am out of my depth
    • Compiler complexity - Probably Yes - deduced from Object Pascal's fast compilation. Besides everything is less complex than C++.
    • Distinction between . and ->. Yes - uses only '.' operator.
    So 13/17. Better offers?
    1. Re:Here's a game by Anonymous Coward · · Score: 0

      Delphi rules. Fast and powerful.

  76. It still contains an outdated syntax by Anonymous Coward · · Score: 0

    The kind of syntax that allows for "if", "while", "else", and so on, not followed by braces, where
    if (very-long-condition);
    {
    do-stuff;
    }
    always executes do-stuff.

    The kind of syntax where 013 is not equal to 13.

    The kind of syntax where
    if (a = 1)
    {
    return true;
    }
    always returns true.

    Those stupid errors need a lot of attention to be avoided as a programmer, and are not detected until the program misbehaves or fails the unit testing, wasting a lot of programmer time.

    Such syntaxic pitfalls are a legacy from C (or most probably even before). It should not be in any language that claims to be modern !

    1. Re:It still contains an outdated syntax by Burton+Radons · · Score: 1
      "if (...);" is invalid D code. The empty expression in D is "{ }", not ";", and that change was made for precisely the reason you give. I disagree with it, but no matter.

      "if (a = 1)" is invalid D code. Not a recommended warning (there are no warnings in D) - if the compiler doesn't fail it, it's not compliant. This hasn't found its way into the specification yet - I'll notify Walter.

      Octal notation can't be changed for reasons which should be obvious if you think about it.

      That's a pretty strange last assertion. Does that mean that the most modern language is FORTH? Or perhaps Befunge! Idiosyncratic doesn't equal better. And yes, the basic syntax of C evolved from BCPL and ultimately evolved from FORTRAN.

    2. Re:It still contains an outdated syntax by Anonymous Coward · · Score: 0

      Point 1:
      I was wrong, ok.
      But I still believe using
      IfStatement:
      if ( Expression ) BlockStatement
      if ( Expression ) BlockStatement else BlockStatement
      as a rule for IfStatements would avoid a lot of error cases. Not even mentioning the fact it would solve the "which else?" ambiguity.

      Point 2:
      Where is it written ?
      Right now, the Expression rule directly allows AssignExpression as a way to build a valid expression. And Expression is the required type going after a "if". But my point here was that "=" is way too often confused with "==", and using the assignment operator ":=" (as defigned in algol 67, and used in Pascal and Ada since) solves this problem gracefully, and with minimal effort.
      But using ConditionalExpression instead of Expression would be a good start...

      Point 3:
      What does make using "0o" as a prefix for octal notation a bad way to handle a real problem in C ? I thought about it, and since we don't care about code compatibility with C and C++, I didn't see any reason to reject it. But I may have missed something.

      Point 4:
      What features to drop, point 1. You want D to be as good as it can get, isn't it. And yet, at the same time, it seems to me you're saying "it may not be too syntaxly different from C".
      But at some times, C syntax is wrong. Even if it suffers from a verbose syntax, and an appaling lack of good libraries, Ada solved most of the syntaxic pitfalls that plague C. But since you're trying to replace C and C++, I belive it would be great if you had the courage to correct them, even if some of the latest languages (as Java and C#) have it wrong.

    3. Re:It still contains an outdated syntax by cakoose · · Score: 1
      But I still believe using
      IfStatement: if ( Expression ) BlockStatement
      if ( Expression ) BlockStatement else BlockStatement
      as a rule for IfStatements would avoid a lot of error cases. Not even mentioning the fact it would solve the "which else?" ambiguity.

      Your grammar doesn't allow for the if-else-if-else-if-else chain. A special case could be made for this but I don't see a reason to because enforcing BlockStatement seems unnecessary anyway.

      I think a better solution would be in the next compiler pass instead of in the parser. The compiler could ensure that the code triggered by the 'if' has a side-effect (or could have a side-effect). This will probably produce better error messages as well.

      I have also sometimes thought that '0o' should be used as the octal prefix. Though I've never made the mistake of prepending a zero to a decimal value, it seems a little more uniform to use '0o'. I am also interested in what reason Burton has in mind.

      By the way, how do you include properly-indented code in a Slashdot post?

    4. Re:It still contains an outdated syntax by Anonymous Coward · · Score: 0

      I forgot about the if-else-if-else ....
      It must have something to do with the fact that I hate that way of expressing things, indeed. But what I thought interesting was to keep explicit begin and end tags for conditional statements.

      As for properly indented code, using <pre> and <tt> tags does wonders...

    5. Re:It still contains an outdated syntax by cakoose · · Score: 1
      As for properly indented code, using <pre> and <tt> tags does wonders...

      That's what I normally use, but Slashdot doesn't seem to allow the <pre> tag. Now I see that there is a 'Code' posting option but that effectively puts the whole comment within <pre> and <tt> tags. How exactly do you do it?

    6. Re:It still contains an outdated syntax by Jayson · · Score: 1

      No, the most modern language is K. Seriously. If you are writing a language it should be required knowing about. It's amazing.

  77. This is true of most systems by mlyle · · Score: 1

    Most dynalinking codes allow libraries to cause an initializer function to be run when they're loaded. So the problem you're describing isn't really new and exists on most systems today.

    Besides, no system can verify the integrity of itself-- you'll run into Godel's incompleteness theoreum if you try. ;)

  78. Csharp is not Dflat by Habbie · · Score: 2, Informative

    Yes, on a piano it is. As on most guitars. But on a recorder flute or for example a violin, Csharp and Dflat are not the same!

    1. Re:Csharp is not Dflat by Anonymous Coward · · Score: 0

      AFAIK, Microsoft has no plans to port .NET to a recorder or flute.

  79. Re:Steelers suck! by Anonymous Coward · · Score: 0

    .. and the Browns have also beat the jets

  80. Pascal has not value classes by StrawberryFrog · · Score: 2
    Pascal has value classes

    Which version of pascal would that be? Some people insist that when you say "pascal has" you should refer only to the published standard pascal, which doesn't have classses of any kind whatsoever.

    I've been programming for years in the most popular commercial extension of Pascal, Delphi. It has no value classes.

    and so does C#.

    I have Jesse Libery's book "programming C#" (2nd ed) right here. On page 126 he notes "although a class is a reference type, a struct is a value type" . Thus C# does not have reference classes.

    --

    My Karma: ran over your Dogma
    StrawberryFrog

    1. Re:Pascal has not value classes by Major+Woody · · Score: 0

      How is it that everybody in this thread knew what g4dget was talking about when he said "value classes" except for you? Clearly he meant "something that kind of looks like a class that at least has data members, except its allocated on the stack instead of the heap". Pascal has this via the use of RECORDs. C# has this via the use of structs.

  81. D has a marketing department... by RockyJSquirel · · Score: 3, Informative

    I was looking at the list of features.

    While it looks fine, and useful, I can't help noticing that last time we heard about D it didn't have most of these features (templates, overloading etc.) and they were claiming that the lack of these features was it's strength.

    I called them ignorant swine for that at the time.

    The new D looks a lot like Modula 3, a great language aiming at the same sort of niche which disappeared without a trace.

    Rocky J. Squirrel

    1. Re:D has a marketing department... by alannon · · Score: 2

      D does have templates. It simply claims to not implement them in the same brain-dead manner as C++ does.

    2. Re:D has a marketing department... by daniel_yokomiso · · Score: 1

      Those features we're asked by D's users, but they are simpler and safer than C++ version. Right now C++ has more expressive features, but D is improving.

      Best regards,
      Daniel Yokomiso.

      --
      Disclaimer: If I disagree with you I'm probably trolling...
  82. OO IS EVIL! VIM RULEZ! by Anonymous Coward · · Score: 0

    Emacs users will be cast into the fiery void of arcane key combinations. Vim is the one true editor!

    :wq

  83. Some comments by Anonymous Coward · · Score: 0

    I'm extremely unimpressed by this language. Looking at it it seems the author his learned a little bit of C++, and then, without fully understanding it, set out to "fix" it. Looking at the "differences with C++" page, I find he made the following changes:

    - An extra keyword is needed to specify a constructor. Whoop-dee-doo, *that* will certainly gain us a 10% productivity gain!

    - The baseclass constructor can now be called from any point within the child constructor - or presumably, not at all. I'm not sure what prompted this odd notion, but I can see a new class of bug here: forgetting to call the baseclass constructor.

    It also breaks the guaranteed destruction order of C++ - C++ guarantees that destruction order is opposite of construction order. Without a fixed construction order, presumably D has no fixed destruction order either.

    - The structure comparison feature is poorly thought out. The author uses a very nasty method to compare two structs, and then he complains that the method he used is nasty so C++ must be 'fixed'.

    I do agree that it would be nice if some sort of structure comparison facility existed within C++. However, the correct way to do this would be to add a structure (or class) inspection facility. Such a facility would serve more than just this one need - for instance, it could also be used to build a serialization feature for structures (or classes). This way orthogonality would be preserved.

    The author of D obviously missed this and added a little wart to the language just to solve one specific problem. Worse, this solution does not at all scale to the other comparators (, >=). Suppose I have a struct s { int a, int b }. How can the compiler define a meaningful operators1). Again, orthogonality (and with it understandability) suffers.

    - The strong typedef feature is a good idea. I wish it were added to C++.

    - The "module" idea is again badly thought out. Instead of giving more and more code access to more and more private members, what is needed is to precisely allow access, for one specific class, to a specific body of code. One way to do this is to add a fourth type of protection class (alongside public, protected, and private) that grants access to only one specific other class (and possibly its children). Like this for instance:

    class X {
    public: ...
    private: ...
    interface class Y:
    void func ();
    };

    The function func contained in the 'interface' block is part of class X, but can only be accessed by class Y. Thus we get the benefits of having a friend declaration (to whit, a class can have members that are accessible to a specific non-child class, but not to everyone else), without giving up the benefits of the 'private' keyword.

    In comparison, the module feature just makes the problems with the friend declaration worse by removing *all* boundaries within the module.

    For large projects, being able to fence off members (using a private declaration) is not just a theoretical nicety. It is a matter of life and death.

    - The 'cmp' function: I do not entirely understand how it works, but I guess the 'cmp' function returns an integer that specifies either , or >=. Bear in mind that since I'm guessing here my criticism could be wrong.

    First of all, why return an integer and not an enum? Second, what stops you from doing exactly this in C++? Define your overloaded operators once for a base struct or class, derive your structs or classes from that base struct or class, and override the virtual cmp function for each child that needs it. The amount of work is nearly the same - all you need extra is the base comparison operators.

    - Namespace 'using' declarations: I do not have enough experience with namespaces to comment on this.

    - RAII: I (and I imagine I am not alone in this) commonly use this strategy on dozens of things that are not memory or semaphores. They are used for *anything* that must be deallocated, including windows, controls, files, filescan structures, printer enumerations - the list is endless. I only have *one* delete statement in 160,000 lines of code - in my autopointer class.

    Not having to write that one delete statement is not going increase my productivity by 10%. In fact, if I wanted to do that I should stop reading slashdot...

    1. Re:Some comments by Paradise+Pete · · Score: 1
      Looking at it it seems the author his learned a little bit of C++, and then, without fully understanding it, set out to "fix" it.

      Yeah, what the hell does Walter Bright know about writing C++ compilers, anyway?

    2. Re:Some comments by cakoose · · Score: 1
      - An extra keyword is needed to specify a constructor. Whoop-dee-doo, *that* will certainly gain us a 10% productivity gain!
      - The baseclass constructor can now be called from any point within the child constructor - or presumably, not at all. I'm not sure what prompted this odd notion, but I can see a new class of bug here: forgetting to call the baseclass constructor.

      I don't think he claimed that using 'this' to specify a constructor would increase productivity. That said, I like the feature.

      Firstly, it doesn't add any extra keywords. The 'this' keyword is already used to call other constructors within a constructor. Also, I think it is slightly more orthogonal than using the class name. While using the class name makes it mesh better with the 'new ClassName()' instantiation expression, using 'this' matches the syntax used to call alternate constructors from within a constructor.

      A real tangible advantage of using 'this' is that it doesn't rely on the class name. If you end up changing the class name (something I find myself doing often), you don't have to worry about about changing all the constructor calls (superclasses included).

      Being allowed to call the superclass constructor anywhere in the constructor is definitely a good thing. Since calling the superclass constructor is essential, I'm sure the compiler will insert it in there for you if you don't explicitly do so (this is how it works in Java).

      Requiring the superclass constructor call to be at the top is really a pain-in-the-ass restriction. Sometimes, you will want to do some calculations on what parameters to pass to the superclass constructor. In Java, for example, the following code cause a compiler error:

      class ErrorMessage {
      ErrorMessage(String message) {
      ...
      }
      }

      class MyError extends ErrorMessage {
      static String MESSAGES[] = { "file not found", "blah", ... }<br>

      MyError(int code) {
      String message;
      if (code < 0) {
      message = "negative error code";
      } else if (code >= MESSAGES.length) {
      message = "unknown error code";
      } else {
      message = MESSAGES[code];
      }
      super(message);
      }

      }

      Even though the code before the 'super(...)' call doesn't touch any instance variables, it is still not allowed. The dumb thing is that you can actually achieve the desired result with the following constructor code:

      MyError(int code) {
      super((code < 0) ? "negative error code"
      : (code >= MESSAGES.length) ? "unknown error code"
      : MESSAGES[code]);
      }

      In this situation, the second example's code may or may not actually be more stylistically pleasing, but I'm often stuck in situations where I have to create these truely monster expressions. Sometimes, it is simple impossible to create an equivalent expression because of the imperative nature of what has to be done (resorting instead to creating external functions just so I can fit it all into a single expression).

      Sorry about the unreadable formatting. Couldn't figure out how to post code on Slashdot. I tried nesting <blockquote> tags but encountered the junk filter. I didn't try &nbsp; characters but assumed that they would aggravate the filter even more than the <blockquote> tags.

  84. Re:Steelers suck! by Anonymous Coward · · Score: 0

    And the Browns ain't going to the Super Bowl, so it don't matter, does it?

  85. Why not use an existing modern, well-designed one? by jopet · · Score: 2, Interesting

    Why not simply use a well-designed, modern language like Ocaml (www.ocaml.org)? Functional programming and strong typing compined with type inference can give your productivity quite a boost, once you get used to the modern times.

  86. Where is Algol68? by Anne+Thwacks · · Score: 4, Interesting
    Algol68 is what we want/need.

    Algol68 does all the things claimed for D, and more (Including support for threads). Designed and tested 30 years ago, it only died because it was not invented by IBM, who, at that time, were the power that M$ is today. And the books about it were printed in decent fonts :->

    Come on all ye compiler-writers, and give us an Algol68 compiler (preferably will support for NetBSD on Sparc :-)

    --
    Sent from my ASR33 using ASCII
    1. Re:Where is Algol68? by lahi · · Score: 2, Interesting


      Algol68-to-C by Sian Leitch
      (Source appears to be somewhat Debian-centric. I haven't managed to compile it on NetBSD yet.)


      Algol-68G
      (Works fine with NetBSD-i386, I suppose it would on sparc too.)

      -Lasse

    2. Re:Where is Algol68? by Tony-A · · Score: 3, Funny

      Algol68 may *still* be ahead of its time. :-(

    3. Re:Where is Algol68? by hughk · · Score: 1

      Unfortunately, the computers that could compile and run it were painfully slow by today's standards and also memory limited. Some reduced variants were created (68R), but they still didn't exactly sing. It was used for some defence and telecoms applications in the UK, but was largely supplanted by CORAL 66 until ADA came along (also not exactly fast).

      --
      See my journal, I write things there
  87. My favorite by r6144 · · Score: 1
    Generally Not Used
    Except by Middle-Aged Computer Scientists

    Well, although I am a Emacs (and GNU) fan, it is really ``Generally Not Used'' by anyone I know.

  88. Ok, what's the licence? How proprietary? by RockyJSquirel · · Score: 2

    Can anyone write a D compiler?

    Does it have to be approved?

    I assume the compiler itself isn't open source.

    How much is this going to cost me (or my employer)?

    What are the plans for commercial vs. non commercial licences.

    Rocky J. Squirrel

  89. Re:What is D? Delphi with C++ syntax by marcovje · · Score: 1


    If I look at the specs, it looks more like Delphi with C++ syntax then a C++ derivate.

  90. Re:Why not use an existing modern, well-designed o by Anonymous Coward · · Score: 0

    They call ocaml a hacker's language? HAH!

  91. Should it not be called "P" by rasteri · · Score: 1

    ...since so far C-like programming languages seem to be following the letters of the programming language "BCPL". Yes, the language that preceded C was B, but the fact that it precedes it in the alphabet is a coincidence.

  92. hacker's language by jopet · · Score: 2, Interesting

    I do not know whether anybody calls Ocaml a hacker's language nor even what your idea of a hacker's language is. Fact is that Ocaml is a language that supports the process of problem solving better than many other language and certainly better than C, C++, or D. Anybody who invested a week or two to learn how to program in a modern language like Ocaml will experience that he/she is now suddenly capable of implementing more functionality in less time. Maybe even with less lines of code. And much smaller likelyhood of crashes. Actually, I have yet to see a program written in Ocaml crash.

  93. Re:Ok, what's the licence? How proprietary? by DarkBlack · · Score: 1

    I really should have read the article before posting. Oh, I forgot, this is slashdot.

    On the first page there are links to both a win32 compiler and a linux port. Download them to read the license.

    Don't expect slashdot to do your homework. If you had really been interested in evaluating this, you would have read the article before posting.

  94. Re:Ok, what's the licence? How proprietary? by Burton+Radons · · Score: 1
    It's a free language; anyone can write a compiler. If it passes a suite of compliance tests as yet unwritten, it's a D compiler (Compliance will be easier than C for sure). The reference implementation is free, and produces code on par with MSVC and GCC. The backend is closed-source, but the frontend source is included in the distribution under the Artistic and GPL licenses, your choice. If you want to get the backend source, you'll have to talk to Walter (walter@digitalmars.com). I have no idea whether he'd be jiggy with licensing it.

    The frontend leaves you at the stage of the syntax tree after semantic checking, so it's ready for translation into an IR. I wrote a dumb backend for my Linux port, so I can help anyone with the trickier parts of the frontend, like struct initialisers.

  95. Whoa. Try/finally for cleanup? by Kickasso · · Score: 1
    I can't believe somebody could make this mistake again. It's just plain wrong. There are destructors for that purpose. They encapsulate cleanup so that that the programmer doesn't have to worry about it.

    Compare this (C++):

    {
    ObjectThatNeedsCleanup o;
    DoSomething();
    }

    with this (Java/D/whatever):

    {
    ObjectThatNeedsCleanup o;
    try {
    DoSomething();
    } finally {
    o.cleanup ();
    }
    }

    And they say try/finally is less error-prone? Gimme a break. Repeat after me: encapsulation good, code duplication bad.

    Aside: how do I insert friggin' spaces with this ecode thingy?

    1. Re:Whoa. Try/finally for cleanup? by Burton+Radons · · Score: 1
      See (here) under RAII. In short, you apply an "auto" attribute to the class and instances of it; this will insert a "delete XXX;" when it goes out of scope. auto classes are limited to local variables and can't be reassigned, so they can't be included in garbage collection and thus have a more stable environment for the destructor.

      I'm not going to advocate how this feature is put together; I've never used it.

  96. lack of bool type by pomakis · · Score: 2

    I think it's a real shame that D lacks a bool type. That's the first thing I looked for when I went to the spec. It's such a trivial thing to add, and (in my experience) makes a lot of code quite a bit cleaner (i.e., easier to read/understand). It could also (in theory) help a compiler optimize code, because there are only two possible values (enforced at compile time!) rather than the entire range of the integer type.

    1. Re:lack of bool type by Burton+Radons · · Score: 1

      It has a bit type with true and false constants, which is rather misnamed as it doesn't allow implicit casts to it, but explicit casts have a logical (boolean) result. bit arrays are compact, and we could pack class fields. However, bit pointers are not allowed, nor are bit inout/out arguments for functions, as these would require pointer/mask pairs. I think it's worth the additional complexity, but there's more important things right now to work on.

    2. Re:lack of bool type by Anonymous Coward · · Score: 0

      The "bit" type.

    3. Re:lack of bool type by alannon · · Score: 2

      Try the 'bit' type.
      A list of C and D primative types is here.

  97. This is very limited RAII. by Kickasso · · Score: 1

    Only local function variables? Why not class members? Oh, and the garbage collector calls the destructors in the non-auto case. I don't see how they are different from Java finalizers, and pretty much everyone agrees that Java finalizers were a bad idea.

  98. D - Not for beginners! by fygment · · Score: 3, Interesting

    "I could imagine it being a real pain for a new programmer to learn a language like that."

    D isn't for beginners. It's for intermediate to advanced programmers of medium to large programs. Read about it here:

    http://www.digitalmars.com/d/overview.html

    --
    "Consensus" in science is _always_ a political construct.
  99. D License by Anonymous Coward · · Score: 0

    Note: all D users agree that by downloading and using D, or reading the D specs, they will explicitly identify any claims to intellectual property rights with a copyright or patent notice in any posted or emailed feedback sent to Digital Mars.

    Does this bother anyone else besides me?

    Only the compiler front end appears to be open source. The libraries appear to be proprietary.
    The D language looks great, but it's the kiss of death to a language if potential users don't know if they can legally use it. Their FAQ needs to be more explicit on this issue.

    http://www.opend.org has an effort to make a truly free version of the language (a front-end for GCC).

  100. Types... by SlayerDave · · Score: 1

    The biggest selling point for me is D's direct, language-level support of complex and imaginary number data types. The C/C++ treatment of this issue is a hack at best. Delphi uses variants, which I find distasteful, and Java ignores the issue altogether. So for me, a developer who knows C++ and wants to write scientific applications, it looks like D has just the features I want.

  101. Fair enough by the_Speed_Bump · · Score: 1

    I guess what I meant was that C and C++ tend to enable, instead of restricting programmers "for their own good." (correct me if I'm wrong, but that's the impression I get from Java)

    Also, one little thing: D will un-virtualize a specific call if it can come to the conclusion that it's not necessary. More or less ideal, I think. :) (it's also got things like final methods, for which it is a compile-time error to override)

    --
    "Break out the gin, and the small violin, I'm a raging success as a failure." --Firewater
    1. Re:Fair enough by aled · · Score: 1

      Java isn't more restrictive than C, until you try to program in C with it.
      Programmers use to talk about restrictive when they are showed a new language in which things that normally do are not needed anymore and other features are used differently. It should be translated to "don't touch my toys or else...".
      In fact, to do anything usefull with a computer you must restrict your language grammatic and semantic, isn't it so computer? HAL? what's wrong with this thing?

      --

      "I think this line is mostly filler"
  102. I disagree by spitzak · · Score: 2

    I see way too much code like this:

    class FunnyName {
    public:
    FunnyName() {} // does nothing
    ~FunnyName() {do_the_cleanup_I want();}
    }; // Many lines later when we finally want it:

    function() {
    FunnyName funnyname; // make the cleanup happen.
    do_stuff(); // cleanup is done here because we fooled C++ into doing it. Too bad // nobody can figure this out by reading the source!
    }

    I think explicitly stating what is wanted with finally is far better.

    I think even better would be to somehow specify the "finally" back where the decision it was needed was written. Usually this was due to some action at the start of the function. Some syntax like this, maybe:

    function() {
    finally {cleanup_A();}
    do_A();
    finally {cleanup_B();}
    do_B();
    do_other_stuff_that_might_throw_exception();
    }

    The result of the above, if no exceptions are thrown, is that do_A, do_B, do_other_stuff..., cleanup_B, and cleanup_A are done in that order. cleanup_B and cleanup_A are done if exceptions are thrown (unless do_A throws an exception in which case only cleanup_A is done).

    The reason for this syntax is so that when I decide do_A is no longer necessary I can delete it by deleting (or commenting out) 2 adjacent lines of code.

  103. missed one by Anonymous Coward · · Score: 0

    You forgot:

    4. Profit!

  104. Congolmeration by Cranx · · Score: 1

    From a person who develops in C++, Java, and Object Pascal (Delphi) a lot, it's nice to see a language show up that sort of just glops it all together into one big Frankensyntax. *shrug* Now if Borland would just support it with a Delphi-esque IDE and port that to Linux ala-Kylix and call it Builphix...

  105. Do not forget C-- http://cminusminus.org/ by now3djp · · Score: 1


    C-- Is an abstraction of Assembler and C combined. Great for use in decompilers. Or as in my case decompilation.

    Regards

    now3djp

    http://cminusminus.org/

  106. Just great .... by Anonymous Coward · · Score: 0

    Instead of wasting their time on another language that isn't going to become anything but a fad, why don't these morons use their intellect to help solve some real world problems like the decline of society and the destruction of the environment? Another bunch of losers that want to make sure that their putrid life has some meaning by leaving their mark somewhere.

    1. Re:Just great .... by Burton+Radons · · Score: 1

      Damn, this is going to get put in the troll category and disappear, and I can't agree more. What about this laundry that's piling up? Why won't Walter wash my floors instead of gallavanting about with this language nonsense?

  107. Progress? by Anonymous Coward · · Score: 0

    I wish going from C to D would be considered progress by the Dean of my college. Sheesh.

  108. Re:Why not use an existing modern, well-designed o by scrytch · · Score: 2

    Ocaml is fabulous, except for one big wart: it lacks overloading. Declaring a function again with a different parameter signature simply replaces the function. This forces you to make the type polymorphic instead of the function, which isn't cool when you don't want to touch the type. This tends to make adaptors come into play when they shouldn't have to. Compare to Haskell, which does have overloading (but forces very weird monad syntax and semantics on you when you want state). Is anything being done to address this rather annoying problem? It's not a complete show-stopper, but it does make me feel like I've been limited where I shouldn't have been.

    --
    I've finally had it: until slashdot gets article moderation, I am not coming back.
  109. low level features needed in high level langauge? by iggymanz · · Score: 2

    Looks a little better than c++ (which I've been doing for 11+ years), what with enforced single calling of class/object destructors, garbage collection, try/catch/finally blocks, package/module, doing away with throwback preprocessor syntax....but would anyone really use this for device drivers and OS kernel writing? No, probably not. And if not, then why bring over the "low level" features of C, like primitive data types, unions, explicit pointers.....leave that stuff for the C libraries that you maybe CALL with your high level language.

  110. Try C99... by ChaoticCoyote · · Score: 2

    ...which has intrinsic support for complex and imaginary numbers. GNU gcc is getting closer to full C99 compliance with each release.

  111. Re:Why not use an existing modern, well-designed o by scrytch · · Score: 2

    Adding on (I wish slash supported something like .5e's editing), the overloading problem's even worse than lacking ad-hoc polymorphism. I don't think there's even a type for operators (e.g. ordinal, sequence) like haskell has, so you couldn't make a type implement the list operators if you wanted to. Add to that having different infix operators for float and int. I can see not mixing them (implicit promotion is evil) but you can't even add two floats with + and you must use +. instead. I don't want to sound like I hate ocaml, but those are some real turn-offs that could and should be fixed.

    --
    I've finally had it: until slashdot gets article moderation, I am not coming back.
  112. That Old Time Religion by mellon · · Score: 2

    As someone who used Emacs on character terminals back when a bitmapped display that could be used for text editing wasn't even a pipe dream, I can tell you that the Hurd wasn't even a twinkle in RMS' eye when emacs came out. The original Emacs was written in ITS TECO on the DECsystem 10. Let's face it, folks, Emacs is the Old Religion. :')

    As for first tools, I believe that RMS thought of gcc as the first tool, but I could be wrong - it's been a long time.

    BTW, speaking from my experience with gcc hacking way back when, I can say pretty definitively that if you want to have some fun geek adventures and learn a lot, you could do worse than to participate in hacking on the D compiler.

  113. I've Known Walter a Very Long Time (Some History) by ChaoticCoyote · · Score: 5, Interesting

    ...and I have great respect for his work. Back in the early 90s, he had the first and best C++ native-code compiler, which he built on his solid Datalight C tools. Walter's compiler became Zoretch C++, which became Symantec C++, which became their Java compiler (after a fashion). I used Zortech C++ up until the time Symantec let it die on the vine. I even wrote the official numerical programming docs for Zortech and Symantec C++.

    I remember sitting around with Walter and his buddies, talking about how much trouble Walter had in implementing C++. This was before the ISO standard, and to some extent, before the ARM definition. Walter isn't a fool; he's one of the brightest programmers I've ever met. When C++ was first emerging, I talked with compiler developers from Watcom, Microsoft, and others; all found C++ to be more than a challenge. Stroustrup invented an incredible power tool that ANSI complicated through the committee process; I am impressed that anyone has come close to making this monster work.

    D is Walter's attempt to move beyond C++, based on his experiences in writing C, C++, and Java compilers. I'd say he has an excellent understanding of the issues involved.

    Do I use D? No. While a good effort, D simply doesn't address my programming needs. When I look at a "new" language, I consider O'Caml or Haskell or something that provides very different paradigms. I don't believe it is possible to define a single, all-purpose programming language that scales across the spectrum of applications. I haven't got anything against D, but it doesn't do anything for me that I can't get elsewhere.

    Whther or not I use D is irrelevent to its future. Walter Bright has created yet-another-C-derivative; it may succeed, or it may end up like the hundreds of "good ideas" that never caught on. But don't make the mistake of thinking Walter is foolish; he has a fine mind and has produced brilliant software before. He once started from obscurity to build the first useful XC++ compiler for MS-DOS and Windows; I will not be surprised at all if he proves his mettle again with D.

  114. Re:Why not use an existing modern, well-designed o by jopet · · Score: 1

    There are good reasons for this. Note that the different design decisions that are made for a language ultimately should lead to make life easier for the programmer.While some of the issues you raise might look like limitations or complicated at first sight, they allow a design that makes other things possible which are more important. For example, the different operators for float and int might look like unnecessary work at first sight, but when you look at it a second time it makes you more aware of what type you are really using. This is actually a strength of Ocaml and one of the reasons why programs tend to be less error prone once the have managed it through the compiler. I am not really an expert, but I suspect that this also makes type inference easier or even possible, and this by far outweights the problem of typing that additional dot for float addition. Type inference and type parametrization are something that is incredible useful, once you have tried it. The nice thing about Ocaml is also that you can actually use different programming paradigms, depending on taste and aplicability: modules, functors, closures, objects, functional style or procedural style, pattern matching - it is your choice.

  115. Carts driving oxen by leandrod · · Score: 2
    > its time for a new language born out of practical experience implementing compilers

    That is not what I want for sure. I want a language based on conceptual integrity, and then it is the compiler job doing the better of it. To me, and perhaps to Donald Knuth, having the compiler determine the language is like the cart driving the oxen.

    Perhaps what I want would be more in the way of a relational Scheme or ML. But then, the missing part is the relational system, not Scheme or ML.

    BTW have someone ever tried to create a compiler for Dijktra's guarded programming language?

    --
    Leandro Guimarães Faria Corcete DUTRA
    DA, DBA, SysAdmin, Data Modeller
    GNU Project, Debian GNU/Lin
    1. Re:Carts driving oxen by Anonymous Coward · · Score: 0
      BTW have someone ever tried to create a compiler for Dijktra's guarded programming language?

      An unimplemented language is the fruit of ignoring implementation issues.

  116. It has a garbage collector... by Mike+McTernan · · Score: 1

    ... up until this point I thought it looked quite good. Unless you can turn it off and get around it, it's not going to be too good for embedded realtime systems - a reserve for C for quite a while now.

    Also not sure about the intrinsic thing in Phobos - isn't it the job of the compiler to spot processor specific optimisations and apply them in a transparent manner?

    --
    -- Mike
    1. Re:It has a garbage collector... by cakoose · · Score: 1

      Also not sure about the intrinsic thing in Phobos - isn't it the job of the compiler to spot processor specific optimisations and apply them in a transparent manner?

      It still is transparent. You don't have to do anything processor specific. 'intrinsic' is just essentially a namespace for certain functions that are good candidates for manual optimization. As is especially the case with CISC instruction sets, there are often very specific instructions that will do what you want but that the compiler isn't smart enough to make use of.

  117. Modula-2 by jbolden · · Score: 2

    What languages out there are truly modular? Are there any languages that encompass basic logic principles and which are then able to be augmented by blackboxed modules?

    Don't know if this language still exists but Modula-2 was designed to offer Pascal like syntax with very strong support for programmers pulling in each other's modules as a black box. It was the core design principle. Logitech (yes the mouse people) used to make a very cheap compiler for the PC though I'm sure you can pull down free ones today.

    Another language with very strong black box module support are mainframe COBOLs; in fact many languages popular on mainframes (like VAXBasic have this).

    The fact is today though almost every language has good support for black box modules and it turns out that the advantages of great over good don't outweigh the huge limitations so today's languages tend to have strong support.

    Are there any truly novel languages out there, or are they all just variations on a common theme, with shared shortcomings and much duplication of effort?

    Anyway I really think you are using novel wrong here. What it seems like you are asking is "are there languages different from one another so that's its worth knowing more than one". For this I'd say absolutely. Mathematica for example offers huge advantages in programmer productivity over C with numberic extensions for symbolic work; plus an interactive vs. a static environment. So for example what might takes weeks in C takes in hours in Mathematica to write and debug. OTOH Mathematica code tends to execute roughly 2000x slower than the same code implemented in C. So here you get a clean trade off of programmer productivity vs. computer productivity.

    And in general that's the case with interpreted dynamically typed languages vs. fully compiled staticly typed languages. The real novility that is going on today (with languages like Java) is to try and avoid the extreme cases (like C and Mathematica) and try and get high programmer productivity and high computer productivity. Parrot for example is an excellent project which is working on this very theme.

    LISP was genuinely novel. Lex and Yacc were genuinely novel. Highly specific languages designed for one task but Turing complete (like sendmail's language) were genuinely novel. OTOH is novel what you are after?

  118. Re:Steelers suck! by larry+bagina · · Score: 1

    i gave kathleen fent a "Cleveland Brown" last night (shit on her ample cleavage, then titty fuck her).

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  119. switch statements by Eric+Smith · · Score: 3, Insightful
    I looked over the FAQ, and am thoroughly unimpressed with some aspects, like the decision not to fix the behavior of the switch statement (i.e., falling into the next case if there's not a break).

    The stated argument is that it's desirable to make the language "look like" C. If you want a language that looks like C, use C. Personally, I want someting better. In fact, I think that making Java look like C was one of Java's biggest mistakes; it lulls the programmer into a false sense of familiarity when in fact Java's semantics are much different than C's.

    And if you just want to make sure that C programmers don't get burned by their old habits, there's a simple solution to that as well. Require that each case end with a "break" or "fallthrough" statement. That way there's no ambiguity if the user forgets the break, it will produce a compile error.

    1. Re:switch statements by SpryGuy · · Score: 1

      Yes, the switch statement is one of the biggest annoyances in the C/C++ language, imho. Okay, I said "one of" ;-)

      I programmed in a langauge called BLISS for a few years, which pretty much did everything wrong EXCEPT the way it did switch-like statements. It had several alternatives, depending on what you wanted. One was a compile-time "select" statement that worked just like the C switch did (more or less). Then there was a "SelectOne" statement that didn't do automatic fall-through. And finally, there was a DYNAMICALLY evaluated one, where you could use variables and expressions for your "case" statements, and it was essentially syntactic sugar for long and messy "if/elseif/elseif" type statements.

      I would hope that D would "fix" this problem with the switch statement. I mean, the problem with "switch" is that it's default behavior is only RARELY needed. Thus the default behavior is incorrect. Each "case" SHOULD be treated as a statement-block, just like in an if/else, and not just a stream of statements. This would eliminate another problem of declaring variables in "case" blocks. Personally, I'd require the braces (since I always put them in anyway).

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
    2. Re:switch statements by Anonymous Coward · · Score: 0

      you're a stupid fuck
      the fallthroughs on switch take one second to learn.
      all C programmers expect it.
      yes, dumbassed programmers like you would like it but if you screw with it all good programmers will not use the language.

    3. Re:switch statements by Eric+Smith · · Score: 2
      all C programmers expect it.
      And all C programmers get screwed over by it, sooner or later. I've had to fix code that was out in the field for years with one of these stupid bugs in it. I would much rather have the language defined so that the compiler can catch this.

      Sounds like you belong to the "I don't want any damn compiler telling me what I can and can't do" camp. If you don't like having the compiler check for obvious errors, you should write in BCPL, or maybe assembly language.

  120. beware of DDJ (off-topic) by Anonymous Coward · · Score: 0

    Be careful not to overlook other aspects of DDJ.

    See for example the neo-fascist editorial on the Feb edition by J. Erickson, and his take of state laws discriminating against immigrant workers (i.e. his interpretation of New Jersey SB1349 applying to legal resident aliens)

    Morons like J. Erickson affect DDJ as a whole, and focusing only on theat publication's technical aspect will just allow such hateful incompetence to fester further.

  121. Heisenbugs by LPetrazickis · · Score: 1

    Dictionary Definition

    Heisenbugs are eeeevil!:P

    --
    Is this a sigs-optional kind of place? 'Cause I am totally down with that if you know what I mean.
  122. No Interfaces by Anonymous Coward · · Score: 0

    D doesn't seem to have an equivalent to the Java interface.

  123. Squirrels by Anonymous Coward · · Score: 0

    His name was Rocket J. Squirrel, in case anybody cares. No, I ain't using my karma on this one!

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

      His name was Rocket J. Squirrel, in case anybody cares.

      Yeah, I know that.
      I just wish I'd spelled Squirrel right.

      Rocky J. Squirrel

  124. Yes except by ttfkam · · Score: 2

    Yes except that people will start writing code to those C libraries and build a mountain of code that has no consistency. Even if there are native D libraries, what benefit would it give if there are three different interfaces for database access? D doesn't need to implement everything. Software darwinism is a good thing. But at least specify the interfaces!

    Otherwise I will have to do the market research to determine which API I will code to. I don't have to do this in Java (or .NET). Why? Does Sun write every database driver out there? No. They wrote a database API interface almost from the beginning to which vendors could write their own implementations. The obvious standard made ad hoc interfaces seem ridiculous. And rightly so!

    Imagine what C++ would have been like if it didn't have be compatible with C. Unfortunately, that similarity was the only way that it could get a foothold and get used.

    D, on the other hand, is not prentending to be "C with classes" or "C only better." A D compiler cannot compile C or C++. I applaud the author for making the clean break and taking only the parts of C and C++ (and Java) that make sense. But as soon as the tutorials pop up in Dr. Dobbs and various online venues that teach OpenGL programming with D as linkage to the C library, D is screwed.

    Modern C++ can do so many things, but because of the C baggage, it is constantly held back. 95% of the time, you should never use char* for strings in C++. std::string makes much more sense in almost every way. It's easier to use, consistent with the STL, and about as fast as char*. There is so much code out there that uses char*, however, that std::string adoption (and std::list, std::map, std::vector, etc.) has been unreasonably slow.

    Don't underestimate inertia. D should try to stay out of the limelight as long as possible so that these design issues can be worked out. Otherwise you'll end up seeing ad hoc implementations of every major feature with no consistency. And we will be right back where we started -- only with a new name to our troubles.

    --

    - I don't need to go outside, my CRT tan'll do me just fine.
    1. Re:Yes except by dcmeserve · · Score: 1

      > Yes except that people will start writing code to those C libraries and build a mountain of code that has no consistency. ...
      > D should try to stay out of the limelight as long as possible so that these design issues can be worked out. Otherwise you'll end up seeing ad hoc implementations of every major feature with no consistency.

      --ding!--

      Ahh, now I get it. ;)

      Yes, it would probably be in D's best long-term interests to *remove* the C-library accessibility, at least until it has a substantial code base already.

      It serves it in the short term, allowing one to write fully-functional programs easily, but perhaps there's a sort of unwritten idea -- in the minds of D's creators --- that any such programs you write now will be rather temporary. The danger being that a lot of users might not get that.

      I guess they try to warn people a bit by declaring D as being in Alpha stage, but maybe they should probably make these aspects more clear in their documentation, instead of trumpeting the C-compatability stuff.

      --
      "Orthodoxy is unconsciousness" - Orwell
  125. Re:More importantly... by Anonymous Coward · · Score: 0

    How does it feel to lose to a homo, then?

  126. Re:What is D? Delphi with C++ syntax by lscoughlin · · Score: 1

    delphi is a _well thought out__ (unlike c++) oo extention to pascal, which is basically just really really verbose c. It would follow that they would be similar.

    However, it has some features distinctly different from delphi's that are very interesting, and make it unique in it's own right ant not "just another (blah blah blah)".

    --
    Old truckers never die, they just get a new peterbilt
  127. I meant it though by MichaelCrawford · · Score: 2
    Chuck meant his Power Koding page as a joke, sure, but he may not have realized when he wrote it that people used to write software that way for a good reason.

    Mike wrote his first D compiler the normal way until it worked right, then "compressed the source code" to make the interpreter work right.

    I saw the source, and it looked just like all those obfuscated C code entries.

    --
    Request your free CD of my piano music.
    1. Re:I meant it though by ralphclark · · Score: 2

      Well I'll be the first to admin that there are no hard and fast rules and that there is always the possibility of extenuating circumstances. Suit the technique to the problem.

      But even so an exposition of such techniques should always come with a clearly visible warning such as: "this code is write-only and cannot be maintained by anyone except the author - or even by the original author himself after six months away from it".

      Preferably in capitals inside a big frame of asterisks.

    2. Re:I meant it though by Godwin+O'Hitler · · Score: 1

      Since all he was trying to do was produce an efficient run-time version, he could have easily maintained the compiler as a normal legible program (in as far as Basic can ever be legible) and then awked* it to produce a runtime version. A precompiler in other words.

      * or used a program written in Basic to do the source compression

      --
      No, your children are not the special ones. Nor are your pets.
  128. How to indent code in proportional fonts by yerricde · · Score: 2

    How do you deal with tab/space alignment?

    To indent code in a proportional font, place each line's first non-whitespace character directly below the character in the line above it that would be directly above it if the font were monospace.

    --
    Will I retire or break 10K?
  129. B, C, PlusPlus, AVAL by yerricde · · Score: 1

    I thought the next one was supposed to be called P

    My theory on the B-C-P-L progression: P is short for "Plus Plus" as in C++. L is a reversed J, as in Java language.

    --
    Will I retire or break 10K?
  130. PII 266 and truth in advertising by yerricde · · Score: 1

    The actual clock speed is 2000/3 MHz, or 666.6 repeating

    The actual clock speed of the PII 266 was 266+2/3 MHz, but Intel still rounded down to satisfy truth in advertising laws that state that you can't overstate the speed of a product.

    --
    Will I retire or break 10K?
  131. Perl by yerricde · · Score: 1

    The sequal to C should've been P.

    If you don't believe that P stands for "Plus Plus", then how about swallowing up both of the next letters in .pl?

    --
    Will I retire or break 10K?
  132. Sounds self-contradictory to me by Anonymous Coward · · Score: 0

    Hmm. I don't get it. I'm seeing: (1) D specifically doesn't include a philosophy, and (2) one of the things that made C++ clumsy is that the language is so huge, each programmer uses a particular feature subset, which can make using C++ between various developers harder.

    Wouldn't having an overall philosophy help prevent the "programming in your own island" problem they say C++ has? I'm not seeing how this is any improvement.

    The other thing that's weird is I don't hear about any target program being used to drive D development. Usually that's somewhat important.

    D looks like C/C++ updated for the 90's. Fabulous. As an application programmer, if there's one thing I have no use for, it's a C/C++ updated for the 90's. I'm much more interested in what Paul Graham is doing with Arc.

  133. He wasn't joking by MarkusQ · · Score: 2

    I know you're joking but it's missing the point.

    He wasn't joking. The code he posted was the very code the orginal poster was raving about. It's not like he pulled some obscure C out of left field to make his point; he simply posted the code 434 byte CSS descrambler that ebyrob brought up as an example of the power of C.

    -- MarkusQ

  134. an overriding philosophy... by alder · · Score: 1
    Which of "release resource using destructor" (C++) or "release resource using finally" (D) is better is a topic for much debate, but I obviously am in the latter camp.

    That a good root for a language "religion", isn't it?...

  135. I hate unsearchable names! by ml10422 · · Score: 1

    Aargh! Why did they have to give it a single-letter name? How are you supposed to do a Google search for "D"?!

    In fact, I wish they would make it a feature of the language that you can't have a single-letter variable name. Every try to grep for all uses of a variable named, "c", in a C or C++ program?

    1. Re:I hate unsearchable names! by pne · · Score: 2

      No, but if I had to, I'd use an appropriate tool -- such as GNU grep's -w (whole words only) switch. Or a regular expression something like /\bc\b/ in Perl. Or a search pattern such as /\<c\> in vi.

      --
      Esli epei etot cumprenan, shris soa Sfaha.
  136. Anachronism by jopet · · Score: 1

    A language that does not allow functions to return functions (or rather, closures) can only be called retarded and crippled IMO. If D is supposed to be a "modern" C then it is already an anachronism. It looks a bit like an attempt to modernize transportation by making those horse-carriages out of carbon fiber ....

  137. Stick shift vs automatic, what's "best"? by Inflatable+Hippo · · Score: 1

    An aspect of programming that doesn't get discussed much is how they interact with out mental frailties.

    Arguments about the best/fastest/smallest/cleanest language generally play to our personal predjudices.

    The need for self expression often motivates us to choose a language, maybe you like objects or regular expressions. Maybe compilers are a drag or you never quite fathomed all that multiple inheritance syntax.

    But overall we're flawed as a species and tend to make the same mistakes over and over:

    We are forgetful: hence C prototypes show us when we've forgotten what function parameters should be.

    We are careless: hence Java exceptions force us to think about (if not do anything about) error handling.

    We need structure to aid comprehension: hence while/repeat/for etc when goto and if work just fine.

    etc. etc.

    In my view a good language is one that takes account of our stupidity and compensates for it, avoids it or slaps us in the face before we ship it to customers.

    Frankly, languages like C and particularly C++ are poor in this regard when compared to languages like Java.

    Sure, a Godlike coder will produce a smaller, faster solution in assembler, C or C++. But what about the rest of us that forget to free strings in our destructors, accidentally introduce side effects into out macros or have creative mishaps with CVS?

  138. you misunderstand sir by ttfkam · · Score: 2
    I want them to build good interfaces.

    If there are no standardized interfaces, the code I write today will be intimately tied to the library I use. Or I could write an abstraction layer (basically an interface) but there will be no consistency when I change jobs or inherit someone else's work.

    If there are well defined interfaces with substandard implementations, it won't matter too much. Once a better library comes out, I can just relink and use it.

    Imagine being able to write the following:
    Panel panel = new Panel();
    Label label = new Label("There is unsaved work!");
    Button button1 = new Button("Save and Exit");
    Button button2 = new Button("Don't Exit");
    button1.addActionListener(saveAndExit);
    button2.addActionListener(exitWithoutSaving);
    pan el.add(label);
    panel.add(button1);
    panel.add(but ton2);
    Yes, this is simplified and based on Java's GUI model, but you get the idea. No imagine that you could write to this API (or one like it) and plug in Qt, GTK, MFC, or whatever.

    I don't want the ultimate graphics library (UGL); I want the ultimate graphics interface (UGI) into which I can plug in the UGL. :)
    --

    - I don't need to go outside, my CRT tan'll do me just fine.
  139. Re:low level features needed in high level langaug by midiclub · · Score: 1

    It is useful in any kind of coding, just not to break the developers' way do to things they're used to. Including this directly into D allows for automatic inlning and calling convention optimisations.

  140. D does support value 'classes' by Anonymous Coward · · Score: 0

    They're called structs.

  141. Re: Because it is GC-based... by Elazro · · Score: 1

    From the specification, it seems that D is actually designed to be able to do quite a bit of low level programming. In the section on 'Interfacing to C', the spec states that you can use C's malloc and free without interference from the GC. (Yes, GC scares me a little too, so I was heartened by this.)

    Not that I'd go a'kernel-hacking with D myself, but it seems possible.

    -matt

  142. Garbage Collection by kinema · · Score: 1

    Garbage Collection make any language totally unsutible for most if not all embedded (device) programming and deffinitly unsutible for an realtime (soft or hard IMHO) programming. The problem is that you can never be sure when everything is going to come to a hault while GC does it's business.

  143. Monospace problems by General+Cluster · · Score: 1

    The real problem comes when several different developers collaborate and each uses a different proportional font. What appears aligned on the originial developers screen is a twisted mess on another developers screen.

    Monospace font solves this problem.

  144. Monospaced font by vasqzr · · Score: 1



    The real reason we use monospaced fonts is so that we can all think we're coding on 80x43 or 80x25 terminal screens.