There's an interesting little project out there in beta now called DuoCode that is basically a transpiler (though they wrongly dub it a cross-compiler) from C# to JavaScript. It provides a projection of the browser DOM into the C# world so that when the resulting JavaScript is executed, the normal DOM interactions can occur.


I think that people who haven't learned yet how to write modular or object-oriented JavaScript, but who are fluent in C#, will appreciate a tool like this. But this is a commercial tool with as-yet unspecified pricing, which will certainly dampen enthusiasm.

I've tried other transpilers such as CoffeeScript, and I can't say that I'm really a fan of them, especially when the two languages in question are very similar. I do very much like the idea of simpler syntax and "sugar" that transpiled languages offer, but I find that there's a cognitive overhead that I can't get away from.

This cognitive overhead occurs because in my head I'm aware of the syntax of both languages and I'm often "mentally transpiling" and thinking about what the output will be when I write the to-be-transpiled code.

So when it comes to JavaScript and transpiling to it from CoffeeScript or C#, my take is that it is better to just learn and use the JavaScript syntax itself.