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

Re: [Q] Dylan to Java/JVM compiler?



Raffael Cavallaro <raffael@mediaone.net> writes:

> On 5/3/01 4:45 PM, Jeffrey Siegal, (jbs@quiotix.com), wrote:
> 
> > The whole idea in Dylan is to minimize the number of fully-general GF
> > dispatches that need to be made through compile-time analysis.
> 
> 
> As Jeffrey Siegal suggests, the Holy Grail of Dylan was to create a
> language, runtime, and compiler that incorporated the best aspects of Common
> Lisp/Scheme (dynamism - interacting with and/or modifying a running
> application, generic functions, closures, macros) and go beyond them (OO
> from the ground up - e.g., writing methods that specialize on individual
> instances of built-in classes - not possible in CLOS, macros that are
> hygenic - unlike Common Lisp macros), all while generating compiled code
> that is as fast as the fastest statically compiled languages like C, or
> Fortran.

CL is OO from the ground up in any reasonable definition of the
term. And you might want to study CLOS a bit more before pronouncing
things impossible ;-)

CL-USER 1 > (defgeneric hello ((object t))
              (:method ((object t)) 
                 (format *debug-io* "Method not implemented~%")))
#<STANDARD-GENERIC-FUNCTION HELLO 2050B24C>

CL-USER 2 > (hello 'foo)
Method not implemented
NIL

CL-USER 3 > (hello 'world)
Method not implemented
NIL

CL-USER 4 > (defmethod hello ((object (eql 'world)))
              (format *debug-io* "Hello world!"))
#<STANDARD-METHOD HELLO NIL ((EQL WORLD)) 21220954>

CL-USER 5 > (hello 'foo)
Method not implemented
NIL

CL-USER 6 > (hello 'world)
Hello world!
NIL

> If one creates a Dylan that targets a JVM, one just ends up with yet another
> lisp-like language, but without the execution speed of even a good Common
> Lisp compiler.

Is there at this moment a Dylan compiler that beats a good CL compiler
on equivalent code? Theoretically, the Dylan compiler can potentially
do better by the sealing constructs, but that's about the only
difference I see between CL and Dylan w.r.t. possible optimisation.

-- 
Lieven Marchand <mal@wyrd.be>
Glaðr ok reifr skyli gumna hverr, unz sinn bíðr bana.



Follow-Ups: References: