News for hackers. Stuff that matters.
Re:Coconut: Pythonic functional programming by elviejo on Thursday January 03, 2019 @11:23AM (#18816254)
I agree and the closest thing I've found to a Haskell lite is F#.
Re:Coconut: Pythonic functional programming by debatem1 on Thursday January 03, 2019 @11:49AM (#18816525)
Ocaml is, imo, a pretty and not utterly impractical language as well.
Re:Coconut: Pythonic functional programming by TylerE on Thursday January 03, 2019 @11:59AM (#18816641)
Does it still do the thing where it doesn't have operator overloading?

Made math code oh so ugly.

Re:Coconut: Pythonic functional programming by lenticular on Thursday January 03, 2019 @12:30PM (#18816973)
Ocaml 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.

Re:Coconut: Pythonic functional programming by TylerE on Thursday January 03, 2019 @02:28PM (#18818344)
That 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.
Re:Coconut: Pythonic functional programming by weberc2 on Thursday January 03, 2019 @11:54AM (#18816585)
I 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).
Re:Coconut: Pythonic functional programming by gmfawcett on Thursday January 03, 2019 @12:34PM (#18817022)
Given 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.

Re:Coconut: Pythonic functional programming by weberc2 on Thursday January 03, 2019 @12:54PM (#18817236)
Granted objects are rare and this isn't one of the things I consider to be significant grievance about OCaml. :)
Re:Coconut: Pythonic functional programming by gmfawcett on Thursday January 03, 2019 @02:58PM (#18818653)
Fair enough. :)
Re:Coconut: Pythonic functional programming by ummonk on Thursday January 03, 2019 @10:02PM (#18821634)
Also has a syntax reskin in the form of ReasonML