ArsTechnica brings you an introduction to Mono. For starters, they will dish up a basic introduction to Mono, MonoDevelop, and C#, and then branch out to GTK#, database access, ASP.NET, advanced C# topics, and conclude with a discussion of the future of Mono, and the C# standard. Not a Linux guy? Don’t worry, all examples will work on Windows and Linux, with OSX support coming shortly.
I’m a big newb when it comes to Mono, .NET, C#, &c. as a Fortran 95/Ruby man. So, I have what is probably the dumbest question ever, but I have to ask.
Namely, what is the difference between Mono, .NET, and C#? That is, whenever I think of .NET/Mono I equate that to C#, but reading over articles like this makes me think that is simplistic. .NET/Mono use C# but also means libraries to build on…right?
To continue on, in an example, the article uses the function Regex.IsMatch. Now, is that a builtin of C#, or is it part of those various .NET libraries I read about?
Sorry for the question, but it’s been bothering me everytime I read a story like this. Thanks for any help.
C# is a language, .NET and Mono are platforms. if you equate it to Java: Java is a programming language, the Java Runtime Environment (JRE) is the platform it runs on. .Net/Mono apps can be written in several different languages, just like Java apps, the program is compiled into bytecode that can be run on a virtual machine.
with all that out of the way:
has anyone gotten gtk# to compile on OS X? i was going through one of the other tutorials posted here a few days ago, but couldn’t get gtk# going, so i gave up and wrote a simple command line app to see how it worked (and boy did it work!).
.Net is made of 2 things:
1. A Common Language Runtime: The CLR is a multi-language execution environment. http://www.gotdotnet.com/team/clr/about_clr.aspx
Bascially it allows for developing apps or web apps using a variety of languages. This is your class library synonimous to the Win32 API, but easily accessed from multiple programming languages and the data types are more compatible when for example VB code passes data to C# code.
2. Intermediate Language: IL is like Java byte code. The “compile once, run anywhere” motto.
.Net as a whole is a development platform. C# is just a language, it has a syntax similar to Java/C/C++, new rules and features, you get the idea. It’s a programming language.
Mono is pretty much everything I said above, but is NOT developed by Microsoft and it can run on Linux.
In the OSX world Mono apps won’t take of until there a native GTK# (i.e. native GTK2+).
As the community appears not to be too interested in doing it, GTK-Aqua is stalled. GTK-OSX (GTK 1.2) mostly works but needs someone who knows GTK and X11 inside and out to push it the few last steps and no one has come forward to do it.
If the Mono team is is serious about GTK# being a serious option on OSX it’s going to have to help port GTK.
Well said Dave.
There is an effort to create native Cocoa bindings for Mono, however, even if this effort does take off, apps that are written for GTK# for Windows and Linux (and these will be many), still won’t work on Mac OS X, so it makes the whole Mono graphical thing not so multi-platform as it should have been.
I am a newbie programmer and am learning C#. I understand the GTK# tookit stuff. But can someone expaline MyAxml? It looks like another toolkit to me.
Uhm, there’s only two pages and I don’t see all these topics that OSNews is listing (database access, ASP.NET, advanced C# and the future of Mono). Am I missing something?
This is a multi-part article, next parts will be published in the future.
I’d be more enthused with Mono if other languages jumped on the bandwagon, appealing to a wider development community (like me).
I’m still waiting on IronPython (www.ironpython.com), looking forward to interoperability with C# code.
Just out of curiosity, you could take a look at Boo (http://boo.codehaus.org):
“Boo is a new object oriented statically typed programming language for the Common Language Infrastructure with a python inspired syntax and a special focus on language and compiler extensibility.”
Still very early on development, but interesting anyway.
Boo is close to Python on .NET (http://boo.codehaus.org)
as far as GTK on Mac is concerned, it works wonderfully and those it works on X11 it looks perfectly fine (though it’s not aqua). For that, you need to use the native toolkit by ways of the cocoa-sharp project found on Novell Forge and very much active.
I think I understand this correctly, so shoot me down gently
Am I right to think that anyone with access to the .net bytecode can de-compile it and view the source code? I know that C/C++ compiled code is really hard to decompile, but what about .net programs?
Thanks!
I think you’re right, it is possible.
But for those worried about intellectual property problems, there are lots of obfuscators available (I could be wrong but I think one is already bundled with VS.Net, at least the Enterprise Architect version)
the regex stuff is part of the fcl or framework class library.
It can be used by any .net language i.e. C# vb.net Delphi.net cobol.net etc etc.
Mono is pretty cool, I just recently ported some command line database utilities I wrote on linux with Kylix and I did everthing on my windows pc and simply copied the binary to my linux server and it just worked.
Mono is way cool 🙂
There is something called the .Net obfuscator, the Dotfuscator (http://www.preemptive.com/products/dotfuscator/index.html) that is in Visual Studio. I don’t know if MonoDevelop comes packed with one though. But if the obfuscator itself is written to run on .Net, it should work on Linux + Mono as well.
It is easier to get decompiler information from the java and .net bytecode. This is due to them being a more dynamic language then C/C++ so more ‘meta’ information gets stored. This is a problem with ANY modern language.
You can’t decompile the whole program word for word, but there is some extra information that you can get that you can’t get from a c/c++ program (or anything assembly compiled). Both of these platforms come with tools that allow you to get this information, and both have code obuscators (sp?) to help minimize the amount of data that can be retrieved.
Mono is a great tool but lacks of documentation, I’ve learned .NET thx to the big repositories of documentation on the internet.
I would be more entusiastic about learning mono with more documentation.
I am the uber noob when is about Mono/.NET . I have read this article and I would very much like to start doing some mono. Is there a site for total newbies in mono? What do I need and how should I start once the system is configured.I mean a tutorial starting from the moment you boot your computer.Is there such a resource?
I am doing Java for about 6 years now.Won’t harm too much to learn something new now.
Eugenia (IP: —.osnews.com) – Posted on 2004-07-15 20:47:40
Well said Dave.
There is an effort to create native Cocoa bindings for Mono, however, even if this effort does take off, apps that are written for GTK# for Windows and Linux (and these will be many), still won’t work on Mac OS X, so it makes the whole Mono graphical thing not so multi-platform as it should have been.
Well, the better solution would be for BSD licensed QT# bindings which will be able on all platforms with Qt.
With that being said, is it possible to make a wrapper around cocoa so that gtk calls are translated into Cocoa?
Just wanted to say that I thought the article was very poorly written and doesn’t give Mono the meris it deserves. Saying that using regexs on both systems really isn’t compelling as you can do this in Java, Perl etc. The real power is that the same compiled file can be used on both systems without change and that you can use mulitple languages with a common VM. I don’t mean to complain, but the article is very amateur and fails to grasp the point of Mono and instead focuses on “look at the cool libraries!”.
Joao :
Only the more geekier members, thats’ not meant as an insult, it’s a convenient grouping and I’m probably a member, of the OSX community would be happy with Apps running in X. The majority would like things like drag and drop to work. I used to use PAN as my usenet client, but quickly got fed up with having to start up X every time (I switch my Mac off at night).
kaiwai :
QT# would have the ‘QT on windows isn’t free’ problem until the windows port of the GPL’d QT is finished. I’m not totally sure that a BSD licensed port is possible due to licencing, may be it was developed against a paid for licensed version of QT?
Wrapping GTK around Cocoa probably wouldn’t work due to the differences in the event models. That would need dealing with at the GDK level where the current (stalled) GTK ports are aimed.
“…until the windows port of the GPL’d QT is finished…”
Wah? Link?
i really cant stand using glade, and monodevelop is far from being done. stuff here looks real interesting, but i think ill wait another few months at least before i start doing anything more then play with mono.
GPL’d QT
http://kde-cygwin.sourceforge.net/qt3-win32/index.php
If this article were really supposed to be an intro, it should teach how to _compile_ the program, stuff like this…
to be really useful the documentation needs to be a lot better. Especially in areas where we can not rely on ECMA standards. I’m thinking of things like Gtk. You should not have to guess class names from C method names. (Even though reading the documentation for gtkmm may be somewhat helpful).
As long as this is not fixed, people who program for their living will probably go for java or .Net on windows instead.
From a Linux perspective I have also worries about security. As all programs is run by mono, it will be hard to create good SELinux security policies. Is would be nice if there was some easy way to create native binaries, that was run in processes of their own.
QT 4 will have a Opengl backend. Windows supports Opengl. S porting the X11´s Opengl backend to win32 should be easy.