Stories
Slash Boxes
Comments

News for nerds, stuff that matters

The D Language Progresses

Posted by michael on Sun Jan 12, 2003 12:06 AM
from the lots-of-letters-left dept.
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."

Related Stories

[+] The D Programming Language, Version 1.0 570 comments
penguinblotter writes in a journal article: "Soon, Walter Bright is scheduled to release version 1.0 of the D Programming Language. D is a systems programming language. Its focus is on combining the power and high performance of C and C++ with the programmer productivity of modern languages like Ruby and Python. Special attention is given to the needs of quality assurance, documentation, management, portability and reliability. D has appeared on Slashdot a few times before, and Walter has continued to add more and more features. Most Slashdot community comments in these articles have been offered on feature X or spec Y without reading through the extensive D newsgroup archives. It has been here over the past seven years where extremely gifted and experienced programmers hashed out discussions and arrived at excellent implementations of all the ideas discussed." Read on for the rest of penguinblotter's writeup.
This discussion has been archived. No new comments can be posted.
The D Language Progresses | Log In/Create an Account | Top | 526 comments (Spill at 50!) | Index Only | Search Discussion
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • What is D? (Score:5, Informative)

    by Anonymous Coward on Sunday January 12 2003, @12:12AM (#5065294)
    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.

    • Re:What is D? (Score:5, Insightful)

      by -strix- (154910) on Sunday January 12 2003, @12:21AM (#5065335)
      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.
      [ Parent ]
      • Re:What is D? by russellh (Score:2) Sunday January 12 2003, @01:13AM
      • Re:What is D? by aminorex (Score:3) Sunday January 12 2003, @01:14AM
        • Re:What is D? by yeti (dn) (Score:1) Sunday January 12 2003, @02:23AM
      • Re:What is D? (Score:5, Insightful)

        by SecretAsianMan (45389) on Sunday January 12 2003, @01:24AM (#5065535) Homepage
        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++.

        [ Parent ]
        • Re:What is D? (Score:4, Insightful)

          by be-fan (61476) on Sunday January 12 2003, @01:35AM (#5065562)
          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.
          [ Parent ]
          • Re:What is D? by voodoo1man (Score:1) Sunday January 12 2003, @02:03AM
            • Re:What is D? by be-fan (Score:2) Sunday January 12 2003, @05:24PM
          • Re:What is D? by captaineo (Score:1) Sunday January 12 2003, @08:35AM
            • Re:What is D? by ConceptJunkie (Score:1) Sunday January 12 2003, @02:33PM
              • Re:What is D? by be-fan (Score:3) Sunday January 12 2003, @05:41PM
            • Re:What is D? by be-fan (Score:2) Sunday January 12 2003, @05:28PM
              • Re:What is D? by captaineo (Score:1) Sunday January 12 2003, @06:04PM
          • Re:What is D? by swdunlop (Score:2) Sunday January 12 2003, @12:41PM
          • 2 replies beneath your current threshold.
        • Re:What is D? by orthogonal (Score:2) Sunday January 12 2003, @03:37AM
        • Re:What is D? by pyrrho (Score:1) Sunday January 12 2003, @05:18AM
        • Re:What is D? by oliverthered (Score:2) Sunday January 12 2003, @07:28AM
        • Re:What is D? by macrom (Score:2) Sunday January 12 2003, @08:24PM
          • Re:What is D? by SecretAsianMan (Score:3) Monday January 13 2003, @01:29AM
        • 1 reply beneath your current threshold.
      • Re:What is D? (Score:4, Funny)

        by the_Speed_Bump (540796) on Sunday January 12 2003, @03:18AM (#5065801) Homepage
        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 ;)
        [ Parent ]
        • 1 reply beneath your current threshold.
      • Re:What is D? by SN74S181 (Score:1) Sunday January 12 2003, @03:35AM
      • Re:What is D? by alonsoac (Score:1) Sunday January 12 2003, @03:35AM
      • Re:What is D? Delphi with C++ syntax by marcovje (Score:1) Sunday January 12 2003, @08:31AM
      • D - Not for beginners! by fygment (Score:3) Sunday January 12 2003, @11:15AM
      • Re:What is D? by pVoid (Score:2) Sunday January 12 2003, @01:25PM
      • Re:What is D? by cpeterso (Score:1) Sunday January 12 2003, @04:52PM
      • Stick shift vs automatic, what's "best"? by Inflatable Hippo (Score:1) Monday January 13 2003, @12:54PM
      • 1 reply beneath your current threshold.
    • Re:What is D? (Score:5, Funny)

      by macrom (537566) <macrom75@hotmail.com> on Sunday January 12 2003, @01:16AM (#5065510) Homepage
      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...?
      [ Parent ]
      • Re:What is D? by RockyJSquirel (Score:2) Sunday January 12 2003, @06:47AM
        • Re:What is D? by daniel_yokomiso (Score:1) Wednesday January 15 2003, @08:13PM
        • 1 reply beneath your current threshold.
      • Re:What is D? by HiThere (Score:3) Sunday January 12 2003, @11:52AM
    • Re:What is D? by jdkane (Score:2) Sunday January 12 2003, @02:05AM
      • Re:What is D? by aled (Score:1) Sunday January 12 2003, @10:17AM
        • Re:What is D? by jdkane (Score:2) Sunday January 12 2003, @10:47AM
        • Re:What is D? by charleschuck (Score:1) Sunday January 12 2003, @11:39AM
      • Re:What is D? by scrytch (Score:2) Sunday January 12 2003, @01:08PM
      • Re:What is D? by daniel_yokomiso (Score:1) Wednesday January 15 2003, @08:20PM
    • Re:What is 'the D'? by caino59 (Score:2) Sunday January 12 2003, @02:12AM
    • Where is Algol68? (Score:4, Interesting)

      by Anne Thwacks (531696) on Sunday January 12 2003, @07:22AM (#5066188)
      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 :-)

      [ Parent ]
    • Re:What is D? by ObviousGuy (Score:1) Sunday January 12 2003, @01:04AM
      • Re:What is D? by spinkham (Score:2) Sunday January 12 2003, @09:14PM
        • Re:What is D? by spinkham (Score:1) Sunday January 12 2003, @09:17PM
    • Re:What is D? (Score:4, Insightful)

      by mgv (198488) <Nospam.01.slash2 ... g ['tma' in gap]> on Sunday January 12 2003, @01:42AM (#5065589) Journal
      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
      [ Parent ]
      • Re:What is D? (Score:5, Informative)

        by ebyrob (165903) on Sunday January 12 2003, @05:01AM (#5065978) Homepage
        C is a powerful language

        Whenever I think about language utility I always think of the gallery of CSS descramblers [cmu.edu]. 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.
        [ Parent ]
        • Re:What is D? by FrostedChaos (Score:1) Sunday January 12 2003, @05:41AM
          • Re:What is D? by ebyrob (Score:2) Monday January 13 2003, @03:04PM
            • Re:What is D? by FrostedChaos (Score:1) Friday January 17 2003, @04:04PM
              • Re:What is D? by ebyrob (Score:2) Sunday January 19 2003, @04:17AM
        • Re:What is D? by aled (Score:1) Sunday January 12 2003, @10:27AM
          • Re:What is D? by ebyrob (Score:2) Monday January 13 2003, @03:26PM
            • Re:What is D? by aled (Score:1) Monday January 13 2003, @04:48PM
              • Re:What is D? by ebyrob (Score:2) Monday January 13 2003, @09:56PM
        • Re:What is D? (Score:4, Funny)

          by djmurdoch (306849) on Sunday January 12 2003, @11:53AM (#5066879)
          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
          ...
          [ Parent ]
        • Re:What is D? by lemonjelo (Score:1) Sunday January 12 2003, @02:50PM
        • Re:What is D? by cpeterso (Score:2) Sunday January 12 2003, @04:58PM
          • Re:What is D? by Paradise Pete (Score:1) Sunday January 12 2003, @08:14PM
            • Re:What is D? by ebyrob (Score:2) Monday January 13 2003, @02:54PM
      • Re:What is D? by Anne Thwacks (Score:2) Sunday January 12 2003, @07:24AM
      • Re:What is D? by pVoid (Score:2) Sunday January 12 2003, @01:28PM
      • 1 reply beneath your current threshold.
    • Re:Some comments by Paradise Pete (Score:1) Sunday January 12 2003, @08:18PM
    • Re:Some comments by cakoose (Score:1) Sunday January 12 2003, @08:29PM
    • 5 replies beneath your current threshold.
  • Shouldn't it be 'E'? (Score:4, Funny)

    by aerojad (594561) on Sunday January 12 2003, @12:15AM (#5065305) Homepage Journal
    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
  • Language overloading... (Score:3, Interesting)

    by ObviousGuy (578567) <ObviousGuy@hotmail.com> on Sunday January 12 2003, @12:18AM (#5065320) Homepage Journal
    The D language is a language looking for a niche. It needs a pretty hefty runtime to support all the features that it exposes. It duplicates so many features of C++ that it's indistinguishable at first glance. And it is far from complete.

    They could have saved themselves the trouble and waited for Microsoft to implement C# (which is lightyears ahead of D as far as implementation goes).
  • What is D? by Jason1729 (Score:2) Sunday January 12 2003, @12:18AM
    • Re:What is D? by pstemari (Score:2) Sunday January 12 2003, @01:02AM
      • Re:What is D? by SpryGuy (Score:1) Sunday January 12 2003, @03:52PM
        • Re:What is D? by pstemari (Score:1) Sunday January 12 2003, @11:31PM
          • Re:What is D? by SpryGuy (Score:1) Monday January 13 2003, @01:26AM
      • Re:What is D? by alannon (Score:2) Monday January 13 2003, @07:29PM
      • Re:What is D? by daniel_yokomiso (Score:1) Wednesday January 15 2003, @08:34PM
      • Re:What is D? by pstemari (Score:1) Monday January 13 2003, @12:50AM
      • 1 reply beneath your current threshold.
    • 2 replies beneath your current threshold.
  • This is a life-saver! (Score:5, Funny)

    by Quaoar (614366) on Sunday January 12 2003, @12:19AM (#5065322)
    Now I can just tell my mom that my grade in computer programming is actually just the name of the course...she'll never suspect!
  • I can see it now ... (Score:5, Funny)

    by sunwukong (412560) on Sunday January 12 2003, @12:19AM (#5065326)
    Me: Boss, I think building our app with the D language will put us a step ahead of our competitors!

    Boss: "D?" What happened to C? Or that other one, C++, that you're always harping about?

    Me: Well, D is a further refinement of C++, and ...

    Boss: Weren't you just telling me that "J" language was supposed to be the next big thing? Isn't J further along than D?

    Me: Yes and no ...

    Boss: And if only want to make small changes, is a "+" higher than a "#"?

    [suddenly, a shot rang out]
  • So Is Their Motto... (Score:3, Funny)

    by long_john_stewart_mi (549153) on Sunday January 12 2003, @12:20AM (#5065332)
    "The D Language: It's C! With Implants!"
  • Does D work with with .net? by Anonymous Coward (Score:2) Sunday January 12 2003, @12:21AM
    • 1 reply beneath your current threshold.
  • almost up my alley.. (Score:5, Funny)

    by gothamNY (473289) on Sunday January 12 2003, @12:22AM (#5065338)
    As soon as they get to F, which I am intimately familiar with, I might pick it up..
  • Contracts (Score:4, Informative)

    by The Bungi (221687) <thebungi@gmail.com> on Sunday January 12 2003, @12:25AM (#5065347) Homepage
    Nice to see contracts [digitalmars.com] 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 [digitalmars.com].

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

    • Re:Contracts by __past__ (Score:3) Sunday January 12 2003, @04:01AM
      • Re:Contracts by aled (Score:1) Sunday January 12 2003, @10:52AM
        • Heisenbugs by LPetrazickis (Score:1) Sunday January 12 2003, @04:18PM
      • Re:Contracts by Tony-A (Score:2) Sunday January 12 2003, @11:44PM
    • Re:ECMA goodness? by The Bungi (Score:2) Sunday January 12 2003, @12:48AM
    • 1 reply beneath your current threshold.
  • Golly by xagon7 (Score:2) Sunday January 12 2003, @12:26AM
    • Re:Golly by lsdino (Score:1) Sunday January 12 2003, @01:14AM
      • Re:Golly by NortWind (Score:2) Sunday January 12 2003, @02:28AM
      • 1 reply beneath your current threshold.
    • 1 reply beneath your current threshold.
  • A Religion (Score:5, Interesting)

    by bahwi (43111) <incoming AT josephguhlin DOT com> on Sunday January 12 2003, @12:27AM (#5065353) Homepage
    "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).
    • KILL HIM!!!! by DAldredge (Score:1) Sunday January 12 2003, @12:30AM
      • Blasphemer!! (Score:4, Funny)

        by Billly Gates (198444) on Sunday January 12 2003, @12:59AM (#5065454) Homepage Journal
        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.

        [ Parent ]
    • Re:A Religion by The Bungi (Score:2) Sunday January 12 2003, @12:34AM
    • Re:A Religion by cant_get_a_good_nick (Score:2) Sunday January 12 2003, @01:24AM
    • Re:A Religion by the_Speed_Bump (Score:1) Sunday January 12 2003, @02:39AM
      • Re:A Religion by orthogonal (Score:2) Sunday January 12 2003, @05:58AM
        • Re:A Religion by aled (Score:1) Sunday January 12 2003, @10:58AM
          • Re:A Religion by scotch (Score:2) Sunday January 12 2003, @12:31PM
        • Fair enough by the_Speed_Bump (Score:1) Sunday January 12 2003, @12:01PM
    • Re:A Religion by the gnat (Score:2) Sunday January 12 2003, @03:44AM
    • Re:A Religion by Duncan3 (Score:1) Sunday January 12 2003, @07:48AM
    • an overriding philosophy... by alder (Score:1) Sunday January 12 2003, @11:51PM
    • Re:A Religion by bahwi (Score:2) Sunday January 12 2003, @02:07AM
      • 1 reply beneath your current threshold.
    • 2 replies beneath your current threshold.
  • Java sans VM? by Dougthebug (Score:1) Sunday January 12 2003, @12:28AM
  • Doubles are good... by cperciva (Score:2) Sunday January 12 2003, @12:29AM
  • no value classes == no go (Score:4, Insightful)

    by g4dget (579145) on Sunday January 12 2003, @12:32AM (#5065373)
    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.

  • Thou shalt use objective-C (Score:4, Interesting)

    by jpt.d (444929) <abfall&rogers,com> on Sunday January 12 2003, @12:47AM (#5065422)
    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.
  • D has already been taken... by fidget42 (Score:1) Sunday January 12 2003, @12:58AM
  • D Language from early 80's (Score:5, Interesting)

    by MichaelCrawford (610140) on Sunday January 12 2003, @01:01AM (#5065463) Homepage Journal
    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 [wpi.edu] - 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 [webweasel.com] 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.

  • Quote from Dilbert (Score:4, Funny)

    by SAN1701 (537455) on Sunday January 12 2003, @01:04AM (#5065474)
    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?
  • The evolution of languages (Score:5, Interesting)

    by DarthWiggle (537589) <sckiwi&gmail,com> on Sunday January 12 2003, @01:05AM (#5065476) Journal
    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. :)

    • Re:The evolution of languages (Score:5, Interesting)

      by aminorex (141494) on Sunday January 12 2003, @01:36AM (#5065566) Homepage Journal
      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.

      [ Parent ]
      • The Bell Labs answer (Score:5, Funny)

        by devphil (51341) on Sunday January 12 2003, @04:23AM (#5065908) Homepage


        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.

        [ Parent ]