1. 6

  2. 2

    One of the things I really like about learning Erlang (I’ve so far worked through about half of http://learnyousomeerlang.com/ ) is that, because of the common pattern of looping and listening for incoming messages, it is quite easy to see how you would use this functional language with actual changing state. Because Erlang programs commonly loop by calling themselves after handling messages, they are able to pass modified state into the next iteration, which lets you have the program’s behavior change over time.

    In contrast, I haven’t really got far enough with Haskell to start dealing with monads, so it’s not clear to me how to start thinking about solving some problems using that language.

    1. 1

      With respect to this particular issue, a State monad would abstract away the idea of “passing the modified state from the last iteration into the next iteration,” or the notion of an additional input and output, with operators to describe the transformation between them.

    2. 1

      If the only problem with Erlang is the syntax, has there been any effort to make a C-style language that compiles down to Erlang?

      Edit: A quick googling answered my question for me.

      lfe – lispy erlang Efene – python/js syntax Mercury – declarative (maybe? the website isn’t too clear) Elixir – metaprogramming

      It looks like Efene is the closest to what I would be interested in, although it still has the libraries problem. Does anyone have any experience with it?

      1. 1

        There is also reia ( http://reia-lang.org/ )

        1. 1

          I don’t see why Erlang’s syntax is much of a problem. It’s just different from C, in my limited use it’s been much easier to get a handle on than Haskell was.