The lack of benchmarks comparing Mono to the CLR (C# VM) is very frustrating. Apparently, the lack of benchmarks is due to Microsoft's license forbidding the publication of benchmarks without Microsoft's permission (common practice among commercial vendors?).
Fortunately, we have the Benchmarks Game and that shows Mono performing well [on synthetic benchmarks...] when compared to a variety of languages.
We have included Mono in our Framework Benchmarks project for some rounds now. However, we have recently set up a new hardware environment and we're not having any luck getting Mono installed on that environment [1]. It's simply not installing correctly for us. We're not Mono experts, so we're probably doing something wrong.
If anyone is interested in lending a hand, we'd appreciate it since we'd like for the Mono tests remain in Round 9. Thanks!
Thanks. It took a little while to find, but if anyone is interested in comparing Mono to the CLR for themselves (and likely do some work to adapt the system to Windows), here's where to start: http://benchmarksgame.alioth.debian.org/play.php#languagex
I think if you run a recent Mono, with the sgen GC using the LLVM backend and turn off array bounds-checking performance is supposed to be pretty impressive. (I recall Miguel saying within 10-20% of C++).
Having said that, I've had no performance issues running 3.2 on Linux in general.
I seem to remember that changed; and for a couple of years the benchmarks game did provide measurements for C# F# (.Net and Mono) and Java on MS Vista.
MVC5 still not working tho. Good thing we have Nancy.
Edit: Seems like many do not know about Nancy, check it out, some even say it's better than MVC. The good side is that it's 100% compatible with Mono because they run tests against it too so you can host your C# websites on Linux.
no it's not. it's a .NET clone of sinatra. it's a web framework. it has little to nothing to do with node.js. although .net have pretty powerful multiprocessing and async routines, and can therefore be connected to node.js without too much effort.
This works on Fedora and probably other distributions as well, though this uses HTTP which might be less optimal than FastCGI with Fos. I got Fos to compile with Mono but it's not usable yet, it can't find IAppBuilder in my "console" application no matter what references or using directives I add. Nowin compiles cleanly but the example projects don't, so it'll take some effort to get it to work. Things are progressing, though. But I really can't recommend anyone use Mono for web development as it stands.
Nancy, like Sinatra, is a general-purpose web framework. You could implement an API in it, or you could implement a user-facing website.
Nancy and Sinatra are typically used for smaller sites. They're based around routes, controllers, and views but they don't (for better or worse) lock you into an MVC project structure like ASP.Net MVC or Rails.
Web API, by comparison, is pretty much "just for implementing a web-based API" and not something you'd want to use for a user-facing web application that serves up HTML pages.
There's nothing in node.js that you can't get with .NET/Mono except for JavaScript, and even if you must run JS for some reason there are some solutions (like IronJS).
Entity Framework is really not a good excuse. .NET has lots of great things going for it. Entity Framework is firmly on the "enterprise .NET" list of such items though.
.NET has always been able to do what Node does anyway. It has had HttpListener since v1.0...
Think you'll be getting a shock in a couple of years if you think the EF is enterprise. It's changed massively and coding without it is becoming a little like coding javqscript without jQuery.
You can do it, but why bother writing all those crud operations yourself??
Even with complicated SQL you can hand roll it and then tell the EF which class you're.returning and it'll handle all the boring `rs.GetInt(rs.GetOrdinal("ID"))` crap.
I think that the LINQ integration with EF is nice.. but EF in and of itself isn't all that great imho... Most of what it does is generate types to correspond to your database tables.
When you use a language with real variable types, it's less of an issue... If you really want it, you could shoehorn generators and other db platforms into the hyena[1] package.
In general, I've found that using databases tend to be much more straight forward under node, and that using ORM tools are less necessary.
When you use dynamic, you lose the biggest advantage of C# in general, intellisense in VS. Don't get me wrong, it can be great to use dynamic at times... I just feel you're losing the advantage that VS/C# give you when you do, so you may as well be using something else. (I like node.js)
It may run but it won't compile. I'm no fan of Gentoo, but if it's open source I ought to be able to reproduce the binary with those sources.
Edit: An open source program must never depend on binaries in the build process where those binaries can't themselves be rebuilt from source. Again, I'm not a zealot but as a developer I see dependencies on arbitrary binaries as damage and try to work around them.
It's the 'Dynamic Dictionary' [0]. It's usually called 'parameters' but it's idiomatic in dotnet to name lambda input parameter '_' if don't use it in your expression.
As others have said, it's idiomatic to name a lambda param "_" if you're not using it.
To perhaps clarify a bit, here's what the Hello World example would look like if we added a second route that uses the lambda parameter, and a third route that does something else, and a fourth route that renders a view template.
public SampleModule() {
Get["/"] = _ => "Hello World!";
Get["/hello/{name}"] = p => ("Hello, " + p.name + "!");
Get["/something-complicated"] = _ => {
// complicated stuff happens here
return "OK... we're all done";
};
// A variety of template engines are supported
Get["/my-resume"] = _ => View["resume.cshtml"];
}
I tried Mono a few months ago because I was thinking of writing cross-platform (ish) desktop GUI application.
My dev platform is Ubuntu so I downloaded MonoDevelop and load the GtkSharp example (or maybe it was just the skeleton project template). Hit compile, bunch of errors showed up. Apparently I don't have the GTK libraries. Googled a bit, it looks like I had to download gtk-dev, compile, and do a bunch of things before I can run a "Hello, World" GTK sharp app.
I wade through the net and the tutorials and documentations are either for older versions or just weren't there (for example, integrating with NuGet).
It's a bit sad because I'm sure there are tons of engineering effort went into Mono but it just doesn't feel polished enough.
It's open source but lately I felt that it's more of a teaser for Xamarin than anything else.
That sounds like the kind of growing pains experienced when you set up any new largish development environment. If we're up and running with ecosystem X, we forget how much work it took to get there, because it was amortized over time. When we start out with a new ecosystem Y, we spend a lot of time in the steep part of the learning curve before reaching Hello World. Java is, IMHO, the worst for this.
Just curious, I've never installed Mono, but my first thought would have been to look for a PPA. Are there none out there? Let someone else figure out the dependencies and configs for you.
An IDE should aim to pass a simple UX test which is: after installing the IDE with no prerequisites and no further configuration (no I don't want to create an env var, specify where I keep my compiler or ...), a hello world program should be possible to run straight away.
If only more people thought like this then I wouldn't be looked at funny when calling my Emacs an IDE. Instead I have some 90% of PyCharm functionality (+ Org Mode), but I constantly hear that it doesn't count because "I had to configure all these plugins" and so on...
And last time I checked VS installed everything it needed to run by itself - it didn't even ask if I want it IIRC. Dunno about Eclipse.
Eclipse and IntelliJ don't come with the compiler, probably due to licensing.
Also keep in mind that VS only works in Windows, not as cross platform as these two. Installing for Single-Family-OS (Windows...) vs different OSes => different complexity.
Which is why I think that IDE makers that don't make their language are at a disadvantage (that they should try to work around), and language makers that don't provide an IDE don't take full advantage of their situation. A language/platform without a good dev experience is just not complete. The dev experience is a huge part of what a lang/platform does, and should influence design decisions at every level, i.e. "do we have all the debugging/hot-deploy/profiling entry points in place", or "could this grammar be better for providing autocomplete in invalid synax"?
As for java IDE's: it can't be rocket science to detect & use existing java installations in a good way, or even download & install them in the background (even with licensing issues).
> what's the recent version of Java that should be installed?
The latest one? The most common one? The one the IDE requires?
Surely you don't want to use an older one? Even if you deploy to an older target, if you can't do that from a newer one something is wrong. Worse case the IDE could just ask during installation.
If the IDE setup isn't made by monkeys, suerely it wouldn't rely on a hard-coded download url. They would serve it themselves or ask a web service on their end for the URL to the java installer. Sorry if I sound like a grumpy old man, but it's exactly this sort of thinkning that makes OSS platforms and IDE's so clumsy to work with.
The error is usually the idea of "this tool just tries to do X and doesn't care about Y", or sometimes phrased as "the tool does one thing, and does it well". While that is a noble idea, it should never be used as an excuse for a crappy UX.
I believe Eclipse and IntelliJ do detect & use existing (default) Java installations, just can't download&install them in the background (plus there might be complication in doing so: what's the recent version of Java that should be installed? can we guaranteed Oracle won't break the URL, etc etc).
It's not a text editor, it's the whole experience. I never even want to worry about where libraries are or where the compiler executables are. I just want to edit and run code. If the compiler comes with libraries, debugger and editor, or if the IDE comes with libraries and compiler doesn't matter. I want the matlab experience, not the gcc experience.
Example: A java IDE that can't set up java automatically for me (OR detect/configure an existing install without my intervention) is disappointing.
While it is disappointing if it doesn't have a single setup experience, they should at least try to locate & use an existing install without the user having to specify a path on disk or an env-var for example. Two installs but no gluing is at least acceptable.
Fedora isn't much better, Monodevelop is stuck at 2.8.8.4 even. Luckily there's an OpenSUSE repository mentioned elsewhere in this discussion which has CentOS/Debian/Fedora/Ubuntu in it as well.
You'll still have to install them, but it won't be a pain in the ass. The default mono package assumes you want everything, you want the latest version, and you don't want to spend an hour finding packages.
>My dev platform is Ubuntu so I downloaded MonoDevelop and load the GtkSharp example (or maybe it was just the skeleton project template). Hit compile, bunch of errors showed up. Apparently I don't have the GTK libraries. Googled a bit, it looks like I had to download gtk-dev, compile, and do a bunch of things before I can run a "Hello, World" GTK sharp app.
Well, that's how it works on Linux. What else did you expect? That they'd bundle all the Gtk stuff statically?
I am still so frustrated that Mono got lambasted for being a M$ trap. It was the biggest FUD I have ever read. Hope to see mono return to use in Linux community again.
The nix world never suffered from lack of decent languages, compilers, development tools, ecosystems and runtimes. The only benefit Mono gives nix users is to write software that's easy to run on Windows and that barely registers on most priority lists. It's been, IIRC, 6 years since I last wrote a "real" desktop app. I did it in C#, but Mono couldn't run it because it relied on Windows-only GUI components. Happily, it was never intended to be deployed on non-Windows environments and everyone was happy.
If I needed to write a desktop application (that's so 90's) that runs identically on both Windows and Linux, I'll just write it in Java.
I wonder how much of the mobile market cross-platform toolkits have. I've used Titanium, but only for exceedingly simple apps. Anything else is done with the native tools. I know there are apps that require complex device-side logic but, most of the time (at least for me), almost all of the logic runs on a server and all that's left is user interface management.
Agreed, it was disappointing. There were some trust issues surrounding Mono but also an excessive amount of hyperbole.
A real shame, as Mono is great technology with good GTK bindings and integrated well with the GNOME system. I think having Mono as a first-class GNOME environment would have been interesting.
I've spent the past week using Monodevelop and F# to develop compiler tools under Fedora and have thoroughly enjoyed it. Not to mention F# is well supported within IDE, almost equal to VS.
I'm a lot less optimist, I think it will just focus Mono development on the mobile platforms (Xamarin on Android/iOS) but will do nothing good for desktop or server use.
How is that a reasonable conclusion? Microsoft has a new CEO. It's an unpredictable situation where anything could happen. Betting your business on perceived, not even openly stated, marketing suggestions at this time seems overly risky.
So baking in Xamarin as a compile target in Visual Studio. Conciously changing their licensing terms of various BCL NuGet packages to allow their unrestricted use on Xamarin/Mono platforms... yeah, there's clearly no hints at all as to what they're up to.
The idea of package management is more than "easy to install once". It's also "easy to keep up to date". For example, apt-get update; apt-get dist-upgrade and I just updated my packaged mono vs having to go find that there was a tagged update, then rebuild, etc.
That might be, but how do you then make a source-package of your program that compiles and installs successfully on the target distributions that don't have an up-to-date mono toolchain? Because while a developer might follow upstream, users shouldn't have to...
It's actually quite a bit worse than that. For instance, I successfully built and installed mono locally now, but am unable to run simple gtk-applications.
git clone git://github.com/mono/mono.git mono.git
cd mono.git
./autogen.sh --prefix=${HOME}/opt
make get-monolite-latest # Need mono to compile mono
make EXTERNAL_MCS="${PWD}/mcs/class/lib/monolite/gmcs.exe"
make install
export PKG_CONFIG_PATH=${HOME}/opt
I can now successfully compile and run a command-line hello world, but
a simple gtk-test (and winforms test) fail when attempting to run the
examples. This probably has someting to do with linking and assemblies,
but experimenting with PKG_CONFIG_PATH, GAC_PATH and MONO_PATH makes no
apparent difference...
cat <<eof > hello.cs
using System;
public class HelloWorld {
static public void Main () { Console.WriteLine ("Hello Mono World!"); } }
eof
mcs hello.cs
mono hello.exe
> Hello Mono World!
cat<<eof > hello-gtk.cs
using Gtk; using System;
class HelloWorld {
static void Main () {
Application.Init();
Window w = new Window("Hello Mono World!");
w.Show();
Application.Run(); }}
eof
mcs hello-gtk.cs -pkg:gtk-sharp-2.0
mono hello-gtk.exe
> Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or
assembly 'gtk-sharp, (...)
That situation is now verging on the comical. Is it really so hard to cut a new deal with Xamarin? Even if they can only offer the new Mono version for paid users in Unity Pro, they need to do something.
If Unity go another major version still using Mono 2.6, they seriously risk losing ground among developers making CPU/memory-intensive games. Or even those concerned about optimizing for mobile platforms.
"If Unity go another major version still using Mono 2.6, they seriously risk losing ground among developers making CPU/memory-intensive games. Or even those concerned about optimizing for mobile platforms." - that would be great! I feel they desperately need some competition.
I recall reading somewhere that Unity wasn't going to upgrade its Mono framework until Mono 4.0. I can't find the link, so I'm hoping it was just a rumor.
There doesn't seem to be many reliable benchmarks available. I'm not sure why. Here is an in depth benchmark showing Mono lagging very heavily behind Microsoft, but I have no idea if the gap has widened or shrunk since then.
That article is 2.5 years old; Mono has gotten significantly better since Xamarin spun off from Novell, and much progress has been made in the last 18 months or so. It would be interesting to re-run those benchmarks with the latest version of Mono though.
AFAIK Microsoft's .NET runtime has also made significant improvements in the last 2.5 years, so as I said, it's just a thumb-suck as to whether the gap has changed. Maybe this will get someone interested in doing some comprehensive benchmarking...
In recent experiences, .NET runtime is faster in most situations, but sometimes Mono can be faster than .NET. It all depends on what you are doing. In extreme cases, .NET is usually ahead. You also have to account for the JIT time. It's after the JIT that should matter.
I'm trying to do that for a small community site but I find the documentation a bit lacking. I know I have to create a directory somewhere and write a web.config in XML but I'm still figuring out the rest. I may end up copying someones Github project and tearing it apart to see how things work in practice, or perhaps my RTFM skills are somewhat lacking lately. But if you'd ask me I'd say the widespread presumption all developers are running Visual Studio.NET with Nuget is part of why you haven't seen those success stories.
On the bright side, I've heard good things coming out of ServiceStack. Apparently it shines in the backend web service department and works well with Mono. It's based on ASP.NET and since the requirements for my little project are fairly minimal, I think it's a bit overkill there. But it's still worth checking out for more demanding projects, IMHO.
Fortunately, we have the Benchmarks Game and that shows Mono performing well [on synthetic benchmarks...] when compared to a variety of languages.
vs Java: http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
vs Go: http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
vs Python: http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...