none
Can i use javascript language to create .net assembly instead of C# or VB RRS feed

  • Question

  • Can i use javascript language to create .net assembly(dll) instead of C# or VB.

    So that this dll can be used for all platforms Windows Forms/ASP.NET/WPF/Silverlight/MVC/WinRT....

    It is ok if i have multiple dlls for each platform, but i need to compile against a single source code.


    - Jegan




    • Edited by Jegan Ravi Saturday, February 23, 2013 5:30 AM
    Saturday, February 23, 2013 4:38 AM

Answers

  • Hi Jegan,

    JavaScript is a script language and as that it cannot be compiled into an assembly out-of-the-box (and most of the time you don't want to do that). There are some third party tools (like Jurassic, a JavaScript Compiler for .NET) which could do the job, but I haven't tried any of them. Is there a reason why you don't want to use one of the standard .NET languages as C# or VB? Also remember that not every assembly/code build/written with C# will run on all of your mentioned platforms (in my opinion it is not possible to write a single source code for all of these platforms).


    Best Regards. When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. This helps us build a healthy and positive community.

    @Horizon_Net | Blog

    Saturday, February 23, 2013 5:26 PM

All replies

  • Hi Jegan,

    JavaScript is a script language and as that it cannot be compiled into an assembly out-of-the-box (and most of the time you don't want to do that). There are some third party tools (like Jurassic, a JavaScript Compiler for .NET) which could do the job, but I haven't tried any of them. Is there a reason why you don't want to use one of the standard .NET languages as C# or VB? Also remember that not every assembly/code build/written with C# will run on all of your mentioned platforms (in my opinion it is not possible to write a single source code for all of these platforms).


    Best Regards. When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. This helps us build a healthy and positive community.

    @Horizon_Net | Blog

    Saturday, February 23, 2013 5:26 PM
  • Sorry for such a stupid question, just to find if there is a way.

    Even if there is way I may or may not use such things.

    I would like to write a library that have some basis mathematical calculations, layout algorithms and string handling, etc. This library requires just basic things were all the framework will support.

    For now I can use 2 copies of a source code,

    1.       java scripts which can be used in client side ASP.NET, MVC and in WinRT.
    2.       C# code for WF, WPF, SL, WinRT

    So far I am working with C# based platforms and almost never in javascript.

    WinRT app can be written in both the way (C#, script) which attracts me. But I have not tried script part yet.

    I would love to have a single source code (no matter what the language is).


    - Jegan


    • Edited by Jegan Ravi Sunday, February 24, 2013 2:26 PM
    Sunday, February 24, 2013 2:21 PM
  • That's not a stupid question. If you want to have a single source code you should try C#. I don't know if it will fit all your cases and platforms, but the code for ASP.NET, MVC and WinRT could be written in it. Normally you have to go with the smallest common factor, but I would guess that you will need specific implementations for some of the platforms.

    Best Regards. When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. This helps us build a healthy and positive community.

    @Horizon_Net | Blog

    Sunday, February 24, 2013 5:09 PM