Slashdot Mirror


Creating .NET C# Applications for Linux

An anonymous reader wrote to mention an article on the IBM site entitled Mono brings .Net Apps to Linux. From the article: "Mono gives open source developers the programming power and flexibility to build applications for Linux while maintaining cross-platform capabilities, using a variety of .NET-compatible languages. One of the great advantages of Mono for current .NET developers is providing an easier migration path to Linux. The Mono project has a very open and active development community and provides both developer tools and the infrastructure needed to run .NET client and server applications. Perhaps the most important benefit of using the Mono architecture is that you gain language independence. Mono lets you leverage any existing code from languages supported in the .NET runtime. "

21 of 340 comments (clear)

  1. Ewww.... by Afecks · · Score: 5, Funny

    IBM gave me mono... gross!

  2. let me get this straight ... by SamSeaborn · · Score: 4, Insightful
    Linux programmers will use .NET/C# but they won't use Java?? What's up with that?

    Sam

    1. Re:let me get this straight ... by mysqlrocks · · Score: 4, Insightful

      Linux programmers will use .NET/C# but they won't use Java?? What's up with that?

      Yea, that is pretty strange. I would use Java before I'd use .NET. It's much more cross-platform then .NET is or ever will be even with Mono. Also, they mention that an "advantage" of .NET is being able to write in more than one language. Technically speaking this is true. However, practically speaking the two choices are VB.NET and C#. VB.NET was seriously overhauled from VB6 to make it more compatible with .NET thus losing a lot of it's "roots". I'm certainly not suggesting that VB6 should have stuck around. I'm stuck building stuff in VB6 at work right now and it's not pleasant. I'd jump to VB.NET in a heart-beat. However, I'd much prefer C# which I think is really the only viable language for .NET. Anyways, I'm not a big fan of either. Like I said before, I'd use Java before I'd use .NET (if it were my choice).

    2. Re:let me get this straight ... by psavo · · Score: 4, Insightful

      Linux programmers will use .NET/C# but they won't use Java?? What's up with that?

      I can apt-get install mono, but Sun told me to go fuck myself with a chainsaw when I wanted a .deb of Java1.5. (Yes, there is java-package, which does a great job, but really, it's a fucking mess).

      --
      fucktard is a tenderhearted description
    3. Re:let me get this straight ... by Decaff · · Score: 4, Insightful

      C# and the core parts of .NET are open standards, whereas Java is not

      This means nothing. These parts are still subject to patents. Sun is prepared to certify any Java implementation as 'Java' providing it passes their compatibility tests. They have even done this for clean-room implementations by rival companies like HP.

      That in itself won't give you compatibility with Microsoft applications

      Whereas Java gives you a definite guarantee of compatibility.

      and you lose nothing by not going to Java.

      Except performance, reliability, being able to use quality products from multiple vendors such as Sun, HP, IBM etc, and using the language which is now the de-facto standard for commercial server-side software development.

    4. Re:let me get this straight ... by Trepalium · · Score: 5, Insightful
      Or how about the fact you actually have UNSIGNED integer types in C#/.NET. I don't care how much James Gosling says that unsigned/signed types cause confusion, they're a reality of dealing with data on computers. The moment you have to force Java to interoperate with some "legacy" (read: non-Java) infrastructure, you're stuck with hacks and nasty ones at that.

      Other useful parts of C#/.NET include delegates, enums, automatic boxing of value types, properties, indexers, multidimensional arrays (as opposed to jagged ones) and foreach (for simple iteration through arrays or other indexed/enumerable objects). Hopefully the Java language designers will take notice and adapt some of these incredibly useful features to Java. Microsoft took so much from the Java language design that it should only be fair for Java to do the same to Microsoft's product.

      --
      I used up all my sick days, so I'm calling in dead.
    5. Re:let me get this straight ... by TummyX · · Score: 4, Interesting

      .NET makes it simple to interface with existing libraries written in C which, IMHO, makes it a more natural fit with Linux. C# applications can easily take advantage of existing libraries (GTK etc) whilst Java requires more effort (to force you to be "pure" and cross platform).

      Sometimes having ease and flexibility is more important than being cross platform.

      Besides, most libraries linux C# applications p/invoke are source-portable so the C# application itself will be cross platform as long as you have the platform specific binaries for the native libraries you pinvoked. The binaries you distribute won't necessarily be cross platform but for desktop applications, that's not really a big issue.

    6. Re:let me get this straight ... by miguel · · Score: 5, Informative

      I run the Mono project, so I can speak for our goals.

      And one of our goals is to be compatible with the .NET implementation. This is part of what we do on a day-to-day basis when we write unit tests for the APIs we are implementing, when we keep track of any possible difference and we respond to bugs filed on our bug tracking system where the behavior differs by fixing the differences.

      But our goal is not limited to *only* being compatible with Microsoft's .NET. We have also grown outside of the scope of what .NET has to offer, and this is why you see a very healthy ecosystem of libraries and applications *around* Mono which are not limited to being compatible.

      We created Gtk#, the toolkit we recommend for new applications that are to be cross platform; The enhanced XML stack (Commons.RelaxNG and Mono.Xml.Ext), our extended security and cryptography stack (Mono.Security), our extended Database support (Mono.Data and all of the providers for proprietary and open source databases), our IL manipulation library (Cecil) and everything that goes with these libraries.

      We try to make our libraries cross-platform, because the same code will reach more users and helps grow our community, but every once in a while we have to create OS-specific libraries. For example, the Mono.Posix library is not completely portable to Windows. The Cocoa# library only works on MacOS X, as it is designed to be just an interface to Cocoa.

      Miguel.

  3. Wouldn't it be funny if... by jarich · · Score: 5, Insightful
    Wouldn't it be funny if .Net (with Mono) actually delivered on the promise of Java? That is to say, bringing software to the Linux platform from traditional MS developers?

    Given that Java was a new language, maybe the migration from MS developers wasn't all that great... but now, with Mono, MS developers can move right over.

  4. portability problems by vlad_petric · · Score: 4, Interesting
    The article is silent on the GUI part. Unfortunately, that's also the most unportable part with .NET. Since winforms was really tailored for the windows api, porting it is no trivial tasks. Windows.Forms/Mono is still under heavy development.

    Keep in mind that Microsoft saw .NET as cross-platform, but only between windows platforms. Java is far better in that respect. While full compatibility is in many cases impossible, the extra effort per platform is much smaller

    --

    The Raven

  5. "cross-platform" by oGMo · · Score: 4, Funny

    You keep using that word. I don't think it means what you think it means.

    --

    Don't think of it as a flame---it's more like an argument that does 3d6 fire damage

  6. Why bother? by Decaff · · Score: 4, Insightful

    With Java you now have a complete implementation of all language APIs on Windows, Linux, Solaris, HP and so on, not an incomplete port of .NET (Mono) potentially subject to Microsoft patents.

    If the Apache Harmony projects succeeds (and it has a lot of backing) there will be a complete open source cross-platform Java implementation. There are already open-source Java versions that are good enough for many applications (gcj, Kaffe).

    Mono is a waste of time.

  7. Why so many stories about mono? by t35t0r · · Score: 4, Insightful

    Why does Mono show up so many times on slashdot?

    Why use Mono/.NET when you have ruby, perl, php, and python? All of which are cross platform? As far as only being able to give binary code to your customers ActiveState's Perl Dev Kit allows you to do just this (even though it's not free, but still less expensive than a license for Visual Studio .NET). I'm sure someone has written a decompiler for PDK binaries but the same thing could be done for .NET applications.

    But honestly can someone who has done development in Mono and and the other aforementioned languages convince me or anyone else for that matter to learn C#/Visual Basic.NET, and enjoy what it has to offer? What does it offer that the other aforementioned languages do not?

  8. but it's non-free by themusicgod1 · · Score: 4, Insightful

    details. I will not use java, for anything, so long as licenses like theirs are forced upon it. With java, you are always a second class citizen.

    --
    GENERATION 26: The first time you see this, copy it into your sig on any forum and add 1 to the generation.
  9. Java has language independence too! by TheNarrator · · Score: 4, Informative
    Perhaps the most important benefit of using the Mono architecture is that you gain language independence.

    This is by far the most hyped feature of C# but it's also present in Java. If you look at the large incompatibilities between Visual Basic and VB.NET you'll see that .NET is not really that language independent and that each language is really more of a "skined" version of C#.

    As far as alternative languages go in Java there are many. Among the most popular are: JRuby
    # interpreter written in 100% pure Java
    # Most builtin Ruby classes provided
    # Support for interacting with and defining java classes from within ruby
    # Bean Scripting Framework (BSF) support
    # Distributed under a tri-license (CPL/GPL/LGPL)

    Jython (Python)
    Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform.

    Groovy
    Groovy is an agile dynamic language for the Java 2 Platform that has many of the features that people like so much in languages like Python, Ruby and Smalltalk, making them available to Java developers using a Java-like syntax.

    There's a lot more smaller projects like JavaScript and Rhino, Jelly, BeanShell, Tcl/Java, Sleep, ObjectScript, Pnuts, Judoscript. Some people event think there are too many alternative languages for the Java Virtual Machine.

  10. GUI applications by DynamiteNeon · · Score: 4, Interesting

    Don't get me wrong, I happen to like both C# and Java, but if I have to create a gui app on windows for some reason, C# and .net wins hands down.

    Yes, I realize I could use SWT, but that's still not necessarily good enough. It surprises me that Swing still sucks so much after all this time. I would love to use one language exclusively if I could, but until I see some decent gui apps being built using Swing, it's hard for me to want to use Java unless I have backend services to create.

    Having said that, I would like to know if anyone can point me to gui applications that use swing and are actually good and fast. I'm curious if they exist at all.

  11. Agreed... by Burz · · Score: 4, Insightful

    Mono will always be on the fringes of acceptance like WINE... Never quite compatible and necessitating that you keep returning to Windows at least semi-frequently for that last bit of missing compatability.

    No thanks.

    Oh and MonoDevelop vs Visual Studio? Don't make me laugh. Well maybe one could run VS under WINE to get a decent IDE.

  12. Re: here we go again by cortana · · Score: 5, Insightful
    Why do people even bother with Mono?
    I don't give a crap about whether Mono allows me to run shitty Windows-centric apps on my system. I bother with Mono because it makes it easy to rapidly develop and deploy programs for the linux desktop. Mono is a good enough product in its own right.

    The excellent java-gnome project is the Java equivalent of GTK#/GNOME#, but I don't see nearly as many programs being developed for it. In fact, a quick apt-cache rdepends reveals that there are precicely zero applications using libgtk-java in Debian, whereas libgtk-cil is used by projects such as tomboy, graphmonkey, gnunit, beagle and blam. There are also a load of programs that have not yet been packaged; assuming that the same proportion of GTK# and java-gnome apps have been packaged, it seems that there is a lot more developer interest--buzz--around Mono than there is around Java. Mono-based programs are certainly mentioned more often (read: at all) on the feeds I read than Java-based ones; and how many "Creating Java applications for Linux" articles have been posted to Slashdot recently?

    So why is this? I recon it's simply down to how easy it is to get started using the platforms in question. Say I want to run Beagle--I apt-get install beagle. Now let's say I want to run the hypothetical jeagle. I have to navigate, with a graphical browser no less, Sun's gargantuan site; agree to a huge, no-doubt soul-selling bullshit EULA; run Sun's crappy installer that shits untracked files all over my system... and I still can't apt-get install jeagle because Sun's crappy installer doesn't know about dpkg. As a Debian user who actually knows what he is doing, I can use java-package to convert Sun's crap installer into a .deb that halfway complies with Debian poilicy, but by making me go through this procedure Sun has basically killed my enthusiasm for working with this platform--there is no longer any buzz.

    "But Mono isn't made by Microsoft! It's not a fair comparison", you might say. To this I reply, I don't care! C# and Java are both nice, modern (perhaps I should say 'fashionable' to avoid being prodded by the Lispniks) languages that make software development fun and easy--but it is easier to get into C# because a platform that lets me use it is only an apt-get away.

    Now, perhaps Sun could turn this around by hiring a couple of Debian Developers to make some really high quality Debian packages of Java, and granting Debian permission to distribute them in non-free; but this only solves the problem for users of Debian and Debian-derived distributions. Sun would also have to find someone to create decent packages for Fedora, Mandriva, Suse, Slackware, whatever. But hold on a minute--Mono has people coming out of the walls to package it for their favourite distribution, so why should Sun have to put in extra effort to make this possible--and still be playing catch-up? It's because Mono has buzz! The openess, liberty and low barrier-to-entry have drawn developers to the Mono platform, while Java has languished under Sun's iron fist.

    In the end it's not about Java-the-language vs. C#; it's about the openess of the platforms: Java-the-closed/inaccessible platform vs the GPL'd Mono. Development of the components of an open source Java platform has been slow because Sun have already created a 'good enough' implementation of Java on GNU/Linux--but Mono has everything to to play for; the stakes are high, there are no grumpy old gits saying "Microsoft's GNU/Linux .NET implementation is good enough, Mono will never beat it", this is an exciting time when men are men, women are women, small furry creatures from Alpha Centuri are real small furry creatures... etc, etc.

    To summarise: Mono is exciting. Java is a pain in the ass.
  13. Re:Here we go again by miguel · · Score: 4, Interesting

    There are a number of cross-platform commercial applications that run on Mono, for example:

    * Novell's own iFolder client and servers (same code base, modulo UI which is native on each of the three platforms: Linux/Gtk, Windows/Winforms, Cocoa/OSX).

    * (http:///www.medsphere.com) Medsphere's products (Mono/Gtk# based).

    * Otee's Unity game engine (http://www.otee.dk/index.html).

    You can look for the "Works with Mono" logo on open source .NET applications and various commercial applications.

    For a larger but still incomplete list, see:
    http://www.mono-project.com/Software

    As for your question about what will happen when C# 2.0 comes out, we have good news, we already have implemented it (we are missing two fairly minimal features though), for details you can see our web page on the subject:

    http://www.mono-project.com/CSharp_Compiler

    Generics, itereators, anonymous methods, nullable types, partial classes, per-accessor modifiers, static classes, fixed buffers and co/contra-variant delegates are all implemented and available today.

    And we can not wait to implement the new features in C# 3.0

    Miguel.

  14. Re:.NET is not an "open standard" by earache · · Score: 4, Insightful
    This is such a troll.

    You make no sense. There is not one valid reason why Microsoft would not want this project to exist. Someone is expanding their market reach for them, for free. What they lose in any kind of sales is more than made up for in mindshare.

    Sure they could pull the plug, and, sure, Mono is always going to be playing catch up; but it defies logic that Microsoft would radically mess up the framework for the sole purpose of screwing an open source project. Believe it or not, Microsoft is responsible to their developers. They do listen. To radically alter the framework for no apparent reason would just be idiocy beyond compare. If you've never participated in a beta cycle for Microsoft development tools then you would understand how well that responsibility is played out. Anyone can participate in these cycles and the responsiveness of the different teams working on the tools is impressive and commendable.

    For Microsoft to harm Mono in any way would harm their own customers, and what company wants to hurt the customers that generate the need for their OS? I think there is a reason that CrossOver office exists beyond simply being compatible with the outside world for document exchange. It's because linux applications are still playing catch up to Windows applications. Gimp still trails Photoshop for professional grade imaging work. Evolution is still trying to play feature tag with Outlook. OpenOffice is still trying to equal Excel, Word, etc. That is not to say any of these efforts don't outclass the Microsoft products in some regards, because they most certainly do. I merely point this out to be an example of where Microsoft's commitment to their developers touches their economics. For the first time, we're seeing free tools for .NET development that are actually useful. I think this will continue with lower licensing costs.

    As for the rest of your comments, I'm going to chalk those up to zealotry, closeted or not and simply being ignorant of what good design really is. And just because you spent a few years with ASP.NET doesn't mean you are at all competent.

    And though I may sound like a Microsoft bigot, I am not. There is no fiscal or professional gain in being religious about toolsets. The more tools in that box, the more shit you can fix, and the fatter you can make the wallet. While I mostly do .NET consulting now, I still do PHP projects and, every once in a blue moon, a java project. Sure, sometimes I think about how one feature of another language might make a certain chunk of my work go faster, you also need to balance your concentration towards those things about the tool you are working with that are appreciable. I appreciate how quickly I can bang out a PHP site. I appreciate the massive library support and open source tools for Java. I appreciate C#, the .NET framework and Microsoft's dedication to their developers. If you can't do that than you are severely limiting your brain and your bank account.

    Also, consider this: If Sun hadn't taken it to the extreme, there would be no .NET. Had they looked for an agreement, instead of seeking injunction, what a better picture for them that would have been than the picture we are looking at now.

    Anyways, nice troll.

  15. Why Mono is Currently An Unacceptable Risk by Anonymous Coward · · Score: 4, Insightful

    Argument In Brief

    1. Microsoft's C#/CLI licensing people, at high levels, are aware of us.
    2. Microsoft can choose to do damaging things in the current C#/CLI licensing ambiguity.
    3. Microsoft considers the free software / Linux community to be a major competitive threat
    4. Microsoft does not "compete" gently
    5. A + B + C + D = ?

    The word pile amassed below defends points (1) and, in particular, (2). I take points (3) and (4) as given. I leave point (5) an exercise for the reader. ;-)

    Stupid Disclaimer

    Since I'm not a lawyer, I don't know if these disclaimers are important. But given the nature of the topic, I'll play it safe and write one. I'm not a lawyer, and this ain't legal advice, its just a dump my current thinking on an issue. It does not represent my employer's opinion. It may represent my cat's opinion, but only on the second tuesday of summer months.
    Restatement of the Issue

    Miguel has repeatedly stated that the patents necessary to implement the standards ECMA-334 (C#) and ECMA-335 (CLI) are available from Microsoft "RAND + Royalty Free". This seems like an effective open patent grant and encouraged me initially that we could do Mono. I really like Mono. Its terrific technically, and I'd love to be able to use it. But two problems upon further consideration the past couple months:

    1. I've not seen an official statement by Microsoft that will let me trust the royalty free assertion. I think we are remiss if we do not assume Microsoft is looking for ways to, quite frankly, screw us. So unless there is a statement from Microsoft that they will have to stick to in a court, I feel (at the very least) uncomfortable.
    2. "RAND + royalty free", can still seriously screw Free Software. I think this is more important than the first point. Even with RAND + royalty free you still have to execute a license agreement with Microsoft, and license agreements can stipulate things that are RAND from a corporation perspective but still screw over Free Software. Also, there is evidence that key Microsoft people are already aware of (or planned?) incompatibilities between the licensing scheme for C#/CLI and, at least, the GPL. The eye of Sauron is upon us. RAND + royalty free is very different from a patent grant.

    In short, we are in an adversarial situation. Microsoft does not want us to succeed. Thus we cannot trust Microsoft, even if we'd like to, and must consider Mono based upon the question "What is the worst thing MS can reasonably do?". We can only trust Mono if we are convinced Microsoft doesn't have weasel room. The current situation appears, to me, to have lots of weasel room. The technical merits of Mono are basically irrelevant if its a trojan horse in the long term.
    The Horror Story

    So here's the obligatory horror story based upon what I see as our current course. Actually, I don't think this is taken to extremes at all. The GNOME actions look to me like the path we are currently on, and the Microsoft actions are not out of character, and look legally tenable based on what I know today. Microsoft can choose to not exercise these actions, but they will have the possibility (and will be more likely to the more successful the Linux desktop is).

    * Act 1 - Novell hackers continue to push Mono. Novell hackers code most new independent programs/functionality in Mono and gradually start writing extensions to software like Evolution in Mono. Evolution's core continues to remain Mono free, but if you want features X, Y, and Z you have to use Mono. A few GNOME hackers write apps in Mono, some as toys, and perhaps a couple more serious. Red Hat hackers complain. Some try to weakly push Java and some stick with working in C & Python. Sun makes noise, and does their own thing, starts some wacky projects, tries to push Java with OpenOffice.org, and