8 ms·
Gordon: An open source Flash runtime written in pure JavaScript
- hendler 17y agoHas anyone tried this out? Is it more than a toy? README says little http://github.com/tobeytailor/gordon/blob/master/README http://github.com/tobeytailor/gordon/blob/master/README
- chipsy 17y agohttp://wiki.github.com/tobeytailor/gordon/demos http://wiki.github.com/tobeytailor/gordon/demos The demos are basically graphics tests: vector drawing, frame-by-frame animation, tweens. http://wiki.github.com/tobeytailor/gordon/swf-tag-support-table http://wiki.github.com/tobeytailor/gordon/swf-tag-support-ta... The tag support table shows just how much is missing: everything from SWF 2 onwards! Many of those tags aren't feasible in pure JS right now, anyway.
- lt 17y agoInteresting. Those work nicely using Safari on my iPhone. Looks promising. But on Chrome 4.0.288.1 dev moving the mouse over any of the animations crashes the tab.
- judofyr 17y agoInteresting. Works fine on 4.0.249.49.
- city41 17y agoThe demos don't work at all in IE8.
- metachor 17y agoI have the same experience with Chrome. Mousing over the animation crashes not only the active tab, but all of the tabs in the window.
- ig1 17y agoAll the demos work fine for me on the Chrome 4.0.288.1 dev.
- njn 17y agoworks for me in Chromium 4.0.266.0
- catch23 17y agoAlso, I think most of the newer SWF files have lots of actionscript bytecode which is something that Gordon probably can't handle unless they implement their own stack-based virtual machine and implement all of the mx.core set of libraries.
- dutchflyboy 17y agoIt would be possible (a bit slow though). This has already been done a few times with JS. For example, qBasic (http://stevehanov.ca/blog/index.php?id=92 http://stevehanov.ca/blog/index.php?id=92) or even virtualizing a whole device like the gameboy (http://www.codebase.es/jsgb/ http://www.codebase.es/jsgb/).
- sethaurus 17y agoA custom virtual machine probably isn't necessary. There are plenty of flash decompilers which can emit AS3 source from bytecode — and since ActionScript 3.0 is basically the old ECMAScript 6 draft spec, it can be trivially downcompiled to plain old Javascript using Mascara (http://ecmascript4.com/ http://ecmascript4.com/). Ideally the conversion would take place on a server-side proxy, and its ouput would subsequently be cached, but it could theoretically be done on the client as well. Re-implementing the standard library remains a major issue, but certainly not insurmountable.
- rabidsnail 17y agoIt doesn't look like it supports sound or video.
- voodootikigod 17y agoThere appears to be support for video in there, audio is a different issue. http://github.com/tobeytailor/gordon/blob/master/src/Movie.js http://github.com/tobeytailor/gordon/blob/master/src/Movie.j...
- godDLL 17y agoThat's the Flash Movie object, not H264 or Indeo video. A Flash Movie object is what Macromedia decided to call their hybrid format (like "page" for the Web, or "track" for audio).
- dutchflyboy 17y agoWell, it could be done with HTML5 and the video tag.
- cmars232 17y agoI saw a tiger head for about a second. I said, "oh cool". Then Chrome said: "Aw, snap!"
- godDLL 17y agoIt's a great new beginning, and a monumental effort on the part of one guy (the developer). Flash is undocumented (apart from what Adobe decided to share with search engine crawlers), and difficult to reverse-engineer.
- daeken 17y agoThis is not true at all. Flash is now an "open standard", in that Adobe released the specs to the file format, the VM, and most (all?) of the video format. For what it's worth, outside of a few errors in the documentation, it's fairly well written; I was working on a Flash->iPhone App compiler before Adobe announced theirs, and it was fairly straightforward to implement most things.
- axod 17y agoQuick link to demo: http://github.com/tobeytailor/gordon/raw/master/demos/tiger.html http://github.com/tobeytailor/gordon/raw/master/demos/tiger.... Wish people made github pages a bit more friendly. It's like being thrown into a pit of 1s and 0s.
- bdotdub 17y agoHere are some other links: http://wiki.github.com/tobeytailor/gordon/demos http://wiki.github.com/tobeytailor/gordon/demos
- ronnier 17y agoDemos posted here: http://paulirish.com/work/gordon/demos/ http://paulirish.com/work/gordon/demos/
- knv 17y agoAll three of them crashed my Chrome 4.0 tab.
- timf 17y agoCool technology to pursue but considering how Flash content's CPU requirements are often a problem on C-based interpreters, this doesn't seem like a practical thing.
- jacquesm 17y agoWhen you see a pig dance it is impolite to comment on the quality of the dance, but you can express amazement at that it dances at all ;) Let's give them a bit and see how far they take it. With a bit of luck they get some help from a nifty jit for js and who knows what might happen. The evil .swf might turn in to a standard component after all, if only via a somewhat roundabout way. I really wonder how they're going to do audio though, and capture devices and such are probably out (I can see a route to do video via the canvas, it's going to be bloody slow though unless js gets sped up a lot compared to where it is today).
- uggedal 17y agoIf the new HTML5 <device> element gets implemented they could use that for capture devices: http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#devices http://www.whatwg.org/specs/web-apps/current-work/multipage/...
- jacquesm 17y agoYes, I can't wait. I've been waiting for that literally for years. Many years long we used a crappy old little javascript that I wrote long ago, it basically loads jpegs under water in to an off screen buffer and then flips them over the previous one when they're. Using some trickery I could get pretty good framerates if the connection is good but the bandwidth cost is just terrible. Now we've switched to (yuck) flash and it works ok I guess but something more standardized would be much appreciated.
- s3graham 17y agoIt's translating to SVG, so there's "just" the script translation overhead, not rendering overhead. I think it's quite practical if maybe not especially useful given Flash penetration. I wrote a Flash player for the PS2 ~9 years ago now that was fast enough. I'd say that current PCs + jitted JS are faster than that platform.
- flog 17y agoThis was my 2009 new-years prediction... damn it, just out! The best demo is http://jancona.com/gordon/demos/blue.html http://jancona.com/gordon/demos/blue.html
- kqr2 17y agoJust in case anyone was wondering about the project name and is not too familiar with classic science fiction: http://en.wikipedia.org/wiki/Flash_gordon http://en.wikipedia.org/wiki/Flash_gordon
- Raphael 17y agoFlash! Ah ah. He's a miracle.
- leoc 17y ago"Dispatch war rocket AJAX to bring back his body!"
- abstractbill 17y agoOf course it's damn impressive, but it doesn't seem very useful to me. Nobody uses Flash for the language (actionscript is a terrible mash-up of javascript and Java, and haXe is not a lot better), or because we think the virtual machine is awesome in some way. Simply, we use it to bridge the gap between what web browsers can do and what native apps can do (access to webcams and microphones, local files, real tcp/ip sockets, etc, etc). Having said all that, who knows - maybe web browsers really will eventually bridge those gaps themselves, and this will just be used to run legacy Flash code. It's possible I guess.
- jacquesm 17y agoI invite you to switch your flash player off for a bit and see how many sites use it for all kinds of stuff. It's a nuisance but it is so pervasive it's not even funny.
- racketman4 17y agoActionscript 3 isn't that bad.
- abstractbill 17y agoCompared to javascript though? (that's the point after all). I definitely prefer javascript to as3.
- scotth 17y ago
- mcav 17y agoThe demo uses 1/3 as much CPU as a similar Flash app would on my Mac. Very cool.
- mortenjorck 17y agoI'm not sure if that says more about the poor optimization of the Mac Flash plugin or the great optimization of your browser's (Safari? Mac Chrome?) JS interpreter. Probably both.
- mcav 17y ago[Safari 4, though I would expect Chrome to fare well too.]
- tedmielczarek 17y agoThere's a lot more overhead to the plugin model, since the browser has to call to the plugin via NPAPI and the plugin has to draw itself separately, vs. just being integrated into the normal reflow/repaint of the webpage.
- wensing 17y agoSWF files on the iPhone.
- abstractbill 17y agoBut not useful SWF files on the iPhone. This doesn't magically give you anything you didn't already have in javascript.
- deleted 17y ago[deleted]
- mortenjorck 17y agoYes, but that big Flash site you just finished with no budget for an iPhone version just got a lot cheaper to re-target.
- catch23 17y agonot really, if you're writing flash apps, there's a huge chance that you're actually writing as3 code, which gets compiled into DoABC tags (actionscript bytecode) and I don't think DoABC tags will ever be supported unless they implement a stack-based virtual machine in javascript. It gives the appearance that it got cheaper to re-target, but really it will be a ton more work when you realize what will never be supported. Even if they managed to implement a virtual machine in javascript, they'd still need to implement all the library code that normally doesn't ship with every swf file.
- wensing 17y agoUnless you aren't starting from scratch, as you said ("legacy Flash code") in your other comment.
- s3graham 17y agoIt gives you the Flash (animation) authoring environment without plugin requirement for playback.
- varjag 17y agoFlash Gordon: Worst Search Engine Terms Since A* Algorithm
- a-priori 17y agoI think that title belongs to "God" (http://god.rubyforge.org/ http://god.rubyforge.org/)
- Keyframe 17y agoTry D!
- leoc 17y agoThere have been a couple of programming languages named 'English'.
- rsheridan6 17y agoScheme is pretty bad too.
- pjhyett 17y agoFunny enough, that site still appears on the first page of google search results for "god".
- mrcharles 17y agoI always thought a good anti-piracy measure would be to name your TV Show / Band / Game "The".
- deleted 17y ago[deleted]
- funkdobiest 17y agoToo bad the name is already used for a flash decompiler http://www.futurecandy.net/ http://www.futurecandy.net/
- galactus 17y agoI had already used the name for my lisp flash library :( http://wiki.freaks-unidos.net/gordon http://wiki.freaks-unidos.net/gordon (not that it is a very original name or anything ;))
- dflock 17y agoThis leaks memory like a sieve on Chromium, unfortunately. Be very interested to see where this goes eventually though.
- gcb 17y agoGreat! now people will go back to blocking JS to avoid ads like the old days. All that easy ride of blocking just the flash player left the web all screwed up with that JS for content running loose. Good ridance, ajax.
- duairc 17y agoDoes this actually implement the equivalent of Adobe's Flash runtime in Javascript? Does it work for all SWFs? If so, is there some sort of magic involved? If this works, how come things like Gnash and swfdec have never been able to achieve full compatability with Flash, yet this has seemingly come out of nowhere and done just that?