Flython?

Discussion in 'Python' started by Peter Hansen, Aug 12, 2004.

  1. Peter Hansen

    Peter Hansen Guest

    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=)

    -Peter
     
    Peter Hansen, Aug 12, 2004
    #1
    1. Advertising

  2. Peter Hansen

    John J. Lee Guest

    Peter Hansen <> writes:
    [...]
    > 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
     
    John J. Lee, Aug 12, 2004
    #2
    1. Advertising

  3. On Thu, 12 Aug 2004, Peter Hansen wrote:

    > 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!
     
    Christopher T King, Aug 12, 2004
    #3
  4. Peter Hansen

    Peter Hansen Guest

    Christopher T King wrote:

    > On Thu, 12 Aug 2004, Peter Hansen wrote:
    >
    >
    >>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!


    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
     
    Peter Hansen, Aug 13, 2004
    #4
  5. Peter Hansen wrote:

    > Christopher T King wrote:
    >
    >> On Thu, 12 Aug 2004, Peter Hansen wrote:
    >>
    >>
    >>> 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!

    >
    >
    > 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
     
    Daniel Ellison, Aug 13, 2004
    #5
  6. Peter Hansen

    Peter Hansen Guest

    Daniel Ellison wrote:

    > 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?
     
    Peter Hansen, Aug 13, 2004
    #6
  7. Peter Hansen wrote:

    > Daniel Ellison wrote:
    >
    >> 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"


    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
     
    Daniel Ellison, Aug 13, 2004
    #7
  8. Peter Hansen

    Guyon Morée Guest

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



    "Peter Hansen" <> wrote in message
    news:...
    > 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=)
    >
    > -Peter
     
    Guyon Morée, Aug 13, 2004
    #8
  9. Peter Hansen

    Peter Hansen Guest

    Guyon Morée wrote:
    > 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
     
    Peter Hansen, Aug 13, 2004
    #9
  10. Christopher T King wrote:
    > On Thu, 12 Aug 2004, Peter Hansen wrote:
    >
    >
    >>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!
    >

    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...
     
    Benjamin Niemann, Aug 13, 2004
    #10
  11. 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
     
    Cousin Stanley, Aug 13, 2004
    #11
  12. Peter Hansen

    Peter Hansen Guest

    Cousin Stanley wrote:

    > 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
     
    Peter Hansen, Aug 13, 2004
    #12
  13. Peter Hansen

    simo Guest

    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.....
     
    simo, Aug 14, 2004
    #13
  14. 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
     
    Cousin Stanley, Aug 15, 2004
    #14
  15. Peter Hansen

    Peter Hansen Guest

    simo wrote:

    > 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
     
    Peter Hansen, Aug 16, 2004
    #15
  16. Peter Hansen wrote:
    > simo wrote:
    >
    >> 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.


    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! :)

    >
    > -Peter



    Dan
     
    Daniel Ellison, Aug 16, 2004
    #16
  17. Peter Hansen

    Mike Rovner Guest

    Daniel Ellison wrote:
    > Peter Hansen wrote:


    >> to come. Flash has a compact bytecode, while SVG comes
    >> as XML. Need I say more?

    >
    > 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
     
    Mike Rovner, Aug 16, 2004
    #17
  18. Mike Rovner wrote:

    > Daniel Ellison wrote:
    >
    >>Peter Hansen wrote:

    >
    >
    >>>to come. Flash has a compact bytecode, while SVG comes
    >>>as XML. Need I say more?

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


    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.
     
    Daniel Ellison, Aug 16, 2004
    #18
  19. Fwd: Flython?

    On Mon, 16 Aug 2004 12:21:03 -0400, Daniel Ellison <> wrote:

    > 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
     
    Shawn Wheatley, Aug 16, 2004
    #19
  20. Peter Hansen

    Mike Rovner Guest

    Mike Rovner, Aug 16, 2004
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave Benjamin

    Flython

    Dave Benjamin, Aug 13, 2004, in forum: Python
    Replies:
    17
    Views:
    776
    Dave Benjamin
    Aug 18, 2004
  2. Ben Last

    RE: Flython?

    Ben Last, Aug 16, 2004, in forum: Python
    Replies:
    0
    Views:
    367
    Ben Last
    Aug 16, 2004
  3. Ben Last

    RE: Flython?

    Ben Last, Aug 18, 2004, in forum: Python
    Replies:
    1
    Views:
    386
    Daniel Ellison
    Aug 18, 2004
Loading...

Share This Page