Earlier quoted context omitted.
Maybe that's where source maps come handy? http://www.html5rocks.com/en/tutorials/developertools/source...
This sounds like a solution to a problem that probably shouldn't exist because there is a solution that shouldn't exist to start with which has caused a problem that doesn't need to occur. The slightly overbearing complexity of the solution matches the linguistic complexity of the statement above :)
New C# to Javascript compiler released
71–80 of 81 posts
Re: New C# to Javascript compiler released
#72Given decent source maps to allow debugging through the original code, I don't think solutions like this are terribly different than native Javascript. The primary difference though is that I trust the browser JS interpreters and VMs more than I trust many X->JS compilers.
Re: New C# to Javascript compiler released
#73Earlier quoted context omitted.
JSIL is also great, but its philosophy is that yo write .net code and run it in the browser, whereas Saltarelle's (and Script#'s) is that you write Javascript but with better tools. Also, the script that JSIL generates is very far from what you would write by hand, whereas that generated by Saltarelle/Script# can be distinguished from hand-written script primarily because the indentation is always correct and there i…
Could you not somehow reuse the JSIL code generator, and add things for the approach you took in Saltarelle (good integration with JQuery etc.)? Another question, did you do any performance comparisons of Saltarelle? (to normal C# builds, to JSIL, or anything else?)
Re: New C# to Javascript compiler released
#74Earlier quoted context omitted.
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.
But it will not write JavaScript the way you would write it - and (avoiding arguments about personality in code) that JavaScript will be way harder to follow and debug.
Re: New C# to Javascript compiler released
#75Earlier quoted context omitted.
Could you not somehow reuse the JSIL code generator, and add things for the approach you took in Saltarelle (good integration with JQuery etc.)? Another question, did you do any performance comparisons of Saltarelle? (to normal C# builds, to JSIL, or anything else?)
I think the tools fill different purposes, so integration with JSIL is absolutely a possibility in the future. I did not do any speed comparisons, I just translate what you write in C# to the equivalent script, so if you write a fast script it will be fast, if you write a slow script, it will be slow :)
Re: New C# to Javascript compiler released
#76As I see the author reads these comments, I'd just like to add that this makes me very excited. C# is my favourite language by far, combining some of the most powerful (mainstream) language features with some of the most powerful dev tools out there. Having the ability to run the same code in the browser and on the server, in C# , is really a big thing for me. I think the debugging problem stated in many comments her…
Re: New C# to Javascript compiler released
#77Re: New C# to Javascript compiler released
#78Earlier quoted context omitted.
This sounds like a solution to a problem that probably shouldn't exist because there is a solution that shouldn't exist to start with which has caused a problem that doesn't need to occur. The slightly overbearing complexity of the solution matches the linguistic complexity of the statement above :)
I don't see how these are significantly different than .PDBs which allow Windows developers to step through their source code when debugging compiled binaries.
Process: C# --(compiler)--> Js --(parser)--> IL --(compiler)--> machine code/interpreter.
Type conversions: Static --> dynamic --> static --> none.
That's just too much to go wrong in my mind. I wouldn't touch it with a barge pole.
Re: New C# to Javascript compiler released
#79Looks impressive! I'm curious how you're doing the parsing. I see that you reference both NRefactory (which reads C#) and Cecil (which reads IL) -- can you talk about how are each of these used and how you combine them? Also, did you consider using Roslyn (Microsoft's official C# parser)? Obviously it's still beta, but once it's complete would it remove the need for Cecil and NRefactory completely?
Re: New C# to Javascript compiler released
#80Earlier quoted context omitted.
I hear you, but I can't agree. Maybe it's my background. For 13 years as a professional developer my primary languages were Perl and Javascript, using Vim and the Unix command-line as my IDE. For the past 1.5 years I've swapped C# for Perl and Visual Studio for my IDE (still have a vi emulator though.) Intellisense is definitely useful, but I find it gets in the way a lot... both literally by overlapping the code aro…
For statically typing Javascript, I strongly recommend Google's Closure toolset- it uses JS comments to statically type and validate your code, plus you can either run it compiled or uncompiled. https://developers.google.com/closure/ There are no editors that give you the nice intellisense bells and whistles, but static typing is by far the most important for me.
Here is a nice side project, static typed coffee script, with eclipse IDE support...
I really don't want to go back to GWT or move to Dart...
Scala's Javascript DSL is another hope I have, but it's still under development