Diane Trout (alienghic) wrote,
Diane Trout
alienghic

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.
Tags: me, programming
Subscribe

  • Guild Wars 2

    I started playing Guild Wars 2, and am happy their questing system has broken with WoW's current quest design. As WoW grew they "simplified" and…

  • calendar.

    Its been a really long time since I tried to write. I keep meaning to roll my own blog software, but there's so many other things I should be doing.…

  • Building debian packages for mozilla's sync server

    I'm surprised this seems to have gotten valid debian packages with a minimum of fuss for a package where I couldn't find a recommended release…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 8 comments