I'm confused. C# doesn't even support global functions. In your example, it's a static private member of the AI class. Why is it wrong to generate
var AI = {
GetBestMove: function(....) { ... },
...
};
?Another thing, I had someone tell me once that according to Erik Meijer (of LINQ and Rx fame), years ago, Microsoft tried a C#-to-JS compiler too. It worked, but they had good reasons to drop the project anyway. Did you ever hear about that, do you know Microsoft's reasons for doing TypeScript instead? Are they still valid?