Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Software

Adobe Releases C/C++ To Flash Compiler 216

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."
This discussion has been archived. No new comments can be posted.

Adobe Releases C/C++ To Flash Compiler

Comments Filter:
  • by TheRaven64 ( 641858 ) on Wednesday November 19, 2008 @06:55PM (#25826287) Journal
    On the off-chance that someone from Adobe reads this:

    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.

  • Oh oh Adobe... (Score:2, Interesting)

    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...
  • NES emulator? (Score:3, Interesting)

    by Mr. Sketch ( 111112 ) <mister...sketch@@@gmail...com> on Wednesday November 19, 2008 @06:58PM (#25826327)

    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.

  • It has been said (Score:5, Interesting)

    by frictionless man ( 1140157 ) on Wednesday November 19, 2008 @07:01PM (#25826375)
    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).
    • Re: (Score:3, Insightful)

      by m50d ( 797211 )
      This seems to further cement flash as a worthy application environment, especially given the perceived problem in flash appeared to be its inefficiency.

      Huh? You think this method is going to give anything remotely resembling the efficiency of native code? Unless the flash script language is really badly written, the performance will be even worse than programs that were manually written in flash.

      • Re: (Score:2, Insightful)

        by Anonymous Coward

        Huh? You think this method is going to give anything remotely resembling the efficiency of native code?

        It won't be fast but Good Enough is good enough.

      • by Scaba ( 183684 )

        You forgot the link to your benchmark results...

      • Huh? You think this method is going to give anything remotely resembling the efficiency of native code? Unless the flash script language is really badly written, the performance will be even worse than programs that were manually written in flash.

        Correction: Unless the C/C++ compiler was implemented very poorly, and fed terrible code, it's performance will at least be on par with equivalent code written in flash script.

        C and C++ compiler optimization technology is very well established, and there are no hidden garbage collection quirks waiting to burn you.

        The existence of a decent C to AS3 bytecode compiler opens up possibilities: language compilers and tools such as SmallEiffel, Ctalk, Flex, Yacc, Bison, Ragel, etc. use C as their first stage compi

        • Re: (Score:3, Funny)

          by internerdj ( 1319281 )
          And you forgot the most important thing, now they can port linux to flash and appease all the slashdot haters with one question and one answer: Does it run linux? and Yes, it does.


          And before someone responds to this as if it were a serious post: I very sincerely hope this is and will remain a joke.
      • by tepples ( 727027 )

        This seems to further cement flash as a worthy application environment, especially given the perceived problem in flash appeared to be its inefficiency.

        Huh? You think this method is going to give anything remotely resembling the efficiency of native code?

        What's inefficient is maintaining separate versions of your product's business logic in one language for each platform (C++, Java, C#, and ActionScript), and then somehow proving that they produce bit-for-bit identical results.

      • by mgiuca ( 1040724 )

        Huh? You think this method is going to give anything remotely resembling the efficiency of native code? Unless the flash script language is really badly written, the performance will be even worse than programs that were manually written in flash.

        Sorry, what? Why would C running on Flash get worse performance than ActionScript running on Flash?

        Obviously you won't have the same performance of native code (for one thing, you need to be doing security checks, which is part of the major benefit of using Flash o

    • Comment removed (Score:4, Interesting)

      by account_deleted ( 4530225 ) on Wednesday November 19, 2008 @10:30PM (#25828217)
      Comment removed based on user account deletion
  • by Anonymous Coward on Wednesday November 19, 2008 @07:03PM (#25826385)

    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.

    • Re: (Score:3, Insightful)

      by cstdenis ( 1118589 )

      > java Virtual Machine written in java.

      Link? This sounds completely useless, but it would be interesting to look at the source if available.

      • by Halo1 ( 136547 ) on Wednesday November 19, 2008 @07:20PM (#25826599)

        http://jikesrvm.org/ [jikesrvm.org]

        • Re: (Score:3, Informative)

          by Urza9814 ( 883915 )

          Wow. Even worse. Apparently there's more than one, because if you notice my previous comment...well, that wasn't the one I found.

          http://joeq.sourceforge.net/ [sourceforge.net]

          • by Halo1 ( 136547 ) on Wednesday November 19, 2008 @07:46PM (#25826869)

            There's nothing inherently bad about the concept. It's in fact quite interesting to have the JVM optimise itself along with the programs running inside it. And while the JikesRVM, being a research VM, does not run as fast as Sun's VM or IBM's commercial VMs, it's not that slow either (definitely not as slow as you'd first think of a JVM implemented in Java).

            • But wouldn't the Java JVM have to run on a JVM? Thus introducing yet another layer of inefficiency?

              • by Halo1 ( 136547 )

                JikesRVM has a small "bootstrap" VM that is used to get the main VM going, but after startup everything is run in the main VM (including the main VM itself).

                • by MichaelSmith ( 789609 ) on Wednesday November 19, 2008 @09:26PM (#25827747) Homepage Journal

                  JikesRVM has a small "bootstrap" VM that is used to get the main VM going, but after startup everything is run in the main VM (including the main VM itself).

                  I am getting mental stack overflows just trying to parse that.

                  • I am getting mental stack overflows just trying to parse that.

                    Computer science is based on the idea of machines that can simulate themselves, and actual computers end up working like that pretty frequently.

                    • I am getting mental stack overflows just trying to parse that.

                      Computer science is based on the idea of machines that can simulate themselves, and actual computers end up working like that pretty frequently.

                      Halo1 claims that the JikesRVM runs inside itself. Sure I know that GCC compiles itself but this is like saying the JVM can run without a physical machine below it.

                    • by Halo1 ( 136547 )

                      The (small and simple) bootstrap VM is written in C++.

    • My god! I thought you were _kidding_ when you mentioned the Java Virtual Machine written in Java. But the damned thing _exists_! What has this world come to???

      • Re: (Score:2, Insightful)

        by pohl ( 872 )

        Speaking of, where did the computer-science demographic on slashdot make off to? You know, the guys who are aware of historical minutiae like the time-honored milestone of a programming language becoming self-hosting? Just asking.

        • Well, of course, but isn't it a bit different with Java? I mean, most programming languages aren't virtualized.

          I'm a computer science major by the way. Freshman though, so I guess I have some to learn still. ;)

          • Re: (Score:3, Interesting)

            by pohl ( 872 )

            OK, sorry to be so hard on you. It turns out that there are copious buttloads of languages that use some sort of bytecode under the hood. The thing that really makes it stick in your mind with Java is just that it's the format that you're expected to distribute your programs in. Contrast that with Python: The reference implementation (CPython) is also a bytecode interpreter. I'm not sure, it may be possible to distribute a python program in bytecode, but I've neither seen nor heard of anyone doing

            • by armb ( 5151 )

              > copious buttloads of languages that use some sort of bytecode under the hood

              But fewer where the bytecode interpreter is written using itself. The historical self-hosting milestone is usually when the compiler written in the language can compile itself (once it's been compiled with another version first), and a Java compiler written in Java is nothing special.

        • by abigor ( 540274 )

          Speaking of, where did the computer-science demographic on slashdot make off to?

          I don't know. I wish I did, because I would go there too.

          Or maybe they are still around, and it's just that the number of know-nothing posters has increased so hugely.

    • by fm6 ( 162816 ) on Wednesday November 19, 2008 @08:11PM (#25827095) Homepage Journal

      If you have a complete C++ application that runs fine on native code, then obviously this would be silly. But if you bothered to RTFA, you know that this serves a simple and obvious purpose: reuse. If you need rendering code for your Flash game, and the best code available is in C or C++, it's a lot easier to just recompile the code than it is to hand-translate the code into ActionScript.

      • C produces very small executables, whether they be native executables or targeted to a VM
        • by fm6 ( 162816 )

          Hmm, have you ever played Momentum Missile Mayhem? Good game, though you can't really play it inside a browser (too sluggish.) The thing is about 7 MB, which is tiny for a PC game, but pretty big for a Flash game. One wonder if it wouldn't benefit from a little re-coding in C.

  • 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.
  • More details (Score:5, Informative)

    by supermansuper ( 1183487 ) on Wednesday November 19, 2008 @07:21PM (#25826605)
    More details here: http://www.llvm.org/devmtg/2008-08/ [llvm.org] (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 [adobe.com] These forums are closely watched by the flash player team.
    • by smcdow ( 114828 ) on Thursday November 20, 2008 @10:10AM (#25832247) Homepage

      More details here: http://www.llvm.org/devmtg/2008-08/ [llvm.org] (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!!!

  • by shird ( 566377 ) on Wednesday November 19, 2008 @07:33PM (#25826749) Homepage Journal

    compiling C/C++ code into AS3 bytcode (which runs on AVM2) that can run on the Flash or Flex platform and boasts increased performance for computationally-intensive tasks

    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.

    • by drspliff ( 652992 ) on Wednesday November 19, 2008 @08:01PM (#25826977)

      The point is that the LLVM project can do far more optimization before being compiled to bytecode than Adobe's ActionScript compiler is doing, and as a result it runs faster.
      Yes... Adobe's ActionScript compiler sucks at generating bytecode for their own VM, and even they admit it.

      • by mrboyd ( 1211932 )
        So in short, instead of optimizing their primary and widely used compiler used by hundred of thousands of people every day (AS3) they created a better compiler for a language most people will never use to write flash apps just to show that if they wanted to put some their mind to it they could do something better for AS3.. kind of annoying. ;)
  • by NouberNou ( 1105915 ) on Wednesday November 19, 2008 @07:36PM (#25826789)
    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.
    • by Locke2005 ( 849178 ) on Wednesday November 19, 2008 @07:54PM (#25826923)
      This is why I'm actually pleased to see Microsoft pushing Silverlight; if nothing else, it forces Adobe to get off their ass and actually make the Flash 10 SDK available platforms other than Mac OS and Windows! I'm still waiting for Flash 8/Flash 9 content to work on my Wii and on my Android G1 phone, since almost all 'net video is using Flash now. (Looks like the Android Flash support will be there pretty soon. I still think Silverlight gave them a powerful incentive to get their act together on this.)
    • by Locke2005 ( 849178 ) on Wednesday November 19, 2008 @08:12PM (#25827105)
      I have been working on two large enterprise class applications using their Flex/AIR framework...

      I think I see your problem right there... there is nothing like using the right tools for the job, and this is nothing like using the right tools for the job. ;-)

      • Re: (Score:2, Insightful)

        by shadwstalkr ( 111149 )

        Well, Flash is the only tool for the job when you need an application that runs the same in all (relevant) browsers on all (major) platforms with no installation by the end user. Flash solves a lot of problems, and Flex has a really nice UI toolkit. Flash 10 still hasn't fixed a lot of the performance issues, so the door is open for Unity or Silverlight, but I'm not holding my breath.

      • Re: (Score:3, Insightful)

        by NouberNou ( 1105915 )
        I completely agree... :( But we are stuck with it.

        Really though they are not that big. One is a graphing and reporting application, and another is a web interface for a CMS that we developed in house as a product.

        The first could have been done in Java, or a cross-platform C++ framework like Qt (though that would remove the selling point that it runs on the desktop and the browser), and the second could be done purely in JS, so there were alternatives, maybe more appropriate ones, but they were not taken
    • you use a janitor class or just a Dictionary to hold references to all of your objects so you can delete them and any listeners or timers or other objects that are not removed automatically. Google memory management for as3 and you should find a few good examples.

    • Re: (Score:3, Interesting)

      by gaspyy ( 514539 )

      I will say the exact opposite. We made a large enterprise application for a UK health insurer. All interface and logic was flash (not even Flex) with custom-built components. It was a lot better than the alternatives (the initial plan was to use ASPX for the interface). It was nice and fast too (the bottlenecks were on the server). By my last count there were over 200K lines of AS code.

      I also made a chess game [flashchess3.com] in AS3. It's not Deep Blue but after optimizations it's fast enough to have fun with (and strong e

    • Re: (Score:3, Interesting)

      by YAN3D ( 552691 )
      We had a similar experience with Flex 2/3. Flash would hold onto objects through invisible references that were almost impossible to track down and release. We even went so far as setting all object properties for all objects to null before unloaded, and still nothing. It got so bad at one point that each user click increased memory usage by 10mb without ever returning it. This problem occurred both with our own custom code and with the base components provided by Adobe/Flex. This leads me to believe that
  • 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 othe
    • Porting the compiler is only part of the problem; you also have to port the run-time environment, which is even more work. I think the reason everybody thinks Android's Java sucks is that it is not compatible with J2EE, so Java apps written for other platforms may need to be rewritten for the new libraries. While I think being able to compile any language down to bytecode is great for portability, I still don't understand why we need so many different Virtual Machine implementations. JVM, Flash, Parrot VM..
      • You can get dedicated CPUs for Java. They aren't exactly taking the desktop by storm; but there are some creeping in at the low end for things like hardware acceleration of cellphone apps, and at the high end for Big Serious Enterprise Java. I assume the performance is good enough to make it worthwhile in power constrained or very high load situations; but I'm guessing JVM on x86 isn't threatened anytime soon.

        http://en.wikipedia.org/wiki/Java_processor [wikipedia.org]
      • the runtime environment for Android is written in C++ anyway, well the underlying libraries are. Most of the problems for Android seem to be a lack of a C++ development environment for people coming from Symbian and/or Linux who have existing code they want to port/re-use.

        The reason we have so many different VMs is because of licensing. IIRC Sun's 'open' java licence doesn't apply to the one used in mobile devices. We do have a decent common 'VM' ... its Linux. If you code for a linux implementation, you'll

  • why... (Score:3, Insightful)

    by Vexorian ( 959249 ) on Wednesday November 19, 2008 @08:40PM (#25827383)
    Righty...

    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.

  • 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 [adobe.com] bug?
  • 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.
  • by mgiuca ( 1040724 ) on Thursday November 20, 2008 @08:35AM (#25831293)

    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!

    • Re: (Score:3, Funny)

      by drspliff ( 652992 )

      Are you sure you don't want to port Bochs first so you can run Java on Windows 98 in your Flash?

Decaffeinated coffee? Just Say No.

Working...