Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (549)
Games in Android Showcase (139)
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 3839 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:

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: 232
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.


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 ( 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 ( 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: 885
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 ( 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.

Archive (23 views)
2015-01-29 04:26:08

theagentd (22 views)
2015-01-28 15:33:52

GamerIDGoesHere (31 views)
2015-01-27 01:23:23

GamerIDGoesHere (33 views)
2015-01-27 01:22:15

CopyableCougar4 (39 views)
2015-01-27 00:34:41

CopyableCougar4 (26 views)
2015-01-26 04:47:56

Olo (19 views)
2015-01-25 21:26:00

Olo (24 views)
2015-01-25 18:44:22

Robo11 (42 views)
2015-01-25 06:14:26

basil_ (34 views)
2015-01-17 22:29:32
2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

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 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‑
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!