POV-Ray : Newsgroups : povray.programming : URGENT: FRAME structure : Re: URGENT: FRAME structure Server Time
29 Jul 2024 02:20:13 EDT (-0400)
  Re: URGENT: FRAME structure  
From: Thorsten Froehlich
Date: 20 Aug 2000 13:24:53
Message: <39a01465@news.povray.org>
In article <chrishuff-5D4489.11363420082000@news.povray.org> , Chris Huff 
<chr### [at] maccom>  wrote:

> I've often wished I could store a bunch of different types of data for a
> data structure in one chunk.

Well, this is obviously not a feature of object oriented languages only.  I
agree that there hsould be some way to store data of different types more
easily, but I am not sure if C++/Java style syntax would really be the most
appropriate and easy to learn.

As said before, there are programming languages that fit the language model
of POV-Ray much better than C/C++/Java.

> #declare MyFlare = object {PlainLensFlare};
>
> MyFlare.SetSize(5);
> MyFlare.SetPos(< 5, 1, 6>);
> MyFlare.SetColor(< 1, 0, 0.5>);
> object {MyFlare.CalculateFlare();}

What is wrong with:

object
{
    PlainLensFlare
    scale 5
    translate < 5, 1, 6>
    color < 1, 0, 0.5>
}

I understand that there are cases when it appears to be the best way to use
the kind of syntax you suggest. (continues below)


>> Would it be easier to learn?
>
> No, but since the existing language wouldn't need to be disturbed, you
> wouldn't have to learn it. It would be considerably easier to learn than
> C++, though.

My major problem with it is that is obvious in all discussions about an
object oriented POV scene description language is that people who are
familiar with C/C++/Java seem be caught in the thinking that every language
should look this way. to quote the old Apple slogan "Think Different"!

In particular, I think the low level capabilities of C/C++/Java are in the
way of creating a simple and easy to learn object oriented extension to the
POV language.  As a matter of fact, due to the completely different nature
of C/C++/Java and POV, nobody having to learn it would benefit from existing
C/C++/Java documentation, books, etc if he/she does not know any of them
before.

To quote [1] Tog talking about the JavaScript in "How Programmers Stole the
Web":

>> And from whence arose this new syntax? It was derived from, and I am quoting
here, "the familiar C++ syntax." Familiar to whom? Certainly not the
millions upon millions of people who know BASIC. Certainly not the millions
upon millions who know HTML. It was familiar to the select cadre of
engineers at Netscape, along with all of their friends. Did they set out to
be exclusionary? I'm sure not; they just simply adapted the tools with which
they themselves felt comfortable. <<

So, should programmer also "steal POV-Ray"?

>> Would it be fast to parse?
>
> It probably wouldn't be noticeably slower without benchmarking, and
> could possibly allow doing some things in a way that would parse faster
> than previously possible.

Well, I would say it would parse slower because certain access to internal
data structures of POV-Ray would surely take some time.  A more abstract
language could hide these complex tasks behind the POV scene language and
use the many benefits of a hardwired access of C++ (in POV-Ray 4.0) rather
than doing it in small steps in the interpreted POV scene language!

>> Would it allow porting C/C++/Java programs to POV-script?

This is a rather provocative question, and I wanted to see someone claim
this would be the reason for the language extension :-)


     Thorsten




[1] "How Programmers Stole the Web" by Bruce Tognazzini
    <http://www.AskTog.com/columns/028WebStealers.html>

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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