POV-Ray : Newsgroups : povray.pov4.discussion.general : Next Generation SDL Brainstorming Server Time
8 Jul 2024 10:21:31 EDT (-0400)
  Next Generation SDL Brainstorming (Message 13 to 22 of 92)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
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

From: Warp
Subject: Re: Next Generation SDL Brainstorming
Date: 27 Mar 2009 16:20:25
Message: <49cd3509@news.povray.org>
clipka <nomail@nomail> wrote:
> 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.

  The problem with that is that it will execute the body always at least
once. If it should never be executed (which isn't even a rare occurrence),
you will need to add a conditional around the entire repeat-until loop,
and the condition will be a duplicate of the 'until' condition.

-- 
                                                          - Warp


Post a reply to this message

From: Kenneth
Subject: Re: Next Generation SDL Brainstorming
Date: 27 Mar 2009 16:30:01
Message: <web.49cd3625ad594047f50167bc0@news.povray.org>
"clipka" <nomail@nomail> wrote:

>
> 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
>
>

Cool! I get to choose a keyword for the new SDL. :-P  I feel like a contestant
on that U.S. TV game show "The Price Is Right":  "Let's see, I think I'll
choose door number...THREE.  No, wait...number FOUR!"

Actually, in looking up the definition of a #for loop, I really can't think of
an easy English-syntax equivalent. And I see that #for is a basic keyword of
almost all computer languages--so changing it would be silly, I guess.

> > 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.

That's an interesting point, one that I hadn't considered. And I would agree.
(I'm not sure why the SDL learning-curve didn't put ME off when I started with
POV-Ray--probably because the astounding visual results of the program just
outweighed any seeming syntax difficulties. I just *had* to learn it!
Hopefully, that's how other newbies react to the SDL as well. And it goes
without saying that POV-Ray is not for everyone--but then neither are the
plethora of other programming languages out there. You have to be willing to
take a leap into a 'new world.' And as the saying goes, "No pain, no gain.")

KW


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.