|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <chr### [at] netplexaussieorg>,
Christopher James Huff <chr### [at] maccom> wrote:
> It supports arithmetic, function declarations, and...um, the return
> statement. Ok, it needs a little work. ;-)
It now supports scalar and vector variables, numeric constants, if(),
if()-else, and while() statements. ;-)
--
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> > It supports arithmetic, function declarations, and...um, the return
> > statement. Ok, it needs a little work. ;-)
>
> It now supports scalar and vector variables, numeric constants, if(),
> if()-else, and while() statements. ;-)
So what is this patch exactly? An extension to functions?
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <3db74adc$1@news.povray.org>, "Slime" <slm### [at] slimelandcom>
wrote:
> So what is this patch exactly? An extension to functions?
It isn't a patch, though it will be part of one eventually. It's just a
very simple procedural language designed to be interpreted quickly, for
things like shading or math computations. I'm going to try to get it to
work alongside or through POV functions.
--
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
|
|
| |
| |
|
|
|
|
| |
|
|