Adobe Releases C/C++ To Flash Compiler
SnT2k writes "Adobe recently released the beta version of Alchemy which compiles C/C++ code into AS3 bytecode (which runs on AVM2) that can run on the Flash or Flex platform and boasts increased performance for computationally-intensive tasks (but still slower than native C/C++). It was demonstrated last year during the Chicago MAX 2007 to run Quake. A few months later it has been demonstrated to run a Python interpreter and Nintendo Emulator. One interesting tidbit is that the thing is built upon the open source LLVM Compiler Infrastructure."
I've been interested in this idea since the presentation at the LLVM dev meeting. I'd be interested in extending clang to use the native ActionScript object model for Objective-C objects, and adding a GNUstep back end to use the native flash drawing primitives so that we can easily port Cocoa apps to run in a browser. Unfortunately, there was no contact information listed anywhere on the presentation or on this site, so I haven't been able to get in touch with anyone at Adobe Labs about this.
I am TheRaven on Soylent News
Adobe, Adobe, Adobe.. you are asking for it :)
Just remember Borland Delphi, Novell, OS/2, and the many products that at one point competed with M$'s dev monopoly..
Now where is that Linux suite of publishing tools? now that may #@!# M$ a bit...
Where I can find info on the NES emulator in Flash? That link didn't have any info that I could find.
I had started such a project a while back, but never quite finished due to poor performance.
Things you think are in the Constitution, but are not.
It has been said that the reason apple doesn't want flash on their iPhones is that it would create a competing application infrastructure over which they would have no control. I can see this development reinforcing that position.
This seems to further cement flash as a worthy application environment, especially given the perceived problem in flash appeared to be its inefficiency.
Looking forward to better flash games... (Or perhaps not if im not wanting to procrastinate).
Wow, I can compile my C/C++ code to run on a slow virtual machine instead of a native cpu architecture.
I haven't had this much fun ever since I discovered the java Virtual Machine written in java.
It brings back the heady days of my 8088.
I'd love to see what this will lead to. Flash games are all good but when you see freakin' QUAKE running in your browser window, all the possibilities suddenly hit home.
Fool me once, shame on you. Fool me twice, watch it -- I'm huge!
http://www.google.com/url?sa=t&source=web&ct=res&cd=5&url=http%3A%2F%2Fcs.anu.edu.au%2F~Peter.Strazdins%2Fseminars%2FdJVM.pdf&ei=FK0kSafSAZSo0gScxs3FDw&usg=AFQjCNHrPDWFanLbyUu3kX-lEkzZrWR6bw&sig2=jcMo0CIWzGg_nZVLvDHpxA
More details here: http://www.llvm.org/devmtg/2008-08/ (Look for the topic - Flash C Compiler: Compiling C code to the Adobe Flash Virtual Machine)
You post your ideas for Adobe here: http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=72&catid=755&entercat=y These forums are closely watched by the flash player team.
Well, I don't know whether Quake is that much of a benchmark. I can run Quake on my Nintendo DS through homebrew, and it was ported by one guy on his own, although I think he is a professional game developer for XBox 360, but I may be confusing him with someone else or may have misconstrued a forum post by him. Here's the site for anyone interested: http://quake.drunkencoders.com/
All your base are belong to Wii.
I'd love to see what this will lead to. Flash games are all good but when you see freakin' QUAKE running in your browser window, all the possibilities suddenly hit home.
JOGL has allowed hardware-accelerated 3D in your browser for years. Jake2 is the port of Quake2--arguably much more intensive than Quake--and that already runs in an applet. The technology has been there, but no one is using it.
Calm down!
Quake ran on old Pentum I's without any hardware-accelerated graphics.
So it's not really that surprising...
Increased performance over what exactly? Is there some other 'slower' bytecode that the VM runs? The summary fails to mention this. I don't see how compiling C++ to the AS3 bytecode would be any faster than compiling some Flash language to AS3 bytecode, or writing AS3 bytecode directly. I assume it is the AS3 bytecode itself that is faster, in which case the 'compiling C++' part is irrelevant to the increased performance.
I.O.U One Sig.
I have been working on two large enterprise class applications using their Flex/AIR framework and the performance is absolutely dismal!
The Flash VM is slow beyond belief when getting into large data-structures, event its native array parsing is incredibly slow.
Object instantiation is slower than molasses. We were averaging about 7 seconds to instantiate about 500 fairly complex objects that in most any other language, compiled or interpreted would have easily been created in a thousandth of that time.
The Flash VM's garbage collection is perfectly incapable of doing anything that involves long application run-times and leaks memory all over the place, even inside its native low-level components. It got to the point that even doing any proactive cleanup in our code was totally fruitless and I am sorry to add that a lot of the proactive steps we were taking have been left by the wayside because it is utterly hopeless to release all the memory you have taken back to the system.
Loading an SWF inside another SWF and then disposing of it will not stop the loaded SWF's playback and it does not release it from memory. Instead of Adobe fixing this obvious bug they just added a different method in Flash 10 called "unload and stop" or something like that. This requires anyone who wants to fix this issue to go back and refactor their code!
There are also numerous inconsistencies between applications that run in Flash and those that run in AIR, even though the code base is the same and the idea is that you do not have to change any obvious code to make it work in one platform or another.
Even flashes most basic function, doing vector drawings and animations fails horribly under load. We have had to hack and jury-rig numerous fixes in to compensate for Flash's seemingly random graphical glitches.
If Adobe wants to be taken seriously as a application platform developer, especially one that is used on the desktop they need to get their shit together because right now it feels like a childs toy or half-assed attempt to enter a new market.
Unfortunately the project, the client, and the management have chosen this path for us and we are stuck with it so I really hope that Adobe gets it together because its been a royal pain doing this sort of work on their platform.
Why is it that whenever someone says "I don't want to be off topic" something copletely off topic follows?
Anyway, compiling C/C++ into the Actionscript VM might start (or reinvigorate) a trend of broader programing language support for VM's. The specific platform that came to mind was Android. One of the main complaints I've been hearing is that developers are contained by Android's own (some say retarded) implementation of Java. I think it would be awesome to see something like a C/C++ compiler for other VM platforms, making it easier for developers to port their applications to a wider range of devices.
If I wanted to punch myself in the balls, I don't need Adobe's help.
Yes, but does it run Linux?
C produces very small executables, whether they be native executables or targeted to a VM
"Compiler", is that the new spelling for "Automated Buffer Overflow Generator" ?.
Let's say... SDL gets a flash port, then you basically can turn your simple C++ game into a game that people can run in flash computers without downloading... At least it sounds interesting.
Copyright infringement is "piracy" in the same way DRM is "consumer rape"
I really hope that Adobe gets it together
Fat chance to that happening.
They should just throw their code out to the hounds, but I guess they're scared and embarrassed to even consider taking up a 'proper' development model...
Quake Live.
http://quakelive.idsoftware.com/beta/
It was me, I did it, I moved your cheese
http://www.google.com/url?sa=t&source=web&ct=res&cd=5&url=http%3A%2F%2Fcs.anu.edu.au%2F~Peter.Strazdins%2Fseminars%2FdJVM.pdf&ei=FK0kSafSAZSo0gScxs3FDw&usg=AFQjCNHrPDWFanLbyUu3kX-lEkzZrWR6bw&sig2=jcMo0CIWzGg_nZVLvDHpxA
My first thought on reading this post was that the super-long Google url WAS the cluster-aware distributed virtual machine.
So, how long until Google reveals its next project: Compile C++ to a Google URL, and visit the URL to see your program running?
ActionScript, aka Javascript VM's are never going to be that fast. The problem is within the language itself and can not be fixed. It can be made slightly faster but it will never be as fast as well designed scripting languages and their VM's (eg. Lua). Compiling from C/C++ makes no difference when you're executing on a VM designed for Javascript shit.
Don't get me wrong, in theory Javascript is kinda cool but there are so many hacked in, tacked on and just plain weird "additions" to the language that the specification reads like some sort of government lawyer-speak contract. It's too convoluted to ever result in a fast VM.
Now with that fiexed, there shouldn't be anymore delay in the article on Flashing a C/C++ coder while he's in PE class. On with the Donkey Show.
Javascripts vary in quality, but the latest ones are pretty fast: for example, Javascript V8 (the Javascript from Google's Chrome browser project) is nearly as fast as Lua, which is the fastest widely used scripting language at the moment.
/dev/null
... but Slashdot no longer accepts the <pre> tag in HTML mode for displaying formatted output.]
Here are some basic timings I made just to give a rough feel for the relative speeds (don't read too much into them). The first entry provides the timings for C, which is obviously compiled, purely as a basis for comparison with the scripting languages. Note that the times for C are in milliseconds, while the rest are in seconds, lower is better:
Execution times for recursive F/P factorial(n) to
Langs @ 2008 Times: n=1 n=170 difference
C 0.000 ms 0.090 ms 0.090 ms
Lua 0.001 s 0.005 s 0.004 s
Parrot-opt/iterative 0.013 s 0.018 s 0.005 s
Parrot/iterative 0.014 s 0.019 s 0.005 s
V8-Javascript 0.007 s 0.013 s 0.006 s
Ocaml 0.022 s 0.029 s 0.007 s
Python 0.013 s 0.027 s 0.014 s
Parrot-opt/recursive 0.013 s 0.029 s 0.016 s
Mozilla-Javascript 0.001 s 0.018 s 0.017 s
Perl 0.002 s 0.021 s 0.019 s
Nickle 0.031 s 0.065 s 0.034 s
Parrot/recursive 0.014 s 0.056 s 0.042 s
Ruby 0.041 s 0.095 s 0.054 s
Lua_on_Parrot 0.303 s 1.314 s 1.011 s
Although every scripting language is still at least some 50 times slower than compiled C, interpreters and language VMs in general have been improving steadily over recent years, and Javascript in particular is getting a lot of attention now, with more optimizations in the pipeline from all the major players.
The gap will shrink, guaranteed.
[Sorry about the Code posting mode, it's not very easy on the eyes
"The question of whether machines can think is no more interesting than [] whether submarines can swim" - Dijkstra
Not quite quake, but it's almost there:
http://www.abrahamjoffe.com.au/ben/canvascape/textures.htm
Who wants to download a hundred megabyte file just to play in their browser?
Qxe4
So does Flash.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
Wow!!!! That's like rain on your wedding day! That's like like ten thousand spoons when all you need is a knife!!! That's like good advice that you just didn't take!!!
Cube - Free download in the app store. It's a completely uncontrollable Quake clone that's destined to disappoint. So what are you waiting for? The faster you download it, the faster you get to remove it!
Amen, brother! and i'm actually working with that sh!t :P
While I salute to new possibilities, Adobe Flash is still unusable for anyone who wants to allow Linux users to input anything other than english in their application. How about fixing http://bugs.adobe.com/jira/browse/FP-40 bug?
In Italy, there is horse-meat (cavallo) babyfood. The first real culture-shock experience I had while grocery shopping.
Sorry to hear it, man. Hope you can find a better gig soon.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
It has a Quake 4 video which you sit through thinking "why did you stick that in front of what I want to see a video of". Then the video ends and you realize that they just put it there for nothing. Yay.
Finally! Java applets are always so full of hassle to get running compared to Flash objects.
Now I can compile the JVM to Flash and run my Java applets inside Flash - no more need to install those meddlesome Java plugins!
For in-browser apps that want to be reasonablly cross platform (supporting at least wintel,lintel and mac) you have essentially three options.
Javascript with browser DOM/xmlhttprequest
Flash
Java applet (which means java with the user interface made with either AWT or swing)
I would guess at actually running code the java applet will be fastest but java's bloated libraries mean it will probablly be slowest to load. Am I correct?
note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
I've been meaning to re-write the interface on my Chumby for a long time; I even bought the O'Reilly on Actionscript 3 to help me out, but I'm still balking at diving into it. Now I can write my interface in C, which I'm much more comfortable with, and not have to learn anything new!
More details here: http://www.llvm.org/devmtg/2008-08/ (Look for the topic - Flash C Compiler: Compiling C code to the Adobe Flash Virtual Machine)
While scrolling down looking for the Adobe talk, I found this:
Designflow: using LLVM to compile to Hardware - This project uses LLVM to compile code to a mixed hardware and software implementation. This detects pieces of programs that may be efficiently compiled to VHDL and synthesized them onto an FPGA. The rest of the program is compiled to PowerPC code and uses to drive the FPGA. The system automatically handles data migration and other handshaking between the two systems.
Waaaayyyy more interesting than LLVM for flash. This is cool!!!
In the course of every project, it will become necessary to shoot the scientists and begin production.
I've always wanted to post my classic Quake screenshots in pdf format. Yup, been waiting. All. These. Years.
WARNING: Smartphones have side effects--most of them undocumented.
Very cool! I wonder how it would play within a Wt environment.
http://www.webtoolkit.eu/wt/doc/tutorial/wt-sdj.xhtml
Having to work for a living is the root of all evil.
Can I compile a keylogger and a trojan? I missed hard drive space on my botnet since they shutdown mccolo :p
Many times I've been asked if Tux Paint can be used "on the web." Well, perhaps some day soon, it can. (Er, kinda)