sq / JSIL

CIL to Javascript Compiler
http://jsil.org/
Other
1.73k stars 241 forks source link

Comparison with il2js #1003

Open danroth27 opened 8 years ago

danroth27 commented 8 years ago

How does this project compare with the approach taken by il2js? Pros/cons?

slang25 commented 8 years ago

Came here to ask the same question. IL2JS has 3 commits since it was pushed to github in 2012, that can't be healthy.

danroth27 commented 8 years ago

@slang25 Well, IL2JS was a multi-year project at Microsoft, so it did get a substantial amount of investment before it was abandoned and open sourced.

Personally, I think getting .NET code to run in the browser deserves another look. Browsers and getting more and more powerful, but the friction between writing your server code with one platform and writing your browser logic in a completely different platform is just too high.

@mshields822 @mattpodwysocki I know it's been a few years, but do you guys have any thought that you could share with us on the differences between what IL2JS was trying to do and the approach taken by JSIL? Do you have any thoughts on how you might evolve your approach given your learnings from IL2JS and modern trends?

iskiselev commented 8 years ago

It's also interesting to compare us with http://bridge.net/, http://duoco.de/, http://www.cshtml5.com, http://sharpkit.net/. There is comparison table at https://monohtml5.wordpress.com/2014/06/09/monohtml5-what-are-the-existing-projects-in-this-area/, but it really only gives links to existing projects. It would be great if somebody that works with at least 2 of them make some comparison - main difficult here, there are not so many people that have worked with more than one.

danroth27 commented 8 years ago

@iskiselev Thanks for sharing those links!

I've looked a bit at the C# to JS transpilers (like bridge.net and duocode), but one of my requirements is I want to be able to reuse an existing .NET binary. The transpilers seem to require that everything in your project is C#, which really limits reuse. I have wondered though if you could just decompile the binaries you reference so that you could transpile them to JS. Not sure if that would actually work.

wizzard0 commented 8 years ago

@iskiselev surprisingly, bridge.net is able to compile most of my ArraySegment examples which were showstoppers for JSIL usage. I thought it would struggle with structs, but apart from explicit interface implementations, it all works.

ghost commented 8 years ago

It looks like http://www.cshtml5.com/ is actually using JSIL in their commercial product. To me, it looks like the only two relevant projects of this type are JSIL and Bridge.Net. Happily, both are open-source.

But JSIL has the clear advantage of being able to decompile existing assemblies. Additionally, JSIL's core libraries are much more extensive than Bridge.NET, which seems to be just targeting the browser from C# code.

JSIL aims to be able to turn existing apps into JS (and is succeeding), but Bridge.NET is aiming to let you write new C# code to run in the browser.

If you're porting anything that makes heavy use of built-in types, you're probably better off with JSIL. That's just my opinion.