4 ms·
> The matlab style syntaxt is infinitly better for ML, stats and math. Syntax is a secondary concern for all but short-term, small-scale programming. When it
by valw 7y ago
> The matlab style syntaxt is infinitly better for ML, stats and math.
Syntax is a secondary concern for all but short-term, small-scale programming.
When it comes to making scalable software systems (scalable in every sense of the term, not just performance but also feature growth etc.), syntax is really not the biggest concern; as such, optimizing for syntax can be detrimental to other more important aspects (e.g composability, reusability, programmability), and focusing on syntax means you're not paying attention to the really critical stuff.
I mostly work in Clojure where _all_ operations use prefix syntax (e.g you write (+ A B C) instead of (A + B + C) for addition, and + is just a function). Trust me, it's unfamiliar at first, but it makes reasoning about the program MUCH saner than all the special cases and irregularities that language designer bake into the language just to make some operations infix.
- zwaps 7y agoDifferent things to care about. I have worked on stats in research, start ups and at large banks. A lot of production/infrastructure related things certainly profit from the points you mention. But 99% of statistical applications I have seen differ. For someone using math, "programmability" and the other aspects you mention are certainly higher in a language that emulates how we think about the problems. While indeed Clojure may work well for some areas in math, Julia is certainly appropriate for statistics and probability - in my opinion the best -, and finally, Python isn't very good for either. Everything else is almost always secondary. I would also argue that Julia is absolutely fine for developing large, scalable programs, not worse than Python. Since Clojure has no statistics / ML ecosystem afaik, I am not sure why you mention it. This is absolutely crucial to even being considered in my point. That is why R dominates statistics still, by a large margin.
- valw 7y ago> Since Clojure has no statistics / ML ecosystem afaik, I am not sure why you mention it. I mentioned it to illustrate my point, that semantics and other aspects matter much more than syntax in many cases. (Btw Clojure does have a ML / stats ecosystem, in part via the JVM, though certainly not as developed as Python / Julia / R. For instance, Anglican is a probabilistic programming language embedded in Clojure: https://github.com/probprog/anglican https://github.com/probprog/anglican). > For someone using math, "programmability" and the other aspects you mention are certainly higher in a language that emulates how we think about the problems. Sure, but syntax is just about notation - semantics are much more important to achieving nearness to a mental model. If you can't express your mental model in another notation than the one you're familiar with, then you probably don't have a very deep understanding of said model. Continuing with my example, prefix notation for matrix multiplication does not hurt _at all_ my ability to reason about linear algebra - it sometimes even clarifies it. I also think you misinterpret what I meant by programmability, which is not the same thing as 'ease of programming' - more like how smoothly various parts of a program interact. If for the sake of syntactic sugar you've introduced a proliferation of different programming constructs with no unifying abstraction, then the other parts of the program will need to make a proliferation of case distinctions as well - that's one way to hurt programmability.
- daslu 7y agoTo add on what @valw said: Clojure's ML/stats ecosystem is moving fast. Several important libraries are under construction and will mature in few months. Imho, it is worth following this year, for anyone interested in languages for ML/stats. In addition to probabilistic programming libraries such as Metaprob and Anglican mentioned above, here are some libraries worth mentioning: https://github.com/MastodonC/kixi.stats https://github.com/MastodonC/kixi.stats https://github.com/generateme/fastmath https://github.com/generateme/fastmath https://github.com/techascent/tech.ml https://github.com/techascent/tech.ml
- fulafel 7y agoAnyone have a comparison of Anglican vs Gen? According to https://github.com/probprog/anglican/blob/master/doc/devel.md https://github.com/probprog/anglican/blob/master/doc/devel.m... the programmable inference seems to be a feature of both.
- alew1 7y agoGood question. Disclaimer: I’m in the lab that made Gen & was on the paper, so not impartial :) Anglican is implemented in Clojure, and can be extended (by writing new Clojure code) to support new general-purpose inference engines. Creating those extensions requires an understanding of both the statistics and the PL concepts used in Anglican’s backend; you are essentially writing a new interpreter for arbitrary Anglican code. Gen provides high level abstractions for writing custom inference algorithms for _specific models/problems_ (not entire general-purpose inference engines). Those abstractions don’t require reasoning about PL concepts like continuation-passing style, nor do they require the user to do any math by hand. Of course, since Gen is just Julia code, you can still reach in and implement new inference engines (just as in Anglican/Clojure) if you’re an expert. But I wouldn’t expect people who are not probabilistic programming researchers to do this (in either Anglican or Gen).
- kgwgk 7y agoMaking scalable software systems is a secondary concern to most people.
- bayareanative 7y agoRPN FTW. Good ol' LISP. :) In Haskell, you can turn any function into an infix operator with backquotes. As a qualitative, nonfunctional stylistic, ergonomic opinion, I find Haskell much more flexible and beautiful than the ugliness of most brace-, paren- and prolixity-heavy languages. It can present too many features for pragmatic use, orthogonal to something in another domain like Rust or Go for effective software production where features are intentionally constrained or disallowed.
- GorgeRonde 7y agoWe have macros and LISP is a building material, not a language. One line of code is just enough to get something that works (defmacro infix [a op b] `(~op ~a ~b)) There are libraries for that too. Clojure: https://github.com/rm-hull/infix https://github.com/rm-hull/infix
- gumby 7y ago> RPN FTW. Good ol' LISP. :) Actually Lisp uses ordinary old polish notation. Reverse Polish Notation is used by stack-oriented systems like HP calculators and Forth.
- kazinator 7y agoNot really; the motivating point of Łukasiewicz's notation was specifically to eliminate parentheses.
- klipt 7y agoWell choosing between (- (+ 1 2 3 4 5) 1) and - + + + + 1 2 3 4 5 1 The first one seems much more readable to me...
- gumby 7y agoLisp functions can take fewer or more than two arguments while many mathematical operators take only two. And parentheses don’t serve precisely the same role in Lisp syntax than they in the more free-form world of maths.