Hacker News new | past | comments | ask | show | jobs | submit login
Erlang OTP 21.3 (erlang.org)
144 points by lelf 9 days ago | hide | past | web | favorite | 15 comments





> The HTML reference documentation now shows the OTP version where modules and functions were first introduced.

As someone who works with an older version of erlang, this is a killer feature. Well done.


Agreed. https://erldocs.com/ is a godsend. Glad they introduced this feature to the main docs as well.

I think they took that from Elixir? This is done also on elixir docs!

When I first started doing Elixir I was worried that it depended on old technology... then realized it is actually just mature and always improving.

The one weird legacy feature that grates on me when trying to do strange things with Erlang is its heavy reliance on the filesystem. You can barely generate+load a module in memory; you can't generate+load an application in memory, let alone a relup or an entire release. These operations all use the filesystem as a working store for their state. There's many other similar thingsā€”e.g. the reliance the ssh application has on the OS host-keys directory.

Something I can appreciate about Erlang is their dedication to improving the platform and language, without the features ever really feeling "bolted on".

For example, I personally hated the way records were done in Erlang, but in Erlang 17 they added Clojure-style maps to fix that. I hated that in order to do a loop in a lambda, you had to implement a y-combinator, but they fixed that.


> I hated that in order to do a loop in a lambda, you had to implement a y-combinator, but they fixed that.

Heh, I see what you did there.


I actually didn't mean any kind of pun in this case; I actually meant the lambda-calculus Y combinator.

Basically, Erlang doesn't allow loops, only recursion, which is fine for regular functions, since you can just use the function's name. However, anonymous functions inherently do not have a name, and as a result the only way to do loops is to whip out your textbook on Lambda Calculus, and copy Haskell Curry's way of doing recursion.

It works fine, but it's also really hard to read, and not fun. Erlang 17 allowed you to give a temporary name to the lambda, which you could use for recursion.


I'm glad Erlang gave you the feature you were looking for but I can't help think of what the cases would be where a map, fold, or even assigning a lambda function to a variable wouldn't work?

95% of the time, a fold or map are fine. Typically the reason that I use recursion explicitly is when I want to early-exit a loop. In imperative languages, that's trivial, just do a break or something, but in functional, that sort of goes against the point of a map or fold.

Also, it's useful for any other particular reason you might need recursion (e.g. directory traversal)

EDIT: In regards to assigning it to a variable, I don't believe that will work, since the naming comes after the fact. I could be wrong on that.


Thank you for the response. I totally agree on the early-exit loop problem

Yes, I knew that you were referring to the lambda calculus y-c.

I've edited my original comment to make the pun more apparent.


Silly me!

It's just

   fun(F)->fun(X)->F(fun(V)->X(X(V))end)end(fun(X)->F(fun(V)->X(X(V))end)end)end

There's no fun reading that



Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: