Live data from Hacker News

How I fell in love with Erlang

boragonul.com

111–120 of 263 posts

Re: How I fell in love with Erlang

#111

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.

I do a lot of Elixir programming, which is different and not at the same time :-) . What I find is that it takes me longer to write the initial code than I might in, say, JavaScript, but that the refactoring and ongoing maintenance of code is significantly faster. This is because I think the functional & actor paradigms force you to think harder upfront, but once those decisions are made are easier to manipulate. For me personally, I'd take that trade since I'm either refactoring or maintaining much more frequently... but I understand there are other considerations which could drive a different preference.

Also, I'm sure my personal experience isn't necessarily true for everyone... so weight this anecdote accordingly.

Re: How I fell in love with Erlang

#112
post #14
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…

I am just wondering when the next "We-Love-Haskell" cycle is going to start!

Feels like Rust has stolen a lot of Haskell thunder, in the sense you can write similar code and satisfy that functional programming itch in a much more popular language, while falling back on imperative programming if you really need it.

Re: How I fell in love with Erlang

#113

Will it ever run in WASM? EDIT: there is Lumen, but not sure if it's stalled or still going.

Usage

It is not immediately clear what the intended usage pattern for Lumen and WebAssembly is.

Pros and Cons

Things we like:

    The idea of having both runtime and code compile is cool
Things we’re not big fans of:

    We could not immediately figure out exactly how Lumen works, and builds appear to be failing
    The project might be stalled or unmaintained. It has not been updated in over a year.

Re: How I fell in love with Erlang

#114
I have been trolling for a while now to find a great project to write in Erlang. I can't write any erlang and it's sufficiently foreign it's been fun to try to get my LLM to do it for me. This is because I cannot make any useful suggestions on _how_ to write it.

I have a toy replacement for syslog.

i supervised an LLM writing a discord-esq chat program that implemented a imaginary JMAP extension called 'JCHAT'.

i had the LLM write a Erlang based dimensional accounting system

So far in real life i don't have any uses, which is a shame because it's a great language and OTP comes so batteries included I can think of many use cases.

Re: How I fell in love with Erlang

#115
post #29

Earlier quoted context omitted.

I don't think it's cycles, more like newcomers rediscovering the future. I've learned Elixir in 2016 after a lull in my interest in programming languages, and 9 years later it's still my favourite environment by a country mile. It's not the language per se, but the BEAM, the actor model, the immutability — just makes sense, and doing things the C/Rust/Javascript/Python way is like building bridges out of cardboard. F…

> Why has no one put microkernels and Erlang into a blender? I know there's QNX, but it's still UNIX, not Erlang. That's a very good question. There are some even lesser known dialects out there that do this but you are going to find it hard to get to the same level of feature completeness that Erlang offers out of the box. QNX and Erlang embody quite a few of the same principles, but QNX really tried hard to do this…

> That would be an absolutely awesome project. Usually when you can think of it someone has already done it so a bit of googling

I've done a bit of googling and research, nothing viable has surfaces, and I still haven't found the time to create a prototype myself, just some doodling around here and there. I do agree that it's an awesome idea, and it's been stewing in my head for a couple years now!

There are a lot of moving parts (scheduler design, probably needs its own high level language and bytecode, mapping capabilities onto actor semantics, etc.) that are outside what current OS-research seems to be focused on.

EDIT: I've just seen the mention of your QNX-like OS in your profile. Lovely! Any reason you haven't posted it on Github/Codeberg?

Re: How I fell in love with Erlang

#116
post #107
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…

Mutation should be an advanced topic in programming teaching. Even in procedural languages. It should be seen as an optimization technique you only use when analysis has shown that to be the only way to solve a difficult bottleneck. Using mutation as a basic tool in programming was a mistake.

Yes, see SICP (Structure and Interpretation of Computer Programs).

Re: How I fell in love with Erlang

#117
post #57

Earlier quoted context omitted.

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

GNU Guix has a good blog, but I don't feel like they are very "marketing" focused. It's hard to describe precisely, but a lot of free software projects do a good job of putting themselves out there in an unfussy way. There really is something refreshing and cozy about that.

i think this is especially true of projects run by people with deep experience in the field and are in it “for the love of the game”, and don’t feel the need to stunt on everyone in hopes that they are taken seriously.

Re: How I fell in love with Erlang

#118

Earlier quoted context omitted.

This blocked me from understanding computer programming for 3 years. I thought of 'variables' as immutable and the fact that they were not didn't really click at all. Once I mentally transitioned from 'it's a label attached to a value' to 'it's a named box which holds a value' life got a lot easier. I was 15 when it finally clicked (on a TI programmable calculator...).

I wonder if haskell would have made more sense to you at the time with everything being immutable.

Or maybe Erlang.

Re: How I fell in love with Erlang

#119
post #100
post #29

Earlier quoted context omitted.

I don't think it's cycles, more like newcomers rediscovering the future. I've learned Elixir in 2016 after a lull in my interest in programming languages, and 9 years later it's still my favourite environment by a country mile. It's not the language per se, but the BEAM, the actor model, the immutability — just makes sense, and doing things the C/Rust/Javascript/Python way is like building bridges out of cardboard. F…

Lets count the number of comercial sucesful released games that don't use mutability or object orientation.... I can't find any.

> Lets count the number of comercial sucesful released games that don't use mutability or object orientation....

1) I suspect game engines that Carmack designed towards the end of his career are built in a largely-functional style. He's on record [0] as thinking that writing code in a functional style is generally a good thing to do.

2) Running on the BEAM doesn't mean that you give up mutability. In my experience with Erlang, functions that return updated state are very, very, very common. Similarly, functions that mutate state external to the function [1] are also common... it's rare that a program that has no visible effect on the outside world is useful.

It's generally quite a lot easier to understand what your program does when most or nearly all of its functions take input and return output without mutating external state as a side effect.

[0] There's some Twitter thread of his that I CBA to find saying -in effect- "Writing in a functional style makes your code much easier to understand. Obviously, if you're writing a video game, you have to pass around pointers for efficiency reasons, but that doesn't preclude writing most of your code in a functional style."

[1] Such as in an ETS table, a external database, with a network call to a remote system, or even writing data to disk.

Re: How I fell in love with Erlang

#120
post #100
post #29

Earlier quoted context omitted.

I don't think it's cycles, more like newcomers rediscovering the future. I've learned Elixir in 2016 after a lull in my interest in programming languages, and 9 years later it's still my favourite environment by a country mile. It's not the language per se, but the BEAM, the actor model, the immutability — just makes sense, and doing things the C/Rust/Javascript/Python way is like building bridges out of cardboard. F…

Lets count the number of comercial sucesful released games that don't use mutability or object orientation.... I can't find any.

Meh, I remember hearing that no one would release a commercially successful game in a managed language with a GC 15 years ago. Time flies.

Most things are said to be impossible until someone tries to do it anyway.

Post reply on HN