Live data from Hacker News

Shumway: a SWF interpreter entirely in JavaScript

benjamin.smedbergs.us

41–50 of 61 posts

Re: Shumway: a SWF interpreter entirely in JavaScript

#41
post #40

I have good hopes for this (Mozilla's HTML5-based PDF reader is my favourite PDF browser plugin), but I'm a little worried - there have been a lot of Open Source Flash reimplementations, and so far as I can tell they all have early success and pretty demos of older Flash content, but are completely useless on most real-world Flash usage, like nearly any site that shows a video. I'll note that Gnash does actually work…

that's the point , you cant keep up with the latest flash version = fail . You cant get good performances = fail , you cant run it on old browsers that dont have flash = fail . Nobody needs that. This has already been done , all the projects have failed. If i had skills i would not waste my time trying to fit a triangle in a star , i would develop tools to make perfect fitting stars. That's what people want.

Interestingly this has been my opinion of all the projects that attempt to create a bridge between native mobile APIS and javascript like phonegap and trigger.io. Don't get me know, they've been noble useful effects, but a lot of that effort should have going into projects like WebKit and Firefox to bring those native APIs to the browsers themselves.

Re: Shumway: a SWF interpreter entirely in JavaScript

#42

Earlier quoted context omitted.

There's a big difference between displaying a PDF file in JavaScript and compiling and displaying an active, real-time Flash game in JavaScript. A PDF file is just words and pictures on a page, same thing browsers have always done. They don't include animations, they don't accept user input, they don't connect to servers and stream files and send updates, and they definitely don't run real-time graphics code or path…

>A PDF file is just words and pictures on a page >They don't include animations, they don't accept user input, they don't connect to servers and stream files and send updates A PDF file is much more than just words and pictures. There are forms which accept user input, weird embedded content, and other strange things. Although I am not familiar with the spec, I have seen the features that Adobe Acrobat lets you do wi…

Right, but what percentage of the esoteric features technically supported by PDFs are actually in use? With the exception of forms, the huge, overwhelming majority of PDFs never use things like embedded objects (which, funnily enough, can sometimes be Flash files). And forms are definitely doable in a JavaScript PDF reader; they are, in fact, probably easier than in a native PDF reader since you'll be able to use HTML. So in JS, they can display almost any PDF in the world with no trouble at all. How many Flash programs are more complex than that little car demo, which runs slowly on my top-of-the-line hardware?

Why are we so afraid of native code these days? Firefox already runs plugins in a sandbox, and has done so since 3.6. There is more complexity and opportunity for screwups in unmanaged code, yes, and for a PDF JavaScript is just fine, but for something that requires a powerful, fast VM capable of real-time graphics and real-time user input without lag or freezes, it is silly to write off the benefit of performant native code just because Adobe's plugins are rife with security holes, which I believe is what is happening here.

Re: Shumway: a SWF interpreter entirely in JavaScript

#44

I have good hopes for this (Mozilla's HTML5-based PDF reader is my favourite PDF browser plugin), but I'm a little worried - there have been a lot of Open Source Flash reimplementations, and so far as I can tell they all have early success and pretty demos of older Flash content, but are completely useless on most real-world Flash usage, like nearly any site that shows a video. I'll note that Gnash does actually work…

There's another use case for this: Write a Flash app targeting both Swiffy and Adobe. The Swiffy part is easy since you can serve your own known-compatible or locally-hacked version of Swiffy used to run your app.

Re: Shumway: a SWF interpreter entirely in JavaScript

#45
post #14

Preface: this is pretty cool. That said, is the payoff of implementing this enormously involved solution really worth it? I don't know why I feel like this, but something deep down pains me when I think of the man hours and frustration that had to have gone into something like this. Does anyone else know what I mean?

I agree, brilliant job but kinda depressing if no one really ends up using the results of his hard work.

.. definitely skating to where the puck used to be.

Re: Shumway: a SWF interpreter entirely in JavaScript

#46

The main advantage to Flash is that you get a much more mature language (Actionscript 3) to work with over JS and you also get a whole host of great APIs that are easy to use. (From ByteArrays, to the Camera class, to different blend modes and filters, easy Bitmap manipulations, etc.). Now, JS is starting to implement some of these things which is good, but they still vary across browser, only work on the most modern…

You seem up-to-date on AS3 but not on JS. JS has typedarrays (even in IE10) now. /be

Sure, but from what you said I'm guessing that they don't work in IE9, which is what I mean about cross-browser issues. Plus, TypedArrays are somewhat clumsy maybe?

It seems as if JS is the future, and that's not necessarily a bad thing, but it would be nice if JS had a few more features to make it easier to use. I personally wouldn't be opposed to starting clean (with something like Dart) but that's probably unrealistic.

Overall, the reduction of plugins is a good thing, who doesn't like less security holes, less software to update, etc. But it's also a bad thing if we lost features off stuff, lose functionality, loss cross-browser capabilities etc.

Also, can't believe I said "righting" instead of "writing" in my last post. That's quite cringe-inducing.

Re: Shumway: a SWF interpreter entirely in JavaScript

#47
post #25

this project is a waste of time. The problem is not the player , but how flash can output content that use standard browser apis. This kind of emulation is a good demo , but doesnt work in the real world. Why whould i use that ? old browser will never support that tech ( It makes more sense to build tools similar to flash IDE that can export to HTML5 than wasting time trying to make legacy code run slow and blow up t…

Platforms where Flash is not supported by Adobe, or not allowed by the OS vendor: - Linux - Win8 Metro, depending on the whitelist contents - iPad - iPhone - FirefoxOS (neé B2G) As Stan the Man says, 'nuff said! /be

I think we pretty much all agree that flash is dead on mobile. That includes iPad, iPhone, Android, and so forth.

On the desktop, it's a bit of a different story. Chrome supports Flash on Linux quite well. Internet Explorer also has Flash baked in. There is some whitelisting if you are in "tablet mode"-- or so I am told. It seems like for a normal computer you should be able to turn off tablet mode, though.

I wish Mozilla had put some effort into contributing to Gnash or swfdec. There really wasn't, and isn't, a good flash decoder that isn't derived from Adobe's codebase. All the ones that exist now are toys. I have a feeling that this effort will be no different. I hope I'm wrong.

Re: Shumway: a SWF interpreter entirely in JavaScript

#48
post #40

I have good hopes for this (Mozilla's HTML5-based PDF reader is my favourite PDF browser plugin), but I'm a little worried - there have been a lot of Open Source Flash reimplementations, and so far as I can tell they all have early success and pretty demos of older Flash content, but are completely useless on most real-world Flash usage, like nearly any site that shows a video. I'll note that Gnash does actually work…

that's the point , you cant keep up with the latest flash version = fail . You cant get good performances = fail , you cant run it on old browsers that dont have flash = fail . Nobody needs that. This has already been done , all the projects have failed. If i had skills i would not waste my time trying to fit a triangle in a star , i would develop tools to make perfect fitting stars. That's what people want.

There's no need to keep up with the latest flash version. If you can render 90% of the legacy content out there (ads, animations, simple games) it's already good enough. You can always fall back on the real Flash player if you need to play a fancy game.

Re: Shumway: a SWF interpreter entirely in JavaScript

#49
post #16

Being more of a designer than a developer, I've got to admit that the thought of second wind for Flash kind of scares me. I've never liked Flash, mainly because historically it wasn't as "open" as HTML, Macromedia Flash (I know, right) crashed a lot, as well as the general abuse of Flash found all around the web in the late 90's/early 2k. Anyone willing/able to take my (probably irrational) fear away and tell me why…

Even ignoring the Player / AIR runtime, Flash is a fantastic tool for animation authoring. For example, our game artists use Flash to create SWF clips which we then export and playback with an internal format and C++ engine, supporting a fairly limited subset of all SWF features. This content ranges from UI layouts and transition animations to particle special effects and storytelling cutscenes. It wasn't hard to wri…

I believe Adobe made a tool for converting Flash MovieClips to HTML5 so you could use it to make animations and such.

Re: Shumway: a SWF interpreter entirely in JavaScript

#50
post #16

Earlier quoted context omitted.

Even ignoring the Player / AIR runtime, Flash is a fantastic tool for animation authoring. For example, our game artists use Flash to create SWF clips which we then export and playback with an internal format and C++ engine, supporting a fairly limited subset of all SWF features. This content ranges from UI layouts and transition animations to particle special effects and storytelling cutscenes. It wasn't hard to wri…

I believe Adobe made a tool for converting Flash MovieClips to HTML5 so you could use it to make animations and such.

Yeah, that's the CreateJS Toolkit for CS6: http://www.adobe.com/products/flash/flash-to-html5.html

It is an exporter from the Flash tool to a separate format, not a SWF file interpreter, so it has a different set of tradeoffs.

Post reply on HN