Live data from Hacker News

Exploring ReasonML and functional programming

reasonmlhub.com

61–65 of 65 posts

Re: Exploring ReasonML and functional programming

#61
post #60
post #59

Earlier quoted context omitted.

I mean, if you want a direct quote from Lennart Augustsson, here's a quick transcription of the relevant parts of the relevant video. https://www.youtube.com/watch?v=hgOzYZDrXL0 > So strictness is really fantastic, I must say. Stack traces work. When something goes wrong, you can say "so you call things from there to there to there". It's the single most time saving thing from Mu compared to Haskell, because things d…

It seems we have have got a bit off track and my quite precise claims have got lost. My claims are that 1. It is incorrect to claim that "Laziness is very hard to get right in practice. ... It's the reason why ... Standard Chartered, uses their own Haskell compiler that's strict by default." 2. Rather, the reason Mu is strict is that it was designed to target an existing strict runtime (I offer this claim without pro…

My claim that Standard Chartered thinks "strict haskell is a lot easier to deal with" comes from this comment from Lennart.

> If my only concern was semantics (i.e., input-output behavior) then I'd prefer call-by-name semantics, because I think it behaves more compositionally. But for practical concerns like resource consumption, debugging, stack trace, etc then strict evaluation is better.

Overall though, you're right that my initial claims against strictness may have been a bit too harsh. If I could edit my initial comment, I would write something more like

> 2. Laziness is often hard to use in practice. As Standard Chartered, a company that uses a strict variant of Haskell, notes: space leaks, difficulty of debugging, and hard to decipher stack traces are downsides to laziness.

In my opinion, laziness definitely does have nicer semantics than strictness. It's more expressive and easier to compose. In practice though, I prefer strict languages mostly for the reasons Standard Chartered mentions.

Re: Exploring ReasonML and functional programming

#62
post #45
post #21

Earlier quoted context omitted.

I view this as more of a general, why should somebody learn Ocaml instead of Haskell? There's a couple of reasons. #1. Ocaml's type system is nearly as expressive as Haskell's and includes several features that Haskell's does not. Polymorphic variants and functors being notable ones. #2. Laziness is very hard to get right in practice. I'm sure Haskell enthusiasts will not be very happy with that statement, but I thin…

> It's the reason why one of the biggest users of Haskell (and the most notable example of Haskell in industry), Standard Chartered, uses their own Haskell compiler that's strict by default. No it's not. The reason Mu is strict is that it was designed to target an existing strict runtime.

That begs the question: why target Haskell to an existing strict runtime instead of using Haskell's own delayed evaluation runtime?

Re: Exploring ReasonML and functional programming

#63

Maybe not the right place to ask, but "Better standard library" appears in the section detailing future improvements that ReasonML might bring to the OCaml ecosystem. How do they plan on doing this, given that the major standard library camps seem relatively entrenched in OCaml today? Which one does the ReasonML community favor/intend to contribute to?

Base[1] is a good candidate for an OCaml standard library. It's got tons of functionality, results in binaries with small footprints, is cross-platform, and has a fairly stable API. It's also code that has been and continues to be battle tested every day in production systems at Jane Street. I'm biased, as I'm one of the maintainers, but trust me it's good, it's good. [1]: https://github.com/janestreet/base

I'm not convinced that Base will solve our problems. It's not, afaik, more portable, more lightweight, more performant, or more feature-full than [containers](https://github.com/c-cube/ocaml-containers) (which has reached 1.0 and also does a bit of IO and Unix, as a stdlib extension). In addition to that it's not compatible with programs that use the stdlib right now, so the fragmentation will stay for a long time (unlike for build systems where you "only" have to change the build scripts, not the code itself).

(Of course I'm biased too, I wrote containers ^^)

Re: Exploring ReasonML and functional programming

#64
post #45

Earlier quoted context omitted.

> It's the reason why one of the biggest users of Haskell (and the most notable example of Haskell in industry), Standard Chartered, uses their own Haskell compiler that's strict by default. No it's not. The reason Mu is strict is that it was designed to target an existing strict runtime.

That begs the question: why target Haskell to an existing strict runtime instead of using Haskell's own delayed evaluation runtime?

I always understood it to be for interoperability with existing software targeting that runtime, but I'm not sure that was more than assumption.

Re: Exploring ReasonML and functional programming

#65

Earlier quoted context omitted.

That begs the question: why target Haskell to an existing strict runtime instead of using Haskell's own delayed evaluation runtime?

I always understood it to be for interoperability with existing software targeting that runtime, but I'm not sure that was more than assumption.

That is correct.
Post reply on HN