18. @OldDutchCap catenacci@ieee.org
You Must Remember This
● Alternate Languages
o Help expand our skills
o Let us use libraries in other languages
● Probably not ready for production work just
yet
18
Editor's Notes
First of all a bit about me
My name is Onorio Catenacci and I’ve been a .Net developer almost as long as there’s been .Net; about 12 years or so. You can reach me via twitter at @OldDutchCap and you can e-mail me at catenacci@ieee.org. Those two things will be at the bottom of all the slides so don’t worry about writing that down.
Tonight we’ll be discussing other languages built on the CLR platform besides C#. I will also try to get to some code samples but since we’re going to be discussing a breadth of languages, I can’t go very deep into any of them. If you see a language and want to know a bit more about it, my suggestion would be to go to RosettaCode and check out examples of how to code in the language.
One thing I want to avoid is some of the religious arguments which come up when developers discuss languages. I don’t think of languages as being “better” or “worse” than other languages. I just think some languages make certain chores easier and some languages make certain chores harder.
A couple of bookkeeping points here:
Please silence your phone if you haven’t done so already.
If you think of a question while I’m talking, please raise your hand. We’ll have time for questions at the end as well but I’d rather people ask questions while they’re fresh in their minds than wait till the end of the talk to ask.
Please remind me if I forget to repeat the question back to the person asking me the question.
So probably the first question most developers will have is “Why bother with other languages on the CLR? Isn’t C# capable of doing everything I need?” I think there are a few good reasons to at least examine alternate languages on the .Net platform; I’ll cover them right now.
A friend of mine, Leon Gersing, used to be an actor on Broadway. Leon related the story of sitting in a deli in New York City with some friends discussing a performance of Chekov they’d just seen. A Russian fellow who happened to be sitting nearby said something like “Pardon me but I couldn’t help overhearing you. It’s a shame you don’t speak Russian; Chekov is much better in the original language. In Russian there are several different words for love and Chekov uses all of them.”
While the Sapir/Worf hypothesis doesn’t hold true as far as I know, it is certainly true that certain ideas are very tough to express without the right vocabulary to capture them. And certain programming ideas are very hard to express without the right code constructs. Anyone here tried to write an implementation of a linked list in a language that doesn’t have recursive types? It can be done but it’s neither easy or fun.
I will say that I think it’s a shame that Object Orientation has become the new orthodoxy. While OO is fine for solving lots of problems there are a whole range of problems that simply don’t decompose into objects easily and developers end up kludging together weak solutions in those cases.
There are some libraries already present in other languages which are sometimes handy to use in C#. If you want to use these libraries you’re left with a choice; try to find a similiar library in C#, try to rewrite the code in C# or try to figure out another way to get the functionality you need.
Another reason to investigate alternate CLR languages is to learn new skills. Even if you’re happy in the rut you’re in, learning new skills can still make you a more effective developer.
So what other alternate languages exist for the CLR? You can find a list of them here; there are probably about 20 or so. I’m going to focus the rest of this talk on the more interesting and maintained alternate languages.
Yes, there is a version of COBOL for .Net. The biggest advantage of this, is, of course creating new code to work with legacy COBOL code that you don’t want to have to rewrite. As an aside there’s also Ada and Prolog but it seems as if both of them are basically abandonware. If anyone’s unfamiliar with Ada, it’s used in defense department work while Prolog is an implementation of Logic programming
One interesting point; when MS first released the CLR and the .Net platform, they were uncertain of the reception of either C# or VB.Net but they had a powerhouse in C++. So they built a version of C++ which basically, for lack of a better way to say it, neutered the manual memory management which had always been a hallmark of both C and C++.
Now the functional languages take the traditional paradigm of default mutability and flip it on its head. While I don’t have the time or the inclination to do a long discussion of the ideas behind functional programming, suffice it to say that functional is gaining a lot of traction in more cutting edge shops. I’ll show you some rosetta code in some of the functional languages in just a bit. You might also note that “IronScheme” is on that list; we’ll see that name “IronBlahBlah” again. The story goes that Iron is short for I Run On .Net.
Now besides having the distinction of being scripting languages for the CLR, IronPython and IronRuby also have the distinction of being a large part of the reason that the DLR was created. Both python and ruby are dynamically typed languages. The CLR itself was designed with statically typed languages in mind. When Jim Hugunin created the language, he also had to basically create the dynamic language runtime from scratch. Around 2006, Microsoft officially began supporting these two languages but in 2010, they dropped support for them. IronPython is still around but I believe IronRuby, like Prolog and Ada is basically abandonware.
There are a few other languages worth a quick mention before we move on to other topics. These are a couple of languages which are definitely gone.
Axum was an implementation of the actor model for .Net. In a sense it could be called an interesting hybrid of Erlang and C. While Axum has been discontinued for years several of the ideas which started in Axum ended up in the TPL and in the async behavior of current versions of .Net
Scala for .Net was at one point actively developed with the help of MS Switzerland (or so I understand anyway). Scala, like F#, Clojure CLR and Iron Scheme is a functional language but unlike those other three languages Scala retained a bit more of the OO flavor.