[Prev][Next][Index][Thread]

Re: A question





Neel Krishnaswami wrote:
> 
> o Multiple dispatch and generic functions.
> 
>   This is hugely helpful in writing well-structured programs. Whole
>   categories of problematic areas in OO magically disappear. Now that
>   I have it I can't imagine living without it; only pattern-matching
>   from the strongly-typed FPLs is of comparable power.

Ah! Though I don't grok the fully-functional style in general, I do
understand the patter-matching. This comment helps me a bit get a handle
on the full extent of what multiple dispatch is good for. (As I may have
said elsewhere, I'm at the point of understanding the mechanics of it
pretty full, and recognizing that it is powerful, but having only the
vaguest and shallowest understanding of how to use it.)

> o Optional type annotations.
> 
>   When I'm writing quick prototype code, I can use dynamic typing,
>   *and* I can add type annotations as needed to help document the
>   code for myself. The additional speed that the compiler can extract
>   from these annotations doesn't hurt either.

Now this is one where I got really baffled. Wrote a small database front
end. Timed some operations. Went back and added pretty complete type
annotations. (Complete for the repeatedly-called methods.) Got a 10%
slowdown! I know there's a reason, but I don't know what it is.

> o The hygienic macro system.
> 
>   As a small project, I tried adding lazy evaluation to Dylan. It took
>   me 15 lines of code to write something that was as much part of the
>   language as the if statement or the for-loop. (That was a project
>   that finished a lot sooner than I expected!) The ability to extend
>   a languge's syntactic constructs as needed is surprisingly useful.

"surprisingly useful"? That's pretty weak! How about amazing,
incomparable, superb, mind-bending?



Follow-Ups: References: