FW: [dirGames-L] first Flash experience as Lingo programmer

Thought I would forward the below email written by Marco Christis of the
Netherlands. It was originally sent to the Dirgames-L list, a Director list.
Very interesting and even quantitative comparison of the speed of
Actionscript versus Lingo.

I might add that the conclusion is not 'use Director rather than Flash'. I
find that using them both in the same project is advantageous. I make my
animations in Flash and then import the SWF into Director. Because
animations of Director text are slower than animations of Flash text. And,
also, the Flash animation drawing tools are far superior to the Director
animation drawing tools. If your project uses vector animations, Flash is
superior. But if your project needs a speedy coding language, Actionscript
is too slow. And if you want to manipulate bitmaps, Director is in every way
superior to Flash…there are other factors to consider depending on the
project…

ja

—–Original Message—–
From: [email protected]
[mailto:[email protected]]On Behalf Of Marco Christis
Sent: Friday, May 23, 2003 10:19 AM
To: [email protected]
Subject: [dirGames-L] first Flash experience as Lingo programmer


Hi,


I, as a fanatic Director user, could no longer resist the load of Flash
project offers so I accepted a small Flash assignment. For a mediate or
experienced programmer Action Script is pretty easy learn. So I translated
my Lingo Object Model to Action Script which wasn't too hard because both
languages are OO. And once you've get used to (or accepted) to Action Script
rule #1 ("Errors are non-existent during run time.") you can call yourself a
Flash scripter.
Next I translated my Lingo Physics Engine to Action Script. That also wasn't
too hard because I adopted my Flash Object Model from my Lingo Object model.
But just when I started to enjoy Action Scripting I run into a (pretty
shocking) limitation of Flash which is speed. I already accepted that
graphics in Flash were going to be slow but I didn't expect the scripting
language to be slow also. I couldn't believe what I was seeing so I did a
little test with pure math functions and it turned out that Action script
does the job 30 times slower than Lingo does! (See the code of the speed
test below.)
My Physics Engine is detached from the movie frame rate to make sure it runs
at a frequency that is high enough (at least 60 Hz) to create a stable
physics simulation. Resulting that the frame rate of the Flash movie drops
to less than 2 fps (in my P3 450 Hz). Flash and real-time (time based)
physics, you can forget it! What I've learned from this project is that when
you compare the speed of Lingo vs. the speed of Flash that the outcome is a
factor 50 difference! (slow Action Script + slow vector graphics)


This means it takes 5 or 6 computer generations before we can do the same
thing in Flash that we can do in Director today. Knowing this I know that
it's only a rumor that Director is going to disappear soon. People who claim
that Director is going to disappear have never build a high-end Flash
application.

Though it leaves me with the question: "Why is Action Script so slow?". They
are both interpreted script languages AFAIK. Does somebody know how what's
causing the significant speed difference??



grtz,
Marco.





Speed test code in Lingo:

on startMovie
t1 = the milliseconds

repeat with i = 1 to 5000
a = sqrt(i)
b = atan(i)
c = cos(i)

end repeat

t2 = the milliseconds

put t2 - t1

end

output:
– 32




Speed test code in Action script:

this.onLoad = function(){
init();
}


function init(){
var t1 = getTimer();

for (var i =1; i <= 5000; i++) {
var a = Math.sqrt(i);
var b = Math.atan(i);
var c = Math.cos(i);
}

var t2 = getTimer();
trace( (t2-t1) );
}

output:
937



_____________________________________

-= B l i x e m M e d i a =-
_____________________________________

Design & Development of New Media
Specialized in Director Lingo

Marco Christis MA
Herengracht 141 III
1015 BH Amsterdam
The Netherlands

[email protected]
http://www.blixem.com
_____________________________________

Comments

, Christopher Fahey

It is totally frustrating that ActionScript is so damn slow. What was
the general response from the Dirgames-L list about *why* Flash is so
much slower than Director?

Personally, and I know I'm being quite superficial here, I find that
Lingo's esoteric syntax just looks stupid ("the milliseconds"?!?)
compared to the sensible, logical, and ECMA-262 standards-compliant
structure of ActionScript.

-Cf



[christopher eli fahey]
art: http://www.graphpaper.com <http://www.graphpaper.com/>
sci: http://www.askrom.com <http://www.askrom.com/>
biz: http://www.behaviordesign.com <http://www.behaviordesign.com/>



—–Original Message—–
From: [email protected] [mailto:[email protected]] On Behalf
Of Jim Andrews
Sent: Friday, May 23, 2003 4:01 AM
To: List@Rhizome. Org
Subject: RHIZOME_RAW: FW: [dirGames-L] first Flash experience as Lingo
programmer


Thought I would forward the below email written by Marco Christis of the
Netherlands. It was originally sent to the Dirgames-L list, a Director
list. Very interesting and even quantitative comparison of the speed of
Actionscript versus Lingo.

I might add that the conclusion is not 'use Director rather than Flash'.
I find that using them both in the same project is advantageous. I make
my animations in Flash and then import the SWF into Director. Because
animations of Director text are slower than animations of Flash text.
And, also, the Flash animation drawing tools are far superior to the
Director animation drawing tools. If your project uses vector
animations, Flash is superior. But if your project needs a speedy coding
language, Actionscript is too slow. And if you want to manipulate
bitmaps, Director is in every way superior to Flash…there are other
factors to consider depending on the project…

ja

—–Original Message—–
From: [email protected]
[mailto:[email protected]]On Behalf Of Marco
Christis
Sent: Friday, May 23, 2003 10:19 AM
To: [email protected]
Subject: [dirGames-L] first Flash experience as Lingo programmer


Hi,


I, as a fanatic Director user, could no longer resist the load of Flash
project offers so I accepted a small Flash assignment. For a mediate or
experienced programmer Action Script is pretty easy learn. So I
translated my Lingo Object Model to Action Script which wasn't too hard
because both languages are OO. And once you've get used to (or accepted)
to Action Script rule #1 ("Errors are non-existent during run time.")
you can call yourself a Flash scripter.
Next I translated my Lingo Physics Engine to Action Script. That also
wasn't too hard because I adopted my Flash Object Model from my Lingo
Object model. But just when I started to enjoy Action Scripting I run
into a (pretty shocking) limitation of Flash which is speed. I already
accepted that graphics in Flash were going to be slow but I didn't
expect the scripting language to be slow also. I couldn't believe what I
was seeing so I did a little test with pure math functions and it turned
out that Action script does the job 30 times slower than Lingo does!
(See the code of the speed test below.)
My Physics Engine is detached from the movie frame rate to make sure it
runs at a frequency that is high enough (at least 60 Hz) to create a
stable physics simulation. Resulting that the frame rate of the Flash
movie drops to less than 2 fps (in my P3 450 Hz). Flash and real-time
(time based) physics, you can forget it! What I've learned from this
project is that when you compare the speed of Lingo vs. the speed of
Flash that the outcome is a factor 50 difference! (slow Action Script +
slow vector graphics)


This means it takes 5 or 6 computer generations before we can do the
same thing in Flash that we can do in Director today. Knowing this I
know that it's only a rumor that Director is going to disappear soon.
People who claim that Director is going to disappear have never build a
high-end Flash application.

Though it leaves me with the question: "Why is Action Script so slow?".
They are both interpreted script languages AFAIK. Does somebody know how
what's causing the significant speed difference??



grtz,
Marco.





Speed test code in Lingo:

on startMovie
t1 = the milliseconds

repeat with i = 1 to 5000
a = sqrt(i)
b = atan(i)
c = cos(i)

end repeat

t2 = the milliseconds

put t2 - t1

end

output:
– 32





Speed test code in Action script:

this.onLoad = function(){
init();
}


function init(){
var t1 = getTimer();

for (var i =1; i <= 5000; i++) {
var a = Math.sqrt(i);
var b = Math.atan(i);
var c = Math.cos(i);
}

var t2 = getTimer();
trace( (t2-t1) );
}

output:
937



_____________________________________

-= B l i x e m M e d i a =-
_____________________________________

Design & Development of New Media
Specialized in Director Lingo

Marco Christis MA
Herengracht 141 III
1015 BH Amsterdam
The Netherlands

[email protected]
http://www.blixem.com
_____________________________________

, MTAA

hmmm, very interesting.

i haven't done much with director myself, and actionscript is very easy
to learn once you have the basics of similar ECMA languages, like
Javascript, and vice versa.

what are the details of the test i wonder. were these tests conducted
on EXE's or on the plugin formats in browser (or standalone viewers)?
wonder if there would be a difference. the standalone apps just
basically bundle the viewer with the piece so it prolly wouldn't
matter, but you never know.

wonder if Macromedia has any comments on this.

On Saturday, May 24, 2003, at 02:34 PM, Christopher Fahey [askrom]
wrote:

> It is totally frustrating that ActionScript is so damn slow. What was
> the general response from the Dirgames-L list about *why* Flash is so
> much slower than Director?
>

, Jim Andrews

Message
It is totally frustrating that ActionScript is so damn slow. What was the
general response from the Dirgames-L list about *why* Flash is so much
slower than Director?

no response so far. but i have heard previously that Actionscript is 30-60
times slower than Lingo, depending on the job you give it. that's fairly
well-known. i gather its true regardless of plugin or projector.

lingo goes back to 1987. the further back in time something was written,
the more imperative it was to optimize its speed because computers were
slower. i tried out director 4 or 5–the first Windows version–on my 386
and it was very slow. And the syntax was off-putting, as you note. So I
shelved it and didn't come back to it until 1999. Yet, as it turns out, it's
30-60 times faster than Flash. Flash is built for future machines, it seems.
I suspect that in ten years its slowness won't be an issue.

http://www.macromedia.com/support/director/programs_fl.html is a page of
useful links that compare Flash and Director and how to use them together.

http://www.johnhenry1.com/ has some interesting interviews (toward the
bottom of the page) with John Henry Thompson, the dude who devised Lingo.

http://vispo.com/lingo/windows/documentation/resources.htm is a page of
links to Director resources I put together.

Personally, and I know I'm being quite superficial here, I find that
Lingo's esoteric syntax just looks stupid ("the milliseconds"?!?) compared
to the sensible, logical, and ECMA-262 standards-compliant structure of
ActionScript.

ha. yes, lingo is a quirky language in some regards. i started into it
after they introduced 'dot syntax'. so
set the width of sprite 6 to 120
is legal and so is
sprite(6).width0

i don't know the old lingo syntax very well because, like you, i'm used to
more standard syntax in programming languages. but i do run across the old
syntax in my reading of examples of code and pick it up somewhat. like you
can date the code, 'oh, that's 'old lingo', hmm, wonder when this was
written'.

it's also the case that the deeper you get into the language, the less
well-documented it is. so that when i was writing nio, i was in
correspondence with the musician/programmer who was managing the audio lingo
in director and got the arcane poop on it, even the odd (at that time)
undocumented feature. and the director lists are usually devoted to the
undocumented work arounds and optimizations that you need to make high-end
applications. a bit of a cult, but a mostly friendly and intelligent cult.
and the director engineers hang out on some of the lists, and some of the QA
folks.

the english 'community' is an odd assortment of pros doing commercial work
for CD, installation, kiosk, games and so on, together with artists doing
high-end multimedia applications, but relatively few of the latter. then
there's the european lists. many of the europeans are on both north american
lists and european lists, and those who are on both tend to be hot shots.
and, interestingly, the european director users seem to contain more
artists, or at least they're more vocal on the lists.

ja
http://vispo.com

, Jim Andrews

> wonder if Macromedia has any comments on this.

hi twhid,

i found another url more concerned with comparing director and flash than the last one:
http://www.macromedia.com/software/director/resources/integration/ ; if you click "Flash and
Director Comparison" on the right side, you get some links comparing the two.

ja