Hi, my name is Timo Ernst and I am a web expert.

Posts Tagged ‘JavaScript’

ZK user group conference in Mannheim, Germany

Posted on: November 22nd, 2011 by Timo

I’ll be speaking on the upcoming ZK user group conference in Mannheim, Germany on December 6th, 2011 (what’s ZK?).

If you enjoy developing rich internet applications with the power of Java, I highly recommend to be there.
If you want to join, just sign up for the event on zkoss.org for free and see three exciting presentations including ones from ZK head Timothy Clare and me.
Also, this is a great opportunity to meet other ZK developers and share some ideas and latest news in the community.

As a little teaser, here is the title sheet for my presentation.

TwitterDiggFacebookShare

SmokeScreen.us: Flash2HTML5 converter

Posted on: June 5th, 2010 by Timo

Here we have an interesting Flash2HTML5 converter which seems to work up to (parts of) Flash8. Check out smokescreen.us for demos and more info (Thanks to Antonio for the link).
Seems like it works pretty decently regarding movies and animations but I wonder if “real” applications would work with it, like for example such which were built using the Flex framework.

TwitterDiggFacebookShare

Flash Player 10.1 performance explosion

Posted on: May 6th, 2010 by Timo

I am currently writing my diploma thesis at the University of Ulm on performance issues regarding Rich Internet Application technologies like Adobe Flash/Flex, JavaFX, Silverlight and various JavaScript solutions.
(Update: It’s done! :-) )

I started back in December when I first noticed that Adobe’s Flash Player seriously has some performance issues. It always was by far the slowest of all technologies.
Today, I retried some of my self-written benchmarks using the new Flash Player 10.1 RC4 and I was absolutely blown away. The new version is so fast, it’s absolutely incredible.
I am not done yet with my thesis until mid-July, so I won’t publish to much about it here but I thought it might be interesting to show just one benchmark-result here.

I don’t want to go to much into detail regarding the test implementations since these might change til July, so if you want to know more about the exact details on my benchmark, you gotta wait til I am done with my thesis. So long, think of this as a “preview” ;-) since some things might still change. The final test/benchmark will be revealed in 2 months when it’s 100% finished. I just didn’t want to post anything that’s not done yet. As already said, this is just a little teaser for the final benchmark.

Test setup
All tests were run on a Macbook Pro with an Intel Core 2 Duo at 2.53 GHz and 8 GB of RAM.
Tests, which require a plugin were running using Safari.
Additionally, I also ran some JavaScript-based tests on Firefox, Google Chrome and Safari.
The code base for all tests is basically the same, except for differences regarding Syntax, of course. This makes all test results comparable.

Results (Click to enlarge):

All values are in milliseconds [ms] => Less is better

In numbers:

  • Flash Player 10.1: 528 ms
  • JavaScript (Safari 4.0.5): 1015 ms
  • JavaScript (Google Chrome 5.0.375.29: 1039 ms
  • Silverlight 4.0.50401.0: 1300 ms
  • JavaFX 1.3 (JRE 1.6.0_17): 1392 ms
  • Firefox 3.6.3: 1449 ms
  • JavaFX 1.2 (JRE 1.6.0_17): 1635 ms
  • Flash Player 10.0: 3201 ms

Adobe, what the hell did you do???

Note: Please be aware, that I am basically testing FP 10.1 vs FP 10.0 here. This has nothing to do with the latest RC4 version of FP 10.1 since I haven’t done any tests with older release candidates yet.

Update: Added test results for JavaFX 1.3 and fixed a mistake regarding the test results for Firefox.

Update II: According to a blog entry of Tinic Uro, an engineer at Adobe Systems, the reason why Flash Player 10.1 works so well on Mac OS is Apple’s Core Animation Framework (Thanks to Matthew for the link!)
What I really liked about this blog post is the following:

“You might have noticed that Core Animation is a Cocoa API. Yes, Flash Player 10.1 is a true Cocoa app now (with a Carbon fallback to support Firefox and Opera which are not Cocoa yet).”

Flash Player is a true Cocoa application now? Nice.

TwitterDiggFacebookShare

Please, Adobe. Give us the Ajax Builder!

Posted on: April 29th, 2010 by Timo

I think, I already mentioned that I really like Adobe’s products for creating animations and rich internet applications, which are namely Flash Professional, Flash Builder, Catalyst and Illustrator. What I don’t like is the target platform: The Flash Player. So, after all these debates about Flash, isn’t it time to simply drop the Flash Player and add an additional compiler option for Flash Builder and Flash Professional? Yes, you guessed right. I am talking about HTML5 deployment. Wouldn’t it be great if one could build rich internet applications using technologies like ActionScript3 and MXML, which are both superior to JavaScript and pure HTML, without being forced to target the Flash Player? Flash Professional could simply render into HTML5′s <Canvas> element. It has already been shown, that this is possible. Flash Builder could simply transform the code base into HTML/Ajax, similar to the client-side part of GWT. I know that I might sound a bit childish here but, I’d call this “Ajax Builder” :-D

Don’t get me wrong. I didn’t say: “Replace the Flash compiler option.” – This is important since there are still some things HTML5 can’t handle, like webcam support for example.
=> No Flash, no ChatRoulette.
So, til HTML5 is ready to completely replace Flash, both compiler options must be offered.

Also, the whole Illustrator-Catalyst-FlashBuilder workflow should be kept and optimized for HTML5. Although Catalyst is still in its baby-shoes and has some serious mis-concepts, the basic idea is great. Adobe should keep working on this.

Further, AIR shouldn’t be canceled if Flash gets (ever) dropped. Instead, AIR could be a great way to bring Ajax-based rich internet applications to the desktop (and mobiles).

The benefit is clearly visible: Flash-developers can keep using their knowledge about AS3, MXML and Adobe’s software products, but simply target a Flash-free platform.
In the same time, all this Flash-sucks-no!-Flash-is-great-blahblah would finally come to an end.

Update: Seems like, Adobe heard me :-)

TwitterDiggFacebookShare

Instant Flash player engine in JavaScript?

Posted on: April 12th, 2010 by Timo

Note: This is not a posting about introducing Gordon. This article describes a concept of automatically porting the Flash Player to JavaScript in a generic way, based on the idea of Gordon and Adobe Alchemy.


You might know Gordon, an experimental attempt of implementing the Flash Player runtime environment, completely written in JavaScript (by Tobey Tailor).
Demos have already shown, that this is possible.

The idea itself is great: Create a Flash application as you’re used to and then compile it into a SWF file.
Then, embed it together with Gordon into your website like this:

<html>
	<head>
		<script type="text/javascript" src="/path/to/gordon.js"></script>
	</head>
	<body>
		<div id="your_stage">Replace me</div>
		<script type="text/javascript">
		var movie = new Gordon.Movie("/path/to/your.swf", {id: "your_stage", width: 480, height: 320});
		</script>
	</body>
</html>

The problem here is that I doubt that one person alone can completely re-implement the full Flash engine. This is somewhere close to impossible, since Gordon currently only supports SWF1, while the Flash Player was just released in version 10.1.
Even open-source projects like Gnash, a re-implementation of the Flash Player (written in C++), which already exists since several years, currently only support SWF7 and SWF8 partially.

Now, here comes my idea:

What, if it would be possible to automatically transform existing Flash Player implementations into JavaScript?

I know that this sounds crazy, but read the following first.

Ever heard of Alchemy? It’s a transformation tool, which converts C/C++ code into ActionScript and then build a Flash file from. Yes, you heard right. This is not an April joke. It’s real and it works. There have already been ports using the original (open) Quake2 source, transform it into ActionScript and then run the game inside Flash Player.

Now, since this is nothing new, here comes the big trick: Why not use the source code of Gnash, send it through Alchemy and achieve the ActionScript version of it.
Then, write a transformation tool, which converts ActionScript into JavaScript code. Since both languages share some syntax similarities, this should be possible (Especially if it is possible to transform C/C++ into ActionScript, which would sound even more crazy to me, if I’d hear it in the first place).
After this, the achieved JavaScript code must be cleared of anything that the Flash Player offers, but cannot be handled by JavaScript/HTML5, like for example web-cam support.
Finally, an interface must be written in order to output video and audio. Since HTML5 supports the new <canvas> and <audio> tags, this should be possible. Simply draw the content of the graphical buffer, generated by the Flash Player emulator, onto the canvas element and playback the sound using <audio>. Done.

This way, it would be possible to run (existing) Flash applications without having the Flash Player plugin installed.

I know, this still might sound crazy but it might be possible with enough man-power and the know-how. The only thing that might become a bigger problem is the file size. I wonder how big such a .js file, implementing the full(!) Flash Player, might become. Maybe it would then be necessary to package only required subsets of it.

So what do we get at the end? A JavaScript-version of the Flash Player which supports up to SWF8, thanks to Gnash.
If Adobe ever releases the Flash Player as open source, it would be easy to throw it into our C/C++-to-JavaScript transformator. Sounds great, or not?

Update: It just came to my mind that, if it’s possible to transform C/C++ into ActionScript, why shouldn’t be possible to directly cross-compile C/C++ into JavaScript?
As far as I know, Alchemy is based on LLVM, which should be able to handle this.

TwitterDiggFacebookShare