POV-Ray : Newsgroups : povray.programming : Python and POVRay : Re: Python and POVRay Server Time
28 Jul 2024 12:27:51 EDT (-0400)
  Re: Python and POVRay  
From: Roberto Ferrer de Amorim
Date: 12 Mar 2001 14:16:59
Message: <3aad20ab$1@news.povray.org>
> You don't want to know what I think of Python as a scene description
> language...

Scrolling back I saw an "Object-Oriented language for POV" thread, and by
reading it, I know what you think of Python, yes. :-)

> The basic idea isn't bad, I just don't like Python, and don't think it
> is the best choice for this. I think a language designed for the purpose
> of scene description would be better...with built-in support for
> vectors, colors, transformations, etc...and a more OO way of doing
> things. (Python still looks procedural to me...)

Python combines the best things about OO, functional and procedural
programming without turning into a mess. I will not try to "convert" you,
but I can't find a better tool for the job than Python.

In a web application server called Zope, they designed ways to run Python
code on a sandbox and with little syntax differences. What do I mean by
that? I mean that it is possible to write a Python script like

def f(x):
x = 1 + 2
:end

for instance - no whitespace needed, and it could be converted easily to

def f(x):
  x = 1 + 2

before being parsed. That way you can use it as you use C (although I do
prefer the whitespace approach). That's not an issue.

I see Python as a great language for that job because:

- it can be highly OO - multiple inheritance is not a problem, and all data
structures are high-level
- it's easy to learn
- it can be easily extended and/or embedded.

Who knows, maybe when I get it done you'll actually like it. I hope so. :-)

> I've been working on the idea of a CSDL (C-like Scene Description
> Language) for a while now, I might start writing an interpreter soon. It
> would be a language loosely based on C (the loop and conditional syntax,
> {} blocks, semicolon statement endings, etc), but designed around the
> idea of manipulating objects (shapes) in a 3D environment. It would be a
> separate program that would take a CSDL file and output a .pov file (and
> possibly formats for other renderers), platform specific versions could
> automatically render the output file.
> There wouldn't be any "classes", objects would inherit from other
> objects, and inheritance would be done by creating a modified copy of
> the parent object. There would be a base object, a "prototype" that all
> shapes and other objects would inherit from.

If well designed, this CSDL can be great. However, I may be wrong, but I
think it can be way easier using Python. I'm using Python for all the new
projects on my job, and it fits great on most (if not all) programming needs
I have - and it's faster to develop with than Java, PHP, Perl and such (at
least for me).

As a last comment, some guy called Bruce Eckel feels the same as me about
Python. Check http://www.mindview.net/ and
http://www.mindview.net/Python/ThinkingInPython.html . Quoting from the
C++/Java ubermaster himself:

"Considering that Python is my language of choice for virtually all my own
programming projects, my research into the language is continuing apace."

Best regards,

Wolfox


Post a reply to this message

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