wasm-demo/demo/ermis-f/python_m/cur/0442

77 lines
2.6 KiB
Plaintext

From: jason at harlequin.com (Jason Trenouth)
Date: Thu, 29 Apr 1999 10:48:23 GMT
Subject: Dylan vrs Python (was; Re: Python IS slow ! [was] Re: Python too slow for real world)
References: <613145F79272D211914B0020AFF6401914DAD8@gandalf.digicool.com> <p5g15lmb35.fsf@bidra241.bbn.hp.com> <slrn7ieipq.8uk.wtanksle@dolphin.openprojects.net> <372769B0.3CE8C0F3@prescod.net> <7g89eg$vb0$1@brick.cswv.com>
Message-ID: <375533c2.241102625@newshost>
Content-Length: 2085
X-UID: 442
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