POV-Ray : Newsgroups : povray.general : A new SDL Idea : Re: A new SDL Idea Server Time
31 Jul 2024 12:25:04 EDT (-0400)
  Re: A new SDL Idea  
From: Darren New
Date: 4 Oct 2007 00:24:06
Message: <47046ae6$1@news.povray.org>
Bryan Valencia wrote:
> So the POV engine would become a "Framework" that no longer parses 
> strings, but instead just executes some minimalist bytecode.

Rather than have an entire CLR, you could have the program structured to 
have C libraries (or C++ classes, I suppose), and clearly document how 
they're used. Then the SDL parser would invoke constructors building the 
classes, then invoke the "render" method.

Other languages could be written to also do the same sort of thing.

I contrast this with what you seem to be describing, which seems to be 
"output the result of parsing in a simpler form, then invoke a runtime 
to interpret it."

I already have programs(*) that take a "simpler" language and output 3.6 
SDL code, then invoke POV-Ray to get the images, along with (in this 
case) the web pages that link the images together.  That POV has a 
well-documented input format is what draws me to it.

Doing it my way falls down when you want to have "subroutines" that were 
written in a different language and you want to use them in your scene, 
but you don't have the proper interpreter. My way has the advantage that 
there are already a bunch of languages that easily link to C (and 
probably C++ with work), so nobody has to write code that loops, does 
math, does I/O, etc etc etc. In other words, the library would embody 
the ray-tracing code and nothing else, in much the same way that emacs 
handles buffers and files and edits, and leaves stuff like reading email 
and parsing error messages to the non-core language.

Your way is a fairly huge undertaking to implement, and I'm not sure 
what benefit it gives you beyond a "cleaned up" SDL that allows for 
better modularity and better efficiency in parsing. In other words, why 
wouldn't you make the "bytecode" a readable high-level language, and if 
someone wants a specialized language, simply output the high-level 
language, much the same way that people interface to RDBMs nowadays via 
SQL source code?


(*)   <http://sourceforge.net/projects/lome/> if you care.

-- 
   Darren New / San Diego, CA, USA (PST)
     Remember the good old days, when we
     used to complain about cryptography
     being export-restricted?


Post a reply to this message

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