POV-Ray : Newsgroups : povray.general : Script language speed : Re: Script language speed Server Time
7 Aug 2024 13:17:56 EDT (-0400)
  Re: Script language speed  
From: David Buck
Date: 6 Nov 2001 10:54:53
Message: <3BE80818.4A75390A@simberon.com>
>   There is also a third type of execution, which is a mix between the two:
> The code is first parsed and compiled to a "machine code" or "bytecode"
> (which isn't necessary any machine code known by any processor) and then
> this "machine code" is interpreted by an interpreter.
>   I know of two languages which use this approach: Perl and Java. (Even they
> do it a bit differently: Perl compiles the program on the fly to memory and
> then interpretes the compiled code, while Java compiles the program to a
> separate file and then this file can be interpreted as if it was a compiled
> program.)
>

Actually, Smalltalk used bytecodes and pre-dated Perl and Java.  The first versions
of Smalltalk using bytecodes came out around 1980.  Modern versions translate the
bytecodes to machine code on the fly.  Some Basic interpreters also translated into
a bytecode-like language and Pascal used P-Code.

Getting back to POV-Ray, what is really needed is a better parser and interpreter.
Even interpreting bytecodes can be dramatically faster than parsing the text
directly from a file.  As was mentioned elsewhere in this thread, POV-Ray's parser
was designed for reading the input file once, not looping, macros, etc.  You need a
more sophisticated engine to do those efficiently.

David Buck
Simberon


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.