21 ms·
I feel like you mostly just described Haskell, no?
by johnday 8y ago
I feel like you mostly just described Haskell, no?
- weberc2 8y agoHaskell is functionally pure with a syntax that I just can't bring myself to call readable. It's also very complex--which string type do I use? Which prelude? Which compiler extensions? Which build tools? Which testing library? I think if someone went and made a Haskell-lite and really focused on polishing the experience (including a familiar syntax, simple/straightforward tooling, relaxing the functional purity requirement, etc) it would be a great advancement.
- elviejo 8y agoI agree and the closest thing I've found to a Haskell lite is F#.
- debatem1 8y agoOcaml is, imo, a pretty and not utterly impractical language as well.
- weberc2 8y agoI knew the thread would head in this direction. :) Unfortunately, those languages' syntaxes are only marginally better and they have more complexity than I care for (especially objects and inheritance).
- gmfawcett 8y agoGiven your "especially" comment -- you might be mis-remembering something about OCaml? It's true that it has these features, but in practice they are almost never used. The object system is useful if your program's design really needs open recursion / inheritance. But it's far more common to build an OCaml program using other constructs (modules and simple data types). That's not to say that there isn't any complexity in OCaml. The type system and module/functor system have a daunting number of features. But most applications stick to a much simpler subset of the language, which is quite straightforward and easy to reason about.
- TylerE 8y agoDoes it still do the thing where it doesn't have operator overloading? Made math code oh so ugly.
- lenticular 8y agoOcaml has no ability to do ad-hoc polymorphism at all (but it does have parametric polymorphism), which affects more things than operators, so that's why not only have the weird math operators, but things like string_of_int. This will change at some point though. Modular implicits are coming to Ocaml. These are similar but much simpler than Scala's implicits, and allow the same kinds of patterns. If Ocaml gets that and eventually gains a bigger community with better library coverage, it's something I would consider using heavily.
- TylerE 8y agoThat would indeed be good yeah - it sounds like a small thing but it really would help code readability quite a bit, especially when dealing with stuff like bignums.
- ummonk 8y agoAlso has a syntax reskin in the form of ReasonML
- eli_gottlieb 8y agoPlease don't relax the functional purity requirement. Instead, just use an algebraic effects library in place of monads as the "sin bin", guaranteeing that anything fitting the requirements to be an effect commutes with other effects, but still requiring them to be marked in the type.
- weberc2 8y agoThat's not meaningful to me (I'm a Haskell novice), but the thing I care about is that the compiler doesn't reject correct code (and no, "correctness" is not defined by the compiler, it's defined by the desired behavior). Whether that property comes from relaxing functional purity or some library, I don't much care.
- eli_gottlieb 8y agoThere's a language community investigating those ideas here: https://www.eff-lang.org/ https://www.eff-lang.org/ . As they brag: >Effects are thus first-class citizens of Eff and can be seamlessly combined. There is no need for the do notation, no need for monad transformers, and no need to reshuffle your whole program just to read a global flag.
- johnwyles 8y agoOn that topic Haskell is soooooooooo much more readable than clojure to me
- mclehman 8y agoCould you elaborate on this? Personally, I like the idea of Haskell about as much as I like the idea of Clojure, but Haskell has never quite clicked for me. I don't think it's necessarily readability holding me back from Haskell, but I do find Clojure to be highly readable which really helped me get up to speed with it quickly. I'm curious what you find more readable about Haskell.
- nightski 8y agoHaskell has a higher learning curve. It takes effort to pick it up. There is no learn Haskell in 5 minutes. But it's syntax is incredibly consistent and beautiful once learned. Clojure has an incredibly simple syntax, but that isn't so much because it removed the complexity but rather that it just moved it away from the syntax imho.
- johnday 8y ago> There is no learn Haskell in 5 minutes. True, but there is a learn Haskell in 10 minutes... https://wiki.haskell.org/Learn_Haskell_in_10_minutes https://wiki.haskell.org/Learn_Haskell_in_10_minutes
- lenticular 8y agoIf you spend enough time in Clojure, it becomes quite readable. With threading macros and the like, there's no real reason you need many more parens that a language like Python.
- StreamBright 8y agoIt is kind of funny when I make my programmer friends count parenthesis in their code vs my Clojure.
- dpratt71 8y ago> which string type do I use? I think this issue is way overblown. The reasons for choosing a particular string representation in Haskell are analogous to the reasons to choose among e.g. byte arrays, streams, string builders, etc. in mainstream programming languages. > Which prelude? There is a standard prelude. Unless you actively choose another one, that's the one you'll get. > Which compiler extensions? If you want to use certain advanced language features, enable the appropriate extensions. > Which testing library? Many mainstream programming platforms (e.g. .NET) have multiple popular testing libraries to choose from. Is this a bad thing?
- weberc2 8y agoThese were examples of the choices one has to make when using Haskell; it is far from exhaustive. The point is that IMO Haskell undervalues consistency and standardization.
- dpratt71 8y agoI can only directly address the examples you've given. If you disagree with how I've characterized those examples, I'd be interested to know why. If you have other examples, I'd be interested to hear them. Haskell has its weaknesses, e.g. the lack of quality tooling available as compared to mainstream programming languages. But I disagree that Haskell is complex, at least as a criticism. When expressing concepts of a similar complexity, I find Haskell to be particularly concise and expressive as compared to most other programming languages I am familiar with. And if Haskell undervalues consistency and standardization, I would like to know as compared to what? The only programming languages that I know of where there are not many reasonable choices for e.g. a testing framework are those that either (a) haven't been around that long, or (b) haven't seen wide adoption.
- capitalsigma 8y agoI have never seen non-trivial Haskell that didn't enable at least 1 compiler extension. Laziness is difficult to reason about. Purity makes easy things hard in exchange for making hard things easy. You can't even make it through the standard library documentation without bumping into category theory. Haskell is many things. Simple is not one of them.