Super-dee-duper D features

X Bunny xbunny at eidosnet.co.uk
Mon Feb 12 15:06:59 PST 2007


Bill Baxter wrote:
>> Besides, many people naturally think recursively, 
> 
> The statement was about why LISP is never going to be wildly popular. 
> There may very well be "many" people who naturally think recursively, 
> but if they're not a majority then that's a hurdle to LISP becoming 
> popular.
> 
>> and many problems (e.g. parsing) can be easiest thought of that way.
> 
> Sure.  However, you can write recursive algorithms in most any 
> procedural language to handle those naturally recursive tasks when they 
> come up.   With Lisp or <my-favorite-functional-language> you're pretty 
> much /forced/ to look at everything recursively.  And I think that makes 
> joe coder nervous, thus presenting a major hurdle to any functional 
> language ever becoming truly popular.

You havent qualified what you mean by Lisp, assuming that means Common 
Lisp (CL) then you are uniformed, CL offers a number of iteration 
constructs (they are implemented as macros as a great deal of the 
language is). dolist is very simple, loop is almost a language within 
itself. A common package used is called iterate which is a popular 
alternative to loop.
Also CL is not just a functional language, Like D CL is multiparadigm. 
With CL you can easily write procedural code with side effects like C++ 
or D or you can use object orientated, aspect orientated, functional, 
logic, pattern matching and many other programming concepts. Whats more 
you can add other programming concepts easily should you like.

> 
> My point is just that I don't think syntax is the *only* thing that's 
> prevented lisp from becoming wildly popular.  If that were the case then 
> the answer would be to simply create a different syntax for Lisp. 
> (Actually, according to someone's comment here 
> http://discuss.fogcreek.com/newyork/default.asp?cmd=show&ixPost=1998 
> it's been done and it's called Dylan, another not-wildly popular 
> language).  So I think the problem is more fundamental.
> 

People often try to modify Lisp to have a syntax more familiar to C 
language programmers, Dylan aside, it seems its often people who are new 
to Lisp who do this, after they learn more of Lisp they then can see why 
it is the way it is and although initially alien its design makes the 
language easier to use. Im not actually convinced that you can make a 
language with the features of CL without its syntax. There is an infix 
package also which allows you to use infix for things like math formulas 
and the like.

My personal feelings as to why Lisp isnt as popular as it could be are 
some of these misconceptions:

1) Its all functional code and recursion
2) The syntax is weird and mindbending
3) Lisp is interpreted and therefore slow.
4) Its hard to interface Lisp with non Lisp libraries and operating 
system services.
5) Lisp is old and hasnt changed since the 50's
6) The features are really clever but they wouldnt be useful in a 'real' 
program
7) Its for AI or 'weird' programs
8) You have to be really clever to program in Lisp
9) Lisp is poorly documented and hard for a beginner to understand
10) Its irrelevant because we have Java/C++/something else now

Its interesting to contrast these with D which tends to present an image 
which is the opposite of many of these notions.

Regarding the syntax issue; is this suggestion: (from an earlier post)

AddExpressionTemplate!(
    MultExpressionTemplate!(
       SubExpressionTemplate!(Vector,Vector),
       Vector),
    Vector)

anymore more readable than this?

(defmacro mymacro (a b c d)
   (+ (* (- a b) c) d))

Bunny



More information about the Digitalmars-d mailing list