Re: What's so great about lisp?



Thomas F. Bur*** wrote:
> Jon Harrop <usenet@xxxxxxxxxxxxxx> writes:
>> Lars Brinkhoff wrote:
>> > Or, "how likely is there to be an error, not detectable by a type
>> > system, in your algorithm or its implementation (be it sorting or
>> > otherwise)?". Not unlikely, I'd say.
>>
>> From my experience, that is very true when dynamic typing is required,
>> e.g. my GUI code. However, there are many places (most of my code) where
>> I think the type checker is likely to catch most (>50%?) errors. I
>> watched myself (?!) writing a rewrite interpreter last night and the
>> OCaml and SML type checkers literally caught all of my errors (it worked
>> perfectly the first time it ran).
>
> Yikes, do you not see what you just said here?!?! For normal code,
> dynamic typing helps you get your work done -- but for building
> interpreters for general-purpose languages, the ML type system is
> really helpful. So, ML is good for implementing ML, and things like
> ML, and Lisp is good for everything else?!?! Why bother with ML then?

I said that static type checkers catch >50% of my errors in most of my code.
Quite how you got to "Why bother with ML" from there I do not know...

> For the record, yes, I found static type checking to be very helpful
> when writing a CPS-transforming CL-to-CL compiler. It found 80% of my
> errors, and runtime type assertions found the others. The type
> checking infrastructure cost me 120 lines of CL. Just like the
> ability to write custom interpreters, the ability to write
> domain-specific type checkers is an important tool -- and once you
> have that, and a language that supports you in it (like, eg, CL), you
> always have custom type systems available. The only limit is your
> ability to read type theory papers :-)

Most of the programs that I write are numerical or graphical. I find static
typing very useful there. Static typing was much less useful in my GUI code
but I was still able to leverage it to guarantee that much of my GUI code
cannot produce run-time errors.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com
.