Hacker News new | ask | show | jobs
by gaius 5765 days ago
I do a lot of command-line-tool-writing, my language at the moment is Haskell, tho' I still count myself as a Haskell beginner, it's proving to be very productive. The old adage that if Haskell code compiles it works is mostly true; bugs are caught up-front rather than after running in the wild for a bit; type inference, explicit pure/IO and functional composition are real boons. I need to build more familiarity with the libraries before I can be as productive in the short term (e.g. for "one offs") as I am in Python but already I believe in the long term (because one-offs never are!) I'm pulling ahead.

OCaml would be a good choice too. Both of these languages work very naturally with tree-like structures. Profiling/code coverage in both is very easy. IMHO there's no need to go to C for any but the most performance-critical code (and remember that your I/O etc is already in C in the kernel). The C approach of checking the return value of every syscall (e.g. no exceptions) is very cumbersome.

Case in point today: rather than persuade our Unix guys to roll out Expect across a bunch of new machines, I rewrote a ~200 line Expect script I had in ~60 lines of Haskell and deployed a binary instead of a script.

1 comments

On OCaml, http://ocaml.janestreet.com/ might interest the OP.