Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Adobe Alchemy - C++ code running in Flash  (Read 2843 times)
0 Members and 1 Guest are viewing this topic.
Offline ewjordan

Sr. Member
**

Posts: 255



« on: 2008-11-17 22:45:32 »

This is not directly related to Java, but Adobe labs just announced a preview release of Alchemy, which lets C and C++ libraries run to support AS3 in the Flash player.  A while back there was talk that something similar was in the works for getting Java code on the AVM2, which is why I figured I'd post about it here.

The link: http://labs.adobe.com/technologies/alchemy/

It will be interesting to see how this compares to JNI - it looks like you're not running truly native code, as there's still a significant speed penalty, but I imagine the performance is still better than for pure AS3.  In any case, it does look a bit simpler than JNI, at least at a glance, so it may be worth keeping an eye on.

Edit: ah, so the internals of this are based on LLVM, which I believe we discussed here a little earlier.  It would be fairly straightforward to add a Java source (or target, for that matter) to this if there was interest.
Offline kevglass
« League of Dukes »

JGO Kernel
*****

Posts: 5214
Medals: 49


Mentally unstable, best avoided.


« Reply #1 on: 2008-11-18 03:31:52 »

Ditto, it would definitely be a really useful approach.

Kev

Offline ewjordan

Sr. Member
**

Posts: 255



« Reply #2 on: 2008-11-18 03:44:01 »

It appears that the expected speed is up to ten times faster than hand coded AS3, and between 2 and 10x as slow as native C++, which would put it somewhat close to Java territory, though not quite (I tend to see between 25% and about 75% of C++ performance in Java for general algorithms, i.e. ones that aren't specifically selected to play to the strengths of one language or the other).

It would be very interesting to see how Java would run in Flash when compiled in this way; it's not a panacea to the deployment issues that we've been discussing to death lately, because it wouldn't cover things like graphics and I/O, but IIRC there actually is some work being done on threading support (not sure if it's active or not right now), and for libraries it could be a decent solution.

We (well, "we" as in probably not me, because I'm too busy at the moment, but someone) are probably going to play around with getting Box2d (the C++ version) running using this tool to see how it compares to the manual AS3 port, the Java version, and the C++ one - that's a pretty reasonable test, as the C++ library is independent of most external stuff, and it hasn't been designed specifically to show off this tool.  I'll post a note here if we see anything interesting.
Games published by our own members! Go get 'em!
Offline Mr. Gol

Full Member
**

Posts: 214
Medals: 1



« Reply #3 on: 2008-11-19 05:32:11 »

Isn't there an enormous security risk with this? SWF files don't require signing at all...
Offline Matzon
« League of Dukes »

JGO Kernel
*****

Posts: 1805
Medals: 8


I'm gonna wring your pants!


« Reply #4 on: 2008-11-19 05:40:30 »

no no - its just as secure as fullscreen flash (fake a windows desktop (http://www.readatwork.com/) etc.). Flash has never been safe...

http://certusgames.com (Free Online Multiplayer Java Games)
http://lwjgl.org (OpenGL/OpenAL for Java)
Offline ewjordan

Sr. Member
**

Posts: 255



« Reply #5 on: 2008-11-19 07:03:43 »

Isn't there an enormous security risk with this? SWF files don't require signing at all...
No, it all runs within the sandbox - it's basically a virtual machine emulated in ABC (Actionscript byte code).  We could do the same in Java pretty easily, in fact.
Offline Mr. Gol

Full Member
**

Posts: 214
Medals: 1



« Reply #6 on: 2008-11-19 14:27:12 »

no no - its just as secure as fullscreen flash (fake a windows desktop (http://www.readatwork.com/) etc.). Flash has never been safe...


In fullscreen mode in Flash keyboard access is disabled, probably to prevent phising websites in this style. Looks great though Smiley
Offline Riven
« League of Dukes »

JGO Kernel
*****

Posts: 5866
Medals: 255


Hand over your head.


« Reply #7 on: 2008-11-19 15:45:25 »

"Please draw your password"

Hi, appreciate more people! Σ ♥ = ¾

Learn how to award medals... and work your way up the social rankings
Offline ewjordan

Sr. Member
**

Posts: 255



« Reply #8 on: 2008-11-19 16:59:54 »

no no - its just as secure as fullscreen flash (fake a windows desktop (http://www.readatwork.com/) etc.). Flash has never been safe...
Ha, that's hilarious - gotta remember to leave that open next time I get my hands on my brother's Linux laptop, he'll have a fit if he thinks that I "upgraded" his system on the sly!
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.152 seconds with 20 queries.