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

Re: dual-language systems increase modularity




On Monday, November 17, 2003, at 05:05 PM, Steve Dekorte wrote:

>
> On Nov 17, 2003, at 1:16 PM, Shriram Krishnamurthi wrote:
>> Steve Dekorte wrote:
>>> I suggest picking up a book on programming design patterns and
>>> considering the difficulty with which the examples given can be
>>> implemented in dynamic vs. statically typed languages.
>>
>> I've read more about design patterns than I'm willing to admit, and
>> implemented likewise.  Can you give five concrete patterns from the
>> GoF book that justify your rather nebulous position?
>
> How about the Proxy pattern?
>
> Here's a generic proxy in Io:
>
> Proxy = Object clone
> Proxy setTarget = method(t, self target = t)
> Proxy forward = method(target doMessage(thisMessage))
>
> Could you provide a C++ implementation for comparison?

1. This is not the useful proxy pattern.

2. It's doable in one-line of ML's core language:
       Lambda t. lambda f:t->t.lambda x:t.f(x)
     if you insist on thinking of proxy as an eta-expansion of apply.

3. As much as I would like your statement to be true, you have so
     far failed to prove your claim. I was in your position 12 years ago.
     That's why I went to CMU, studied types for a year from the source,
     and I now fall into Shriram's fourth category.

4. What you're confusing is that just because the typed languages that
     you seem to know (C++, which has an unsound type system, Java,
     which is sound but restrictive, anything else?) don't do it, it 
can't be
     done at all in a typed setting.

5. To prove your point, you will need to set up a fair rules of the 
game book
     (translations must be local, etc) and then show with three (I 
lowered SK's
     bar) theorems in this framework (possibly using meta-theorems about
     this framework) that you have indeed a whole new level of 
programming.

Until further notice, types stand. -- Matthias (a reconstructed 
type-disliker)