Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (525)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (593)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Adobe Alchemy - C++ code running in Flash  (Read 3786 times)
0 Members and 1 Guest are viewing this topic.
Offline ewjordan

Junior Devvie





« Posted 2008-11-18 03: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

« JGO Spiffy Duke »


Medals: 208
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #1 - Posted 2008-11-18 08:31:52 »

Ditto, it would definitely be a really useful approach.

Kev

Offline ewjordan

Junior Devvie





« Reply #2 - Posted 2008-11-18 08: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! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Mr. Gol

Senior Devvie


Medals: 1



« Reply #3 - Posted 2008-11-19 10:32:11 »

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

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #4 - Posted 2008-11-19 10: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...

Offline ewjordan

Junior Devvie





« Reply #5 - Posted 2008-11-19 12: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

Senior Devvie


Medals: 1



« Reply #6 - Posted 2008-11-19 19: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 Overlord »


Medals: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #7 - Posted 2008-11-19 20: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

Junior Devvie





« Reply #8 - Posted 2008-11-19 21: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]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

toopeicgaming1999 (67 views)
2014-11-26 15:22:04

toopeicgaming1999 (58 views)
2014-11-26 15:20:36

toopeicgaming1999 (12 views)
2014-11-26 15:20:08

SHC (25 views)
2014-11-25 12:00:59

SHC (24 views)
2014-11-25 11:53:45

Norakomi (30 views)
2014-11-25 11:26:43

Gibbo3771 (24 views)
2014-11-24 19:59:16

trollwarrior1 (37 views)
2014-11-22 12:13:56

xFryIx (76 views)
2014-11-13 12:34:49

digdugdiggy (53 views)
2014-11-12 21:11:50
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!