5 ms·
Lisp totally works for scientific/statistical computing! Julia, for example, is commonly called a Lisp. And S/R/&c. are also very lispy. As is APL, to a lesser
by snicker7 6y ago
Lisp totally works for scientific/statistical computing! Julia, for example, is commonly called a Lisp. And S/R/&c. are also very lispy. As is APL, to a lesser extent.
- remexre 6y agoThough of course, https://i.redd.it/zcavazlx5sm51.jpg https://i.redd.it/zcavazlx5sm51.jpg applies to that :)
- aidenn0 6y agoOkay, I don't recognize the logo in the very center of that diagram, any hints?
- StefanKarpinski 6y agoThis is great, I hadn't seen this before. Semantic Lawful / Syntactic Chaotic seems like a fair characterization of Julia. There's too much syntax for hardcore lispers to be entirely comfortable but almost all of the syntax is just method calls in disguise, so it's semantically pretty clean.
- TooKool4This 6y agoAside from the language features, some of the libraries in Julia make it really useful for statistical computing. One really cool library I am trying to use more and more in Julia is the Measurements library [1]. With the multiple dispatch system in Julia its super easy to integrate into most problems and can let you estimate error bounds on values programs produce. Super important for scientific applications. I am hoping in the future that I can mix this in with some auto-diff problems to get uncertainty bounds on estimation problems with minimal fiddling with covariance matrices. Right now the performance is the only problem in integrating the library into pretty much any problem :( [1] https://github.com/JuliaPhysics/Measurements.jl https://github.com/JuliaPhysics/Measurements.jl
- clircle 6y agoI've never understood what makes R lispy. I think R is a very flexible and interactive language, more so than Python, but does that mean it is lispy? Pardon me, I don't know enough about languages to pin it down.
- nerdponx 6y agoAll R source code can be represented as built-in R data structures, and you can capture unevaluated expressions in arbitrary places at runtime.
- clircle 6y agoThis is very interesting. Can you recommend some readings about these features? Especially as they may pertain to R.
- nerdponx 6y agoThe "Metaprogramming" section of Advanced R by Hadley Wickham is a good introduction, although it emphasizes the author's own library and their own (intelligent but opinionated) approach, rather than the core language primitives: https://adv-r.hadley.nz/metaprogramming.html https://adv-r.hadley.nz/metaprogramming.html There is also Metaprogramming in R by Thomas Mailund, which seems good from the preview material I was able to find: https://www.apress.com/gp/book/9781484228807 https://www.apress.com/gp/book/9781484228807 For really powerful demonstrations of what R metaprogramming can do, see the Dplyr and Data.table packages. Personally, I've used it to implement things like shorthand lambdas, the Clojure threading macro, and a function composition operator that constructs and evaluates an expression of nested calls to keep runtime overhead down to a minimum. R macros are sometimes more powerful than true Lisp macros, in that there is no separation between the macro expansion phase and code execution. This is possible because R function arguments are lazily evaluated. The argument is a special "code object" that represents an expression. If you want to capture or change that expression, you can do so freely inside the function. So there is no need for macros, just functions that can capture unevaluated expressions. Incidentally this also makes R very hard to optimize, since any function can do this at any time.