I recently published my first
npm package:
assert-type, a library to help with writing concise runtime type assertions in Node.js programs.
Background: An OCaml hacker's year with Node.js
The new
DNAnexus platform uses Node.js for several back-end components, so I've had to write a fair amount of JavaScript in the year since I joined. Considering I wrote the majority of my grad school code in
OCaml, a language found at the opposite end of Steve Yegge's
liberal/conservative axis, this has been quite a large adjustment. Indeed, I frequently find myself encountering certain kinds of silly runtime bugs, and writing especially tedious kinds of unit tests, that are both
largely obviated in a language like OCaml.
So, I still count myself a hardcore conservative. But there's certainly a lot I've enjoyed about Node.js. When requirements evolve, as they always do, JavaScript and Node's "module system" (those are
air quotes) will usually offer quick hacks instead of the careful refactoring that might be demanded by a type-safe language. This incurs
technical debt, but a lot of times that's a fine tradeoff, especially at a startup. More generally, Node's rapid code/test/deploy cycle is a lot of fun, without all the build process and binary dependency headaches. The vibrancy of the developer community is amazing, as is the speed at which the runtime itself is improving. (There was a period a few years ago when I feared OCaml was dying out entirely, but there's some
real momentum building now.)