|
|
I just got G to successfully compile and run a function!
function scalar main(scalar n, scalar p) {return n*n + p;};
It supports arithmetic, function declarations, and...um, the return
statement. Ok, it needs a little work. ;-)
It does support scalar and vector math, and I'm especially proud of the
expression parser...I'm going to use some of the compiler techniques I
developed while working on it in Sapphire.
The language itself is pretty much as the above line shows. It is
designed to do as much work as possible at compile time, it should run
fairly quickly...faster than Sapphire, anyway, because Sapphire is an
extremely dynamic language while this is almost entirely static. I have
no idea how it'd compare against POV functions, probably quite a bit
slower at the moment. (almost no optimizations are done)
Next: Function calls, flow control, and numeric constants (it doesn't
even understand things like "2+2" yet).
Posted in *.general because this is going to be part of a POV patch, but
is not restricted to POV...
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/
Post a reply to this message
|
|