Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Microsoft's GWT solution for .NET? [closed]

I like GWT but I prefer to use ASP.NET MVC for my projects, however, these two are not integrated and require me to write my code in two different platforms and two languages. Does Microsoft have any solutions comparable to GWT for compiling C# into JavaScript? I know there is Script# which is not supported by MS and the Volta project which was killed after its preview, but I was wondering if there is any good solutions available now or at least some good open source project that can integrate ASP.NET with GWT. Thanks.

like image 593
orad Avatar asked Apr 18 '11 04:04

orad


3 Answers

Well, I can tell you what my preferred stack looks like these days. To me it is a nice balance of established tech with flexibility, though keep in mind I use this mostly to build single-page ajax "apps", not for the traditional collection of pages.

  • Sharp UI (full disclosure: this is one of my open source projects)
  • Script#
  • jQuery
  • I use a tool I wrote internally for generating "packet" classes shared by WCF and Script#.
  • WCF (in JSON)
  • ASP.NET (either Webforms or MVC)

I get compile-time type checking from Script#, UI control encapsulation from Sharp UI, fairly easy to maintain JSON service endpoints through WCF and my code generation tool, and ASP.NET for misc or traditional web pages. I'm firing on all 8 cylinders with this setup.

like image 78
DuckMaestro Avatar answered Nov 20 '22 12:11

DuckMaestro


Bridge.NET is in this space. It describes itself as:

Open Source C# to JavaScript Compiler and Frameworks. Run Your App On Any Device Using JavaScript.

The Microsoft driven solution is TypeScript which is a separate language made with input from the lead architect of C#, Anders Hejlsberg. It is also open source.

like image 36
Yishai Avatar answered Nov 20 '22 13:11

Yishai


Good suggestion, but as AFAIK there is absolutely nothing like GWT in the .Net world.

I'm a Java and .Net programmer. I've battled infrequently with javascript for about 3 years, and never become comfortable with it. Since adopting GWT I'm producing Javascript=based web pages but coding in Java - I absolutely adore it ;-)

There's no great reason why there can't be a .Net equivalant of GWT. GWT doesn't do a 'literal copy' of Java to produce the Javascript - so it doesn't rely on the two languages having a 'similar' grammer. Any language could be converted. Mind you, it would take a lot of effort to duplicate the analysis and optimisation performed by the GWT compiler in producing it's js files.

A more effective route may be to find a C# to Java converter, and then pass the output to GWT.

like image 4
ianmayo Avatar answered Nov 20 '22 12:11

ianmayo