From: Uri Guttman <[EMAIL PROTECTED]>
   Date: Thu, 12 Jun 2008 19:11:22 -0400

   >>>>> "BR" == Bob Rogers <[EMAIL PROTECTED]> writes:

     BR> Lisp goes even farther down the road of blurring the boundary
     BR> between interpreter and compiler than Perl does.  You can even
     BR> run code at read time, when the program is being parsed by the
     BR> compiler (or interpreter) . . .

   well perl does that too with BEGIN and eval. BEGIN blocks are executed
   during the compile phase as soon as they are parsed successfully. and
   eval compiles code at run time. so you can run or compile code in either
   phase at will. not much diff than lisp.

That's not what I meant; "BEGIN { ... }" corresponds neatly to Common
Lisp "(eval-when (:compile-toplevel) ...)".  I was thinking of hooks
into the Lisp read-time facilities, which correspond to the
tokenizer/parser in Perl.  So it's not the same as source filtering
either; see my response to Ben below.

   lisp is much older than shell . . .

Indeed, it's turning 50 this fall.  Only Fortran is older.

   . . . and i bet no one has ever written a lisp 'script' to replace a
   shell script! :)

   uri

People *do* write scripts in Lisp; it's reasonable now that operating
systems deal gracefully with large programs.  Some of the example code I
wrote for the talk I gave in May has equivalent Perl and Lisp versions;
the Lisp "scripts" are only a factor of 2 or 3 slower, which is not bad
considering how small they are.

Still, I won't take your bet.  ;-}

   ================
   From: "Mark J. Dulcey" <[EMAIL PROTECTED]>
   Date: Thu, 12 Jun 2008 20:51:58 -0400

   Bob Rogers wrote:
   > . . . Even so, nobody thinks Lisp is a "scripting language."  Go
   > figure.

   Lisp Machine programmers did!

Not strictly true, except in the sense that we thought of Lisp as an
*everything* language.  People kept files of hacks that did scriptish
things, but nobody ever thought to distinguish it from other sorts of
programming.  They were just small functions that did mundane jobs.

   ================
   From: "Ben Tilly" <[EMAIL PROTECTED]>
   Date: Thu, 12 Jun 2008 18:33:36 -0700

   On Thu, Jun 12, 2008 at 4:01 PM, Bob Rogers wrote:
   > . . . You can even run code at read time, when the program is being
   > parsed by the compiler (or interpreter).

   Um, you can do that in Perl as well.  See Lingua::Romana::Perligata
   for an amusing demonstration of exactly what you can choose to do to
   code at read time.

That's source filtering, which is much cruder; it's a single hook that
happens before lexing/parsing, rather than during.  Lisp has a simple
way to say "evaluate this and insert it into the parse at this point,"
and a much more elaborate mechanism for hacking the lexer in order to
introduce new syntax.  New syntax can also be introduced via macros.

   But don't worry; IIUC, Perl 6 will be able to do most if not all of
this.  ;-}

                                        -- Bob
 
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to