Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A For-Next bug in 1.2.8-s682
#9
boriel Wrote:Implementing dynamic is much easier (it's already done) and saves memory comparing to static. Static might be faster sometimes (eg. when using expressions), and take twice the memory for each iterator variable. I think leaving it alone should be ok (since almost no one will be using it). FOR is currently "dynamic" and has not caused much trouble when porting original Sinclair BASIC programs.

In fact FOR loops are expensive in much ways (code, speed, etc). While and DO...LOOP are much faster and simpler.

If you use expressions then you already have to use an extra variable (double
the amount) if speed is the concern and it always is with computers not to
mention the ZX at 3.5 MHz. It is the classical speed vs size when it comes
to opptimization and you can lay the burden on the programmer or the
compiler. This is a compiler's job and it makes for a cleaner code for
a programers perspective in the end instead of having an extra variable
hanging around that you have to DIM in future versions of this compiler.

Dynamic is not in lieu with the BASIC tradition or desing philosophy and
For-Next loops are a fact of life.

This could lead to pontential trouble in porting, sometimes people have
to revise and rewrite instead of preserving the work they have done. Compiler
writing is about the whole and not the individual in my humble oppinion.

Darkstar.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)