Unrelated to the topic, but I really like the feature `> cd ..` at the bottom of the article. It's simple and accessible even with a smartphone. I wonder if there is an easter egg inside.
Because the homepage has this "interactive terminal" which is funny and nice (kudos for readline shortcut support) but also partially "broken", i.e. the blog post(s) and other links you see with "ls" are not clickable, at least on Firefox.
Erlang gets a lot of stuff right for scalable web based stuff, and even though there are many of its influences that have by now made it into other languages and eco systems it is still amazing to me that such a well thought out system is run with such incredible modesty. You'll never see the people behind Erlang be confrontational or evangelists, they just do what they're good at and it is up to you whether you adopt it or not. And that is an interesting thing: the people that are good at this are writing code, not evangelizing. If I had to reboot my career I'd pick this eco system over anything else, it has incredible staying power, handles backwards compatibility issues with grace and has a community that you can be proud of joining. Modest, competent, and with a complete lack of drama.
The hyperbole that Haskellers invoke around pure-functional vs impure is that you're never quite sure whether a function call you make will "fire the missiles".
It's colourful language, but it's just a stand-in for other properties you might care about. For instance, in head(sort(list)), will the whole list be sorted, or will the smallest element be returned? In atomically(doThis(); doThat()), will doThis be 100% reverted if doThat fails? If you stick to pure functions (and in the second example, STM) then you can unfire the missile!
AFAIK, Erlang just fires the missile "over there", not "over here". The author jumped from:
(X = X + 1) is bad
to
(mailbox = mailbox + message) is so simple!
I'm not bashing the BEAM, or the ease with which one can send messages (as an Actor language), but I am complaining about the lack of tooling to write non-missile-firing functions on a single node (as a Functional language).
I can totally relate to this. Programming in Erlang felt so natural compared to the knots I was twisting myself into writing C++. I was churning out C++ code, but wasn't having fun. Suddenly Erlang made it fun and programming became addictive.
Yep; the submitted article is just pedestrian with lots of posturing and pretty language to sell it. There is nothing of Programming/Mathematics/Erlang in it to deserve the upvotes.
Some of the comments here are far more informative.
> X equals X plus one? That’s not math. That’s a lie.
That's really interesting... My wife, who has no real mathematical background had the EXACT same reaction when I was trying to teach her some simple programming. I tried to explain that equals in that context was more of a storage operator than a statement that said line is true. She found it very frustrating and we gave up on the endeavor shortly thereafter.
I've personally always had a soft spot for languages like TI-BASIC that use a storage operator rather than overloading = so for example:
X + 1 -> X
I wonder if I should try a functional language with her.
I explain "X equals X plus one" as though each variable has an implicit version that increases whenever it's written to or as time goes on, but we can only access the lastest version.
> She found it very frustrating [...] I wonder if I should try a [different language] with her
Or, perhaps, preprocess left-arrow to equal?
Customizing a language to taste. Especially for shallow syntactic issues. Like "no multi-line string literals allowed ... I'm sorry, that's just not ok". Or "ok kid, what nicknames would you like to give the keywords today"?
When programming for just fun, I'll sometimes go "this aspect of the language bugs me - I could of course just live with it... but here, I think it will be more fun not to". So for recent example, a few lines of recast.js ast tweaking, and I could use infix unicode mathematical symbols as javascript functions.
I wonder if one could teach programming by build-your-own language. Perhaps even of the video-scanned desktop variety. "Draw a circle around your toys to create a collection. Label it with a letter. Now you can sort/filter it by..."
Tell her there are transparent subscripts on each use of =.
x(0) = 1
x(1) = x(0) + 1
There's no way to reference the subscripts. They're implicit and the language manages it for you. Ask her to think of the Kronecker delta function and it's definition.
Calls a simple swap function with pointers inscrutable (the only hard to decipher character is the asterisk), and as a good counterexample provides this ?
Like other folks have said, show the equivalent C program and then we can have a discussion about implementation complexity and comprehensibility.
Do note that the equivalent C program permits IPC between two instances of the program that could be either running on the same machine or could be running on different machines connected by an IP network.
Edit: For general information, here's an Erlang implementation of increment and swap. Swap is made a bit complicated because Erlang doesn't support multiple returns... returning a tuple or list is the way that's handled, so I had it accept a two-element tuple for consistency with what it returns:
A ten-second search reveals [0]. (Have Kids These Days forgotten all about Emscripten?) However, given that web browser pages are often short-lived, I don't see what benefit bringing in all of Erlang and its VM gets you, other than the fact that you've pulled off the stunt.
I discovered Erlang from Bruce Tate's book[0] and it was such an obviously pragmatic and interesting language that I started participating in the Twitter Erlang community, discovered Basho was using it for Riak and looking for a tech evangelist in the Midwest, and thus began my all-time favorite job.
I'm still more of a infrastructure guy than a software developer, but working with such incredibly smart people was a delight. Basho was good at hiring people who could learn Erlang (and, perhaps unsurprisingly, was almost entirely remote).
There is also Erlang the Movie 2 trying to sell Erlang (called Outlaw Techno Psyhchobitch in the video) with rock and hot chick: https://youtu.be/rRbY3TMUcgQ?t=262
And they were right, rebranding was all Erlang needed 13 years ago
For what it's worth, I'm stuck on the very first x = x + 1 thing.
Not sure if you want to call it a screwup or bad grammar or whatnot, but it is perhaps the huge mistake that the "equals" sign was used for something that feels like, but emphatically DOES NOT mean, "is equal to."
It's "put this into that". It's an action verb. Should have perhaps insisted on x <- x + 1 or maybe better x + 1 -> x
His PhD thesis explains the thinking behind Erlang, especially how it handles failures, message passing, and concurrency. It was last updated in 2003, 22 years ago, time really flies!
I used Erlang for a couple of years. It's cool and elegant for sure, but it always felt like it took longer to write than JS or Py like I'd otherwise use. Recursion with matchers is sometimes natural, sometimes roundabout to what you want to do.
The multiprocess stuff is cool too, but a premature optimization for what I was doing. If I needed to scale, I don't know if that'd be the chosen approach.
54 comments
[ 0.12 ms ] story [ 73.4 ms ] threadErlang gets a lot of stuff right for scalable web based stuff, and even though there are many of its influences that have by now made it into other languages and eco systems it is still amazing to me that such a well thought out system is run with such incredible modesty. You'll never see the people behind Erlang be confrontational or evangelists, they just do what they're good at and it is up to you whether you adopt it or not. And that is an interesting thing: the people that are good at this are writing code, not evangelizing. If I had to reboot my career I'd pick this eco system over anything else, it has incredible staying power, handles backwards compatibility issues with grace and has a community that you can be proud of joining. Modest, competent, and with a complete lack of drama.
Can I interest you in my Rust project hosted in Jujutsu VCS?
It's colourful language, but it's just a stand-in for other properties you might care about. For instance, in head(sort(list)), will the whole list be sorted, or will the smallest element be returned? In atomically(doThis(); doThat()), will doThis be 100% reverted if doThat fails? If you stick to pure functions (and in the second example, STM) then you can unfire the missile!
AFAIK, Erlang just fires the missile "over there", not "over here". The author jumped from:
to I'm not bashing the BEAM, or the ease with which one can send messages (as an Actor language), but I am complaining about the lack of tooling to write non-missile-firing functions on a single node (as a Functional language).It is declaring a relationship, between the previous value and the current. One way or another, youre defining transformations.
I mean even in the sum example, you see the statement "N is n-1" which is the exact same thing as x = x+1 with = swapped for "is"
Some of the comments here are far more informative.
That's really interesting... My wife, who has no real mathematical background had the EXACT same reaction when I was trying to teach her some simple programming. I tried to explain that equals in that context was more of a storage operator than a statement that said line is true. She found it very frustrating and we gave up on the endeavor shortly thereafter.
I've personally always had a soft spot for languages like TI-BASIC that use a storage operator rather than overloading = so for example:
X + 1 -> X
I wonder if I should try a functional language with her.
For example
is reallyOr, perhaps, preprocess left-arrow to equal?
Customizing a language to taste. Especially for shallow syntactic issues. Like "no multi-line string literals allowed ... I'm sorry, that's just not ok". Or "ok kid, what nicknames would you like to give the keywords today"?
When programming for just fun, I'll sometimes go "this aspect of the language bugs me - I could of course just live with it... but here, I think it will be more fun not to". So for recent example, a few lines of recast.js ast tweaking, and I could use infix unicode mathematical symbols as javascript functions.
I wonder if one could teach programming by build-your-own language. Perhaps even of the video-scanned desktop variety. "Draw a circle around your toys to create a collection. Label it with a letter. Now you can sort/filter it by..."
x(0) = 1
x(1) = x(0) + 1
There's no way to reference the subscripts. They're implicit and the language manages it for you. Ask her to think of the Kronecker delta function and it's definition.
Like other folks have said, show the equivalent C program and then we can have a discussion about implementation complexity and comprehensibility.
Do note that the equivalent C program permits IPC between two instances of the program that could be either running on the same machine or could be running on different machines connected by an IP network.
Edit: For general information, here's an Erlang implementation of increment and swap. Swap is made a bit complicated because Erlang doesn't support multiple returns... returning a tuple or list is the way that's handled, so I had it accept a two-element tuple for consistency with what it returns:
EDIT: there is Lumen, but not sure if it's stalled or still going.
A ten-second search reveals [0]. (Have Kids These Days forgotten all about Emscripten?) However, given that web browser pages are often short-lived, I don't see what benefit bringing in all of Erlang and its VM gets you, other than the fact that you've pulled off the stunt.
[0] <https://www.antvaset.com/erlang-otp-wasm>
Sum = n(n+1)/2
I'm still more of a infrastructure guy than a software developer, but working with such incredibly smart people was a delight. Basho was good at hiring people who could learn Erlang (and, perhaps unsurprisingly, was almost entirely remote).
[0]: https://pragprog.com/titles/btlang/seven-languages-in-seven-...
And they were right, rebranding was all Erlang needed 13 years ago
I must go dig up the Erlang book from my library. As I recall, it was a great read.
Not sure if you want to call it a screwup or bad grammar or whatnot, but it is perhaps the huge mistake that the "equals" sign was used for something that feels like, but emphatically DOES NOT mean, "is equal to."
It's "put this into that". It's an action verb. Should have perhaps insisted on x <- x + 1 or maybe better x + 1 -> x
His PhD thesis explains the thinking behind Erlang, especially how it handles failures, message passing, and concurrency. It was last updated in 2003, 22 years ago, time really flies!
Wait, is there something I don’t actually understand about recursion? When a recursive function calls itself, is that not a loop?
The multiprocess stuff is cool too, but a premature optimization for what I was doing. If I needed to scale, I don't know if that'd be the chosen approach.