Live data from Hacker News

New C# to Javascript compiler released

erik-kallen.se

11–20 of 81 posts

Re: New C# to Javascript compiler released

#11
post #2

The very best of luck when it comes to debugging the code when it is running in the browser. Maybe your experiences are different to mine but I avoid such abstractions wherever possible. It has become fashionable to say things like "JavaScript ... is not well suited for developing large systems" - indeed so much so it often passes without comment but when it is JavaScript that will be run by the browser then JavaScri…

Maybe that's where source maps come handy?

http://www.html5rocks.com/en/tutorials/developertools/source...

Re: New C# to Javascript compiler released

#12
post #6
post #2

The very best of luck when it comes to debugging the code when it is running in the browser. Maybe your experiences are different to mine but I avoid such abstractions wherever possible. It has become fashionable to say things like "JavaScript ... is not well suited for developing large systems" - indeed so much so it often passes without comment but when it is JavaScript that will be run by the browser then JavaScri…

"... but when it is JavaScript that will be run by the browser then JavaScript is what you should be writing." So by that logic, one shouldn't be writing C# that targets the CLR either, but should rather be coding in MSIL directly. Mmm, no thanks!

Come on, we all know that isn't a logical equality.

Re: New C# to Javascript compiler released

#13
post #9

Earlier quoted context omitted.

Actually, debugging is quite simple. The generated script (unless minified) is very similar to the input code. Are you also against other options such as CoffeeScript? And do you think it is very hard to debug higher-level languages such as C, C# or Java because "if you are writing code to run on a processor, it is assembly you should be writing"?

The question is how similar? Coffeescript has come a long way in keeping symbols similar enough to be debuggable and not polluting the javascript namespace. Once the code grows to a certain size, tracing from line number in error to a line of code in your source becomes non-trivial. Also, since this has been a constant pain for me when using Google Closure compiler, how do you anticipate this tool working with existi…

It comes with metadata for jQuery and jQueryUI, so obviously those libs can be used. I know of people using Node as well (and I hope to include that import lib in the distribution at some point).

As for porting an existing C# application, it will probably not be trivial, but the back-end stuff is most likely possible (as long as it doesn't have external references). Personally, for my own stuff I tend to compile stuff like DTOs and helpers to both Javascript (running on the client) and regular MSIL (running on the server), but that code has been written with this intent from the beginning.

I prefer to regard working with this to be writing Javascript but with tooling from 2012 instead of 1995.

Re: New C# to Javascript compiler released

#16
post #2

The very best of luck when it comes to debugging the code when it is running in the browser. Maybe your experiences are different to mine but I avoid such abstractions wherever possible. It has become fashionable to say things like "JavaScript ... is not well suited for developing large systems" - indeed so much so it often passes without comment but when it is JavaScript that will be run by the browser then JavaScri…

I don't see the problem.

- If I had written Javascript, I would have to debug the Javascript that is running in the browser.

- If a tool writes Javascript for me, I have to debug Javascript running in the browser.

A better wish would be: I hope that your tool outputs nicely formatted and easy to debug Javascript.

Re: New C# to Javascript compiler released

#17
post #12
post #6

Earlier quoted context omitted.

"... but when it is JavaScript that will be run by the browser then JavaScript is what you should be writing." So by that logic, one shouldn't be writing C# that targets the CLR either, but should rather be coding in MSIL directly. Mmm, no thanks!

Come on, we all know that isn't a logical equality.

Once the debugging tools are able to keep everything abstracted then you no longer need to dig down. Example is of course writing assembly.

Re: New C# to Javascript compiler released

#19
post #12
post #6

Earlier quoted context omitted.

"... but when it is JavaScript that will be run by the browser then JavaScript is what you should be writing." So by that logic, one shouldn't be writing C# that targets the CLR either, but should rather be coding in MSIL directly. Mmm, no thanks!

Come on, we all know that isn't a logical equality.

Yeah there's no logical equality to machine code and C++ but still people use debuggers. I don't think this is something that cannot be solved.
Post reply on HN