Sign in to follow this  
clb

Compile C++ to JavaScript for Web Pages from Visual Studio?

Recommended Posts

Hi,

I think some people here might be interested to know about my latest project, called [b]vs-tool[/b]. It is a plugin for Visual Studio 2010 which enables the integration of external compiler/linker toolchains into VS. The hard work was done by Gavin Pugh, the author of [url="http://code.google.com/p/vs-android/"]vs-android[/url], who developed a MSBuild task plugin to allow invoking GCC from VS. For vs-tool, the following toolchains are now supported:

- Build with MinGW: [url="http://dl.dropbox.com/u/40949268/code/vs-mingw.png"]http://dl.dropbox.co...de/vs-mingw.png[/url]

Allows building Windows applications if you have installed the MinGW compiler.

- Build with llvm-clang: [url="http://dl.dropbox.com/u/40949268/code/vs-clang.png"]http://dl.dropbox.co...de/vs-clang.png[/url]

Allows compiling with the clang compiler. Note however, that clang does not yet fully support building windows applications, but I have tested that simple hello world code at least builds and runs ok.

- Build with Emscripten: [url="http://dl.dropbox.com/u/40949268/code/vs-emcc.png"]http://dl.dropbox.co...ode/vs-emcc.png[/url]

Emscripten is a wonderfully geeky and absurd project, where LLVM bytecode is translated into executable .js for the web. This means one can compile C++ code directly into .js. The project is developed by Alon Zakai from Mozilla, find the homepage at [url="https://github.com/kripken/emscripten/wiki"]https://github.com/k...emscripten/wiki[/url] , and a technical paper at [url="https://raw.github.com/kripken/emscripten/master/docs/paper.pdf"]https://raw.github.c.../docs/paper.pdf[/url] . The main motivation that had me start building vs-tool was to add support for Emscripten directly into Visual Studio, which is now working quite nicely (adding MinGW and Clang support was a bit of a side tour). Rather insanely, Emscripten supports translating GLES2 code directly into WebGL code, which allows me to work on converting my Android GLES2 engine directly for the web, from Visual Studio! This is so hackish, insane, fun, and crazy, at the same time.

The homepage for vs-tool is at github: [url="https://github.com/juj/vs-tool"]https://github.com/juj/vs-tool[/url]

If you give it a go, let me know how it goes!

Share this post


Link to post
Share on other sites
Sign in to follow this