POV-Ray : Newsgroups : povray.pov4.discussion.general : Next Generation SDL Brainstorming Server Time
10 Dec 2024 19:43:00 EST (-0500)
  Next Generation SDL Brainstorming (Message 11 to 20 of 92)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Bill Pragnell
Subject: Re: Next Generation SDL Brainstorming
Date: 27 Mar 2009 05:00:00
Message: <web.49cc943fad5940476dd25f0b0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
>   A simple for-loop removes most if not all the confusion.

I'm not sure. The opinions of people like Kenneth are quite valuable here,
because they are still at a place that those of us who write code fluently can
only dimly remember. I honestly can't remember if I had more trouble with for
loops than while loops when I was learning to program. From where I'm standing,
it could easily be argued that for loops are the more challenging.

>   And it's not like the for-loop would *replace* while-loops.

Well, true. If we have both, then it's not an issue :-)


As an aside, I think there *has* to be a legacy parser (as I believe clipka
suggested). There is just too much useful stuff that will break, and users who
will either stick to pre-4.0 versions or stop using POV completely. Also,
having a simpler, more 'approachable' SDL will encourage users in, as it does
now. I see no problem in the old-style option being more restrictive; this
will, in turn, encourage the more confident user to move on to the new. Of
course, we will need plenty of code and tutorials posting here in the early
days to help everyone out!

(Don't get me wrong, I'm all in favour of a new SDL - indeed, I'm salivating at
the possibilities!)

Bill


Post a reply to this message

From: Kenneth
Subject: Re: Next Generation SDL Brainstorming
Date: 27 Mar 2009 05:00:00
Message: <web.49cc9492ad594047f50167bc0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Kenneth <kdw### [at] earthlinknet> wrote:
> > The #while loop is easily understood, simply from the fact of its name.
>
>   I beg to differ. I once wrote a long page dedicated solely to explaining
> how the #while loop does and doesn't work, because misunderstandings are
> so common:
>
> http://tag.povray.org/povQandT/whileloops.html

My main concern is actually with 'semantics' (if that's the right word.) I.e.,
the term #while seems to be quite logical and understandable in its meaning:
"while (this is true) do this stuff" etc. Same thing with #if. But--using #for
as an example again--I'm not so sure I understand what "for" signifies, in an
English syntax sense. (Actually, I do seem to recall 'for-next' being a part of
Fortran IV that I learned long ago in college. I think. Which has been my only
experience with 'real' computer programming, aside from Basic or one of its
iterations on an old Commodore computer. But #for doesn't immediately create a
mental picture of what it does.) So my own desire would be to have SDL syntax
that is as easy (or even easier) to 'quickly grasp' than the current version's.

KW


Post a reply to this message

From: Warp
Subject: Re: Next Generation SDL Brainstorming
Date: 27 Mar 2009 05:51:58
Message: <49cca1be@news.povray.org>
Bill Pragnell <bil### [at] hotmailcom> wrote:
> As an aside, I think there *has* to be a legacy parser (as I believe clipka
> suggested). There is just too much useful stuff that will break, and users who
> will either stick to pre-4.0 versions or stop using POV completely.

  It's reasonable to expect that some kind of legacy parser module will
be possible, which will allow rendering old scenes with POV-Ray 4.0 (what
the parser internally would do is to convert the old SDL input so that it
can be parsed by the new parser, or such; I'm not sure it would be a great
idea to replicate object creation etc. in two places).

  However, if the new scripting language is a complete rehaul, it will not
be possible to call eg. macros of the old SDL from the new scripting
because they will simply be incompatible. Basically it will be impossible
to convert old SDL macros to the new scripting in all possible cases because
macros are not pure functions. With current macros you can create ugly hacks
like opening a { block in your main scene and closing it inside a #macro
(which may be cool for short code contests, but makes things like byte
compiling a nightmare, if not an impossibility).

  In fact, any kind of legacy parser and converter (be it internal or a
separate tool) will be a rather large job. I have this little feeling that
this might actually never happen due to lack of labor force. Someone would
have to volunteer to do this, and he would have to do it properly.

-- 
                                                          - Warp


Post a reply to this message

From: Bill Pragnell
Subject: Re: Next Generation SDL Brainstorming
Date: 27 Mar 2009 06:25:01
Message: <web.49cca911ad5940476dd25f0b0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
>   However, if the new scripting language is a complete rehaul, it will not
> be possible to call eg. macros of the old SDL from the new scripting
> because they will simply be incompatible. Basically it will be impossible
> to convert old SDL macros to the new scripting in all possible cases because
> macros are not pure functions.

It might not be feasible to actually call the old macros from within the new
SDL, but surely they could be run by the old parser to generate 'pure'
old-style SDL that could then be converted? That would be perfectly adequate in
most cases, I would think.

> With current macros you can create ugly hacks

Not so much of a loss if these get wiped. No decent macro should rely on such
voodoo! I'm sure there'll be some equivalent hackery we can exploit for bizarre
coding contests...

Bill


Post a reply to this message

From: clipka
Subject: Re: Next Generation SDL Brainstorming
Date: 27 Mar 2009 12:35:00
Message: <web.49ccfeffad594047208afb30@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:
> I hope I'm not weighing in with some 'simpleton' comments here (I'm definitely
> NO computer scientist), but the way I approach discussions of a proposed new
> SDL language is strictly from the standpoint of 'comfortable usability.' As
> basically a non-programmer (except with the SDL), I would want to see a
> language that made 'simple sense' as to its syntax. For example: The #while
> loop is easily understood, simply from the fact of its name. Using #for instead
> seems a bit 'obtuse' as to its meaning (except among programmers, of course!)

Good point - unfortunately, for us programmers the "non-obviousness" of such
things is not obvious for us ;) So we definitely need non-programmers to point
such things out to us.

How about this - would these be more obvious for a non-programmer? (Be invited
to pick your favourite or roll your own)

    #for i from 0 to N-1  ...  #end
    #with i from 0 to N-1  ...  #end
    #foreach i in 0 to N-1  ...  #end


> Of course, I could be the 'odd-man-out'; perhaps the majority of POV-Ray users
> *do* actually come from some kind of programming background, where 'odd' syntax
> terms are of no consequence.

.... which is not necessarily the point, because even if most POV-Ray users would
come from a programming background, it could be *because* the syntax might be
not obvious enough to others. Which in that case would rather speak in favor of
making the language more intuitive to noobs.


Post a reply to this message

From: clipka
Subject: Re: Next Generation SDL Brainstorming
Date: 27 Mar 2009 12:55:00
Message: <web.49cd0462ad594047208afb30@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:
> My main concern is actually with 'semantics' (if that's the right word.) I.e.,
> the term #while seems to be quite logical and understandable in its meaning:

Actually, I remember that when I started programming, I was multiple times
fooled by the while-loop, about when the condition is checked. The most
intuitive loop, for me, was:

REPEAT
  ...
UNTIL (condition);

which did exactly what I always expected it to do: Execute the list of
statements, *then* check for the condition, and if it didn't hold true, repeat
the whole smash over and over again.

Then again, maybe this is still not the most intuitive, as there might be some
confusion whether the statements are executed if the condition doesn't hold
true right from the start, so maybe this would be the clearest (albeit not the
most elegant):

REPEAT {
  ...
  IF (condition) END REPEAT
  ...
}

Note that you can build *any* type of loop from this:

// while(condition) ...:
REPEAT {
  IF (NOT condition) END REPEAT
  ...
}

// repeat ... until(condition):
REPEAT {
  ...
  IF (condition) END REPEAT
}

// for i from 1 to n:
LET i = 1
REPEAT {
  IF (i > n) END REPEAT
  ...
}


BTW, as another alternative for the for-loop, how about this:

REPEAT COUNTING i FROM 1 TO n {
  ...
}

I guess that should be plain enough. Otherwise I give up ;)


Post a reply to this message

From: clipka
Subject: Re: Next Generation SDL Brainstorming
Date: 27 Mar 2009 13:30:01
Message: <web.49cd0c98ad594047208afb30@news.povray.org>
"Bill Pragnell" <bil### [at] hotmailcom> wrote:
> As an aside, I think there *has* to be a legacy parser (as I believe clipka
> suggested). There is just too much useful stuff that will break, and users who
> will either stick to pre-4.0 versions or stop using POV completely.

Actually, I'm currently pondering the possibility of what would be a more
formalized variant of the current SDL, in an attempt to remove its
inconsistencies while making it a rather easy task to port existing code to the
new version.

It would probably be an easy thing to modify the existing SDL parser *now* to
accept both variants of the language for now side by side, throwing a warning
e.g. per file if it finds old syntax, allowing for a rather smooth transition;
if that new syntax was introduced anytime soon *now*, maybe the old style would
be "obsolete enough" to drop support with POV 4 - which would then allow to
downsize the parser a good deal.

I'll post on this idea soon.

Just for starters: The main difference would probably be a significant increase
in the number of semicolons used.


Post a reply to this message

From: Chambers
Subject: Re: Next Generation SDL Brainstorming
Date: 27 Mar 2009 14:58:20
Message: <49cd21cc$1@news.povray.org>
On 3/26/2009 11:37 AM, Chris B wrote:
> wise to totally change the product name. Otherwise there's a risk of
> years of confusion that may create difficult barriers to new users.

ACtually, this probably isn't a bad idea.  Perhaps Scene Object 
Language, or Scene Programming Language, to distinguish it from the 
current SDL.

In fact, if that's the case then the current parser could be kept for 
backwards compatability, activated by an appropriate #version directive 
(or whatever the equivalent would be in the new language) but remain 
static and disallowing access to features exclusive to the new language.

-- 
...Chambers
www.pacificwebguy.com


Post a reply to this message

From: clipka
Subject: Re: Next Generation SDL Brainstorming
Date: 27 Mar 2009 15:25:00
Message: <web.49cd27a0ad594047208afb30@news.povray.org>
Chambers <ben### [at] pacificwebguycom> wrote:
> On 3/26/2009 11:37 AM, Chris B wrote:
> > wise to totally change the product name. Otherwise there's a risk of
> > years of confusion that may create difficult barriers to new users.
>
> ACtually, this probably isn't a bad idea.  Perhaps Scene Object
> Language, or Scene Programming Language, to distinguish it from the
> current SDL.

Ah, now I get that point...

With the language no longer claiming to be merely a descriptive language for POV
scenes, I think the term "Scene Scripting Language" would be fitting.

(Dibs on the name "POV-Slang", which I intend to use as the name of a particular
proposal for such a language.)


Post a reply to this message

From: Warp
Subject: Re: Next Generation SDL Brainstorming
Date: 27 Mar 2009 16:18:04
Message: <49cd347c@news.povray.org>
clipka <nomail@nomail> wrote:
> Just for starters: The main difference would probably be a significant increase
> in the number of semicolons used.

  I'm not liking the sound of that. I really like being able to eg. create
lists of elements in a loop without having to worry about the commas.
If you make the current SDL "more formalized" and "consistent", you will
be removing a lot of its current flexibility which makes it so great.

  (Also being forced to create all the necessary commas in the loop,
except for the last element which is never followed by a comma, will
make the resulting SDL code to be more hackish and might not, in fact,
make it any easier to create any kind of converter from it to a new
language.)

-- 
                                                          - Warp


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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