POV-Ray : Newsgroups : povray.general : A new SDL Idea : Re: A new SDL Idea Server Time
31 Jul 2024 22:12:16 EDT (-0400)
  Re: A new SDL Idea  
From: Nicolas George
Date: 6 Oct 2007 05:56:57
Message: <47075be9@news.povray.org>
Nicolas George  wrote in message <4707448b$1@news.povray.org>:
> I think you miss a point: if POV-Ray's rendering features are available as
> library functions call from some languages or, even better, from several
> languages, you can then write in that language whatever parser you want.

Just to have things clear, here is the outline of a plan for this solution.

1. Make the rendering features of POV-Ray into a clean c++ library. That
   gives us libpov4.so and pov4.hh.

2. Chose a language that you like and that makes writing parsers and
   interpreters easy. Let us say, just to avoid writing "that language"
   everywhere, that this is Caml -- if you prefer INTERCAL, replace
   everywhere.

3. Write a wrapper library to use libpov4.so from Caml.

4. Write a clean parser and interpreter for the current SDL in Caml.

5. Chose a language that you like and that can easily be fully embedded.
   Again, just to have a name, let us say this is Lua.

6. Write a wrapper library to use libpov4 from Lua.

7. Extend the parser-interpreter to allow loading new features from a shared
   object and calling them.

8. Build a front-end, linked with libpov4.so, including 3, 4, 6, and 7 (and
   making sure that 7 is directly aware of 6).

Now, let us consider the result:

- Current basic users of POV-Ray just call the resulting binary (8) with
  their unchanged scenes. The scene is parsed and interpreted by 4 and
  rendered by 1.

- Developers of POV-Ray can slowly extend the parser-interpreter to make the
  SDL a little bit less clumsy (with "for" loops for example).

- Medium-level users of POV-Ray can learn Lua, and include Lua code from
  their SDL scenes.

- Advanced users of POV-Ray can add brand new features as c++ objects.

- Other advances users can write wrappers around libpov4.so for other
  languages, and write their scenes with their favorite language. Wrappers
  that are good code can be included in the official POV-Ray distribution.

In the long run, I have the hope that someone could write, for example, a
robot in Scheme, some other person could write a space shuttle in Perl, a
third may write a solar system (with accurate orbits) in Fortran, and a
basic user could just use these scene parts from his SDL scene:

#declare Robot = friendly_robot {
  left_shoulder 90
  right_shoulder 20
  ...
}
#declare Planets = solar_system { 2007, 10, 06, 09, 56, 00 }
...

(Well, actually, I do not hope exactly that, since I hope that Fortran would
be really dead by then.)


Post a reply to this message

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