Connecting Tech Pros Worldwide Forums | Help | Site Map

Flython?

Peter Hansen
Guest
 
Posts: n/a
#1: Jul 18 '05
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/groups?selm=....supernews.com)

-Peter

John J. Lee
Guest
 
Posts: n/a
#2: Jul 18 '05

re: Flython?


Peter Hansen <peter@engcorp.com> writes:
[...][color=blue]
> In the vein of Jython, I wonder what it would take to build
> a Flython?[/color]
[...]

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


John
Christopher T King
Guest
 
Posts: n/a
#3: Jul 18 '05

re: Flython?


On Thu, 12 Aug 2004, Peter Hansen wrote:
[color=blue]
> 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).[/color]

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!

Peter Hansen
Guest
 
Posts: n/a
#4: Jul 18 '05

re: Flython?


Christopher T King wrote:
[color=blue]
> On Thu, 12 Aug 2004, Peter Hansen wrote:
>
>[color=green]
>>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).[/color]
>
> 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![/color]

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
Daniel Ellison
Guest
 
Posts: n/a
#5: Jul 18 '05

re: Flython?


Peter Hansen wrote:
[color=blue]
> Christopher T King wrote:
>[color=green]
>> On Thu, 12 Aug 2004, Peter Hansen wrote:
>>
>>[color=darkred]
>>> 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).[/color]
>>
>>
>> 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![/color]
>
>
> 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[/color]

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
Peter Hansen
Guest
 
Posts: n/a
#6: Jul 18 '05

re: Flython?


Daniel Ellison wrote:
[color=blue]
> I *like* "Flython" as a name! :) A flying python! I can see the logo now...[/color]

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?
Daniel Ellison
Guest
 
Posts: n/a
#7: Jul 18 '05

re: Flython?


Peter Hansen wrote:
[color=blue]
> Daniel Ellison wrote:
>[color=green]
>> I *like* "Flython" as a name! :) A flying python! I can see the logo
>> now...[/color]
>
>
> So does that mean we would have "Monty Flython's @Pie-ing Circus"[/color]

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

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
Guyon Morée
Guest
 
Posts: n/a
#8: Jul 18 '05

re: Flython?


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



"Peter Hansen" <peter@engcorp.com> wrote in message
news:BeudnTybEKkXXIbcRVn-hQ@powergate.ca...[color=blue]
> 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/groups?selm=....supernews.com)
>
> -Peter[/color]


Peter Hansen
Guest
 
Posts: n/a
#9: Jul 18 '05

re: Flython?


Guyon Morée wrote:[color=blue]
> You can also write your objects in python and expose them as xml-rpc/soap.
> Then use them from flash...[/color]

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

-Peter
Benjamin Niemann
Guest
 
Posts: n/a
#10: Jul 18 '05

re: Flython?


Christopher T King wrote:[color=blue]
> On Thu, 12 Aug 2004, Peter Hansen wrote:
>
>[color=green]
>>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).[/color]
>
>
> 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!
>[/color]
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...
Cousin Stanley
Guest
 
Posts: n/a
#11: Jul 18 '05

re: Flython?


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

--
Cousin Stanley
Human Being
Phoenix, Arizona
Peter Hansen
Guest
 
Posts: n/a
#12: Jul 18 '05

re: Flython?


Cousin Stanley wrote:
[color=blue]
> 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 ....[/color]

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
simo
Guest
 
Posts: n/a
#13: Jul 18 '05

re: Flython?


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.....
Cousin Stanley
Guest
 
Posts: n/a
#14: Jul 18 '05

re: Flython?


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/vie...t=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/fl...hflash_03.html

Examples of calling (some quite silly) DHTML facilities

http://www.flashkit.com/tutorials/In...-584/index.php



Peter Hansen
Guest
 
Posts: n/a
#15: Jul 18 '05

re: Flython?


simo wrote:
[color=blue]
> 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.....[/color]

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
Daniel Ellison
Guest
 
Posts: n/a
#16: Jul 18 '05

re: Flython?


Peter Hansen wrote:[color=blue]
> simo wrote:
>[color=green]
>> 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.....[/color]
>
>
> 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.[/color]

Not to mention the size and ubiquity of the browser plugin.
[color=blue]
>
> 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.[/color]

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.
[color=blue]
>
> 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.[/color]

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.
[color=blue]
>
> 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?[/color]

Nope! :)
[color=blue]
>
> -Peter[/color]


Dan
Mike Rovner
Guest
 
Posts: n/a
#17: Jul 18 '05

re: Flython?


Daniel Ellison wrote:[color=blue]
> Peter Hansen wrote:[/color]
[color=blue][color=green]
>> to come. Flash has a compact bytecode, while SVG comes
>> as XML. Need I say more?[/color]
>
> Nope! :)[/color]

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



Daniel Ellison
Guest
 
Posts: n/a
#18: Jul 18 '05

re: Flython?


Mike Rovner wrote:
[color=blue]
> Daniel Ellison wrote:
>[color=green]
>>Peter Hansen wrote:[/color]
>
>[color=green][color=darkred]
>>>to come. Flash has a compact bytecode, while SVG comes
>>>as XML. Need I say more?[/color]
>>
>>Nope! :)[/color]
>
>
> 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
>
>
>[/color]

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.
Shawn Wheatley
Guest
 
Posts: n/a
#19: Jul 18 '05

re: Flython?


On Mon, 16 Aug 2004 12:21:03 -0400, Daniel Ellison <daniel@syrinx.net> wrote:
[color=blue]
> 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.[/color]

[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
Mike Rovner
Guest
 
Posts: n/a
#20: Jul 18 '05

re: Flython?


Daniel Ellison wrote:[color=blue]
> Mike Rovner wrote:[/color]
[color=blue]
> 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.[/color]

Right. Thanks for the tip.
Here is the link:
http://www.macromedia.com/software/f...ng/fileformat/ (v7)

Mike



jmdeschamps
Guest
 
Posts: n/a
#21: Jul 18 '05

re: Flython?


Daniel Ellison <daniel@syrinx.net> wrote in message news:<2oc547F86br8U1@uni-berlin.de>...[color=blue]
> Peter Hansen wrote:[color=green]
> > simo wrote:
> >[color=darkred]
> >> 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.....[/color]
> >
> >
> > 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.[/color]
>
> Not to mention the size and ubiquity of the browser plugin.
>[color=green]
> >
> > 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.[/color]
>
> 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.
>[/color]
....
[color=blue]
>
> Dan[/color]


Well, what about Ming ???
http://www.freenet.org.nz/python/ming

I haven't been able to compile it from source for python 2.3, but
maybe someone out there can .

Jean-Marc
PS I've asked for help on this topic a few times in this list - to no
avail though, so I don't know if anyone as ever done it!
Peter Hansen
Guest
 
Posts: n/a
#22: Jul 18 '05

re: Flython?


jmdeschamps wrote:
[color=blue]
> Well, what about Ming ???
> http://www.freenet.org.nz/python/ming[/color]

Not sure... Ming appears to be in an extremely early form,
and there are suggestions it's not very stable yet (and
I think that word was used in the sense of "unreliable",
not just "changing").

The script support appears to be "C-like, with a very limited
feature set". Doesn't even allow function calls?! That
can't be good.

Maybe improvements are on the roadmap. I'm not sure why
they would have chosen to go with a C-like scripting
language, however, instead of growing an ECMAScript
language piece by piece. Or just adopting an existing
component from some other project... maybe from
spidermonkey or something.

I really don't know. This stuff is not yet something
I know much about.

-Peter
Peter Hansen
Guest
 
Posts: n/a
#23: Jul 18 '05

re: Flython?


simo wrote:
[color=blue]
> 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.....[/color]

I just stumbled over the following text in this page
(http://www.webreference.com/programm...t/j_s/column2/)

'''Now some developers might say: "Big deal, who cares about Flash
animations ?" Well, as it turns out - quite a lot of folks in the
software business. First, Adobe has thrown in the towel on SVG and
adopted Flash's .SWF file format for animations as has just about
every other major player in the graphics, 3D modeling and image
design fields.
'''

Adobe has thrown in the towel on SVG?! When did that happen?
I can't find another reference to the news that inspired this
comment.

On another note: comparing Flash and SVG:
http://www.theopensourcery.com/osrsvgover.htm

-Peter
Graham Fawcett
Guest
 
Posts: n/a
#24: Jul 18 '05

re: Flython?


Peter Hansen <peter@engcorp.com> wrote in message news:<BeudnTybEKkXXIbcRVn-hQ@powergate.ca>...[color=blue]
> 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).[/color]

I've written some code (twice, I think) to generate SWF from Python.
Didn't include ActionScript, but it's all there in the SWF spec, so it
shouldn't be *too* hard to implement. My code was less than fast, and
was highly specialized to do a few things that I was interested in
(and ignored the rest). If there's interest, I'll dig it out, though
it's far from project-grade code and is possibly broken. The toughest
part was just grokking the SWF spec, and building some Pythonic
primitives that can output SWF tags. Simply put, writing SWF from
Python isn't rocket science. But of course, you want more than just
that...
[color=blue]
> 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.[/color]

A neat idea, definitely begging for a proof-of-concept. I look forward
to testing it. ;-)

There will be times when you want to make a GUI "flashier" than your
framework will allow (unless you're planning to reimplement all of
Flash). Perhaps you might want to use the framework to prototype
something, and then knock the real thing out using Flash (perhaps
importing the ActionScript from your framework). I'd encourage you to
leave room in the design for the inclusion of non-native SWF
components (i.e. ones built using something other than your framework)
that could interact with your back-end (and, through it, with other
client components).

Dave Kuhlmann has done some interesting writing on generating Web
applications from declarations (google for him, Quixote, and REST, and
it should turn up). This might be useful, since your framework spans
the client/server boundary (and perhaps you'd like to obscure that
boundary just a little bit) and would be well suited to a declarative
style (except for the scripting). Quixote suits REST quite well, it
seems, and might be worth consideration as part of your back-end
design.

The last random snippet that comes to mind is that, on Win32, it's not
hard to build a SWF viewer using wxPython (and the SWF plugin, of
course). That might help with deployment where a browser really isn't
suitable.

I know I've said "your framework" half a dozen times, and there's no
such animal, but I do hope that you or someone else picks up the trail
on this and gives it a college try. It would be fun to use, I think.

-- Graham <fawcett@uwindsor.ca>
Graham Fawcett
Guest
 
Posts: n/a
#25: Jul 18 '05

re: Flython?


Peter Hansen <peter@engcorp.com> wrote in message news:<BeudnTybEKkXXIbcRVn-hQ@powergate.ca>...[color=blue]
> 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).[/color]

I've written some code (twice, I think) to generate SWF from Python.
Didn't include ActionScript, but it's all there in the SWF spec, so it
shouldn't be *too* hard to implement. My code was less than fast, and
was highly specialized to do a few things that I was interested in
(and ignored the rest). If there's interest, I'll dig it out, though
it's far from project-grade code and is possibly broken. The toughest
part was just grokking the SWF spec, and building some Pythonic
primitives that can output SWF tags. Simply put, writing SWF from
Python isn't rocket science. But of course, you want more than just
that...
[color=blue]
> 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.[/color]

A neat idea, definitely begging for a proof-of-concept. I look forward
to testing it. ;-)

There will be times when you want to make a GUI "flashier" than your
framework will allow (unless you're planning to reimplement all of
Flash). Perhaps you might want to use the framework to prototype
something, and then knock the real thing out using Flash (perhaps
importing the ActionScript from your framework). I'd encourage you to
leave room in the design for the inclusion of non-native SWF
components (i.e. ones built using something other than your framework)
that could interact with your back-end (and, through it, with other
client components).

Dave Kuhlmann has done some interesting writing on generating Web
applications from declarations (google for him, Quixote, and REST, and
it should turn up). This might be useful, since your framework spans
the client/server boundary (and perhaps you'd like to obscure that
boundary just a little bit) and would be well suited to a declarative
style (except for the scripting). Quixote suits REST quite well, it
seems, and might be worth consideration as part of your back-end
design.

The last random snippet that comes to mind is that, on Win32, it's not
hard to build a SWF viewer using wxPython (and the SWF plugin, of
course). That might help with deployment where a browser really isn't
suitable.

I know I've said "your framework" half a dozen times, and there's no
such animal, but I do hope that you or someone else picks up the trail
on this and gives it a college try. It would be fun to use, I think.

-- Graham <fawcett@uwindsor.ca>
Sandy Norton
Guest
 
Posts: n/a
#26: Jul 18 '05

re: Flython?


Peter Hansen wrote:
[color=blue]
> 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).[/color]

Have you looked at http://ming.sourceforge.net/

Sandy
Peter Hansen
Guest
 
Posts: n/a
#27: Jul 18 '05

re: Flython?


Sandy Norton wrote:
[color=blue]
> Peter Hansen wrote:[color=green]
>>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).[/color]
>
> Have you looked at http://ming.sourceforge.net/[/color]

Briefly, but I'm not fully qualified to judge. I wrote this
in another post that you might not yet have seen:

"""Ming appears to be in an extremely early form, and there are
suggestions it's not very stable yet (and I think that word was used
in the sense of "unreliable", not just "changing").

The script support appears to be "C-like, with a very limited
feature set". Doesn't even allow function calls?! That
can't be good.
"""

-Peter
Dave Benjamin
Guest
 
Posts: n/a
#28: Jul 18 '05

re: Flython?


In article <65adnQvUKIK_C7_cRVn-jQ@powergate.ca>, Peter Hansen wrote:[color=blue]
> Sandy Norton wrote:
>[color=green]
>> Peter Hansen wrote:[color=darkred]
>>>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).[/color]
>>
>> Have you looked at http://ming.sourceforge.net/[/color]
>
> Briefly, but I'm not fully qualified to judge. I wrote this
> in another post that you might not yet have seen:
>
> """Ming appears to be in an extremely early form, and there are
> suggestions it's not very stable yet (and I think that word was used
> in the sense of "unreliable", not just "changing").
>
> The script support appears to be "C-like, with a very limited
> feature set". Doesn't even allow function calls?! That
> can't be good.
> """[/color]

This was roughly my reaction as well. It seems like the project kind of
stalled, and its support for ActionScript is very minimal. But it's a neat
library for simple stuff, like rendering (non-interactive) vector graphics,
and turning images into SWFs (which used to be necessary before Flash 6
added support for dynamic loading of JPEGs). I've actually used it from
mod_python for this purpose before.

--
.:[ dave benjamin: ramen/[sp00] -:- spoomusic.com -:- ramenfest.com ]:.
"talking about music is like dancing about architecture."
Closed Thread


Similar Python bytes