Mere Code

Diverse Topics of General Interest to the Practicing Programmer

Bad Snake Joke

Just between you and me, I’m getting a bit bored of writing Python all the time. It’s a good language: I can write code that’s functional or OO as the case may be; it has lots of libraries; it has Twisted, which is incredibly useful; it’s not too hard to make a big project and keep it clean. It’s the least awful programming language that I know of. That said, I’d like to do something different.

I would like to play with something makes static typing rock (like Haskell), or that has what Rich Hickey calls “polymorphism a la carte” (again, like Haskell, or Clojure). I would like to make something that stands a chance of feeling snappy (perhaps PyPy?), a chance to use something with richer debugging and refactoring tools, or to get a feel for doing some serious concurrency work outside of an event loop.

But mainly, I’m just bored of Python.

Also, I increasingly suspect that Python doesn’t have legs. The Python 3 language change has increased the split between the core developer community and people writing code in the field. Python continues to be slow, both with start-up time and while running. The only people who seem to care are the PyPy developers, but I doubt I’ll ever get to use it for commercial development. It’s tricky to write code in Python that takes advantage of multiple cores, and even my phone has multiple cores now.

When I get the chance, I’m going to do more with Haskell and Clojure in my spare time. I’m not sure if there is something less “fringe” that I could recommend for use at Canonical. Go is a possibility, if a slightly disappointing one (interfaces are cool, but why oh why didn’t they do typeclasses?).


John Nilsson on 2012-06-25 23:26
I was mainly thinking of how the scala implicits implementention give you somewhat more control over type class instances.

But in general, being an OOP/FP hybrid it gives you some tools form the OOP end of things that provides some extra options.

Full H-M type inference had to be sacrificed to get OOP though, but the inference is still pretty good.
jml on 2012-06-25 10:22
+John, thanks, will give it a try. I have to say that of the "new" JVM languages, I'm more tempted by Clojure. Can you explain a little how it's type system could be considered better than Haskell's in some respects?
John Nilsson on 2012-06-24 11:16
You should give Scala a try. Its type system rocks (in some ways even beats haskell), has a type class mechanism (which should give you polymorphism a la carte) and compiles to Java (so is quite snappy). But most importantly its fun.
AmanicA on 2012-02-28 10:12
lol. good post :)
jml on 2012-02-26 16:28
@Tom, I'll take a look at Racket. When I last looked at PLT Scheme, my main take-away was disappointment in its module system.

@glyph, it's kind of a good thing. It's arguably a great thing for the end users of my work. If the way out of Python's boredom is to run through some other language's minefield, then, umm, yeah, no thanks. However, I'm not convinced that every other language will necessarily be more dangerous/frustrating/slippery/difficult.

As for going further up the stack, it's definitely an option, but not one that immediately appeals.

@Daniel, I haven't tried Vala. Does it do much beyond Java / C#?

@ddaa, I'm glad I'm not the only one! That I'm bored after twelve or so years rather than, say, consumed by loathing, is a good sign. I look forward to hearing more about your project.
ddaa on 2012-02-26 15:03
That is how I feel about Python at the moment too. As Glyph says, that probably tells something good about the language…

Clojure and Go are the two "next" languages I have in mind too. I will posting something on g+ about a project I have been contemplating for a while.
Daniel Bo on 2012-02-26 03:14
Learning new things is great and no one should get themselves in a rut.

Have you tried Vala? GObject introspection in a C3/Java-like language that pre-compiles to C. It hits that start-up time problem you mentioned. Vala also has a sister language called Genie, which is much more Python-like and which uses the same libraries and compiler. You may want to start there.
glyph on 2012-02-26 01:02
I humbly submit that being bored with the language is kind of a good thing. Maybe you should be looking further up the stack for some excitement? Do something with PyGame, maybe? Or learn something about bioinformatics and mess around with BioPython?

To put it a different way: when I was doing C++, I felt a range of emotions about the language and my tools for dealing with it, but "boredom" was not one of them.

(That said, Twisted really needs to make it easier to utilize multiple cores.)
Tom Berger on 2012-02-25 15:09
If you're thinking of revisiting lisp, I urge you to take a look at Racket, the latest incarnation of PLT Scheme. Racket gives you the opportunity to work with pretty much all the best tools and paradigms modern programming languages can offer (dynamic typing, static typing, functional, OO, declarative), it is reasonably performant (optimizing JIT compiler, optional type declarations) and though not as hype as Clojure, it has a small but active and very mature community.

Go is great, but I'm finding it hard to give up the dynamism, especially interaction.
Tom Berger on 2012-02-25 15:07
This comment has been removed by the author.