30 January 2014

Under the micRoScope

The R community's instance on layering (for mindshare purposes) "functional" and "object oriented" tattoos on the language has always struck me as something between self-aggrandizement and self-delusion. R is FORTRAN, pure and simple; functions eating data. That the data can be given a identifier is meaningless. One of the results of R's design/heritage is that variables have somewhat squishy provenance.

Now comes another treatment of the pasta bowl via R-bloggers. The comments are a stitch.

If you want the full monty, read up on 'environments' in any R docs; "R in a Nutshell" (mine is first edition) has a chapter on it.

Here's two conjoined footnotes from the chapter (8, page 100):

- If you're familiar with other languages and language lingo, you could say that R is a lexically scoped language.

- This allows symbols to be accessed as though R were dynamically scoped.

Reminds me of that penultimate scene from "Chinatown".

One of the comments links to this post with a comment by Ross Ihaka. That post is from 2010, by the way. Not a new realization.

If you're from the world of "normal" programming languages (C family or Algol family), none of this makes sense. Pick a fork in the road, and stay there. Just because one uses the word 'function' in defining a block of code isn't sufficient to claim that the language is 'functional'. Similarly, attaching labels to data structures, and calling said structures 'objects' isn't sufficient to claim that the language is 'object oriented'.

No comments: