?

Log in

No account? Create an account

Languages

« previous entry | next entry »
Jan. 25th, 2006 | 03:56 pm

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.

Link | Leave a comment | Share

Comments {8}

secretslip

(no subject)

from: secretslip
date: Jan. 26th, 2006 12:07 am (UTC)
Link

I refuse to let there be a language called D. Come on, computer people are more clever and less obvious than that!

Reply | Thread

Diane Trout

(no subject)

from: alienghic
date: Jan. 26th, 2006 12:13 am (UTC)
Link

Considering C was derived from B ( a long long time ago.), computer people can be fairly literal.

Reply | Parent | Thread

secretslip

(no subject)

from: secretslip
date: Jan. 26th, 2006 12:27 am (UTC)
Link

I try not to think about that. A --> B was like "oh ha ha" B-->C was like reusing a joke. Can do it once. C --> C++ is the "i'm overdoing a joke on purpose".

C--> D isn't funny. It wont be funny again until P.

Reply | Parent | Thread

(no subject)

from: clynne
date: Jan. 26th, 2006 01:36 am (UTC)
Link

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.

Reply | Thread

Diane Trout

(no subject)

from: alienghic
date: Jan. 26th, 2006 01:51 am (UTC)
Link

Go for it. It might be nice to have a discussion to help me understand haskell better.

Out of curiosity is his name John Meacham? 'Cause his haskell compiler did far better than GHC, it just took a while to compile.

Reply | Parent | Thread

(no subject)

from: clynne
date: Jan. 26th, 2006 01:55 am (UTC)
Link

Yes, that's the John I know.

I'll give him a link to this LJ entry, and let y'all exchange contact info and so forth. He's john at UGCS if ya wanna just drop him a line.

Reply | Parent | Thread

Bolowolf

(no subject)

from: bolowolf
date: Jan. 26th, 2006 02:30 pm (UTC)
Link

Not knowing enough about programming languages, but understanding some general concepts, and believing highly in your ability, what about writing your own language?

Reply | Thread

Diane Trout

(no subject)

from: alienghic
date: Jan. 26th, 2006 08:44 pm (UTC)
Link

There's a lot of details about language design that I don't know... And I certainly don't know enough about how optimizing compilers work to produce something really fast.

Reply | Parent | Thread