6 ms·
Show HN: Llr – a Clojure inspired Lisp that compiles to R in R
- qsort 5y agoIt's an extremely cursed idea... but it kind of makes sense. I can't stand R but things like dplyr and ggplot are incredible. I wouldn't mind having access to them in a sane shell.
- rcthompson 5y agoIt's not as cursed as you might think. R's semantics are already very lisp-like under the hood.
- bachmeier 5y agoI'll just point out that R started as a Scheme dialect. If you dig into the source, you'll see that the main C data structure is the SEXP, for s-expression. And as the other comment says, you can call everything as a function. You can write an s-expression form of R in about 30 minutes. Literally all you have to do is identify opening and closing parens and rewrite in `function`(arguments) form.
- rackjack 5y agoOoooooh wow, I remember digging into R internals a while ago for something and seeing `sexp`, and only NOW am I connecting it to Lisp's SEXP!! That makes so much sense! Does RData derive from LISP images? Because if so, that'd be quite the revelation to me.
- CornCobs 5y agoRData only stores the environment of the session. It doesn't store the current search path (you need to reload libraries). I believe it's not a full binary image like LISP
- lordgroff 5y agoI submit R is easily the most misunderstood language among programmers. And it's not just under the hood where it's very lisp like. Heck you can write it with an almost lisp notation if you really wanted to, `+`(1, 2), and the syntax is incredibly pliable. I'm a big fan of lisp and I'd argue it's one dialect of lisp I actually get to use.
- clircle 5y agoThere is a reason that statisticians love R. It's because the alternative to R for statistical work is SAS, not python. Compared to SAS, R is a godsend.
- salamandersauce 5y agoHonestly compared to python for statistical work R is a godsend. Pandas is kinda clunky and ggplot2 is IME more enjoyable than matplotlib.
- ptaken 5y agoThere's more to python plotting than matplotlib. Check out plotnine for example I do agree though that pandas can be a pain sometimes...
- asdff 5y agoHere I am preferring the base plotting. To each their own. I read words like "aes" "geom" "grammer of graphics" and my eyes glaze over. plot(data, main="title" etc.) is easy enough for me.
- bart_spoon 5y agoIf the plot is simple, ggplot may seem like overkill if you aren’t familiar with the library. But once you start wanting to customize things substantially or doing non-simplistic plots ggplot becomes much easier to use than base graphics.
- nomilk 5y agoThere's a few arbitrary codes/conventions to learn at the start. My take is not to look too deeply into them - every DSL/framework has them and in ggplot2's case they only take a very short time to get used to before you have the flexibility and incredible power/productivity of ggplot2 at your fingertips!
- Mikeb85 5y agoWhy? R is super Lisp-y anyway. And while R may have it's warts, I can't imagine prefix notation for data analysis all day long...
- rcthompson 5y agoI could imagine that proper Lisp-like metaprogramming might come in handy. R can do metaprogramming, but it's quite tricky, even with all the tidyeval tooling.
- nomilk 5y agoCurious to know what you/others consider to be R's warts? I have my own gripes with it, but mostly love it. I ask because it's interesting to learn what's missing form a language, what other languages do better, etc.
- Qem 5y agoHylang for R?
- pxc 5y agoI played a bit with Clojure and R in college, and I really liked them both. The next time I find myself computing some stats, I'll give this a try!