Better living through fib functions

...or why posting benchmarks of fib a function in x language:

  1. is a slightly puerile approach to discussing performance and scalability
  2. ignores any number of reasons why people would choose node.js, other than throwing out received knowledge for the hell of it

But with the discussion raging (it now appears Haskell is the cure after all) I thought I'd venture a clojure solution:

And the requisite benchmark of questionable utility:

With that we've proved:

  1. A fib function can indeed be written in clojure, and its return value piped to a web browser
  2. Um, that's about it

Presumably the OP will be enraged to find that clojure also has its own web server (piggybacking off aleph here). That said I didn't realise retro CGI scripting was so avant-garde in 2011; guess I'm not 'deck' enough to realise but then I don't have a fixie or an assymetric haircut either :/

Really I haven't dabbled with node much because I just don't can't warm to javascript; I find the language constructs native to lisp dialects (mostly clojure and scheme) much more elegant and alluring, but it's a subjective thing. Having grown accustomed to continuations, first-class concurrency primitives, pure functions, lambdas etc JS (and by implication node) feels like distinctly barren linguistic territory.

I only wrote this post because I was at a loose end but it is surely proof by contradiction that this dialogue achieves nothing. You need more than contrived benchmarks to qualify the shortcomings in a language. Leave them to college kids like me with nothing better to do ;)

Filed under  //   clojure   diatribe  

Comments (0)

Leave a comment...