3 ms·
Ordered it! Erlang is rather fascinating. It is a relatively old language and for being such an old language it managed to keep consistency and didn't explode
by rdtsc 13y ago
Ordered it!
Erlang is rather fascinating. It is a relatively old language and for being such an old language it managed to keep consistency and didn't explode into an all singing all dancing pony with 100 ways of doing everything. It syntax is strange compared to run of the mill curly bracket languages, but it is self-consistent.
It is also interested because it is adding rather fundamental features to it like maps. Yes, yes, all the modern languages have them and Erlang is about to them too! despite being a rather ancient language.
http://erlang.org/pipermail/erlang-questions/2013-May/073656.html http://erlang.org/pipermail/erlang-questions/2013-May/073656...
- derefr 13y ago> It is also interested because it is adding rather fundamental features to it like maps. Yes, yes, all the modern languages have them and Erlang is about to them too! I don't know whether I'd say Erlang didn't have (hash-)maps before. Each Erlang process has always had a "process dictionary." If you think of these as equivalent to another language's thread-local variables, this seems like a wrong comparison--and people tend to avoid using the process dictionary for this reason. But if you think of processes as Erlang's objects, in the OOP sense[1], then the an object's process dictionary is equivalent to that object's "slots", in the Python/Javascript/Lua sense. And so, if you want a (automatically concurrency-safe!) map, you just make a new "map server" object that responds to get and set messages by manipulating its process dictionary. Which is exactly how you'd expect a mutable hashmap object to work in any other language. Or, you can avoid this low-level stuff by using ETS tables instead, if the difference between O(log N) and O(1) performance doesn't much matter to you... but if you think about it, ETS tables are basically just doing this same thing: creating a separate object/process that responds to messages to hold your mutable state, rather than representing it as an on-stack data structure. --- [1] Alan Kay was probably describing something closer to Erlang (or Simula) processes, than Java "objects", with OOP. Here's the unabridged quote: http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_en http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay... . Note especially this part: "I thought of objects being like biological cells and/or individual computers on a network." Both of those conceptions necessarily involve concurrent computation on the part of each "object."
- rdtsc 13y agoNone of those offer "dynamic" records type feature. So you deserialize a json block (and for better or for worse json is here to stay). What should the output of that be? A new process with a process dictionary? A new ETS table? A proplist of sorts. Well it could be all of those the best answer is a map. Which is what we are about to get.
- deleted 13y ago[deleted]