Dylan vrs Python (was; Re: Python IS slow ! [was] Re: Python too slow for real world)

Jason Trenouth jason at harlequin.com
Thu Apr 29 06:48:23 EDT 1999


On 28 Apr 1999 19:34:24 -0500, neelk at brick.cswv.com (Neel Krishnaswami) wrote:

> In article <372769B0.3CE8C0F3 at prescod.net>,
> Paul Prescod  <paul at prescod.net> wrote:
> >William Tanksley wrote:
> >> 
> >> And Oberon (SlimBinaries), and Eiffel (typing and general compile-time
> >> error catching), and ...
> >
> >Actually, isn't Eiffel's type system famous for being full of holes?
> >
> >Regardless, wouldn't a better source of inspiration on typing be a
> >language with *optional* compile-time error checking?
> 
> I've been playing around with Dylan recently, and it seems like what
> Python would be if you added "end" blocks and mated it with CLOS. Since 
> Dylan is nearly as dynamic as Python, I think it might be a good source 
> of inspiration for Python 2. (And it might even be the case that the 
> Dylan-to-C compiler might be a source of good bits to improve Python's 
> speed. I haven't looked at the source yet, though.)

Conversely, I was just looking at Python recently (as related work for a
paper).

The Python community might like to take a look at Dylan:

	http://www.gwydiondylan.org

	http://www.harlequin.com/products/ads/dylan/

As a taster, here is the "invert" example in Python and Dylan:

# Python
def invert(table):
    index = {}                # empty dictionary
    for key in table.keys():
        value = table[key]
        if not index.has_key(value):
            index[value] = [] # empty list
        index[value].append(key)
    return index

// Dylan
define function invert (table)
  let index = make(<table>);
  for (value keyed-by key in table)
    index[value] := add!(element(index, value, default: #()), key);
  end;
  index
end;

The "keyed-by" clause in the "for" statement is a slight cheat since it is a
Harlequin extension (otherwise the Dylan code would be even more similar to
the Python code).

with-heavy-troll ()
What would you give for interactive development and native compilation and
incremental gc and objects-all-the-way-down and extensible syntax and COM and
CORBA and a great GUI toolkit?
end;

:-j

__Jason




More information about the Python-list mailing list