Saturday, July 3, 2010

My Plan for Programming Language World Domination

I've recently been playing around with prolog (of all things). This happened after reading in "Coders at Work" that Erlang was originally written in prolog. This blew my mind. My impression from a few weeks of prolog usage in a programming languages course and another few weeks in an AI course that it was a *cute* idea but not really anything like a general purpose language. I guess this just emphasizes the point that you don't really know enough to have a valid opinion after such a short exposure. FWIW, I've been pleasantly surprised at the feel of declarative programming.

This sort of reactivated a crazy idea I had in my youth. Back in high school I had this notion of being a polyglot. At one point I had a different language for each day of the week (French on Mondays, German on Tuesdays, etc.). Needless to say this overwhelmed me and I never really mastered any of them (though I retained an interest in linguistics).

But I still love this idea of learning lots of languages. But now it occurs to me that I *can* do this with programming languages. The main flaw (besides the audacity) of my original goal was that I didn't have access to any native speakers with which to really practice my language skills. But with programming languages you can always practice to your hearts content.

So here is my plan. I will rotate through my list of "keeper" languages as I run through my usual diet of "99 problems", "euler problems", ACM contest problems and other puzzlers I come across. After I confirm that I can comfortably solve relatively interesting (though smallish) problems in my current list of "keeper" languages I'll start work on getting another language up to speed to add to my Bat utility belt.

Part of my interest in such a plan is that I just love learning to think in new ways. OK, that's a lie. Sometimes it's interesting. Sometimes it is maddening. But in either case it feels important and useful like going for long runs and eating right. I don't love exercise, but sometimes it feels good and I'm more worried about what will happen if I *don't* do it than discomfort/nuisance of actually doing it.

My other concern is related to the fact that I quite luckily have been able to program primarily in python for the last 9 years. This has been fun, but I worry that I could be missing out on other cool emerging technologies and that while python is a decent way to express your thoughts, it is not perfect and I shouldn't stop exercising different ways to bend computers to my will.

So here is my initial list of languages that I presume that I can currently solve programming puzzles in: python, prolog and haskell. Haskell is my language of the year and prolog has been quickly ramping up again. After I verify that these guys are reliably at my fingertips the next few languages will likely be from this short list:

  • oz: Gives me an excuse to read CTM and it feels like and important laboratory for programming ideas
  • c: I feel guilty that I've lost my fluency in this. I want to get comfortable with thinking at that level again.
  • java: this is a lingua franca that I should be comfortable with (though I think it has the least to teach me). I used to be paid to do this, but I don't miss it.
  • a lisp (commonlisp/scheme/clojure/emacslisp): Do I need a reason? OK, probably scheme so that I can go through SICP all the way and be able to wield the ninja star of continuations with confidence.
  • smalltalk: Is there a more direct road to OO mastery? I've spent some time before but probably didn't give it enough of a chance. Also being different is sort of the point of this exercise.

There are many more that seem worth cultivating, but I don't dare write them down for fear of overwhelming myself too early on.

Any way, here we go again.

27 comments:

Juho Vepsäläinen said...

I just recently made a leap from Python to JavaScript as my hobby programming language. I have been having lots of fun with it so far. The object model is refreshingly simple and powerful.

If you decide to check out JS, remember to check out Douglas Crockford's lectures. They are somewhat instructive.

You might also want to peek at Lua. At least a little bit. It will probably change your view on OOP concepts a bit.

Considering you are going to get into C again Lua might be a good pick as it is somewhat easy to integrate into your C app.

I have been meaning to learn a bit of Haskell at some point as it looks really interesting.

Luca Bruno said...

Smalltalk is my favourite, unfortunately it has no luck... and you know, once something starts bad it will be bad in market.
It's the best dynamic OOPL I've ever seen.

Anonymous said...

If you want a Lisp, I would suggest you use Racket. It's a very well-document Scheme with a lot of libraries and extensions.

Hercynium said...

It may come as a surprise, but If you are learning multiple languages, I would actually recommend learning Perl.

Now, I don't mean the type of Perl you see on Matt's Script Archive, and not even the kind of Perl you read about in "Learning Perl" or "The Perl Cookbook"

I'm talking about Modern Perl which has an extremely rich, flexible object system (Moose), safely malleable syntax (Devel::Declare), and just about any modern functionality you may desire - a meta-object protocol, closures, threads, co-routines, roles (aka traits) continuations, first-class functions... even things that may people think are missing are actually available - function signatures, aspect-oriented programming, extremely powerful code profiling (NYTProf), and even (despite some people's belief otherwise) highly comprehensive static code analysis and metrics (Perl::Critic)

The only thing I believe you can't change in Perl are the sigils ($the @characters %at &the *start of variables) and, well, if you can't get over those forget PHP, Ruby, Shell, etc... :-)

BTW, there will soon be a book with the title Modern Perl, and its source is already available on github. It's not my book, but I think it's going to become the new best book to suggest for new, aspiring Perl programmers - or those who just want to get better.

Anonymous said...

If you enjoy prolog, Oz will rock your world. You'll probably have to unlearn some of your prolog habits though - in particular, prolog does implicit backtracking while Oz requires the use of explicit "search" objects.

The idea of a "declarative, object-oriented, distributed constraint logic programming language" might sound absurd but it lets you do some amazing things, like dynamically offload computation into the cloud.

dustbunny said...

@juho: Both of those languages are on my medium size list. There really is an amazing array of languages to choose from. I'd heard the Crockford's lectures are worth watching so I'll have to give those a look.

dustbunny said...

@luca: I've played with smalltalk a bit and I have a bit of a love hate relationship with it (partly due to my being forced outside of emacs). I suspect that it is one of those languages that could really grow on you if you give it a chance and I hope to sometime.

dustbunny said...

@hercynium: Perl was one of my first loves. It was the language that rescued me from my Java malaise and got me excited about programming again. That was a few years ago, but I still have fond memories of it. I think if I *do* resucitate my perl that I may just go with perl6 (since it seems to have lots of interesting ideas in there).

dustbunny said...

@rfk: oz is one of those languages that *seems* like it should be more popular than it is. I've dabbled a bit with a tutorial or two and was really amazed by the cool features. But then I have to wonder why it is that it hasn't caught fire more with a general audience.

kit said...

You might find Ruby is a more pragmatic alternative to Smalltalk. It has many of the same LISP inherited meta-programming concepts, and is a pure OOPL.

John Ortiz Ordoñez said...

I like Java as lingua franca, too. But, there are another alternatives more specialized to solve a concrete programming problems. Thanks for this interesting article. So long.

Newt said...

If you're good at learning new programming languages, then learning new spoken languages isn't that hard.


If you really want to you can. :P

Start with reading/writing, both easily achievable by yourself. Then move onto speaking, get a tape and practice to basic level, then go online for a "language exchange" website.

Even do it in conjuction with a coding language, since you'll exercise the maths part of your brain whilst coding. Then "take a break" and learn a spoken language.

Unknown said...

what about the Go language from Google? It's a new systems programming language. The syntax is good, and it was written by Ken Thompson and Rob Pike umong others.

Anonymous said...

So C# and J# ought to be on your list - C# because it's the best of .NET, and J# because no one else will have heard of it (always helps to have one really obscure one). Don't omit Fortran.

dustbunny said...

@kit: ruby is definitely on my slightly longer list. I've played with it a little but to start out with I want to focus on languages that are farther apart in language design space.

dustbunny said...

@christopher: It's funny, I've sort of lost my desire for learning lots of human languages. I sort of like the idea, but with limited time in a day I have too many other things that I find interesting over learning natural languages.

I did get fluent in Chichewa at one point, though (and got officially certified in it). :)

dustbunny said...

@biffsocko: Go is definitely another language that I would include on a slightly longer list. It does sound really interesting. I'm going to stick with the "classics" for my first few languages.

dustbunny said...

@anonymous(c#): Actually I had sort of written off .Net languages since I spend most of my life in linux, but I think it acutally my be a pretty cool diversion to learn a MS language/environment.

Bruce M. Axtens said...

My last job had me programming (to various depths) in Assembler, Ada, BASIC (predom. VB6 and VBS with a bit of VBA), C / C++, Delphi, Euphoria, Fortran, NewLISP, Octave, Perl, Protium and SNOBOL4.

They've all got their peculiar strengths. It's really hard to pick a favourite as all were good for something.

I'd love to get my teeth back into some Tcl, learn Eiffel, and maybe try my hand at Forth. That and just fill out the alphabetical listing above with languages starting with G through M.

Bruce M. Axtens said...

Oh, and let's not forget COBOL ... and Clipper ... and and ...

Ravi said...

maybe you should try brainf**k!

Bruce M. Axtens said...

@Ravi, bhai jaan, vo to dilchasp kayal hai (Is that how to say "interesting idea"?) What would be even more interesting would be to write a BF interpreter in all the other languages. There's a task on RosettaCode for that at http://rosettacode.org/wiki/RCBF.

dustbunny said...

@bruce: That's like the opposite of my current job. I never have any real reason to do anything other than python. For a long time I've felt lucky but now I feel like I'm really missing out on a wider world.

dustbunny said...

@ravi and bruce: Actually my natural inclination is to start with "silly" and bizarre languages. So I'm sort of forcing myself to do "sensible" languages to start. But I'd definitely like to do something like brainfuck at somepoint.

Further more, my long term goal is to be able to write a compiler/interpreter for any language from any language. I think that would be a good indicator that I've master a language. :)

Bruce M. Axtens said...

@dustbunny, "my long term goal is to be able to write a compiler/interpreter for any language from any language" sounds way too much like a SMOP to me. SMOP = http://en.wikipedia.org/wiki/SMOP

Tim said...

My primary programming language stack consists of C, C++, Python, Verilog, VHDL and assembly.

Language use break down for me.
FPGAs->Verilog/VHDL
Embedded Systems -> C/C++ and Assembly
Desktop -> C/C++ and Python (occasionally I need assembly for debugging.)

I've dabbled with several other languages, but they haven't ever really stuck with me. That said, I did not see Python as useful until discovering how quickly and easily I could put something together.

dustbunny said...

@tim: I'm aiming high, but I'd be satisfied to have a half dozen such languages in my holster. I've been dusting off my C most recently and I'm surprised how *fun* it is. It's harder to get things done than python but it's a surprisingly fun challenge so far.