5 ms·
Because I really like syntax like Haskell (the type signature is much clearer especially in generic code compared to Java or Scala etc. for example), I'm curiou
by redtuesday 10y ago
Because I really like syntax like Haskell (the type signature is much clearer especially in generic code compared to Java or Scala etc. for example), I'm curious, what is so uncomfortable about the syntax?
- skybrian 10y agoThe lack of parentheses around function calls makes it hard for people not familiar with ML-style languages to tell where the function calls are and what the arguments are to each function call. There is a wide variety of syntax among mainstream languages, but basic function calls are pretty much all the same. Take a look at Reason [1] for an example of how a functional language (OCaml in this case) can be made more familiar. [1] https://facebook.github.io/reason/ https://facebook.github.io/reason/
- eastWestMath 10y agoOr maybe people could just become familiar with ML-style languages? The basic syntax shouldn't take more than an hour or two to pick up.
- skybrian 10y agoWell sure, but you could say the same thing about Lisp.
- eastWestMath 10y agoWell they're both the lambda calculus, Lisp just had parentheses.
- kazinator 10y agoDoes lambda calculus have character strings, structures, exceptions, symbols, mutable variables, quoting code as data, macros and three different kinds of object equality?
- fbreduc 10y agoit does have symbols
- kazinator 10y agoDoes it really? Some of the algorithms for reducing lambda expressions are symbolic, like, say, alpha reduction. But they are not done in lambda calculus itself, as far as I can see; they are done on lambda calculus (by the mathematician, or a machine for manipulating lambda calculus terms). Analogy: just like ordinary algebra doesn't have symbols; but of course mathematicians work with symbols and so do computer algebra systems. Since lambda calculus is Turing complete, it can of course represent lambda calculus manipulation (via Goedel numbering of lambda terms and then working with their arithmetic encoding as Church numerals, or whatever).
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]
- redtuesday 10y agoYes, I agree, that took me also some time to get used to when I dabbled with Haskell and I looked at more complex programs.
- kazinator 10y agoOf course, if we adjust "mainstream" so that it refers to that set of languages which have pass-by-value, strictly evaluated arguments, with no implicit currying, then your point is nearly self-evident. :)
- ungzd 10y agoRuby has optional parentheses around function parameters (usually it's recommended to avoid parentheses if possible). Shells have no parentheses around command arguments. These languages are mainstream and no one complains about this.