OT: on IDEs and code writing on steroids

dsimcha dsimcha at yahoo.com
Thu May 21 12:07:10 PDT 2009


== Quote from Andrei Alexandrescu (SeeWebsiteForEmail at erdani.org)'s
> Before I got into D, I was working on Enki. Enki was my own programming
> language and of course made D look like a piece of crap. In Enki, you
> had only very few primitives related to macro expansion, and you could
> construct all language elements - if, while, for, structures, classes,
> exceptions, you name it, from those primitive elements.
> There were two elements that convinced me to quit Enki. One was that I'd
> got word of a language called IMP72. IMP72 embedded the very same ideas
> Enki had, with two exceptions: (1) it was created in 1972, and (2)
> nobody gave a damn ever since. IMP72 (and there were others too around
> that time) started with essentially one primitive and then generated
> itself with a bootstrap routine, notion that completely wowed me and I
> erroneously thought would have the world wowed too.
> The second reason was that I've had many coffees and some beers with
> Walter and he convinced me that configurable syntax is an idea that
> people just don't like. Thinking a bit more, I realized that humans
> don't operate well with configurable syntax. To use the hackneyed
> comparison, no natural language or similar concoction has configurable
> syntax. Not even musical notation or whatnot. There's one syntax for
> every human language. I speculated that humans can learn one syntax for
> a language and then wire their brains to just pattern match semantics
> using it. Configurable syntax just messes with that approach, and
> besides makes any program hugely context-dependent and consequently any
> large program a pile of crap.
> That being said, I have no idea whether or not Nemerle will be
> successful. I just speculate it has an uphill battle to win.
> Andrei

This is pretty much a special case of a more general statement about
customizability.  Customizability is good as long as there are also sane
default/de facto standard ways of doing things and simple things are still made
simple.  Take EMacs or vi, for example.  I absolutely despise both because they
have very annoying, idiosynchratic ways of doing basic stuff like saving a file,
navigating through a file, etc.  The backspace, delete, home, etc. keys don't
always do what I've come to expect them to do out of the box.  I know all this
stuff is customizable, but the barrier to entry of learning how to configure all
this stuff is much higher than the barrier to just using a simple GUI text editor
like gedit or Notepad++ instead.  I don't care how powerful these programs are,
they're still not special enough that violating such basic conventions is acceptable.

Bringing this analogy back to language design, if you make a language very highly
configurable and don't provide good defaults, the barrier to entry will just be
too high.  If people have to understand a whole bunch of intricacies of the macro
system to do anything more complex than "Hello, world", the language will be
confined to a highly devoted niche.  On the other hand, if you do provide strong
conventions and sane defaults, people will probably avoid violating them because
doing so would make their code no longer portable from programmer to programmer,
and would probably break a whole bunch of library code, etc. that relies on the
convention.  In other words, they would feel like they were creating a whole new
language, and for all practical purposes they would be.  Thus, the purpose of this
customizability would be defeated.

As I've said before in various places, my favorite thing about D is that it takes
a level headed, pragmatic view on so many issues that other languages fight holy
wars about.  These include performance vs. simplicity, safety vs. flexibility,
etc.  This is just another one to add to the list.  Having a sane subset that's
something like a hybrid between Java and Python, but then putting D's template
system on top of it for when the sane subset just doesn't cut it is a pragmatic,
level-headed solution to the holy war between meta-languages that let (force?) you
to customize everything and don't have a well-defined sane, simple subset and
excessively rigid static languages that sometimes don't make complex things possible.

(Note:  Don't get me wrong, IMHO, parts of the template system have actually
earned a rightful place in the sane subset, just not the more advanced
metaprogramming stuff.)



More information about the Digitalmars-d mailing list