5 ms·
I've written an interpreter for R (a subset; it was for school and I left out some features like S4 and the condition system) so I have done some pretty deep di
by CornCobs 5y ago
I've written an interpreter for R (a subset; it was for school and I left out some features like S4 and the condition system) so I have done some pretty deep dive into the language reference and GNU R source.
I agree with the author's sentiment - I love a lot of what R has, but there is a lot of small madnesses.
There are so many unique PL ideas in R (may not actually be unique but certainly unique among common languages today)
- first class environments
- named, default parameters and even the ... parameter which encourages the pattern of hierarchical library functions - there's one large customizable main workhorse function, and many wrapper functions that specify some defaults or add some behavior, but all the underlying customizations are exposed through ...
- copy on write as a default
- ability to choose evaluation strategy
But I also wonder how many of these cool ideas would actually work well in a saner language
- ggrothendieck 5y agoIs the subset R interpreter you wrote available on the net?
- CornCobs 5y agoSorry for getting back to you so late; I'd rather not link my github here as I'd rather remain as anonymous as possible on public forums