1. goto: it's conceded

I just conceded to Derek that i cannot defend every possible use of "goto", and
i cannot support to his standards the use of "goto". We agreed i will not be
ultimately happy with Euphoria in all regards, perhaps i not use Euphoria any
more, and i suggested to JBrown he not see what it takes to add "goto" to
Euphoria v4. Is there any other groveling i need do?

Kat

new topic     » topic index » view message » categorize

2. Re: goto: it's conceded

Kat wrote:
> 
> 
> I just conceded to Derek that i cannot defend every possible use of "goto",
> and i cannot support to his standards the use of "goto". We agreed i will not
> be ultimately happy with Euphoria in all regards, perhaps i not use Euphoria
> any more, and i suggested to JBrown he not see what it takes to add "goto" to
> Euphoria v4. Is there any other groveling i need do?
> 
> Kat

A disagreement or an unpopular stance doesn't mean you have to grovel to anyone.
Stick to your beliefs.

--
A complex system that works is invariably found to have evolved from a simple
system that works.
--John Gall's 15th law of Systemantics.

"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare

j.

new topic     » goto parent     » topic index » view message » categorize

3. Re: goto: it's conceded

> Is there any other groveling i need do?

There never has been. 

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view message » categorize

4. Re: goto: it's conceded

Jason Gade wrote:
> 
> Kat wrote:
> > 
> > I just conceded to Derek that i cannot defend every possible use of "goto",
> > and i cannot support to his standards the use of "goto". We agreed i will
> > not
> > be ultimately happy with Euphoria in all regards, perhaps i not use Euphoria
> > any more, and i suggested to JBrown he not see what it takes to add "goto"
> > to
> > Euphoria v4. Is there any other groveling i need do?
> > 
> > Kat
> 
> A disagreement or an unpopular stance doesn't mean you have to grovel to
> anyone.
> Stick to your beliefs.

I agree with Jason.  Please forgive if I've been too harsh.

I would like, if I may, to make a point about the term that you may find
interesting if you don't mind.

Spaghetti code is a term that seems to imply a tangled mess.  You obviously
take pride in not writing tangled messes and would be rightly indignant
to have people unfairly suggest that.

But realize that even if we all actually did write tangled messes, the
computer wouldn't care.  To it, the most tangled mess in the world is no
different from the most orderly code ever written.  That's not the problem.

So for just that reason, the term spaghetti code misdirects from the real issue.

The problem is that all programmers are human.  One of the profound problems
that you will see again and again when using GOTO's is that you can write
a profuse amount of excellent quality code that takes many hours to create.

Then, because of using GOTO's to labels it is much easier to overlook the
fact that the code is never reached.  Again and again you will see this.
This doesn't mean that the same thing can't happen without GOTO'S because
it certainly can.  It's just a fact that it happens much more often when
labels rather than structure is relied upon for program flow.

Humans are more likely to make this mistake with labels.

This isn't the only problem related to GOTO's but it is perhaps the easiest
to perceive.

new topic     » goto parent     » topic index » view message » categorize

5. Re: goto: it's conceded

ken mortenson wrote:
> 
> Jason Gade wrote:
> > 
> > Kat wrote:
> > > 
> > > I just conceded to Derek that i cannot defend every possible use of
> > > "goto",
> > > and i cannot support to his standards the use of "goto". We agreed i will
> > > not
> > > be ultimately happy with Euphoria in all regards, perhaps i not use
> > > Euphoria
> > > any more, and i suggested to JBrown he not see what it takes to add "goto"
> > > to
> > > Euphoria v4. Is there any other groveling i need do?
> > > 
> > > Kat
> > 
> > A disagreement or an unpopular stance doesn't mean you have to grovel to
> > anyone.
> > Stick to your beliefs.
> 
> I agree with Jason. 

I keep my beliefs. They just aren't wanted in Euphoria, #Euphoria, or Euforum.
You will get a lot of new keywords and functions in Eu v4, some of which were
thought up and considered for a few minutes before addition to the language. Goto
isn't one of the new keywords. You will probably get strtok.e, and i appologise
in advance for that, and any offence you take with eunet.e over any of my code
that may still be in it. I had a lot of hope pinned on Euphoria. I am too old to
start looking for a new language, i may just give up on all high level languages,
the entire wintel platform, and goto AVRs and the olde 6502. And not release any
code, so it cannot be called carp, and my ideas for the language not
automatically shot down as a matter of course.

Kat

new topic     » goto parent     » topic index » view message » categorize

6. Re: goto: it's conceded

ken mortenson wrote:
> --8<--
> This isn't the only problem related to GOTO's but it is perhaps the easiest
> to perceive.

One word (or maybe two):

GOSUB

blink

Gary

new topic     » goto parent     » topic index » view message » categorize

7. Re: goto: it's conceded

gshingles wrote:
> 
> ken mortenson wrote:
> > --8<--
> > This isn't the only problem related to GOTO's but it is perhaps the easiest
> > to perceive.
> 
> One word (or maybe two):
> 
> GOSUB

Well, that's terse.  Let me add a few more.  Back in the day, I thought I
could never live without ON X GOTO, as well as ON X GOSUB.  I have matured
quite a bit since then.  The idea of using any of these four today is
physically loathesome to me.  Not to offend, but for a HLL to include these
would make it a toy language not suitable for serious development. YMMV.

new topic     » goto parent     » topic index » view message » categorize

8. Re: goto: it's conceded

ken mortenson wrote:
> 
> Well, that's terse.  Let me add a few more.  Back in the day, I thought I
> could never live without ON X GOTO, as well as ON X GOSUB.  I have matured
> quite a bit since then.  The idea of using any of these four today is
> physically loathesome to me.  Not to offend, but for a HLL to include these
> would make it a toy language not suitable for serious development. YMMV.

Indeed MMV, though it goes by a different name, using routine_id and
call_proc/call_func.  See execute.e in the euphoria source directory for
an example of how this can be reasonably used.  Also, I'd point out that
ON X GOTO is really similar (just a little less controlled) to a 
switch/select/case.

Matt

new topic     » goto parent     » topic index » view message » categorize

9. Re: goto: it's conceded

Matt Lewis wrote:

> Indeed MMV, though it goes by a different name, using routine_id and
> call_proc/call_func.  See execute.e in the euphoria source directory for
> an example of how this can be reasonably used.  Also, I'd point out that
> ON X GOTO is really similar (just a little less controlled) to a 
> switch/select/case.

I agree.  Routine ID's can be used in a very similar way.  Call by address
from a table has many practical uses.  Goto and Gosub however, will never
be missed by me.  Perhaps because I've maintained code where they have
been abused.

new topic     » goto parent     » topic index » view message » categorize

10. Re: goto: it's conceded

Gosub is just a named function/procedure call, only more primitive.

--
A complex system that works is invariably found to have evolved from a simple
system that works.
--John Gall's 15th law of Systemantics.

"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare

j.

new topic     » goto parent     » topic index » view message » categorize

11. Re: goto: it's conceded

Jason Gade wrote:
> 
> Gosub is just a named function/procedure call

Yoda, "This is why you fail..."

new topic     » goto parent     » topic index » view message » categorize

12. Re: goto: it's conceded

ken mortenson wrote:
> 
> Jason Gade wrote:
> > 
> > Gosub is just a named function/procedure call
> 
> Yoda, "This is why you fail..."

Sorry, poor phrasing on my part.

"A function or procedure call is just a named gosub." That's why they're called
"subroutines" and they have "return" statements.

Of course, subroutines existed before gosub.

--
A complex system that works is invariably found to have evolved from a simple
system that works.
--John Gall's 15th law of Systemantics.

"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare

j.

new topic     » goto parent     » topic index » view message » categorize

13. Re: goto: it's conceded

gshingles wrote:
> 
> ken mortenson wrote:
> > --8<--
> > This isn't the only problem related to GOTO's but it is perhaps the easiest
> > to perceive.
> 
> One word (or maybe two):
> 
> GOSUB

procedure GOSUB()
> 
> blink
> 
> Gary


Don Cole

new topic     » goto parent     » topic index » view message » categorize

14. Re: goto: it's conceded

don cole wrote:
> 
> gshingles wrote:
> > 
> > ken mortenson wrote:
> > > --8<--
> > > This isn't the only problem related to GOTO's but it is perhaps the
> > > easiest
> > > to perceive.
> > 
> > One word (or maybe two):
> > 
> > GOSUB
> 
> procedure GOSUB()
> > 
> > blink
> > 
> > Gary
> 
> 
> Don Cole

You are a bad, bad man, Don.

smile

--
A complex system that works is invariably found to have evolved from a simple
system that works.
--John Gall's 15th law of Systemantics.

"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare

j.

new topic     » goto parent     » topic index » view message » categorize

15. Re: goto: it's conceded

ken mortenson wrote:
> 
> > One word (or maybe two):
> > 
> > GOSUB
> 
> Well, that's terse.  Let me add a few more.  Back in the day, I thought I
> could never live without ON X GOTO, as well as ON X GOSUB.  I have matured
> quite a bit since then.  The idea of using any of these four today is
> physically loathesome to me.  Not to offend, but for a HLL to include these
> would make it a toy language not suitable for serious development. YMMV.

Yes, I wasn't being serious. Your excellent treatise on the evils of spaghetti
code took me back to the days when I wrote a rather large drawing program in a
version of BASIC on my CP/M computer (Microbee 256TC). No mouse.

I encountered all of the problems you mentioned using GOTO, so I gradually
started using GOSUB thinking that might alleviate some of those shortcomings
since you didn't need to know which line to GOTO back to. That's when I first
learned what a stack overflow was smile

Gary

new topic     » goto parent     » topic index » view message » categorize

16. Re: goto: it's conceded

On Tuesday 27 May 2008 6:37:57 pm Kat wrote:

> I just conceded to Derek that i cannot defend every possible use of "goto",
> and i cannot support to his standards the use of "goto".

Sorry for coming in late on the conversation, but please allow me to add my 
own grumpy two cents worth.

I can't see the harm of adding GOTO to Euphoria. It adds real value for some 
people, and it doesn't (as far as I know) harm anyone by adding it.

Of course, I'm assuming the reason for not having a GOTO isn't technical.

There's this odd idea that adding features to a language will cause it harm. 
This concept baffles me. Just because you can get by without a feature, or 
you can add a workaround to do without it, doesn't mean the language is 
better off without that feature.

Here's a feature I found in Python: an 'else' clause for loops. The 'else' is 
triggered if the loop is exited without a 'break' being encountered. For 
example:

	-- look for my name in a sequence
	for i = 0 to length(s)
		if equal( s[i], "my name") then
			printf("got a match")
			break
		end if
	else
		printf("no match found")
	end for

Although this is just syntactic sugar, it's really, really useful. But I can't 
see this ever getting implemented in Euphoria, because the language purity 
police will argue that you can do the same thing without the 'else' clause. 
Adding it would only bloat the language.

From my perspective, this need to keep Euphoria spartan creates a language 
which isn't any fun to use. When I'm looking to code a solution, I look for 
the tool that will allow me to get something done, not for the one that 
enforced the maximum amount of B&D pain.

To choose not to implement a feature because someone *might* misuse it, 
reminds me of the definition of a Puritain as being someone that worries that 
somewhere, someone might be having fun.

If the feature isn't going to do any damage to you, but will be truly useful 
for someone, how do you justify not implementing it?

OK, back to lurking.

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

17. Re: goto: it's conceded

David Cuny wrote:

 
> Sorry for coming in late on the conversation, but please allow
> me to add my own grumpy two cents worth.


Hi David,
its so nice to hear from you again. Hope things have been going well for you.

> I can't see the harm of adding GOTO to Euphoria. It adds real value
> for some people, and it doesn't (as far as I know) harm anyone by adding
> it.
> Of course, I'm assuming the reason for not having a GOTO isn't technical.

Your right about that. The reason we haven't got GOTO as I write this is because
everything takes time and nothing happens just by saying "I want".

> There's this odd idea that adding features to a language will cause
> it harm. This concept baffles me. Just because you can get by
> without a feature, or you can add a workaround to do without it,
> doesn't mean the language is better off without that feature.

It appears that you haven't caught up with current developments yet. For some
reason, it appears that if passionate discussion occurs it is also assumed that
the status quo will always hold out. It baffles me as to where this idea comes
from, because if one actually follows both the conversations AND the actual work
being done, it can lead to a much better understanding of where things are really
going with v4.0.

There will be a GOTO in the forthcoming v4.0. It is currently being worked on
and, as I understand it, it is mostly completed. I believe it will allow transfer
of control to any point (forwards and backwards) within a routine, except into
and from a loop. It will not be allowed at the topmost execution level and you
can't jump into a loop or out of a loop, but you can jump around inside a loop.

> Here's a feature I found in Python: an 'else' clause for loops.
> The 'else' is triggered if the loop is exited without a 'break'
> being encountered. 
> For example:
> 
> 	-- look for my name in a sequence
> 	for i = 0 to length(s)
> 		if equal( s[i], "my name") then
> 			printf("got a match")
> 			break
> 		end if
> 	else
> 		printf("no match found")
> 	end for
> 
> Although this is just syntactic sugar, it's really, really useful.
> But I can't see this ever getting implemented in Euphoria, because
> the language purity police will argue that you can do the same thing
> without the 'else' clause. Adding it would only bloat the language.

Firstly, this looks like a handy thing to have. I don't remember having seen
this construct before. I assume the index value is still in scope for the 'else'
block to use.
 
Secondly, who is this "language purity police" you talk of. I haven't come
across them yet. And if they do exist, they are exceptionally ineffectual because
there are quite a few neat syntax sugarary bits coming our way. Maybe not all in
v4.0 but I can't see them being unnecessarily delayed.

> From my perspective, this need to keep Euphoria spartan creates a language 
> which isn't any fun to use. When I'm looking to code a solution, I look for
> the tool that will allow me to get something done, not for the one that 
> enforced the maximum amount of B&D pain.

I think you'll like some of the new ideas being implemented.

> To choose not to implement a feature because someone *might* misuse it, 
> reminds me of the definition of a Puritain as being someone that worries
> that> somewhere, someone might be having fun.

This sounds like you might have been misinformed or misunderstood my personal
position on the GOTO debate. Kat (excuse me for talking about you) does not seem
to fully understand what I have been saying and at times she appears to
misrepresent my words. I hope its me that has misunderstood her.

My position is simple.

I believe GOTO, by necessity, adds to the maintenance overhead of any program it
is used in. The amount of increase varies but it is always an increase.
Therefore, if I am ever being asked to work on maintaining such code, I will need
to have the use of GOTO justified to me before I could be comfortable with it.
The most obvious justification would be in the area of performance, such that by
using GOTO the improved performance is practical, necessary and can only be
achieved via GOTO usage.

I have publicly stated that if one wants to use GOTO in their own personal code
they should be free to do so. I actually argued for a GOTO in Euphoria that had
no limitations whatsoever, just like assember.

> If the feature isn't going to do any damage to you, but will
> be truly useful for someone, how do you justify not implementing it?

Ok, there are limitations to that concept but in general, I agree. For example,
having built-in matrix operations ala FORTRAN would be useful to quite a few
people, but that might have to wait awhile before getting in Euphoria. In the
meantime, a library solution will be used.

> OK, back to lurking.

I'd rather you didn't. You skills are needed in helping improve Euphoria. Why
don't you join us in working on the beast.

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view message » categorize

18. Re: goto: it's conceded

Derek Parnell wrote:

It appears that I was wrong. The GOTO in v4.0 does allow jumping into and out of
loops.


-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view message » categorize

19. Re: goto: it's conceded

David Cuny wrote:
> 
> 
> I can't see the harm of adding GOTO to Euphoria. It adds real value for some
> 
> people, and it doesn't (as far as I know) harm anyone by adding it.
> 

Wow, it's good to hear [read?] from you once again!

Anyway, "first, do no harm" is good advice not just for doctors.
As far as I can tell, goto isn't going to bother me at all. 
There are already lots of keywords in Eu which I have never used. 
One more won't hurt. And I don't ever recall needing a variable 
named "goto":)

Unlike "label" (dang it, EVERY graphic UI lib has something called a "label")
Now that "label" is a keyword, I have to rewrite a bunch of code.

Grumble, grumble....

new topic     » goto parent     » topic index » view message » categorize

20. Re: goto: it's conceded

On Sunday 01 June 2008 4:21:05 am Derek Parnell wrote:

> its so nice to hear from you again. Hope things have been going well for
> you.

Yes, I've been busy!

> Your right about that. The reason we haven't got GOTO as I write this is
> because everything takes time and nothing happens just by saying "I want".

OK. I've been following a number of threads, and perhaps what I've inferred 
from responses isn't the case. My apologies.

I have great respect for the constraints you're under.

> It baffles me as to where this idea comes from, because if one actually
> follows both the conversations AND the actual work being done, it can lead
> to a much better understanding of where things are really going with v4.0. 

I apologize. I've not had time to play with Euphoria recently.

> Firstly, this looks like a handy thing to have. I don't remember having
> seen this construct before. I assume the index value is still in scope for
> the 'else' block to use.

To my understanding, no. You've exhausted the loop and fallen through, so the 
index value is out of scope.

> And if they do exist, they are exceptionally ineffectual 
> because there are quite a few neat syntax sugarary bits coming our way.

Groovy.

> I believe GOTO, by necessity, adds to the maintenance overhead of any
> program it is used in. The amount of increase varies but it is always an
> increase. Therefore, if I am ever being asked to work on maintaining such
> code, I will need to have the use of GOTO justified to me before I could be
> comfortable with it. The most obvious justification would be in the area of
> performance, such that by using GOTO the improved performance is practical,
> necessary and can only be achieved via GOTO usage.

Well, sometimes you're nested deep, and you need to get out. Implementing it 
without GOTO is messy and error prone. With GOTO, it's clear what's happening 
and it executes as expected.

> Ok, there are limitations to that concept but in general, I agree. For
> example, having built-in matrix operations ala FORTRAN would be useful to
> quite a few people, but that might have to wait awhile before getting in
> Euphoria. In the meantime, a library solution will be used.

Fair enough.

> I'd rather you didn't. You skills are needed in helping improve Euphoria.
> Why don't you join us in working on the beast.

I'd love to, but at the moment I'm neglecting to work on my own programming 
language so I can work on a 3d Reyes-style renderer. And yet again, the sky 
is starting to brighten outside, and I still haven't gotten any sleep.

If only there were more hours in the day!

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

21. Re: goto: it's conceded

David Cuny wrote:
> Well, sometimes you're nested deep, and you need to get out. Implementing it
> 
> without GOTO is messy and error prone. With GOTO, it's clear
> what's happening and it executes as expected.

We can now do this (in V4.0) ...

   while cond1 label "toplevel" do
      . . .
      while cond2 do
       . . .
         while cond3 label "anotherpoint" do
           . . .
            while cond4 do
              . . .
              if abc then
                  exit "toplevel"
              else
                  continue "anotherpoint"
              end if
            end while
        end while
     end while
   end while

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view message » categorize

22. Re: goto: it's conceded

Derek Parnell wrote:
> 
> David Cuny wrote:
> > Well, sometimes you're nested deep, and you need to get out. Implementing it
> > 
> > without GOTO is messy and error prone. With GOTO, it's clear
> > what's happening and it executes as expected.
> 
> We can now do this (in V4.0) ...
> 
>    while cond1 label "toplevel" do
>       . . .
>       while cond2 do
>        . . .
>          while cond3 label "anotherpoint" do
>            . . .
>             while cond4 do
>               . . .
>               if abc then
>                   exit "toplevel"
>               else
>                   continue "anotherpoint"
>               end if
>             end while
>         end while
>      end while
>    end while
> 

Why did you
exit "toplevel"
else
continue "anotherpoint"

and not
continue "toplevel"
else
continue "anotherpoint"

or 
goto "toplevel"
else
goto "anotherpoint"

?

Kat

new topic     » goto parent     » topic index » view message » categorize

23. Re: goto: it's conceded

Kat wrote:
> 
> Derek Parnell wrote:
> > 
> > David Cuny wrote:
> > > Well, sometimes you're nested deep, and you need to get out. Implementing
> > > it
> > > 
> > > without GOTO is messy and error prone. With GOTO, it's clear
> > > what's happening and it executes as expected.
> > 
> > We can now do this (in V4.0) ...
> > 
> >    while cond1 label "toplevel" do
> >       . . .
> >       while cond2 do
> >        . . .
> >          while cond3 label "anotherpoint" do
> >            . . .
> >             while cond4 do
> >               . . .
> >               if abc then
> >                   exit "toplevel"
> >               else
> >                   continue "anotherpoint"
> >               end if
> >             end while
> >         end while
> >      end while
> >    end while
> > 
> 
> Why did you
> exit "toplevel"
> else
> continue "anotherpoint"
> 
> and not
> continue "toplevel"
> else
> continue "anotherpoint"

Because I wanted to exit the top level and not begin the next iteration of it.

> or 
> goto "toplevel"
> else
> goto "anotherpoint"

Where is "toplevel"? Is it above or below the goto? I don't know so I'll have to
check the code. Oh there it is ... it's above. But I don't want to GOTO that
label, I want to leave the loop called "toplevel" instead.

Where is "anotherpoint"? Is it above or below the goto? I don't know so I'll
have to check the code. Oh there it is ... it's above. But I don't want to GOTO
that label, I want to begin the next iteration of the loop called "anotherpoint"
instead.


-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view message » categorize

24. Re: goto: it's conceded

irv mullins wrote:
> 
> David Cuny wrote:
> > 
> > 
> > I can't see the harm of adding GOTO to Euphoria. It adds real value for some
> > 
> > people, and it doesn't (as far as I know) harm anyone by adding it.
> > 
> 
> Wow, it's good to hear [read?] from you once again!
> 
> Anyway, "first, do no harm" is good advice not just for doctors.
> As far as I can tell, goto isn't going to bother me at all. 
> There are already lots of keywords in Eu which I have never used. 
> One more won't hurt. And I don't ever recall needing a variable 
> named "goto":)
> 
> Unlike "label" (dang it, EVERY graphic UI lib has something called a "label")
> Now that "label" is a keyword, I have to rewrite a bunch of code.
> 
> Grumble, grumble....


You know, with some added smarts, the scanner could tell whether an identifier
can be used as a variable or might be a keyword. This won't work with a limited
set of keywords (return is the most obvious), but who would name a variable
"return"?

But for that purpose, it has to remember what kind the last token it sent was. I
never tried to benchmark this mod, brcause it was never asked for, and well,
until recenty, adding a new keyword was something bitterly fought by some, so
that the status quo always hld out.

When I get more available time, I'll check if this analysis is possible without
a noticeable performance penalty. If this works, perhaps it could be implemented
in 4.0 stable. alpha will be too early for me, as things go.

A last note: xin32lib has no problem, because it uses Labels, not labels ;)

CChris

new topic     » goto parent     » topic index » view message » categorize

25. Re: goto: it's conceded

Hmm. I guess that I'm one of the "language purity police".

Or at least, cleanliness, simple design, and consistency are important to me, as
is not adding every little quirk and syntactic sugar that sounds cool.

Also not that it matters since I'm not going to rip out code that others add but
there may be a point just to move on to another language or fork.

Time will tell what becomes of this project.

But for now I guess I'm just content with voicing my opinions.

--
A complex system that works is invariably found to have evolved from a simple
system that works.
--John Gall's 15th law of Systemantics.

"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare

j.

new topic     » goto parent     » topic index » view message » categorize

26. Re: goto: it's conceded

My sentiments exactly. I'm looking for the most expidicious way to solve a
programming problem. I've little use for maiking the program a work of art,
only functional and maintainable.

new topic     » goto parent     » topic index » view message » categorize

27. Re: goto: it's conceded

David Cuny wrote:
> 
> On Tuesday 27 May 2008 6:37:57 pm Kat wrote:
> 
> > I just conceded to Derek that i cannot defend every possible use of "goto",
> > and i cannot support to his standards the use of "goto".
> 
> Sorry for coming in late on the conversation, but please allow me to add my
> 
> own grumpy two cents worth.
> 
> I can't see the harm of adding GOTO to Euphoria. It adds real value for some
> 
> people, and it doesn't (as far as I know) harm anyone by adding it.
> 
> Of course, I'm assuming the reason for not having a GOTO isn't technical.
> 
> There's this odd idea that adding features to a language will cause it harm.
> 
> This concept baffles me. Just because you can get by without a feature, or 
> you can add a workaround to do without it, doesn't mean the language is 
> better off without that feature.
> 
> Here's a feature I found in Python: an 'else' clause for loops. The 'else' is
> 
> triggered if the loop is exited without a 'break' being encountered. For 
> example:
> 
> 	-- look for my name in a sequence
> 	for i = 0 to length(s)
> 		if equal( s[i], "my name") then
> 			printf("got a match")
> 			break
> 		end if
> 	else
> 		printf("no match found")
> 	end for
> 
> Although this is just syntactic sugar, it's really, really useful. But I can't
> 
> see this ever getting implemented in Euphoria, because the language purity 
> police will argue that you can do the same thing without the 'else' clause.
> 
> Adding it would only bloat the language.
> 
> From my perspective, this need to keep Euphoria spartan creates a language 
> which isn't any fun to use. When I'm looking to code a solution, I look for
> 
> the tool that will allow me to get something done, not for the one that 
> enforced the maximum amount of B&D pain.
> 
> To choose not to implement a feature because someone *might* misuse it, 
> reminds me of the definition of a Puritain as being someone that worries that
> 
> somewhere, someone might be having fun.
> 
> If the feature isn't going to do any damage to you, but will be truly useful
> 
> for someone, how do you justify not implementing it?
> 
> OK, back to lurking.
> 
> -- David Cuny
> 
> 

My sentiments exactly. I'm looking for the most expidicious way to solve a
programming problem. I've little use for maiking the program a work of art,
only functional and maintainable.

new topic     » goto parent     » topic index » view message » categorize

28. Re: goto: it's conceded

CChris wrote:
> 
> 
> You know, with some added smarts, the scanner could tell whether an identifier
> can be used as a variable or might be a keyword. This won't work with a
> limited
> set of keywords (return is the most obvious), but who would name a variable
> "return"?
> 

Even if it can, I'm not sure it would be the best thing to do:

sequence label
label "hello"
puts(1, label)


just looks a tad strange to me. Sure, you can figure it out, but I do not think
it leads to ease of learning or use.

label is somewhat of a generic name... For instance:

label = "Hello"


label of what? for what? a button? a text field? a label you print on barcode?

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

29. Re: goto: it's conceded

David Cuny wrote:
>  
> There's this odd idea that adding features to a language will cause it harm. 
> 
> Although this is just syntactic sugar, it's really, really useful. But I can't
> see this ever getting implemented in Euphoria, because the language purity 
> police will argue that you can do the same thing without the 'else' clause.
> 
> From my perspective, this need to keep Euphoria spartan creates a language 
> which isn't any fun to use. When I'm looking to code a solution, I look for
> the tool that will allow me to get something done, not for the one that 
> enforced the maximum amount of B&D pain.
> 
> To choose not to implement a feature because someone *might* misuse it, 
> reminds me of the definition of a Puritain as being someone that worries that
> somewhere, someone might be having fun.
> 
> If the feature isn't going to do any damage to you, but will be truly useful 
> for someone, how do you justify not implementing it?
>

I snipped here and there, but I just wanted to say, that was a great post!
 
> OK, back to lurking.

But why? Stay active smile

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

30. Re: goto: it's conceded

Jeremy Cowgar wrote:

>> OK, back to lurking.
>
> But why? Stay active smile

There are a couple reasons. The main one is time: I've got too much on my 
plate as it is.

The second is that I'm not really that skilled of a C coder. It's easy to 
write things in your own style - it's much harder to figure out something 
that someone else wrote, and stay with their coding style and philosophy. I 
say this having looked through the Euphoria source code, and having 
admiration for those who are currently maintaining it.

A third is that I'm not sure that my hopes for Euphoria match most of those 
using it. If you look at wxBasic, you'll see my attitude toward language 
features: if I think it's cool and useful, and I can do it, I'll throw it in.

I wrote my pre-processor and Py as examples of what I thought Euphoria could 
become. They ended up looking a lot like Python  Lua. I'm not sure my idea of 
Euphoria would make many current users happy.

I'd also endlessly promote wxWidgets being part of the GUI version of 
Euphoria. I think there should be a command line version, and a GUI version 
that's officially supported.

Think of it: Even more posts to the already busy EuForum. Only it's me, so I'd 
be posting for better built-in support of hash tables, strings, and a HUGE 
(but enormously useful) GUI library as part of the official release of 
Euphoria.

Me, posting the same darned things. Again and again and again. The mind reels 
at the signal to noise ratio. blink

Most importantly, I don't use Euphoria on a regular basis, so I'm not current 
on the what's going on.

I can't even can't keep current of everything on this forum. It's nice to see 
a lot of useful activity here, and depressing to see so much bickering and 
name calling.

Anyway, if I think I've got anything useful to add, I'll be sure to do it. In 
the mean time, it's good to see progress with Euphoria.

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

31. Re: goto: it's conceded

Derek Parnell wrote:
 
> David Cuny wrote:
> > Well, sometimes you're nested deep, and you need to get out. Implementing it
> > 
> > without GOTO is messy and error prone. With GOTO, it's clear
> > what's happening and it executes as expected.

Sorry to contradict you but your example demostrates perfectly (with some
elaboration) exactly why GOTO result in less clear code.  Thank you for
providing an example that allows me to make this point...
 
> We can now do this (in V4.0) ...
> 
>    while cond1 label "toplevel" do
>       . . .
>       while cond2 do
>        . . .
>          while cond3 label "anotherpoint" do
>            . . .
>             while cond4 do
>               . . .
>               if abc then
>                   exit "toplevel"
>               else
>                   continue "anotherpoint"
>               end if
>             end while
>         end while
>      end while
>    end while

Any person that wrote this probably expects...

while cond4 do

...to be the beginning of a loop.  Does everybody see that?  The fact
is, it's not.  Here's how I would rewrite the code (without labels) to
make it's functionality much clearer.

procedure example()   
  while cond1 do
    ...
    while cond2 do
      ...
      while cond3 do
        ...
        if cond4 then
          ...
        end if
        if abc then return end if
      end while
    end while
  end while
end procedure

Note that 'while cond4 do' has become 'if cond4 then' which make it much
clearer that no iteration is involved (does anybody disagree?)

I have also promoted this code segment to be a procedure of it's own
which further increases the comprehensibity and maintainability of the
code.  I'm not a theorist.  I'm working programmer (not at the moment,
which allows me the luxury of participating in this forum.)

Anyone who says I've reduced performance by adding a procedure will note
the procedure is outside of these loops.  It's inside the loops (mostly)
where performance is the issue.  Taken to an extreme you could say for
performance just write one long block of code (which may actually be true,
but I don't want anything to do with something that ridiculous... and yes,
I've know programmers that code that way.)

Derek, I'm not picking on you.  The fact that you provided the first
example is highly regarded in my book.  It made it possible for me to
show something that I probably would have just asserted without the
example.

If code works, it's probably best to leave it alone.  In cases where I
must make changes, I'm going to remove every GOTO

new topic     » goto parent     » topic index » view message » categorize

32. Re: goto: it's conceded

ken mortenson wrote:
> 
> Derek Parnell wrote:
>  
> > David Cuny wrote:
> > > Well, sometimes you're nested deep, and you need to get out. Implementing
> > > it
> > > 
> > > without GOTO is messy and error prone. With GOTO, it's clear
> > > what's happening and it executes as expected.
> 
> Sorry to contradict you but your example demostrates perfectly (with some
> elaboration) exactly why GOTO result in less clear code.  Thank you for
> providing an example that allows me to make this point...
>  
> > We can now do this (in V4.0) ...
> > 
> >    while cond1 label "toplevel" do
> >       . . .
> >       while cond2 do
> >        . . .
> >          while cond3 label "anotherpoint" do
> >            . . .
> >             while cond4 do
> >               . . .
> >               if abc then
> >                   exit "toplevel"
> >               else
> >                   continue "anotherpoint"
> >               end if
> >             end while
> >         end while
> >      end while
> >    end while
> 
> Any person that wrote this probably expects...
> 
> while cond4 do
> 
> ...to be the beginning of a loop.  Does everybody see that?  The fact
> is, it's not.  Here's how I would rewrite the code (without labels) to
> make it's functionality much clearer.
> 
> procedure example()   
>   while cond1 do
>     ...
>     while cond2 do
>       ...
>       while cond3 do
>         ...
>         if cond4 then
>           ...
>         end if
>         if abc then return end if
>       end while
>     end while
>   end while
> end procedure

 My mistake, the procedure should actually be withing the first loop.  I hit
tab and something else and this got posted before I had a chance to 
 proof it.  but I think my point is still relevant.

new topic     » goto parent     » topic index » view message » categorize

33. Re: goto: it's conceded

David Cuny wrote:
> 
> Jeremy Cowgar wrote:
> 
> >> OK, back to lurking.
> >
> > But why? Stay active smile
> 
> There are a couple reasons. The main one is time: I've got too much on my 
> plate as it is.
> 
> The second is that I'm not really that skilled of a C coder. It's easy to 
> write things in your own style - it's much harder to figure out something 
> that someone else wrote, and stay with their coding style and philosophy. I
> 
> say this having looked through the Euphoria source code, and having 
> admiration for those who are currently maintaining it.
> 
> A third is that I'm not sure that my hopes for Euphoria match most of those
> 
> using it. If you look at wxBasic, you'll see my attitude toward language 
> features: if I think it's cool and useful, and I can do it, I'll throw it in.
> 
> I wrote my pre-processor and Py as examples of what I thought Euphoria could
> 
> become. They ended up looking a lot like Python  Lua. I'm not sure my idea of
> 
> Euphoria would make many current users happy.
> 
> I'd also endlessly promote wxWidgets being part of the GUI version of 
> Euphoria. I think there should be a command line version, and a GUI version
> 
> that's officially supported.
> 
> Think of it: Even more posts to the already busy EuForum. Only it's me, so I'd
> 
> be posting for better built-in support of hash tables, strings, and a HUGE 
> (but enormously useful) GUI library as part of the official release of 
> Euphoria.
> 
> Me, posting the same darned things. Again and again and again. The mind reels
> 
> at the signal to noise ratio. blink
> 
> Most importantly, I don't use Euphoria on a regular basis, so I'm not current
> 
> on the what's going on.
> 
> I can't even can't keep current of everything on this forum. It's nice to see
> 
> a lot of useful activity here, and depressing to see so much bickering and 
> name calling.
> 
> Anyway, if I think I've got anything useful to add, I'll be sure to do it. In
> 
> the mean time, it's good to see progress with Euphoria.
> 
> -- David Cuny
> 
> 

I'll be a likely happy user of your ideas.

CChris

new topic     » goto parent     » topic index » view message » categorize

34. Re: goto: it's conceded

CChris wrote:
> 
> David Cuny wrote:
> > 
> > Jeremy Cowgar wrote:
> > 
> > >> OK, back to lurking.
> > >
> > > But why? Stay active smile
> > 
> > There are a couple reasons. The main one is time: I've got too much on my 
> > plate as it is.
> > 
> > The second is that I'm not really that skilled of a C coder. It's easy to 
> > write things in your own style - it's much harder to figure out something 
> > that someone else wrote, and stay with their coding style and philosophy. I
> > 
> > say this having looked through the Euphoria source code, and having 
> > admiration for those who are currently maintaining it.
> > 
> > A third is that I'm not sure that my hopes for Euphoria match most of those
> > 
> > using it. If you look at wxBasic, you'll see my attitude toward language 
> > features: if I think it's cool and useful, and I can do it, I'll throw it
> > in.
> > 
> > I wrote my pre-processor and Py as examples of what I thought Euphoria could
> > 
> > become. They ended up looking a lot like Python  Lua. I'm not sure my idea
> > of
> > 
> > Euphoria would make many current users happy.
> > 
> > I'd also endlessly promote wxWidgets being part of the GUI version of 
> > Euphoria. I think there should be a command line version, and a GUI version
> > 
> > that's officially supported.
> > 
> > Think of it: Even more posts to the already busy EuForum. Only it's me, so
> > I'd
> > 
> > be posting for better built-in support of hash tables, strings, and a HUGE 
> > (but enormously useful) GUI library as part of the official release of 
> > Euphoria.
> > 
> > Me, posting the same darned things. Again and again and again. The mind
> > reels
> > 
> > at the signal to noise ratio. blink
> > 
> > Most importantly, I don't use Euphoria on a regular basis, so I'm not
> > current
> > 
> > on the what's going on.
> > 
> > I can't even can't keep current of everything on this forum. It's nice to
> > see
> > 
> > a lot of useful activity here, and depressing to see so much bickering and 
> > name calling.
> > 
> > Anyway, if I think I've got anything useful to add, I'll be sure to do it.
> > In
> > 
> > the mean time, it's good to see progress with Euphoria.
> > 
> > -- David Cuny
> > 
> > 
> I'll be a likely happy user of your ideas.
> 
> CChris

Yeas, i would too. It would be like the olde days, same arguements, but
different decade.

Kat

new topic     » goto parent     » topic index » view message » categorize

35. Re: goto: it's conceded

To be explicit, in case I wasn't clear (which I wasn't!!!)...

while cond1 label "toplevel" do
  . . .
  while cond2 do
    . . .
    while cond3 label "anotherpoint" do
      . . .
      while cond4 do
        . . .
        if abc then
          exit "toplevel"
        else
          continue "anotherpoint"
        end if
      end while
    end while
  end while
end while

Without labels or GOTOs becomes...

procedure example()   
  while cond2 do
    ...
    while cond3 do
      ...
      if cond4 then
        ...
      end if
      if abc then return end if
    end while
  end while
end procedure

while cond1 do
  ...
  example()
end while


"Science is the belief in the ignorance of experts." - Richard Feynman

new topic     » goto parent     » topic index » view message » categorize

36. Re: goto: it's conceded

ken mortenson wrote:
> 
> To be explicit, in case I wasn't clear (which I wasn't!!!)...
> 
> Without labels or GOTOs becomes...
> 
> procedure example()   
>   while cond2 do
>     ...
>     while cond3 do
>       ...
>       if cond4 then
>         ...
>       end if
>       if abc then return end if
>     end while
>   end while
> end procedure
> 
> while cond1 do
>   ...
>   example()
> end while
> 

Have you considered the speed diffences? The variables that while cond2, cond3,
etc... need to access from the original calling function? Add all of that in a
real world example and calling a function many times is more complex and much
slower than a properly formed loop. Now, do not get me wrong, loops can often be
nested way to deep and instances where a loop only does one thing with one
variable, is not really time sensitive, then a function call would be fine but
not all loops are that way.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

37. Re: goto: it's conceded

Jeremy Cowgar wrote:

<snip> 

> slower than a properly formed loop. Now, do not get me wrong, loops can often
> be nested way to deep and instances where a loop only does one thing with one
> variable, is not really time sensitive, then a function call would be fine but
> not all loops are that way.

What is the depth limit to nested for/while loops in Eu?

Kat

new topic     » goto parent     » topic index » view message » categorize

38. Re: goto: it's conceded

Jeremy Cowgar wrote:
 
> ken mortenson wrote:
> > Without labels or GOTOs becomes...
> > 
> > procedure example()   
> >   while cond2 do
> >     ...
> >     while cond3 do
> >       ...
> >       if cond4 then
> >         ...
> >       end if
> >       if abc then return end if
> >     end while
> >   end while
> > end procedure
> > 
> > while cond1 do
> >   ...
> >   example()
> > end while
> > 
> 
> Have you considered the speed diffences?

Yes, that's what I'm referring to when I speak of performance.  There is
no question that inline code is faster than a call.  When speed is the
paramount issue (and it seldom is) you would write this a different way
but still without labels or gotos but the preferred way is to create a
routine even if it's only used once.  There is another solution.  Just
like assembler has it's macro facility you could have an INLINE compiler
directive.

procedure_A
Loop
  INLINE procedure_B
End Loop
Procedure_C

Say procedure A and C just run once so speed isn't a big issue, but
B is inside a loop that iterates a million times.  call/return could
become an issue so we tell the compiler to inline the code and eliminate
the call and return.  Interpreted it probably wouldn't be worthwhile, but
who knows?


"Science is the belief in the ignorance of experts." - Richard Feynman

new topic     » goto parent     » topic index » view message » categorize

39. Re: goto: it's conceded

ken mortenson wrote:
> 
> Derek Parnell wrote:
>  
> > David Cuny wrote:
> > > Well, sometimes you're nested deep, and you need to get out. Implementing
> > > it
> > > 
> > > without GOTO is messy and error prone. With GOTO, it's clear
> > > what's happening and it executes as expected.
> 
> Sorry to contradict you 

I assume 'you' here means David and not myself.

> but your example demostrates perfectly (with some
> elaboration) exactly why GOTO result in less clear code. 

> Thank you 

I assume 'you' here means myself and not David.

> for providing an example that allows me to make this point...


>  
> > We can now do this (in V4.0) ...
> > 
> >    while cond1 label "toplevel" do
> >       . . .
> >       while cond2 do
> >        . . .
> >          while cond3 label "anotherpoint" do
> >            . . .
> >             while cond4 do
> >               . . .
> >               if abc then
> >                   exit "toplevel"
> >               else
> >                   continue "anotherpoint"
> >               end if
> >             end while
> >         end while
> >      end while
> >    end while
> 
> Any person that wrote this probably expects...
> 
> while cond4 do
> 
> ...to be the beginning of a loop.  Does everybody see that?

AARRRRGG!!! You missed the point ken. Okay, in this example which I spent all of
5 seconds writing, I missed a minor part which would help my case more. The
example should have been written ...

    while cond1 label "toplevel" do
       . . .
       while cond2 do
        . . .
          while cond3 label "anotherpoint" do
            . . .
             while cond4 do
               . . .
               if cond5 then
                   exit "toplevel"
               end if
               . . .
               if cond6 then
                   continue "anotherpoint"
               end if
               . . .
             end while
             . . .
         end while
         . . .
      end while
      . . .
    end while


I was JUST trying to show that the NEED for goto in v4.0 is not as great, IN
THIS SITUATION, as one might have thought. That's all.

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view message » categorize

40. Re: goto: it's conceded

ken mortenson wrote:
> 

> Say procedure A and C just run once so speed isn't a big issue, but
> B is inside a loop that iterates a million times.  call/return could
> become an issue so we tell the compiler to inline the code and eliminate
> the call and return.  Interpreted it probably wouldn't be worthwhile, but
> who knows?
> 

Ken:

   Euphoria is an interpreter not a compiler.

Bernie

My files in archive:
WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

41. Re: goto: it's conceded

Kat wrote:

> What is the depth limit to nested for/while loops in Eu?

I think it is only limited by available memory. There is no hard-coded limit.

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view message » categorize

42. Re: goto: it's conceded

Derek Parnell wrote:
> 
> Kat wrote:
> 
> > What is the depth limit to nested for/while loops in Eu?
> 
> I think it is only limited by available memory. There is no hard-coded limit.

When you say "available memory", would that be 1Kbytes local stack space per
procedure, or 64k global stack space, or the 2 gigabytes the OS will let the
program have? Or somewhere in between that's undefined?

Yes, real world, i hit TurboPascal's stack limit with nested loops.

Kat

new topic     » goto parent     » topic index » view message » categorize

43. Re: goto: it's conceded

Bernie Ryan wrote:

> Ken:
> 
>    Euphoria is an interpreter not a compiler.

Alright Bernie, you're just trying to get your shot's in.  Come on, admit it!

blink

Uh... you're not thinking I didn't know that, are you?  Nah, couldn't be.
You're just pulling my leg, yankin' my chain, razzin my taz...

"Science is the belief in the ignorance of experts." - Richard Feynman

new topic     » goto parent     » topic index » view message » categorize

44. Re: goto: it's conceded

Kat wrote:
> 
> Derek Parnell wrote:
> > 
> > Kat wrote:
> > 
> > > What is the depth limit to nested for/while loops in Eu?
> > 
> > I think it is only limited by available memory. There is no hard-coded
> > limit.
> 
> When you say "available memory", would that be 1Kbytes local stack space per
> procedure, or 64k global stack space, or the 2 gigabytes the OS will let the
> program have? Or somewhere in between that's undefined?
> 
> Yes, real world, i hit TurboPascal's stack limit with nested loops.
> 
> Kat

Hmm. Not sure where the 1K and the 64k numbers came from, but I don't think that
Euphoria's loops, at least in the interpreter, rely upon the machine stack.

So I choose what's behind door number three -- the total process memory.

I thought I had seen the 262144 number in some build files, but I couldn't find
it when researching your answer. I definitely saw the numbers 49152 and 131072 in
there though...

(grep -i "stack" *.* in the source directory).

--
A complex system that works is invariably found to have evolved from a simple
system that works.
--John Gall's 15th law of Systemantics.

"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare

j.

new topic     » goto parent     » topic index » view message » categorize

45. Re: goto: it's conceded

ken mortenson wrote:
> 
> Bernie Ryan wrote:
> 
> > Ken:
> > 
> >    Euphoria is an interpreter not a compiler.
> 
> Alright Bernie, you're just trying to get your shot's in.  Come on, admit it!
> 

I'm sure we all are not forgetting that it does translate to C code which can
then be compiled to an executable and have zero runtime requirements by Euphoria.
And this is not "binding" euphoria code to a pre-build euphoria interpreter, but
is actually all euphoria files involved in an application translated directly to
C.

So, while Euphoria is not a compiler, it can generate code to be compiled having
the benefits of a compiler then.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

46. Re: goto: it's conceded

Derek Parnell wrote:

> > > David Cuny wrote:
> > Sorry to contradict you 
> I assume 'you' here means David and not myself.
> 
> > but your example...
> > Thank you 
> I assume 'you' here means myself and not David.

Yep, eh... I was using the 'royal' you?  I believe when I was typing
this I hit tab which change focus to the [Send Now] button which ignored
my keystrokes except for the next [Enter] key I hit (this has happened
to me on more than one occasion.  I might have clarified this on proof.

> AARRRRGG!!! You missed the point ken.

It wouldn't be the first time or the last.  Please forgive.  I just thought
your example was a perfect opportunity to demonstrate a weakness of using
an unstructured entry point.

Perhaps this issue is a great concern to me because I think I am human
(contrary to those nasty rumors blink and subject to the same problems that
gotos can cause anybody.

To me, the use of labels makes these a form of goto.
> > >               if abc then
> > >                   exit "toplevel"
> > >               else
> > >                   continue "anotherpoint"

> I was JUST trying to show that the NEED for goto in v4.0 is not as great, IN
> THIS SITUATION, as one might have thought. That's all. 

I understood that.  I took it in my own direction.  I did a poor job of
trying to make the point that I wasn't being critical of any person I was
trying to be critical of the issue that was important to me.  Sadly, I do
a poor job of making that point.  Please, if you understand what I'm trying
to say, I beg your forgiveness.

"Science is the belief in the ignorance of experts." - Richard Feynman

new topic     » goto parent     » topic index » view message » categorize

47. Re: goto: it's conceded

Kat wrote:
> 
> Derek Parnell wrote:
> > 
> > Kat wrote:
> > 
> > > What is the depth limit to nested for/while loops in Eu?
> > 
> > I think it is only limited by available memory. There is no hard-coded
> > limit.
> 
> When you say "available memory", would that be 1Kbytes local stack space per
> procedure, or 64k global stack space, or the 2 gigabytes the OS will let the
> program have? Or somewhere in between that's undefined?
> 
> Yes, real world, i hit TurboPascal's stack limit with nested loops.

If you're strictly interpreted, then there is no such stack limit (possibly
unless you use the multi-tasking stuff).  It's all on the heap.  Multi-tasking
messes somewhat with the stack (I haven't delved into those parts of the code,
so I'm pretty fuzzy on the implementation details).

If you translate, then, of course, you could run into stack issues, depending
on the compiler.

Matt

new topic     » goto parent     » topic index » view message » categorize

48. Re: goto: it's conceded

ken mortenson wrote:
> 
> It wouldn't be the first time or the last.  Please forgive.  I just thought
> your example was a perfect opportunity to demonstrate a weakness of using
> an unstructured entry point.
> 
> Perhaps this issue is a great concern to me because I think I am human
> (contrary to those nasty rumors blink and subject to the same problems that
> gotos can cause anybody.

These [using exits with labels] are gotos in a similar way that an 
if-else-end if block has gotos.

Matt

new topic     » goto parent     » topic index » view message » categorize

49. Re: goto: it's conceded

Matt Lewis wrote:

> These [using exits with labels] are gotos in a similar way that an 
> if-else-end if block has gotos.

Branch and loop are not considered to be gotos in a structured code sense.

I'd agree that anything other than sequential execution is, in some sense
(and certainly under the covers) dependent on a form of goto.

Never debate with programmers.  They invented infinite loops.

"Science is the belief in the ignorance of experts." - Richard Feynman

new topic     » goto parent     » topic index » view message » categorize

50. Re: goto: it's conceded

ken mortenson wrote:
> 
> Matt Lewis wrote:
> 
> > These [using exits with labels] are gotos in a similar way that an 
> > if-else-end if block has gotos.
> 
> Branch and loop are not considered to be gotos in a structured code sense.
> 
> I'd agree that anything other than sequential execution is, in some sense
> (and certainly under the covers) dependent on a form of goto.

We can argue about what "pure" structured code is all day, but it's 
nevertheless a similar burden for comprehension and maintenance.

> Never debate with programmers.  They invented infinite loops.

Yeah, I can live like that.

Matt

new topic     » goto parent     » topic index » view message » categorize

51. Re: goto: it's conceded

Jason Gade wrote:
> 
> Kat wrote:
> > 
> > Derek Parnell wrote:
> > > 
> > > Kat wrote:
> > > 
> > > > What is the depth limit to nested for/while loops in Eu?
> > > 
> > > I think it is only limited by available memory. There is no hard-coded
> > > limit.
> > 
> > When you say "available memory", would that be 1Kbytes local stack space per
> > procedure, or 64k global stack space, or the 2 gigabytes the OS will let the
> > program have? Or somewhere in between that's undefined?
> > 
> > Yes, real world, i hit TurboPascal's stack limit with nested loops.
> > 
> > Kat
> 
> Hmm. Not sure where the 1K and the 64k numbers came from, but I don't think
> that Euphoria's loops, at least in the interpreter, rely upon the machine
> stack.
> 
> So I choose what's behind door number three -- the total process memory.
> 
> I thought I had seen the 262144 number in some build files, but I couldn't
> find
> it when researching your answer. I definitely saw the numbers 49152 and 131072
> in there though...

Everyone who has done machine coding on a C-64 knows 49152 is a warm reboot, so
that's bad, and it's how much ram in a C-128..... and 131072 is how many
processors in a Blue Gene/L superputer.. I don't know, perhaps Euphoria was meant
to run on these computers too, and it's being withheld from us?

Kat

new topic     » goto parent     » topic index » view message » categorize

52. Re: goto: it's conceded

Kat wrote:
> 
> Jason Gade wrote:
> > 
> > Kat wrote:
> > > 
> > > Derek Parnell wrote:
> > > > 
> > > > Kat wrote:
> > > > 
> > > > > What is the depth limit to nested for/while loops in Eu?
> > > > 
> > > > I think it is only limited by available memory. There is no hard-coded
> > > > limit.
> > > 
> > > When you say "available memory", would that be 1Kbytes local stack space
> > > per
> > > procedure, or 64k global stack space, or the 2 gigabytes the OS will let
> > > the
> > > program have? Or somewhere in between that's undefined?
> > > 
> > > Yes, real world, i hit TurboPascal's stack limit with nested loops.
> > > 
> > > Kat
> > 
> > Hmm. Not sure where the 1K and the 64k numbers came from, but I don't think
> > that Euphoria's loops, at least in the interpreter, rely upon the machine
> > stack.
> > 
> > So I choose what's behind door number three -- the total process memory.
> > 
> > I thought I had seen the 262144 number in some build files, but I couldn't
> > find
> > it when researching your answer. I definitely saw the numbers 49152 and
> > 131072
> > in there though...
> 
> Everyone who has done machine coding on a C-64 knows 49152 is a warm reboot,
> so that's bad, and it's how much ram in a C-128..... and 131072 is how many
> processors in a Blue Gene/L superputer.. I don't know, perhaps Euphoria was
> meant to run on these computers too, and it's being withheld from us?
> 
> Kat

Heh.

Actually, 49152 was RAM masked by ROM that could be switched in and out and was
therefore a popular location for user machine code. You had to diddle locations 0
and 1 to switch the I/O registers correctly.

(Edit: looked it up -- 49152 - 53247 was RAM. It was 40960 to 49152 which was
BASIC ROM mapped over RAM.)

How much ram in a C-128 was 131072 but I think it was banked (memory fails now!)
Plus it had an 8502 and a Z80 processor! Man, I was so envious of my friends who
had one.

I still remember poke 53280,0 poke 53281,0 to change my background to black on
the C64.

Of course, the C64's stack was only 256 bytes, stored from locations 256-511
(backwards, of course!)

Another popular location for small machine language programs was from 828 to
1019 which was the cassette tape buffer.

But yeah, now that I think about it, I think I remember that sys 49152 did a
warm reset unless that location was over-written.

Ah, those were the days!

(Yes, I had too look up some things to jog my memory).

--
A complex system that works is invariably found to have evolved from a simple
system that works.
--John Gall's 15th law of Systemantics.

"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare

j.

new topic     » goto parent     » topic index » view message » categorize

53. Re: goto: it's conceded

Kat wrote:
> 
> Derek Parnell wrote:
> > 
> > Kat wrote:
> > 
> > > What is the depth limit to nested for/while loops in Eu?
> > 
> > I think it is only limited by available memory. There is no hard-coded
> > limit.
> 
> When you say "available memory", would that be 1Kbytes local stack space per
> procedure, or 64k global stack space, or the 2 gigabytes the OS will let the
> program have? Or somewhere in between that's undefined?
> 
> Yes, real world, i hit TurboPascal's stack limit with nested loops.
> 
> Kat

The parser creates a few sequences to keep track of loops and blocks. The length
of such sequences is the number of currently active loops/blocks. If that number
becomes dangerously close to 1.0e8, memory may start being scarce on an oldish
machine.

CChris

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu