Flython?

P

Peter Hansen

Just been looking at Flash and ActionScript...

In the vein of Jython, I wonder what it would take to build
a Flython? (Lousy name, I know.) That would take Python
source, presumably a subset since some things couldn't be supported,
and compile it into ActionScript bytecode (aka the bytecode compiled
from ECMAScript source for the Macromedia Flash player environment).

With that, it would be pretty easy to write applications which
have a Flash front end, but with pretty much all the logic
on front and back implemented in Python.

There doesn't seem to be any mention of such an idea on
the web yet. A search turns up only part of a thread
where Cameron Laird asked about marrying Flash and Python
and I replied with a reference to use of Flash in
Twisted's LivePage...
(http://groups.google.ca/[email protected])

-Peter
 
J

John J. Lee

Peter Hansen said:
In the vein of Jython, I wonder what it would take to build
a Flython?
[...]

Judging by the current state of Jython (a lot of work put in, but
still at 2.1): A fair amount of dedication.


John
 
C

Christopher T King

In the vein of Jython, I wonder what it would take to build
a Flython? (Lousy name, I know.) That would take Python
source, presumably a subset since some things couldn't be supported,
and compile it into ActionScript bytecode (aka the bytecode compiled
from ECMAScript source for the Macromedia Flash player environment).

I don't know much about ActionScript bytecode, but I think a general
Python -> ECMAScript translator wouldn't be too hard (presuming a Python
subset is acceptable). ECMAScript variables are untyped, so that should
ease translation some. Sounds like my weekend project!
 
P

Peter Hansen

Christopher said:
I don't know much about ActionScript bytecode, but I think a general
Python -> ECMAScript translator wouldn't be too hard (presuming a Python
subset is acceptable). ECMAScript variables are untyped, so that should
ease translation some. Sounds like my weekend project!

Well, it's not the source code that I care about, it's the
object code (as in, the Flash bytecode). The only ECMAScript
to Flash bytecode compilers of which I'm aware are
commercial and expensive, and come with big useless (to me)
GUI/animation/freaky special effect generation systems...

There are advantages in Python direct to Flash bytecode with
a simple command line compiler (particularly if one uses
test-driven development...).

This may be where I have to dig into an area that's outside
my expertise, namely the compiler.py module, parse trees,
and code generation...

-Peter
 
D

Daniel Ellison

Peter said:
Well, it's not the source code that I care about, it's the
object code (as in, the Flash bytecode). The only ECMAScript
to Flash bytecode compilers of which I'm aware are
commercial and expensive, and come with big useless (to me)
GUI/animation/freaky special effect generation systems...

There are advantages in Python direct to Flash bytecode with
a simple command line compiler (particularly if one uses
test-driven development...).

This may be where I have to dig into an area that's outside
my expertise, namely the compiler.py module, parse trees,
and code generation...

-Peter

I have to agree that Python compiled to swf bytecode would be very handy
indeed. I'm no fan of HTML-based web applications, but there are
currently few alternatives. Flash could be an excellent alternative, but
few developers want to take the time to learn (and purchase!) the Flash
authoring application to create a better web GUI.

I *like* "Flython" as a name! :) A flying python! I can see the logo now...

Dan Ellison
 
P

Peter Hansen

Daniel said:
I *like* "Flython" as a name! :) A flying python! I can see the logo now...

So does that mean we would have "Monty Flython's @Pie-ing Circus"
if the @decorator debate is still going on by the time someone
implements a Flash compiler for Python?
 
D

Daniel Ellison

Peter said:
So does that mean we would have "Monty Flython's @Pie-ing Circus"

BaDA-ba. Well, we definitely already have the @Pie-ing Circus here. All
we need now is Monty Flython.
if the @decorator debate is still going on by the time someone
implements a Flash compiler for Python?

By the time /someone/ implements a compiler? I thought that someone was
going to be you! Damn this full-time contract. We could have paired on
Flython.

Dan
 
G

Guyon Morée

You can also write your objects in python and expose them as xml-rpc/soap.
Then use them from flash...
 
P

Peter Hansen

Guyon said:
You can also write your objects in python and expose them as xml-rpc/soap.
Then use them from flash...

How would I do that without spending hundreds and hundreds
of dollars on a development system for Flash anyway?

-Peter
 
B

Benjamin Niemann

Christopher said:
I don't know much about ActionScript bytecode, but I think a general
Python -> ECMAScript translator wouldn't be too hard (presuming a Python
subset is acceptable). ECMAScript variables are untyped, so that should
ease translation some. Sounds like my weekend project!
Probably more than a weekend project, but if you do it, I'd be very,
very happy! I'm just working on a rather complex Flashproject (simulator
for a digital camera) and I have more than enough reasons to curse Flash
& ActionScript. The thought how wonderful it would be, if I could use
Python for the logic just popped up in my head a few days ago...
 
C

Cousin Stanley

Daniel Ellison wrote ....

| I have to agree that Python compiled to swf bytecode
| would be very handy indeed.
|
| I'm no fan of HTML-based web applications,
| but there are currently few alternatives.
|
| Flash could be an excellent alternative,
| but few developers want to take the time to learn (and purchase!)
| the Flash authoring application to create a better web GUI.
|
| I *like* "Flython" as a name! :)
|
| A flying python! I can see the logo now...

Dan ....

There is a freeware alternative called Powerbullet
for creating/editing Flash .swf files
that runs under Windows ....

http://www.powerbullet.com/

I've only done limited testing with it under Win98,
but it seems to work OK ....
 
P

Peter Hansen

Cousin said:
Dan ....

There is a freeware alternative called Powerbullet
for creating/editing Flash .swf files
that runs under Windows ....

http://www.powerbullet.com/

I've only done limited testing with it under Win98,
but it seems to work OK ....

But does it have anything to do with scripting
via ActionScript? As far as I can see it is
purely a GUI tool for doing simple animations, and
does not allow any scripting.

-Peter
 
S

simo

There's a few libraries for making SVG files in PHP, so there may be
Python versions too, but if you want ActionScript then I guess you're
determined to go with Flash instead.....
 
C

Cousin Stanley

Daniel Ellison wrote ....

| ....
| A flying python!
| I can see the logo now...

Peter Hansen wrote ....

| But does it have anything to do with scripting
| via ActionScript ?
|
| As far as I can see it is purely a GUI tool
| for doing simple animations, and does not allow any scripting.

Peter ....

Like Dan Ellison, I was also would like to see
a Flying Python and thought PowerBullet
might provide a free and convenient mechanism
to help realize that vision ....

Apparently, a few others have also inquired about scripting
capabilities in Powerbullet and a bit of searching at their
on-line forum turned up the following replies from Mark Carter
the author of Powerbullet ....

Cousin Stanley
Human Being
Phoenix, Arizona

---------------------------------------------------------------

Source .......
http://www.powerbullet.com/forum/viewtopic.php?t=243&highlight=actionscript

Posted_By .... Mark Carter,
{ Powerbullet Author }

Date ......... Sat Feb 07, 2004 3:30 am

|| ....
|| will actionscript work if I add it into the HTML code?
|| ....

No. This is something for the future.

Not so hard to support actionscript,
I just haven't included it because PB
is aimed at non-programmers.

For navigation it's more likely
I'll include just low level Flash jumps.

Perhaps later it might be a good idea
to put action scripts in the HTML
- but they won't work now because I don't parse them.

Not a bad idea though... let me think about it


Source ....... http://www.powerbullet.com/forum/viewtopic.php?t=529

Date ......... Fri Apr 30, 2004 7:13 pm

Next version, due for release in a fortnight,
has capability to pass messages from the SWF movie
to your web page.

So you can create a JavaScript function on your page
and call it from the Flash movie.

You do this using the existing URL link mechanism
for buttons or linked external SWF movies.

There are standard commands that can be directed
to Flash from JavaScript.

See the Macromedia Flash site.

Built-in commands that you can call from your web page

http://www.macromedia.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_03.html

Examples of calling (some quite silly) DHTML facilities

http://www.flashkit.com/tutorials/Interactivity/Flash_J-Chris_Pe-584/index.php
 
P

Peter Hansen

simo said:
There's a few libraries for making SVG files in PHP, so there may be
Python versions too, but if you want ActionScript then I guess you're
determined to go with Flash instead.....

Well, SVG and ActionScript have very little, if anything, in
common. On the other hand SVG has much overlap with the rest
of the "Flash" system (taken as a nebulous whole), and when
supplemented with Javascript, in systems that can handle that,
it starts becoming somewhat similar in many ways.

On the other hand, so far I haven't seen signs that SVG
support has advanced enough to really be on par with the
capabilities (mostly in terms of speed and simplicity) of
the little bit of Flash/ActionScript that interests me.

My personal goal with this (and I believe Dan's as well)
is to be able to create GUI software using ActionScript
to write (roughly) the "view" and "controller" portions,
with the back end ("model") implemented elsewhere (i.e.
on a server) with Python.

Why? Well, consider the alternatives. D/HTML plus
Javascript gives you the same basic structure, but at
the cost of a mostly crappy kind of interface which
violates all kinds of UI conventions, feels awkward,
often runs slowly, and is a bitch to construct and
maintain.

Something like wxPython is pretty good for fixing most
of that, but then you actually have to install software
on the client machines, which is pretty much the thing
you want to avoid when you are trying to do client/server.

The idea is *not* to do pretty animations ala JibJab.com
but "plain old GUI software" (POGS, to steal from Bell
and coin a phrase at the same time). SVG really isn't
up to the task (yet), and even if it is I suspect there
may be really serious performance issues for some time
to come. Flash has a compact bytecode, while SVG comes
as XML. Need I say more?

-Peter
 
D

Daniel Ellison

Peter said:
Well, SVG and ActionScript have very little, if anything, in
common. On the other hand SVG has much overlap with the rest
of the "Flash" system (taken as a nebulous whole), and when
supplemented with Javascript, in systems that can handle that,
it starts becoming somewhat similar in many ways.

On the other hand, so far I haven't seen signs that SVG
support has advanced enough to really be on par with the
capabilities (mostly in terms of speed and simplicity) of
the little bit of Flash/ActionScript that interests me.

Not to mention the size and ubiquity of the browser plugin.
My personal goal with this (and I believe Dan's as well)
is to be able to create GUI software using ActionScript
to write (roughly) the "view" and "controller" portions,
with the back end ("model") implemented elsewhere (i.e.
on a server) with Python.

Yes, I'd have to agree with that. The point isn't to get a free
replacement for the Flash authoring environment. I own a copy of Flash,
and know quite well how to use it: I've been using and programming Flash
since v4. No, we want a Pythonic way of producing Flash "swf" files, and
in doing so, simplifying (at least) the "view" considerably, and at the
same time creating a much more appropriate interface for web applications.
Why? Well, consider the alternatives. D/HTML plus
Javascript gives you the same basic structure, but at
the cost of a mostly crappy kind of interface which
violates all kinds of UI conventions, feels awkward,
often runs slowly, and is a bitch to construct and
maintain.

Peter has on occasion been the unfortunate audience of my rants on the
current state of web application interfaces. I've been pushing the idea
of a Flash client for years. There seems to be (there *is*) a prejudice
toward Flash, probably due to those *very* annoying ads on web pages.
Something like wxPython is pretty good for fixing most
of that, but then you actually have to install software
on the client machines, which is pretty much the thing
you want to avoid when you are trying to do client/server.

The idea is *not* to do pretty animations ala JibJab.com
but "plain old GUI software" (POGS, to steal from Bell
and coin a phrase at the same time). SVG really isn't
up to the task (yet), and even if it is I suspect there
may be really serious performance issues for some time
to come. Flash has a compact bytecode, while SVG comes
as XML. Need I say more?

Nope! :)


Dan
 
M

Mike Rovner

Daniel said:
Peter Hansen wrote:

Nope! :)

OTOH, Flash bytecode is proprientary and may change "without notice", SVG is
an open standard. Client machines spped is also tend to increase.

I wish bytecode format be published somewhere. ;)

Mike
 
D

Daniel Ellison

Mike said:
OTOH, Flash bytecode is proprientary and may change "without notice", SVG is
an open standard. Client machines spped is also tend to increase.

I wish bytecode format be published somewhere. ;)

Mike

The swf file format is proprietary, yes, but the spec is public; you can
download it from Macromedia's web site, as Peter did recently.
 
S

Shawn Wheatley

Peter has on occasion been the unfortunate audience of my rants on the
current state of web application interfaces. I've been pushing the idea
of a Flash client for years. There seems to be (there *is*) a prejudice
toward Flash, probably due to those *very* annoying ads on web pages.

[OT]
Another rant that I hear frequently is the accessibility issue...
older versions of Flash were very difficult to work with in terms of
making your application accessible to handicapped users. From what
I've heard, Flash MX and onward have fixed this problem. Anybody care
to comment?

Shawn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top