Live data from Hacker News

How I fell in love with Erlang

boragonul.com

41–50 of 263 posts

Re: How I fell in love with Erlang

#41
post #33
post #22

> 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…

It is not a lie it is just apparently familiar notation that actually has an entirely different meaning. It is not an equation, it is an assignment. X := X + 1 is perhaps less confusing, even if meaning the same thing.

That's exactly right. Looking at the Assignment Operator Wiki page, it's also clear where these notations come from.

I think an easy way to look at it, for someone coming from a math background, is to think of programming lines as instructions, instead of statements. x=x+1 can be then read as "let x be x+1", and that's it.

https://en.wikipedia.org/wiki/Assignment_(computer_science)

Re: How I fell in love with Erlang

#42
post #22

> 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…

I highly recommend How to Design Programs. I recall being repeatedly mind blown working through the book. It was great fun. The authors start by composing pure functions. IIRC you get quite far before you have to do any mutation. Take a look! https://htdp.org/2003-09-26/Book/curriculum-Z-H-5.html

Re: How I fell in love with Erlang

#43
post #22

> 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…

I think it makes more sense in languages where you use the "let" keyword. Then it sounds like assignment, though you still have to get comfortable with the X being on the right side too.

Re: How I fell in love with Erlang

#44

Calls a simple swap function with pointers inscrutable (the only hard to decipher character is the asterisk), and as a good counterexample provides this ? -module(ping). -export([start/0, ping/1]). start() -> register(ping, spawn(fun() -> ping(0) end)). ping(Count) -> receive {pong, Pong_PID} -> io:format("Ping received pong (~p)~n", [Count]), Pong_PID ! {ping, self()}, ping(Count + 1) end. I am not against functiona…

Port ping.erl and pong.erl to C and we'll compare them.

Re: How I fell in love with Erlang

#45
post #38

Earlier quoted context omitted.

> (mailbox = mailbox + message) is so simple! The author did not say this at all, they barely even touched on capabilities of erlang/OTP. Their focus was on the functional syntax of Erlang. > For instance, in head(sort(list)), will the whole list be sorted, or will the smallest element be returned? Your point isn’t clear. The functions have a clear nested call sequence, take a list, sort it, get the head. Also how is…

> The author did not say this at all, they barely even touched on capabilities of erlang/OTP. Two separate Erlang nodes. On different machines, different networks, different continents if I wanted. And they could just… talk. No HTTP. No REST API. No serialization headaches. Just message passing. Just actors doing their thing. > Their focus was on the functional syntax of Erlang. They didn't write any Erlang until the…

[deleted]

Re: How I fell in love with Erlang

#46
post #44

Calls a simple swap function with pointers inscrutable (the only hard to decipher character is the asterisk), and as a good counterexample provides this ? -module(ping). -export([start/0, ping/1]). start() -> register(ping, spawn(fun() -> ping(0) end)). ping(Count) -> receive {pong, Pong_PID} -> io:format("Ping received pong (~p)~n", [Count]), Pong_PID ! {ping, self()}, ping(Count + 1) end. I am not against functiona…

Port ping.erl and pong.erl to C and we'll compare them.

But I am not contrasting the two languages, I'm very aware of their respective strengths and weaknesses.

I am just disagreeing with the fact that C is hard to parse.

Re: How I fell in love with Erlang

#47
post #7

It's funny how HN goes through these Erlang cycles. It's a long standing tradition, starting off with 'Erlang Day': https://news.ycombinator.com/front?day=2009-03-11 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 i…

> 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. The big open source projects where pretty much all like that in the past, in the 80's/90's/early 2000's - in that respect they feel like a pleasant anachronism before everything needed to be promoted/self-promotional influencer like, the users did the evange…

>somehow almost aggressive/corporate style even when there is no paid product.

For those who collaborate with open source for political/ideological reasons (which does not need be the case), it makes sense to join the battle for attention.

As long as the product isn’t compromised in the way, I think it’s very good to see open source influencers.

Re: How I fell in love with Erlang

#48
post #7

It's funny how HN goes through these Erlang cycles. It's a long standing tradition, starting off with 'Erlang Day': https://news.ycombinator.com/front?day=2009-03-11 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 i…

Nice write up. Thank you for taking time to evangelize it.
Post reply on HN