Results 1 to 5 of 5

Thread: .NET and Mono

  1. #1
    Join Date
    May 2013
    Beans
    5

    .NET and Mono

    Hey guys. I'm here to ask how .NET and Mono works, the difference between those. They're developtment platform where i can program a app to run in a OS that has this framework? And what is the utility for this?!
    Last edited by Greenbald; May 24th, 2013 at 02:16 PM.

  2. #2
    Join Date
    Jun 2011
    Location
    Paris
    Beans
    55

    Re: .NET and Mono

    The difference between mono and .net is that .net contains the windows only CLR for C# and other .net languages. Mono is an implementation of the CLR that is multiplatform, but significantly slower than the .net CLR. You can develop programs for both using monodevelop. The utility of this is writing applications that easily and seamlessly work between multiple platforms with minimal loss in speed.

  3. #3
    Join Date
    Feb 2008
    Location
    readlink("/proc/self/exe"
    Beans
    1,120
    Distro
    Ubuntu Development Release

    Re: .NET and Mono

    Answer: Just like Java, just better
    .NET is a bytecode, just like Java.
    This means there is a VM to run the code.
    The compiler (mono-mcs) runs ontop the VM, which is why the compiler for C# is written in C#.

    Unlike Java, .NET is compiled, not interpreted, which means simple instructions it executes are actually translated to native code at compile-time.
    But that still means it calls into code that runs on the VM, and it uses garbage collection, which makes the whole things slower.
    Mainly, that means unlike Java, a .NET program doesn't take half an hour to startup.

    So for you that means as soon as you have the right version of the VM and the right version of the framework libraries installed, you can run .NET programs on Linux.
    The executables the mono-compiler creates are binary compatible to the ones the Visual Studio compiler creates, so you can run a .NET program on Linux (if it doesn't pinvoke the Windows API), and you can run a program written in mono on Windows (if it doesn't pinvoke the Linux/Xorg API).

    You can install the mono runtime by doing
    Code:
    apt-get install mono-complete
    And you can start creating .NET programs on Linux with monodevelop
    Code:
    apt-get install monodevelop

    you can start your .NET programs with
    Code:
    mono /path/to/your/executable.exe
    You should use C# on Linux, because VB.NET is a bit of a 2nd class citizen.
    You can create a console program with monodevelop, and then you can use any C# tutorial you'd like.


    Windows forms is a bit lacking, but you can write programs with GTK# and use Glade to design the UI.
    I would not do that, I would look into web application, like ASP.NET MVC3 or MVC4, which is something you can also do with mono.
    You start the mono webserver (xsp4) and let it serve your webpages.
    Last edited by WitchCraft; May 24th, 2013 at 10:48 PM.
    In a world without walls and fences, who needs Windows and Gates?
    Linux is like a wigwam.... no Gates, no Windows but Apache inside!
    http://www.debianadmin.com
    apt-get install libstdc++6-4.3-doc

  4. #4
    Join Date
    Apr 2012
    Beans
    211
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: .NET and Mono

    The compiler for c# shouldn't have been written in c#. Both java and .net are compiled, but not linked

  5. #5
    Join Date
    Jun 2011
    Location
    Paris
    Beans
    55

    Re: .NET and Mono

    Unlike Java, .NET is compiled, not interpreted, which means simple instructions it executes are actually translated to native code at compile-time.
    Both the CLR and the JVM interpret bytecode, and both use a JIT compiler to convert their bytecode into native code. You can read more on JIT here: http://en.wikipedia.org/wiki/Just-in-time_compilation

    The reason for the slow startup of the JVM is how heavyweight the standard library is and the lack of modularisation of said library. Project jigsaw has shown significant reductions in jvm load time and initial memory reductions. You can read more on it here: http://mreinhold.org/blog/modular-java-platform

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •