News for hackers. Stuff that matters.
Re:Why I Program in Erlang by rozap on Tuesday November 01, 2022 @04:31PM (#33427075)
After programming in elixir/erlang for ~8 years, I have to agree. I've had to dig into the "why" of BEAM a number of times, and I can't remember ever being disappointed. The decisions that they make might be frustrating at the time ("why does passing a shared sub-binary through a process prevent it from being GC'd") but I always come away from the docs with the understanding of how the design decision was the right one in the context of the larger system, which is very pleasant. They just took a handful of requirements around concurrency and fault tolerance, and all decisions logically followed from those. BEAM is not good at everything, but it is good at the things it wants to be good at, which is refreshing.
Re:Why I Program in Erlang by 2c2c2c on Tuesday November 01, 2022 @08:15PM (#33429772)
what are the things it is good at?
Re:Why I Program in Erlang by lmm on Tuesday November 01, 2022 @08:28PM (#33429872)
Presumably, concurrency and fault-tolerance?
Re:Why I Program in Erlang by weatherlight on Tuesday November 01, 2022 @08:54PM (#33430063)
concurrency, general purpose computing, excellent developer ergonomics and tooling. Great community.
Re:Why I Program in Erlang by alberth on Tuesday November 01, 2022 @09:19PM (#33430271)
> general purpose computing

As a huge Erlang fan, I’m not certain I’d say “general purpose computing” is a strength of it.

Re:Why I Program in Erlang by anko on Wednesday November 02, 2022 @04:34AM (#33432758)
server side computing is probably my take - it does handle more than that, eg. nerves but server side computing is the big win.
Re:Why I Program in Erlang by weatherlight on Wednesday November 02, 2022 @12:19PM (#33438311)
Python and Ruby are general purpose computer programing languages. Is there anything they do extremely well that erlang/elixir, can't?

From the following:

https://www.erlang.org/faq/introduction.html

    1 What is Erlang
    1.1  In a nutshell, what is Erlang?
    Erlang is a general-purpose programming language and runtime environment. 
    Erlang has built-in support for concurrency, distribution and fault tolerance.
Re:Why I Program in Erlang by julienmarie on Tuesday November 01, 2022 @11:13PM (#33431041)
Amazing for:

- Web -> Phoenix ( https://www.phoenixframework.org/ )

- Parallel data processing (like scrapers, ETLs, etc...) -> GenStage / Flow / Broadway ( https://hexdocs.pm/gen_stage/GenStage.html )

- IOT -> Nerves ( https://www.nerves-project.org/ )

Soon:

Mobile Apps -> Elixir Desktop ( https://github.com/elixir-desktop/desktop )

ML -> NX ( https://github.com/elixir-nx )

Re:Why I Program in Erlang by insane_dreamer on Wednesday November 02, 2022 @02:11AM (#33431920)
another example of Erlang for concurrency -> MQTT server (i.e., https://github.com/emqx/emqtt)
Re:Why I Program in Erlang by cr4nberry on Tuesday November 01, 2022 @09:16PM (#33430249)
What kind of product would warrant the cost/benefit of using erlang? Where did you use it? Just curious
Re:Why I Program in Erlang by thejosh on Tuesday November 01, 2022 @09:30PM (#33430374)
For Elixir, I really like it for webapps and services.

- Ecto (data mapping) is fantastic, really glad they separated the SQL part - Oban is fantastic (job processing) - Liveview is really good. (frontend framework that uses websockets to build realtime apps that doesn't require writing JS (uses JS under the hood though)).

Re:Why I Program in Erlang by h0l0cube on Tuesday November 01, 2022 @10:45PM (#33430876)
Add to that the sensible date and time primitives baked into the language as well as the super powerful and ergonomic cldr library for i18n.
Re:Why I Program in Erlang by hartem_ on Tuesday November 01, 2022 @10:12PM (#33430677)
Erlang is really good for programming highly-scalable and fault tolerant distributed systems. It was designed by Ericsson (large Telco manufacturer from Sweden) for running on Telco equipment that has extremely stringent uptime and availability requirements.
Re:Why I Program in Erlang by yetihehe on Wednesday November 02, 2022 @02:52AM (#33432113)
I'm working on iot cloud to which you can connect millions of devices (to single server) and it's very easily extensible to different device protocols (we make a driver for each device to expose all of them in unified way). Erlang is perfect here, because it can easily support lots of connections with low latency and you don't need to restart anything when you make changes, which makes development much easier.
Re:Why I Program in Erlang by lliamander on Wednesday November 02, 2022 @03:26AM (#33432311)
Things I would use Erlang for:

- embedded systems (network switches, control systems)

- middleware (databases, message brokers)

- generic web services

Why I would use it:

- it has a lot of operational support tools to remotely monitor and debug a running production application built into the runtime.

- it's not necessarily the fastest language, but it's pretty fast for many things. The thing is, if you program in idiomatic erlang from the start, your application will naturally scale well without having to do anything, and will even handle overload gracefully.

- Erlang and Elixir are both well designed and expressive languages with few flaws and intelligently made tradeoffs. It's an enjoyable experience.

Re:Why I Program in Erlang by afhammad on Wednesday November 02, 2022 @05:34AM (#33433242)
RabbitMQ is a good example of middleware
Re:Why I Program in Erlang by PrayagS on Tuesday November 01, 2022 @09:38PM (#33430441)
> After programming in elixir/erlang for ~8 years

Are Elixir and Erlang very similar? Do they belong to the same family?

Re:Why I Program in Erlang by owyn on Tuesday November 01, 2022 @09:46PM (#33430499)
Elixir compiles to bytecode for the Erlang VM (BEAM). I would put it in the same relationship category as Clojure and Java or Kotlin and Java. Different language but there's a lot of synergy in the libraries/ecosystem/etc. If something goes wrong in your Elixir application it would be a really good idea to understand Erlang and BEAM.
Re:Why I Program in Erlang by macintux on Tuesday November 01, 2022 @10:15PM (#33430696)
I can't speak to Kotlin, but Clojure : Java :: Elixir : Erlang doesn't seem like a great analogy. Clojure and Java have very different philosophies, while Elixir has virtually identical semantics to Erlang.
Re:Why I Program in Erlang by transfire on Tuesday November 01, 2022 @10:39PM (#33430843)
Kotlin : Java :: Elixir :: Erlang

Clojure : Java :: LFE : Erlang

Re:Why I Program in Erlang by macintux on Tuesday November 01, 2022 @10:46PM (#33430880)
Mayyyybe. LFE is still much closer to Erlang than Clojure is to Java.
Re:Why I Program in Erlang by Jtsummers on Tuesday November 01, 2022 @11:09PM (#33431014)
Yeah, I learned LFE a few years back after years of (sadly only) hobby Erlang programming. I don't think anything in it surprised me. It felt very much like: What if Erlang's syntax were replaced with sexprs and we used Lisp-y style macros? Clojure's relationship to Java is nowhere near the same.

Knowing Erlang + Scheme and CL, LFE like exactly what I expected, with a strong Erlang vibe. Knowing Java + Scheme and CL, Clojure felt nothing like Java except that it could access Java classes and objects.

Re:Why I Program in Erlang by macintux on Wednesday November 02, 2022 @02:25AM (#33431983)
Fundamentally the BEAM is very opinionated with a limited range of possible language designs that would work with it. No mutability, e.g.

I love the opinionated, constrained nature of Erlang and the BEAM, vs the kitchen sink approach of Java and the JVM.

Re:Why I Program in Erlang by janosett on Wednesday November 02, 2022 @02:54AM (#33432130)
Maybe Scala : Java :: Elixir : Erlang
Re:Why I Program in Erlang by anko on Wednesday November 02, 2022 @04:33AM (#33432751)
I'm not too sure - scala really has a crazy number of language features, which makes the scope of it way bigger. I'd say kotlin : Java is closer :)
Re:Why I Program in Erlang by kaba0 on Thursday November 03, 2022 @07:53AM (#33449671)
Actually, scala ain’t that big of a language, especially not compared to kotlin. Scala just prefers a bit more complex, but full feature over adding many less complex features that cover the same deal, which is more similar to Kotlin.
Re:Why I Program in Erlang by calo_star on Wednesday November 02, 2022 @02:39AM (#33432049)
I would even say Elixir IS Erlang, so is LFE.
Re:Why I Program in Erlang by bmitc on Wednesday November 02, 2022 @02:58AM (#33432151)
At its core, Elixir is effectively a wrapper of Erlang but with small tweaks/wrappers of the core library, Ruby-ish syntax, piping with `|>`, Mix project management, Hex package management, ExUnit for testing, and several other quality of life improvements. Elixir can easily call Erlang code, which is not easy the other way around. The biggest difference is that Elixir has a vibrant community, big projects like Phoenix, LiveView, and Livebook.