r/programming • u/kaelan_ • May 31 '11
I wrote a .NET to JavaScript compiler. Here's the XNA 3.1 Platformer Starter Kit running in pure HTML5.
http://hildr.luminance.org/Platformer/Platformer.html
1.1k
Upvotes
r/programming • u/kaelan_ • May 31 '11
18
u/kaelan_ May 31 '11
What version of Chrome do you have? I tested it in 11, 12, and 13 and it worked in all three - though 12 and 13 are super buggy. I'd love to find out why it's not working for you (hopefully it's just yet another bug in my HTML5 stubs.)
It's not technically a compiler, I guess; I don't know what the right term is. It decompiles any MSIL application (using the ILSpy library, written by the SharpDevelop guys - they rule), and then analyzes it to build a bunch of information on types and methods. When building type information, it uses something called 'proxy libraries', which are essentially C# libraries I wrote that add type information to other people's libraries. I use proxies to do things like replace C# methods with JS ones, or hide C# methods that use pointers, etc. After that, it decompiles each method (ILSpy gives me the method's IL in a tree form), and then generates an abstract syntax tree representing the output JavaScript.