News for hackers. Stuff that matters.
Re:Admitting That Functional Programming Can Be Awkward (2007) by toast0 on Saturday October 24, 2020 @02:03PM (#24880831)
You can use closures to store state in Erlang, but generally state is kept by passing it through to further function calls.

I would say this makes Erlang mostly have explicit state, rather than saying Erlang is stateless.

Ets is implemented in C as global mutable state, but you could implement it in Erlang as a process per table (and a process to hold the list of tables) with no loss of functionality. You would send messages to fetch data or update data, etc. It's a performance and memory efficiency optimization to do it with C, of course.

There are no comments on this comment yet.