Lisp2Perl compiler

Discussion in 'Perl' started by David, Aug 14, 2004.

  1. David

    David Guest

    Hi People,

    I've just uploaded my updated version of the Lisp2Perl
    translator/compiler - a generaly purpose program for 'compiling' lisp
    programs (which look quite a bit like scheme programs) into efficient
    perl code.

    I've removed the 'include' system which tried to compile included files
    if required and link everything up in the end (it didn't work very
    well). Everything is much simpler and cleaner now. If you want
    everything linked at the end (all the separate compiled lisp files) you
    can do so easily enough ('cat' will do). This also gets rid of the
    messiness of stripping macros since they are not needed at runtime -
    nothing is stripped any more. It also now tracks lexical scopes so that
    it can warn you of references to undefined variables (with
    '(globals-check)'. It still needs work in this area.

    I've been considering implementing a lisp2 version of it too - I started
    (see misc/lisp2.scm in the tarball). It would probably make more sense.

    http://www.hhdave.pwp.blueyonder.co.uk
     
    David, Aug 14, 2004
    #1
    1. Advertising

  2. David wrote:
    > Hi People,
    >
    > I've just uploaded my updated version of the Lisp2Perl
    > translator/compiler - a generaly purpose program for 'compiling' lisp
    > programs (which look quite a bit like scheme programs) into efficient
    > perl code.


    Okay, this will be handy for putting code into systems where
    you can't count on a lisp environment being installed.

    But... several common lisp compilers actually produce faster
    executables than perl does. In fact, with appropriate
    declarations, I think all of them do. If efficiency is your
    goal, wouldn't it be more fruitful to translate perl into
    lisp? (Maybe perl is faster now? I haven't looked at it
    since Perl v4.)

    Bear
     
    Ray Dillinger, Aug 14, 2004
    #2
    1. Advertising

  3. David

    David Guest

    Ray Dillinger wrote:

    > David wrote:
    >
    >> Hi People,
    >>
    >> I've just uploaded my updated version of the Lisp2Perl
    >> translator/compiler - a generaly purpose program for 'compiling' lisp
    >> programs (which look quite a bit like scheme programs) into efficient
    >> perl code.

    >
    >
    > Okay, this will be handy for putting code into systems where
    > you can't count on a lisp environment being installed.
    >
    > But... several common lisp compilers actually produce faster
    > executables than perl does. In fact, with appropriate
    > declarations, I think all of them do. If efficiency is your
    > goal, wouldn't it be more fruitful to translate perl into
    > lisp? (Maybe perl is faster now? I haven't looked at it
    > since Perl v4.)
    >
    > Bear
    >
    >

    I would imagine that many common lisp compilers do indeed produce faster
    code than perl, but that wasn't what I meant when I said efficient perl
    code - I meant efficient compared to other perl code. ie at least as
    fast as perl code you would write by hand. I once implemented a purely
    interprative lisp in perl. Hence: this compiler produces efficient code
    :) (That interpreter was _seriously_ slow).

    Also, I think translating perl into Lisp would be distinctly non trivial.

    -- David
     
    David, Aug 14, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yan
    Replies:
    0
    Views:
    1,139
  2. Jack Wright
    Replies:
    5
    Views:
    628
    Shiv Kumar
    Jan 19, 2004
  3. Ram
    Replies:
    0
    Views:
    2,847
  4. Andrey Batyuck

    Compiler compiler with C++ as output

    Andrey Batyuck, May 11, 2004, in forum: C++
    Replies:
    3
    Views:
    442
    Frederik Hertzum
    May 17, 2004
  5. David

    Lisp2Perl - Lisp to perl compiler

    David, Jan 17, 2004, in forum: Perl Misc
    Replies:
    22
    Views:
    223
    Thomas F. Burdick
    Jan 28, 2004
Loading...

Share This Page