Languages - Diane Trout

Page Summary

Links

Languages

A little while ago on slashdot, there was an essay about a company that used formal methods and a "safe" version of ADA to produce code that with far fewer bugs than standard in the industry. At work I've been coding in python, and though python is a neat language when it comes to processing gigabytes of data, python's feeling a bit slow.

These two things combined left me looking for a new programming language.

What I want is a language that's expressive, safe, fast, and can be called from python. To be expressive a language should support multiple programming paradigms, and have a good suite of control structures.

List comprehensions, though quite dangerous to python's readability, are really quite expressive. The following fragment turns a tab delimited text file into a list (lines) of lists (columns).

data = [ x.strip().split("\t") for x in open("tab-delimited.txt",'r')

For safety, I'm friggen sick of programs suddenly dying because C or C++ let someone use an invalid pointer. Do I have to mention buffer overrun attacks because of brain dead string processing?

In my investigation I considered highly boost-ified C++, haskell, and ocaml. Haskell's GHC compiler generates gigantic binaries (200KiB hello world? WTF?), but is otherwise an interesting looking language. OCaml is fast, and has a good module system, but it can only generate shared libraries when using the byte code interpreter which kind of defeats the purpose of switching from python. C++ is still miserably complicated, and of questionable safety.

My coworker reminded me to not discount D. Upon investigation D does have some really nice features, like built-in unittests and design by contract. It's also compatible with the C binary interface, which should make building python extensions reasonably straight-forward.

(no subject)

My friend John is hugely into Haskell. May I send him the link to this post so he can advocate to you? Or would that be obnoxious? He's not an asshole advocate about programming languages, ie., he's one of those "THIS LANGUAGE IS A GIFT FROM THE GODS THAT WILL SOLVE ALL YOUR PROBLEMS FOREVER!!" -- he just likes Haskell a lot.