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."

204 of 484 comments (clear)

  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 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...
    3. 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-
    4. 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...?

    5. 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.

    6. 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...
    7. 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.
    8. 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.

    9. 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
    10. 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.

    11. 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.

    12. 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.

    13. 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.

    14. 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
    15. 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.
    16. 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.

    17. 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.
    18. 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
      ...

    19. 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.

    20. 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.
    21. 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.

    22. 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.

    23. 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. ;-)

    24. 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".

    25. 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...
    26. 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...
    27. 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...
    28. 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.

    29. 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.
    30. 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.

    31. 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.

    32. 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...

    33. 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.

    34. 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?

    35. 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.

    36. 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).

    37. 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...

  2. 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 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.

    6. 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!
    7. 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!

    8. 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.
    9. 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.
    10. 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.
    11. 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
  3. 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 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!
    2. Re:Of course not by fredrikj · · Score: 2

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

  4. 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 colzero · · Score: 2, Funny

      Nah that's Double D!

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

    If not, it's obsolete already.

  6. 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..

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

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

    Jason
    ProfQuotes

  8. 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 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.

  9. 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 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.

  10. 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 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.

    2. 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.

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

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

    4. 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. =)

    5. 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...

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

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

    7. 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.

    8. 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.
    9. 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.
  11. 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".

  12. 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+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.
    2. 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....
    3. 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.
    4. 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.

    5. 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.

    6. 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....
    7. 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.
    8. 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

    9. 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.
    10. 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.
    11. 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.
    12. 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.

    13. 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.

    14. 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.
    15. 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".

    16. 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.
    17. 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.

    18. 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.
    19. 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.

    20. 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.
    21. 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.

    22. 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.
    23. 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.

  13. 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 bahwi · · Score: 2

      Hallelujah! Hallelujah! Praise the Obj-C!

    3. 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.

    4. 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.
    5. 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)
    6. 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;

    7. 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!
  14. 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.

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

    Thanks for playing.

  16. 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.

  17. 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.
  18. 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 :-)

  19. 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 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.

    2. 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.

  20. 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?

  21. 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 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.

    3. 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,
    4. 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,
    5. 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.
    6. 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.

    7. 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.

  22. 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."
  23. 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 moyix · · Score: 2

      It works because characters are really integers in C. So:

      someVar = 'C';
      someVar++;
      printf("%c", someVar);

      Would, in fact, give "D"

    2. 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.
    3. 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.

  24. 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 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.

  25. 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.
  26. 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 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.

  27. 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 Leimy · · Score: 2

      Pretty sure Walter has listed in his FAQ that he will have templates or something like them as well

  28. 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.

  29. Re:What is 'the D'? by caino59 · · Score: 2, Funny

    well, the d is tenacious of course, the ragekage show!

  30. practical by jdkane · · Score: 2

    After C/C++ give me C# before D.

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

    I thought PL was short for Perl.

    Sorry, couldn't resist ;)

    --

    LedgerSMB: Open source Accounting/ERP
  32. 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 ();
    }

  33. 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 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.
  34. 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!

  35. 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.
  36. 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 ;-))

  37. 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!
  38. 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.

  39. 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)

  40. 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 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

  41. 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 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.

    3. 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.

  42. 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 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).

    2. 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

    3. 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.

  43. 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.

  44. 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 ...
  45. Re:We need a secure system programming language by Tumbleweed · · Score: 2

    Perhaps if there was a true compiler for stackless python... *sigh*

  46. 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)
  47. 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.

  48. 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.

  49. 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?
  50. 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!

  51. 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

  52. 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.

  53. 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.

  54. 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. :-(

  55. 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

  56. 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.

  57. 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 alannon · · Score: 2

      Try the 'bit' type.
      A list of C and D primative types is here.

  58. 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.
  59. Re:Oh, really. by scotch · · Score: 2

    Vim has a menu, too, FanBoy. Also, what if you forget [F10]?

    --
    XML causes global warming.
  60. 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.

  61. 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.
  62. 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.

  63. 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.

  64. 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.
  65. 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.

  66. 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.

  67. 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
  68. 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?

  69. 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 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.

  70. 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.
  71. 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.

  72. 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?
  73. 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

  74. 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.
  75. 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.