Programming languages may be used to build a variety of solutions. Each language contains unique features and benefits that make it best-suited for certain kinds of applications. Microsoft offers a rich palette of four programming languages which together provide developers with the functionality necessary to build robust .NET-connected software. Read the article at MSDN.
What kind of options are there when it comes to C# on platforms other than Windows? Are there any C#-based graphical toolkits to play with on *nix or OSX?
I’m getting ready to abandon VB6 for good (mainly programming graphical frontends for databases and such and other small GUI utils) and looking to go cross platform. As I see it, my options are as follows:
* C++ – Powerful, but a royal pain in the ass to get my head around.
* Java – For now, too damn slow. Forget it.
* Python – Seems to be my best option so far
* C# – Probably good if it spans platforms and is not dependent on .NET
From the article, they offer:
Visual Basic .NET
Visual C++ .NET
Visual C# .NET
Visual J# .NET
So, there’s basic, and three dialects of C (that’s counting Java). Or, basic, java and two dialects of C. Anyway you look at it, that’s hardly a rich palette.
What did they leave out? Let’s see: there’s Perl, Python, Ruby, Guile/Scheme/many Lisps, there’s Fortran (still in daily use, though not for systems programming), there are the dialects of the S language, and Prolog, Ocamel, ADA, Aplus (and all the other dialects of APL), and that just scratches the surface. Big systems have been written in all of these, I believe, and they are all in current use. Each is uniquely suited for some task(s).
Again from the article: “Just as artists are unique and employ the medium and tools to suit their experience and personality, software developers employ programming languages based on their skills and the task at hand. No one language satisfies the needs of all developers. ” MS is obviously not interested in any applications for which basic or c are suboptimal.
Of course C# is dependant on .NET. Its very much like Java as it runs it a type of virtual machine, the VM in .NET.
Right now, .NET is only complete on Windows, but MONO is attempting to port it to other platforms, and seems to be doing a good job.
Don’t dismiss Java just yet. Check if GCJ (a java compiler) and SWT gives you something fast. On the other hand, crossplatform GUI applications usually don’t integrate with the platform as well. Maybe write the model in a platform agnostic language/library, and the view+controller with platform native tools.
A comment from someone with an emerging interest in AI:
Microsoft did a fairly good job with the architecture of .Net (baring a few poor design choices in the class libraries). Unfortunately, it seems like they’ve spent a lot of energy focusing on developing VERY closely related languages. What difference does it really make whether one codes in Java-like or C#-like or VB-like syntax? C++, for all its ugliness, is a worthy addition, giving power to systems programmers.
But, it’s a shame they didn’t include at least one functional language – a LISP (or even Scheme) etc. To my knowledge, only research-grade offerings are available. It looks like Microsoft research is working on SML-like languages. These are useful for compiler development.
As we move into the future, past the tedium of coding web pages and databases, it seems like having the ability to add AI reasoning capabilities will be useful. Most of the systems I’ve seen out there are LISP-derived (the ones written in other languages end up implementing a LISP or LISP-like language internally).
Efficient and seemless support for these languages is going to be the real test of the ability of .Net to support multiple languages. Having LISP like capability on tap inside .Net would be a huge boon to developers. More so, I think than umpteen slightly different flavors of the OOP paradigm.
Stuff like the Math Round() function that does a BANKERS round and not a simple .4 down .5 up (which is just plain stupid)
I also hate the bloatness of webcontrol. I will admit, it is cool but SLOW and NOT easily customizable.
The caching capablities are easy to use and fast but still no better than Java.
and the #1 thing I hate most is the lack of GOOD documentation. Microsoft crap at MSDN detailing the class libraries is a joke compared to SUN Java API (javadocs).
I use C#/.NET every day and can’t come up with a single thing that would be missing in the MSDN documentation.
Can you point me to an example of javadoc on the web that I could check to see what I’m missing?
Complaining about round? Welcome to the world of programming. Where things do what they were programmed to do not what you think they should. It’s a generic round function. not the end all be all of rounding. Look into how floating point rounding works sometime. Geez.
I don’t understand anyone who thinks that C# is going to be faster then Java. As a language they are basically the SAME speed wise. The only difference between them is the librarys that they use. And Java’s is much richer, and that is a win in my book. C# is going to be just as slow for large apps as java because it too is garbage collected. Yes, C# can put certain objects on the stack, but java’s garbage collection has made that advantage almost moot.
are really just syntax sugar over the same runtime, and each has been deformed enough so the compiler doesn’t need to think too much about how to make it fit the runtime/bytecode scheme.
if anyone has done Python.NET (from ActiveState I think), is it still like Python, or is it wedged into the .NET way of doing things?
Here’s your clue, FUDboy…
http://www.gotdotnet.com/team/lang/
> Don’t dismiss Java just yet. Check if GCJ (a java compiler) and SWT gives you something fast.
Or Wx4J.
Could someone name a single commercial Microsoft product which uses .NET?
http://www.gotdotnet.com/team/lang/
Nifty. Fujitsu’s making Cobol for dotnet, and someone’s making Haskel, und so weiter. That info wasn’t in the article. By the way, those are all third-party efforts, I think, and MS doesn’t seem to be directly involved.
What I said stands: it’s goofy to call those four offerings from Ms a “rich palette”, and MS doesn’t offer a whole lot of languages that people use.
I guess it’s a good thing that some others are filling the gaps that article tells us MS has left.
Check this out
http://grunge.cs.tu-berlin.de/~tolk/vmlanguages.html
No Perl.NET?
Awww.. guess I’ll have to wait for Parrot.
http://aspn.activestate.com/ASPN/NET/
The thought of combining C++, with its direct access to virtual memory addresses and explicit control over the lifetimes of objects, with .NET with its garbage collection and checked memory references, makes my head hurt. This is an impedance mismatch, unless it’s exposed in layered fashion as with Java native methods, and I don’t think it is.
I’m not saying it can’t work, but I’d expect you’d end up with a hairy application design.
It is called Managed C++. It is C++ with additional keywords to help it interact in the .NET CLR. It makes it easier to port existing code- you only have to learn the new keywords.
Microsoft tries to make us believe that it is a great advantage of having all these languages to choose from.
In theory it would be a good thing, but in reality doesn’t matter much. All .net languages use the same class libraries so your programs will look very much the same regardless of what language you use. And compared to learning how to use these class ibraries, learning a new language is very easy.
The problem with the mixed language approach in a project is that it limits the possibility for project management to move staff from one part of the project to another if needed. It also makes communications beteween project members using different languages more difficult
This usually ends up in getting behind scheduele.
So my advice is focus on one language if you use .net
If your problem is speed gcj is not the solution. Programs compiled into nativie code with gcj usually runs slower than Sun hotspot. GCJ still has a place in the java world, as it solves the problem of getting native executables. One other advantage is that gcj apps start faster, but once up and running pure java is faster.
SWT might be fast though. I havn’t programmed with it but eclipse that is built with it runs reasonably fast. The downside of SWT is that you need to install native .dlls
to make it run.
Just because the first versions of java was extremly slow doesn’t mean that it still is. In fact java and .net are very similar technologies and we can expect the about the same performance regardless of what .net language used.
But .net and the java platform may excel in different areas. Java has an advantage in distributed and network centric applications as uses leaner and meaner network protocols, while .net have an advantage on windows based GUI applications that only run locally on windows.
I am not at all clear WHY they have to supply such a “rich palette” of languages that provide near enough the same functionality. C# is clearly designed to attract programmers who favour Java, and managed C++ is neither fish nor fowl. The benefit of C++ is maximum performance, at considerable cost in programming effort. VB is the exact opposite; and Java and C# fall in the middle of the spectrum. There is no need for four languages that all generate code for the same proprietary runtime environment.
What there is a need for is the features that are common to Perl, Ruby, Python and TCL. Fully managed storage. Associative arrays. Objects. Reflection. Regular expressions. All in language constructs that are easy to use. I prefer working in any of these scripting languages to VB, C# and Java, and if I want the best possible performance, I will spend the time to use C or C++.
You *just* found that?
That info has been there for 6 months or more….
Must have been a slow news day.
I agree that you shouldn’t discount Java. Java runs slow on Windows but I find its performance more than acceptable on UNIX. I think though that you will find that you will end up utilizing multiple technologies. If you are going to be developing feature rich application on Windows I would consider doing it with .Net, for the other side Java.
Darius:
“What kind of options are there when it comes to C# on platforms other than Windows? Are there any C#-based graphical toolkits to play with on *nix or OSX?”
Two options exist so far: DotGNU ( http://www.dotgnu.org ), and Mono ( http://go-mono.org , founded by members of Ximian). As you can guess, these have their roots in Linux, but DotGNU has a pretty sweet screenshot of using an implementation of System.Windows.Forms in OS X here: http://dotgnu.org/screenshot9.html Both projects are far from finished, but have shown MUCH progress since I last looked into them. Also, Microsoft has released the Rotor CLR for OS X (Jaguar+) and FreeBSD under their Shared Source License.
To your second question, yes, GTK# is (as mentioned earlier, Ximian is working on Mono link: http://go-mono.org/gtk-sharp.html ) one. Nat Friedman is working on a cool project called Dashboard written for it
http://www.nat.org/dashboard/
contrasutra:
“Of course C# is dependant on .NET. Its very much like Java as it runs it a type of virtual machine, the VM in .NET.”
Sort of right, sort of wrong. C# is an approved ECMA standard, you DO NOT NEED .NET implement your own compiler/clr/etc. that’s how Mono is allowed to exist. Mono has their own C# compiler, their own CLR, their own CIL (iirc), garbage collection engine, and everything. Whether you call tha ‘.NET’ or not is up to you, though none of them have ‘.NET’ in their names, so I’d say not.
Jethro Bodine:
“Could someone name a single commercial Microsoft product which uses .NET?”
Not sure if it will be *written in*, but the next release of MS Office (2004, not 2003, which is in beta already), according to Microsoft, will feature scripting engines for C# and VB.NET, so no more putzing around in VBA. I’ve had to do my share of spreadsheet automation before, so that’s welcome news, at least for me. No links for Office 2004, unfortunately, microsoft.com isn’t loading…though searching for Office 2004 should prove promising.
zephc:
“all the .NET languages are really just syntax sugar over the same runtime, and each has been deformed enough so the compiler doesn’t need to think too much about how to make it fit the runtime/bytecode scheme.”
That’s not really true, at least any more than arguing that technically all languages which can understand x86 assembly are all the same. The easiest example is Managed-C++ (VC++.NET). There are many things which you can do from MC++ which you absolutely cannot do in any other language. Managed/non-managed code wrangling is a good example.
april_fool:
“The thought of combining C++, with its direct access to virtual memory addresses and explicit control over the lifetimes of objects, with .NET with its garbage collection and checked memory references, makes my head hurt. This is an impedance mismatch, unless it’s exposed in layered fashion as with Java native methods, and I don’t think it is.
I’m not saying it can’t work, but I’d expect you’d end up with a hairy application design.”
Well, it is hairy…kinda. The purpose of MC++ from what I’ve been reading is not for application design, but for application porting. As I mentioned above, there are times when MC++ can do things other langauges cannot, but these come up very, very rarely if you’re committed to a fully .NET application. Generally, they involve manually hosting a session of the CLR (which does get a wee bit hairy), and that’s not so common.
As for layering, beyond the normal complexities of Windows calling convention, there are 4 basic layers of managed code:
1. Normal code compiled without the /CLR switch
2. Code compiled with the /CLR switch, but is hiding under a #pragma unmanaged directive – this code is still completely non-managed, but can call managed code which is not garbage collected (though not gc’d managed code, iirc).
3. Code compiled with the /CLR switch, either not following #pragma unmanaged, or following that and #pragma managed – this code operates in a managed environment, but references are still not shuffled, and heap memory is still not collected after use, this code can be called by unmanaged code with /CLR, and can call unmanaged, managed w/o gc, and managed gc. To access gc objects, however, this code needs to include vcclr.h, and each type must be declared in a gcroot<T> template, eg gcroot<System.String *>. Also, to qualify as #3, the code need be a class, and have __nongc specified in its declaration.
4. Code compiled with the /CLR switch, in a class declared with the __gc specifier – this code will behave like any other managed type, like a C# type.
I didn’t mean “official” (MS) .NET, I meant all the .NET libraries, JIT, etc. MONO is an open source implementation of .NET.
Thanks. I think I’ll stick for now with your option #1, using VC++.NET to build “classic” PE apps. I think writing production C++ code correctly with no resource leaks or wild stores, etc., is challenging enough, w/o having to worry about two radically different models for resource management. But I have a sinking feeling that I’ll eventually get sucked in to one of your mixed environments, as part of some crash porting effort or something.
As for new projects, I can perhaps see the use of C# GUI code calling C++ code, but the latter could be implemented in regular COM DLLs, right? I’m assuming Visual C# provides some sort of .NET/COM gateway.
Agreed. I’m no expert on functional programming having only taken one class on it, but have you taken a look at F#?
http://research.microsoft.com/projects/ilx/fsharp.aspx
Could be interesting.
The problem with the mixed language approach in a project is that it limits the possibility for project management to move staff from one part of the project to another if needed. It also makes communications beteween project members using different languages more difficult.
Back In The Day, pre-.NET, this was high on my list for choosing Java or MS Anything.
I was unfamiliar with both Java Servlets/JSP and ASP development, but what I did see was to do a solid web app using MS tools, you had your Web folks using ASP code, and your back end folks writing in either Visual Basic or (horrors) C++ for COM objects/DLLs.
This means that you need an “expert” on each of these three different environments, and that there was very little knowledge sharing, or, even worse, basic assumptions we’re invalid (such as between the VB-esque ASP language and the VB du jour dialect at the time).
With the Java solution, it was solid Java from head to toe. All of the backend guys can look at front end JSP code and have a great idea what was going on and how to solve a problem. Also, since JSPs were simply Servlets, they behaved the same at a higher level compared to an ASP page and a VB module.
There are all sorts of issue with JSPs et al, particularly at the time (JSP 0.91), but by focusing on Java, everyone had to learn only a single environment, even if they specialized on different aspects.
HOWEVER, in MS defense, while the multi-language model of .NET isn’t necessarily beneficial at a project level, it is (ideally) beneficial at a library level, allowing the 3rd party libraries to be written in “anything” and interoperate with the same semantics. With .NET it should be easier to, say, use C++ code and objects within VB whereas the before the VB folks had to craft an interface glue layer before.
Mind, this is all heresay based on glossy lit and other net ramblings. I’ve never seen .NET. I think I’ve even managed to avoid downloading the engine to any of my PCs yet.
So, there’s basic, and three dialects of C (that’s counting Java). Or, basic, java and two dialects of C. Anyway you look at it, that’s hardly a rich palette.
I think it is Basic, C++, and two dialects of Java.
* C++ – Powerful, but a royal pain in the ass to get my head around.
* Java – For now, too damn slow. Forget it.
* Python – Seems to be my best option so far
* C# – Probably good if it spans platforms and is not dependent on .NET
For what it’s worth, I know all of these languages and here is my opinion on each:
C++ – Great low level language (although I prefer C), if you need that sort of thing, but with todays processors and memory being what they are, I see no reason to futz around with C or C++ unless you absolutely have to. If you’re writing an OS, I would consider it a good language to use. If you’re writing database front ends, why torture yourself?
Java – Great cross-platform language. Has a stigma of being slow, but this is no longer the case (I recommend using SWT instead of Swing for even better performance). The latest SDK is pretty quick in my opinion.
Python – I’m biased here since Python is probably my all-time favorite language. If you want to write GUIs with it, I recommend avoiding Tkinter and using wxPython (or one of the other graphic libraries available – personally, I lke wxPython). The thing I like about Python is it’s amazing text processing abilities and the ease with which one can implement functional programming techniques.
C# – It is a decent language, but it only works on MS platforms (for now anyway). It’s basically the same as Java, so if you don’t need cross-platform abilities, then it’s really sixes between these two languages; in my opinion.
I like C# for doing the sorts of things you are probably using VB6 for, but I absolutely HATE it for doing ASP.NET programming (but that is only because ASP sucks). The thing I hate about C#/ASP.NET programming is that it feel like your using a hammer to drive a screw. It feels like the wrong tool for the job, if that makes any sense. But I think a lot of MS technology is like that. They always try to munge a bunch of disparate technologies into one giant oozing package of goo.
Anyway, of the list of languages you proffered, I would strongly suggest giving Python a serious whirl.
.NET is an extendable platform. Part of it has been submitted to the ECMA. Its a shame that WinForms isn’t a part of the official standardization process but .net may well be largely platform independant one day.
Other vendors can also offer languages for .net. Its not limited to only what MS offers.
Cobol for .NET:
http://www.adtools.com/info/whitepaper/net.html
Python for .NET:
http://aspn.activestate.com/ASPN/Downloads/VisualPython/
You can also use Perl in .net from the same site above.
There are other vendors out there offering or working on implementing languages in .net.
this is just the beginning. .NET may well grow into a rich development platform.
What kind of options are there when it comes to C# on platforms other than Windows? Are there any C#-based graphical toolkits to play with on *nix or OSX?
GTK# and QT#. Not complete, but heck, it is functional.
* C# – Probably good if it spans platforms and is not dependent on .NET
Windows – Probably good if it spans across quantum dimesions and in not dependent on electricity.
I have to say I found C++ not so hard to learn and to use, but I mainly program on linux. Maybe Windows doesn’t have the sharpest API’s. C++ is a low overhead, general purpose language and therefore is very rich in features.
GTKmm and Qt are fairly easy to use and there are lots of other libs around for all kinds of purposes that I can easily use from C++.
GTKmm gave me some headache in the beginning, because there was little documentation, but that might have changed now (used GTKmm2.0 for that program). I liked the way it does memory management and the sig/slots system from libsigc++.
Qt is really easy to use and comes with a wealth of classes for all purposes and is more cross platform than GTKmm.
I’d rather wait for the next c++ standard (2005) wich will include GC and other things, than to use C#/.Net
The article is by Microsoft and posted on MSDN. Did anyone actually think the company would tout the advantages of any competition? This is nothing more than a company advertisement thinly veiled as a OS news article.
As for any .NET development efforts on any other platform, does anyone actually believe Microsoft will ever support any competitor? Microsoft wants to be the only game in town.
Fin.
Re: contrasutra:
“I didn’t mean “official” (MS) .NET, I meant all the .NET libraries, JIT, etc. MONO is an open source implementation of .NET.”
Well agreed, but regardless of that, my point was (or maybe, should have been )that C# is a standard, and really only needs .NET like C++ needs the STL. If I understand right, Mono’s purpose is really to map .NET as close to one-to-one for Linux as they can, but that’s just one way of doing it. Their aim is for OSS interoperability across platforms, not implement C# in another environment, which would be very possible, if somewhat esoteric.
Re: april_fools:
“But I have a sinking feeling that I’ll eventually get sucked in to one of your mixed environments, as part of some crash porting effort or something.”
I’ve got that crazy sinking feeling too
“As for new projects, I can perhaps see the use of C# GUI code calling C++ code, but the latter could be implemented in regular COM DLLs, right? I’m assuming Visual C# provides some sort of .NET/COM gateway.”
They do, and it’s a lot easier than bridging the gap in your code, but it’s a little legwork. You have to use tlbimp.exe (type-library importer, comes with the SDK and/or VS.NET) on your COM dll, which creates a valid .NET assembly that has all the type information for calling it from a managed environment, and thus wraps all of the COM calls up for you. There’s a good article on C# Corner here: http://www.c-sharpcorner.com/Code/2003/Jan/COMInterop01.asp
> Visual Basic .NET, the latest version of the world’s most popular
> development tool and language.
Wouldn’t they like to believe it.
(yawn)
Looking for funtional .NET?
Look at F#:
http://research.microsoft.com/projects/ilx/fsharp.aspx
-m
You really must remember that .NET “languages” are in reality .NET syntaxes. They are not programming languages, as anybody with 1/2 a brain knows. A programming language compiles, not TRANSLATE to MSIL.. These are scripting languages, aka syntaxes, plain and simple, anybody who say otherwise need their head checked.
Here’s a free, open-source IDE you can use with the freely available .NET SDK.
http://www.icsharpcode.net/opensource/sd/
Look up the term programming language. You will find that the definition does not say anything about wether the language has to compile to native machine code.
And there is nothing wrong with what you call scripting languages: python is not compiled to machine code, and you can write very complex applications in it (e.g. zope), so it is an application programming language.
The whole distinction between scripting languages and application programming languages does not make any sense anyway.
and…. which dictionary did you use?
plus, there is only two things wrong with scripting languages…. 1, they are slower then hell, 2. can anybody say “open source”, aka the source is freely available to anybody who looks?
You really must remember that .NET “languages” are in reality .NET syntaxes. They are not programming languages, as anybody with 1/2 a brain knows. A programming language compiles, not TRANSLATE to MSIL.. These are scripting languages, aka syntaxes, plain and simple, anybody who say otherwise need their head checked.
Apps are compiled or “translated” to MSIL but when they are run the JIT (just in time compiler) does compile them to native code. It then caches that native code on the target machine.
and…. which dictionary did you use?
programming language: An artificial language that is used to generate or to express computer programs. Note: The language may be a high-level language, an assembly language, or a machine language. (188)
He’s right. You’re wrong.
plus, there is only two things wrong with scripting languages…. 1, they are slower then hell,
Where do you get this crap?!? Scripting languages are interpreted. dotNET languages (like Java) are tokenized into IL (intermediate language — think of it as obj code) and are converted via Just-In-Time (JIT) compilation to native machine code. Whoever sold you that bill of goods about Java or dotNet languages being slow is about 7 years behind the technology curve.
2. can anybody say “open source”, aka the source is freely available to anybody who looks
2. can anybody say “open source”, aka the source is freely available to anybody who looks
Ever hear of Mono (<a href=”http://www.gotmono.com/“>http://www.gotmono.com/? Didn’t think so…
Educate yourself before you shoot off your mouth and make a fool of yourself.