C/C++ on Adobe Flash

via DDJAdobe Alchemy

농담이 아니라, Adobe Flash Player 위에서 (물론 정확히는 Adobe VM 이지만) C/C++ 로 작성된 코드가 동작하게 하는 툴인 Alchemy 가 release preview로 나왔다. DDJ에 나온 내용을 따오자면,

Alchemy, which can be downloaded here is primarily intended to be used with C/C++ libraries that have few operating system dependencies. Targeting computation-intensive use cases, such as audio/video transcoding, data manipulation, XML parsing, cryptographic functions or physics simulation, performance can be considerably faster than ActionScript 3.0 and anywhere from 2-10x slower than native C/C++ code. Alchemy is not intended for general development of SWF applications using C/C++.

C/C++ 코드를 ActionScript 3.0 기반의 바이트 코드(?)로 컴파일 해주며, 계산량이 많은 응용 — video/audio 라거나 — 등에 사용할 목적인듯하다. 당연히 Flash Player의 샌드박스를 따라가며 + native C/C++ 보다 느리다. 그렇지만 현재 엄청난 양이 존재하는 C/C++ 코드 베이스를 쓸 수 있다는 점에서는 상당히 고무적이다. (특히 계산량이 많은 쪽은 죄다)

Flash/ActionScript 의 속도 혹은 JS 틱한 semanitc에 괴로워했던 사람들(rein 본인이라거나)에겐 꽤나 희소식인듯 싶다.

각설하고, Alchemy를 다운로드해서 열어보니 linux 기준으로는 대략,

  • 일련의 라이브러리와
  • 일련의 C/C++ 헤더와
  • Flash 라이브러리
  • GCC toolchain을 Alchemy의 그걸로 적당히 치환하는 유틸들

을 가지고 있다.

다만 ActionScript 3.0이기도 하고, 사실상 현재로썬 experimental/unstable한 영역이라 Flash Player 10 / Adobe Air 1.5 에서만 구동 가능하다. 그리고 GCC 툴체인을 쓰기 때문에 linux/MacOSX에서는 그냥 되지만 Win32 환경에서는 cygwin이 필요하긴하다(…).