avsm 8 hours ago

(author here) it's actually the module system of OCaml that's amazing for large-scale code, not the effects. I just find that after a certain scale, being able to manipulate module signatures independently makes refactoring of large projects a breeze.

Meanwhile, in Python, I just haven't figured out how to effectively do the same (even with uv ruff and other affordances) without writing a ton of tests. I'm sure it's possible, but OCaml's spoilt me enough that I don't want to have to learn it any more :-)

pkal 9 hours ago

I recently realized that "pure functional" has two meanings, one is no side-effects (functional programmers, especially of languages like Haskell use it this way) and the other is that it doesn't have imperative fragments (the jump ISWIM to SASL dropped the non-functional parts inherited from ALGOL 60). A question seems to be whether you want to view sequencing as syntax sugar for lambda expressions or not?

  • nh2 8 hours ago

    Who uses the second meaning?

    In my experience, "purely functional" always means "you can express pure functions on the type level" (thus guaranteeing that it is referentially transparent and has no side effects) -- see https://en.wikipedia.org/wiki/Pure_function

  • NeutralForest 8 hours ago

    I'm working with Python and I'm sympathetic to the problem so I'd be curious if you have examples of what Python issues are fixed with OCaml.

    • rienbdj 7 hours ago

      A few ways in which Python is not really functional:

      The scoping rules of Python are not lexical

      Lambdas in Python are not multiline

      Recursion is not a practical way to write code due to stack overflows

      Monkey patching

  • nesarkvechnep 6 hours ago

    Pure functional doesn't mean no side effects but controlled side effects.