Creating .NET C# Applications for Linux 340
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. "
Not really news... (Score:3, Informative)
C# is an open standard (Score:1, Informative)
Re:wxWidgets vs. Qt vs. Windows Forms (Score:3, Informative)
What about using FOX [fox-toolkit.org]? It's far lighter than wxWidgets or QT, while still offering a decent cross-platform GUI. And it's LGPL, with static linking exceptions.
Re:.NET Windows Forms (Score:4, Informative)
It's recommended to use the latest build of Mono System.Windows.Forms, you can find it here [mono-project.com].
And here is the the Mono WinForms class status [myrealbox.com].
I currently wouldn't rely on it. But the outlook is good.
And here are some pretty pictures [myrealbox.com] of Mono's WinForms in action.
For apps where the both compatiblity with Windows and Linux/OSX are important I'd use wx.NET [sourceforge.net].
However on Win32 WinForms works best, even if it isn't the nicest (for developers) toolkit around.
Re:let me get this straight ... (Score:3, Informative)
This will be news to the thousands of developers who are already using Java under Linux and Windows for application development right now! If you look at the IT job market (Java being the most required skill for commercial application development), you won't see Java uptake being held up because it is not currently a 'useful option'!
Personally, I can see the advantage of a mature open source Java, but Java is not being held back by this.
Re:I'm sorry (Score:2, Informative)
We do, sometimes, when we're forced to, but Java IS slow (don't bother quoting any BS benchmarks.
Why play second class citizen in some one elses world. Java was designed to be cross platform from day one and is really supported on all platforms.
Uhm,
Mono is also supported on just about every relevant platform, except maybe in the mobile and embedded spaces. But don't kid yourself, Java isn't exactly "good" in these spaces, either.
And I'm not too sure Mono/Microsoft are exactly second-class citizens in Java's world. They're kind of carving their own niche.
Re:C# is an open standard (Score:3, Informative)
Re:C# is an open standard (Score:2, Informative)
I'd rather use Java and have its full framwork available to me than use C# and a crippled, albeit quickly catching up,
Java has language independence too! (Score:4, Informative)
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 [sourceforge.net]
# 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.org]
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 [codehaus.org]
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.
Re:Where are the apps? (Score:4, Informative)
That will be news to the many developers who have produced such applications. Go to the Swing Connection on the Sun Java Website and you will see hundreds of applications that are consumer-grade. This includes games, graphics apps, and multi-media apps.
And, of course, there are the thousands of different Java games that are downloaded to mobile phones every day!
So much for Java not being 'consumer-grade'!
Re:let me get this straight ... (Score:3, Informative)
yes, I do.
I have been severely critical of Swing performance in the past, however it has improved dramatically.
here is a single post which gives a typical comparison:
http://www.javalobby.org/java/forums/m91832009.ht
But in the end, the best thing to do is to download NetBeans + Java 5.0 and Eclipse (the GTK version is best) and try them out.
Re:let me get this straight ... (Score:3, Informative)
Re:let me get this straight ... (Score:3, Informative)
In real-world applications, C# matches up quite well to Java's speed.
Re:How cross-platform (Score:2, Informative)
I took a console application that used network sockets, timers, and was completely multithreaded that I had compiled using microsoft's c# compiler, and copied it to a linux server (no recompile).
Fired up mono ... it worked flawlessly, first time. I was impressed.
Re:let me get this straight ... (Score:3, Informative)
Keep in mind that there are always extensions so that you can call methods in native assemblies on your platform. This means you can pretty much interact with anything.
Re:let me get this straight ... (Score:4, Informative)
Re:Agreed... (Score:2, Informative)
Re:let me get this straight ... (Score:4, Informative)
Re:Not for me (Score:3, Informative)
Mono happens to be a 'nix implementation of the CLI. Again, this is not "mimicking" anything... it's a native implementation of a recent standard. It also happens that the C# (also specified in the ECMA submission) implementation in Mono is basically complete.
The problem right now doesn't sit with the c# language or Mono... the problem is that an appropriate cross-platform gui/widget set doesn't exist. GTK# shows some promise, but is slow to be adopted. Windows.Forms (Microsoft's GUI implementation for the CLI) *is* proprietary, and thus, has proved difficult to implement on platforms other than Windows. BUT, let's not confuse the implementation of Windows.Forms with the CLI/Mono because they really don't have much to do with each other.
Additionally, Mono is NOT the only non-Microsoft implementation of the CLI. dotGNU Portable.net (www.dotgnu.org) is another -- and I'm sure there are more.
Feel free to educate yourself on the CLI and it's background by starting here:
http://www.dotnetexperts.com/ecma/ [dotnetexperts.com]
http://www.ecma-international.org/publications/st
Re:let me get this straight ... (Score:5, Informative)
And one of our goals is to be compatible with the
But our goal is not limited to *only* being compatible with Microsoft's
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.
Re:Apples and Oranges (Score:3, Informative)
http://www.mono-project.com/FAQ:_Licensing [mono-project.com]
Re:Much smoke, small fire (Score:1, Informative)
How large is your QT suite of libraries?
How large is the Java runtime?
How large is X windows?
20 megs for a comprehensive framework like Mono isn't large.
(`apt-get instal emacs21` tells me that I need 42MBs of space!)
Re:Why bother? (Score:3, Informative)
With a horrible license and horrible performance.
not an incomplete port of .NET (Mono) potentially subject to Microsoft patents. Anti-mono people go on about the patent bogeyman even though MS has *never* used a patent aggressively, and there are situations where it would benefit them far more to do so (OOo, Samba). The threat of patents is just so much hot air.
If the Apache Harmony projects succeeds (and it has a lot of backing) there will be a complete open source cross-platform Java implementation.
Vaporware, gimme a break. People have been saying we will have a complete open source cross-platform Java implementation for as long as Java's been around. It's never materialised.
There are already open-source Java versions that are good enough for many applications (gcj, Kaffe).
Look who's an incomplete port now. gcj and Kaffe are good projects and I support them but if you try and run a random app on them it's not even "hmm, this might work, we can hope", it's "let's see where this breaks".
Mono is a waste of time.
Right now I have a working, open source implementation of all of .Net that I need, which installs easily on every platform I've seen in use. Or, I have a horribly-licensed and horrible-to-install (especially on BSD) Java implementation, or a number of attempts at an open source Java which though initially promising seem to be going nowhere and won't run the vast majority of java programs.
Re:How cross-platform (Score:3, Informative)
Yes, that's the whole point, though it only will if it sticks to the standard APIs. There are things which are only supported in Mono, but they are split off into their own namespaces (usually Mono.*). The same is true with Java, if your thing uses sun.* it won't work on non-sun jvms.
Re:Where are the apps? (Score:3, Informative)
Strangely, mobile devices can run java in just a few 100k. The Java 5.0 VM itself can run in just a few MB.
Write a simple Java 'hello world' program, and you will find it can run in just a few megabytes (use the -Xmx switch to set the max usage).
So the claim that your machine will swap 'each time you use a Java application' is provably nonsense.
I'll start Eclipse, to tell you how much RAM the JVM will use (it might be a shock for you!).
It's an IDE for goodness sake! They are some of the largest apps.
Mind you, the NetBeans IDE can run quite happily in moderate memory. In fact, if you look at the IDE config file for NetBeans 4.1 you will see that the IDE is by default not allowed to use more than about 90-100MB.
In fact, I have just started it giving it a maximum memory of 64MB.
Try it yourself! I am using Java 1.5.0_04 and NetBeans 4.1. The configuration file within the netbeans install directory is etc/netbeans.conf.
So, on a 512MB machine, it isn't causing swapping. (It never does on my PCs, which have this memory).
Saying Java is performing nearly as fast or even faster than C++ is BULLSHIT.
If it is, then it is bullshit backed by considerable evidence. Last year there was a study of java speed for numerical work, using the well-known Linpack benchmark:
http://www.shudo.net/jit/perf/ [shudo.net]
Java 5.0 usually came within 5-10% of optimised C++.
So, I am sorry, but you are plainly factually wrong.
If you don't believe me, again, try it yourself. The source code for these benchmarks is available.
You may also be interested to know that Java is now so fast it can be used for real-time device control and AI systems. Boeing use Java for robotic and autonomous experimental planes, and one of the entrants for this years robotic road race has its software entirely in Java.
Re:Where are the apps? - What Speed? (Score:3, Informative)
That is exactly the situation on all my workstations right now, and I have never seen a system that is faster. It changes nothing, of course.
I have stated that I do not want to wait even a few seconds for an application to load. It's obnoxious to me and, I would venture, most other users. I don't understand why you are supporting the idea that latency is good.
I am not. I am just saying that below a certain point it is completely irrelevant and has no impact on the user. I have been in IT for 25 years and have never seen anyone ever complain or have any issues with a 2 or 3 second load time. When you say that this is obnoxious to most users, I have good evidence from decades of IT support that you are just plain wrong.
If this really is annoying to you, you must find the majority of applications on any workstation intolerable! I use both GNOME and KDE routinely and I can't think of a single application that starts up in less that 2 seconds.
Small, orthogonal tools. That's the UNIX philosophy, right?
Sure. I agree. But that has never ever applied to GUI systems; they have always had some lag.
Also, please note that the bulk of Microsoft Word's libraries are NOT preloaded with the operating system.
Fair enough, but you mentioned Notepad. I would be very interested to see a 2 second startup for any Office application anywhere - Microsoft or otherwise!
Your statement's only grain of truth is that IE's rendering libraries are indeed preloaded (they are used within the Explorer shell).
Wrong. The text editing controls are preloaded (hence Notepad's speed), the menu and GUI controls are loaded, the file browsing tools are preloaded. (This is the advantage of a common GUI library in Windows).
Because of Java's failings, I dislike Java -> anything. Does this make sense?
No. Because as far as I can tell, what you are labelling as failings simply would not even be noticed by the majority of users, so I don't believe it is fair or sensible to call them failings.
Yet again, I would be interested in proof that a start-up time of a GUI app of a few seconds has any ergonomic impact on anyone anywhere, other than being annoying to you.
You are imposing a requirement on GUI software that almost no major GUI application meets. If such applications, written in supposedly high performance languages like Delphi, C and C++ can't do this, why should Java be any better?