Re: Execution of a program in scripting language?

Tony Finch <dot@dotat.at>
19 Jan 2010 13:23:08 +0000 (GMT)

          From comp.compilers

Related articles
Execution of a program in scripting language? pengyu.ut@gmail.com (Peng Yu) (2010-01-18)
Re: Execution of a program in scripting language? dot@dotat.at (Tony Finch) (2010-01-19)
Re: Execution of a program in scripting language? rangsynth@gmail.com (Robin Holmes) (2010-01-20)
Re: Execution of a program in scripting language? cr88192@hotmail.com (BGB / cr88192) (2010-01-21)
Re: Execution of a program in scripting language? arnold@skeeve.com (2010-01-21)
Re: Execution of a program in scripting language? kamalpr@gmail.com (kamal) (2010-02-08)
Re: Execution of a program in scripting language? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2010-02-10)
| List of all articles for this month |
From: Tony Finch <dot@dotat.at>
Newsgroups: comp.compilers
Date: 19 Jan 2010 13:23:08 +0000 (GMT)
Organization: dotat labs
References: 10-01-059
Keywords: interpreter
Posted-Date: 19 Jan 2010 18:43:28 EST

Peng Yu <pengyu.ut@gmail.com> wrote:
>
>Could somebody pointing me some reference on how a script is executed
>so that I can understand the runtime behavior better?


For an example of a modern interpreter implementation, see: The
implementation of Lua 5.0 <http://www.lua.org/doc/jucs05.pdf> Lua has
a simple one-pass compiler that translates the source into a
register-based bytecode. It has an incremental mark/scan garbage
collector.


Perl is rather more old-school. It translates the source into an
intermediate representation that's more like a parse tree. It uses
reference-count garbage collection. The perlguts manual page has lots
of details. <http://perldoc.perl.org/perlguts.html>


The Unix shell is even more old-school. It works on the source
directly, performing a series of substitutions and expansions to
derive each command that is to be executed. Since there are no
significant layers of abstraction between the specification and the
implementation, POSIX provides as good a reference as any.
http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html


Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/
HUMBER THAMES DOVER: EAST 4 OR 5, OCCASIONALLY 3 AT FIRST, INCREASING 5 OR 6
IN HUMBER. SLIGHT IN DOVER, OTHERWISE SLIGHT OR MODERATE. FOG PATCHES AT
FIRST, OCCASIONAL RAIN LATER. MODERATE OR GOOD, OCCASIONALLY VERY POOR AT
FIRST.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.