[HN Gopher] Beam/Erlang/Elixir Concept Explanations
       ___________________________________________________________________
        
       Beam/Erlang/Elixir Concept Explanations
        
       Author : pkilgore
       Score  : 267 points
       Date   : 2021-09-12 14:33 UTC (8 hours ago)
        
 (HTM) web link (beam-wisdoms.clau.se)
 (TXT) w3m dump (beam-wisdoms.clau.se)
        
       | colesantiago wrote:
       | Very curious about the recent surge of Elixir / Erlang posts on
       | HN, is there a reason for this?
       | 
       | How is the the job market surrounding this as well for Elixir /
       | Erlang devs?
        
         | brightball wrote:
         | Elixir shops are learning quickly that the best bet is probably
         | to hire a senior dev that wants to learn and just give them a
         | couple of weeks to learn.
         | 
         | As for the surge in interest, I can't speak for everybody but
         | when I dove into the language I realized it addressed virtually
         | every short term and long term problem that I've experienced in
         | my programming career. The rules it sets out force things to be
         | done in such a way that many issues are avoided as a by
         | product.
         | 
         | I find it balances all of my concerns better than anything else
         | (productivity, performance, maintainability, scalability,
         | learning curve, concurrency, stack simplification, capability,
         | refactorability).
        
           | dimitrios1 wrote:
           | If you are one of these shops please email me :)
           | 
           | I have been dipping my toe in functional land through
           | fantasyland / ramda
        
           | javajosh wrote:
           | Yeah, I'd be into that.
        
           | marcandre wrote:
           | I was hired by super.mx with 3 days of elixir under my belt.
           | We're still hiring btw...
        
             | lejboua wrote:
             | Really liked the recent podcast and hearing from you how
             | you fixed those slow compilation times issues. Looking
             | forward to hear more from you!
        
           | tobinharris wrote:
           | We do this. We're only a small 12-person software agency, we
           | have two Elixir developers right now.
           | 
           | When we hired the 2nd, we looked for someone who had good
           | knowledge of Node, Rails, Laravel or whatever and were
           | excited to learn Elixir/Phoenix. Then they completed a Udemy
           | course and started practicing. It worked out pretty great!
        
         | joelbluminator wrote:
         | I guess the reason is enough people upvote it? HN is pretty
         | popular for nichier tech like Clojure, Julia etc. It gets as
         | many votes as Java I think because the community in general
         | likes reading about exotic stuff.
        
           | ralmidani wrote:
           | Are Erlang/Elixir really that exotic? I interpret exotic in
           | our context to mean a language aimed at academics and very
           | advanced programmers but lacking mainstream appeal.
           | 
           | Erlang/Elixir strike me as very pragmatic and, compared to
           | Haskell/Lisp/Clojure/Scala/Julia/etc., they seem more
           | beginner-friendly.
        
             | joelbluminator wrote:
             | I don't think Erlang/Elixir is many people's first
             | language, no. It's advanced. Someone who is doing their 1st
             | programming project would be better off choosing javascript
             | / php / ruby if they are building for the web. It's quite
             | unlikely their first use cases will be 2 million concurrent
             | web sockets. So given it's not mainstream and it has the
             | advanced aura I think it's fair to call it exotic or "
             | language aimed at academics and very advanced programmers
             | but lacking mainstream appeal" as you just said.
        
               | ralmidani wrote:
               | I honestly don't see why a beginner couldn't learn
               | Elixir. You can start with if/else, and later learn how
               | to do things more elegantly with pattern matching. You
               | don't have to use processes and GenServers right away
               | (and even afterwards, you can use a library/framework
               | which provides an abstraction). The ecosystem has many
               | advanced features and use cases, but simple programs are
               | not much harder to write than they are in Python or Ruby.
               | 
               | In some ways, getting programmers to start out thinking
               | about "everything as an expression" and immutability-by-
               | default might help them write elegant and robust code
               | earlier in their journeys.
        
               | joelbluminator wrote:
               | > but simple programs are not much harder to write than
               | they are in Python or Ruby.
               | 
               | Even if they are just a bit harder it makes it a
               | questionable choice for a beginner. And let's not forget
               | the huge amount of Stackoverflow answers a stack like
               | Python/Ruby have.
               | 
               | > immutability by default
               | 
               | I don't know that beginners should think about that
               | stuff.
        
               | dnautics wrote:
               | There was a class aimed at middle school? Iirc Students
               | where they were taught erlang and by the end of two
               | classes they had built a crude networked chat system,
               | which, believe it or not, gets their attention. You can't
               | really do that so easily in any other language system.
               | 
               | > I don't know that beginners should think about
               | [immutable by default].
               | 
               | Yeah. Beginners should not have to think about
               | mutability. So, immutability by default is the right
               | choice. Details like "why don't integers mutate when
               | passed to a function versus a dict" should not ever have
               | to be answered to a beginner.
        
               | sergiomattei wrote:
               | I don't think Elixir is aimed at academics, though. It's
               | very clear that it tries to be as pragmatic as possible.
        
               | joelbluminator wrote:
               | Yeah agree, you can erase academics from that sentence.
               | Academics mostly use Python and R and Python is actually
               | super pragmatic.
        
               | ralmidani wrote:
               | To clarify, by "aimed at academics" I meant CS academics,
               | not researchers in other fields.
        
         | weatherlight wrote:
         | 1) It's worthy of the praise and attention, ( The BEAM is a
         | marvel of engineering). 2) It's just "exotic" enough for people
         | who work in Java/Ruby/JS to be interested to read and upvote.
         | The articles shared tend to be easy to understand and bite
         | sized. 3) There's enough demand out there and Elixir Devs are
         | usually paid pretty well, that market( for the time being,) is
         | pretty small.
        
         | atraac wrote:
         | As far as I've seen, Elixir job market for Europe is almost
         | nonexistent, sadly.
        
         | Teifion wrote:
         | As a sample size of 1 I can say I didn't have an issue finding
         | an Elixir job and those I did speak to were keen to get an
         | Elixir dev asap. For context I have a few years in Elixir and
         | over 10 as a developer in general. Better yet, the jobs in
         | question were remote only.
        
         | linkdd wrote:
         | I don't really know about the job market, but Erlang/OTP has
         | been a very fine piece of technology for the past 30 to 40
         | years.
         | 
         | Elixir is quite new (2015) and with every release it gains in
         | maturity, and the ecosystem is growing. IMHO, Mix was a game
         | changer in terms of tooling.
         | 
         | Also, with tools like Horde[0] and libcluster[1], it became
         | very easy to setup an Erlang/Elixir cluster on Kubernetes.
         | 
         | When you work with distributed systems, the OTP framework is a
         | godsend, it's no surprise to me that it's finally getting
         | traction.
         | 
         | Also, I like to use Rambo[2] to call small go/rust binaries
         | that I ship with my Docker images, useful for features where
         | performance is important.                 [0] -
         | https://hexdocs.pm/horde/readme.html       [1] -
         | https://hexdocs.pm/libcluster/readme.html       [2] -
         | https://hexdocs.pm/rambo/Rambo.html
        
           | derefr wrote:
           | > Elixir is quite new (2015)
           | 
           | I suppose you can say that; that's when it 1.0ed. But Elixir
           | was surprisingly stable pre-1.0; I was writing production
           | Elixir 0.6 code at Spawngrid in 2012!
           | 
           | Really, the 1.0 announcement felt more like a formality than
           | anything; there was no discontinuous switch from "throwing
           | features at the wall" to "considered engineering." Changes to
           | Elixir have always been considered -- and props to Jose Valim
           | for that! :)
        
           | Zababa wrote:
           | > Elixir is quite new (2015) and with every release it gains
           | in maturity, and the ecosystem is growing.
           | 
           | One thing I really like is that it's considered mostly done.
           | The community has the wisdom of not always trying to add new
           | features and deprecating old ones. There's no 2.0 planned but
           | that doesn't stop people from doing impressive work like Nx.
           | I don't know about the ecosystem, but the language itself
           | seem like a stable investment.
        
             | linkdd wrote:
             | This also has the benefit that your code is likely to keep
             | working in 10 years.
        
               | Zababa wrote:
               | That's what I meant by "stable investment".
        
         | ralmidani wrote:
         | I am starting my first Elixir role tomorrow. I come in with no
         | real-world experience (edit: no real-world experience with
         | Elixir specifically - I have a mid-senior level of experience
         | using other languages), just some tutorials (Elixir Koans and
         | Pragmatic Studio) which helped me submit a decent code sample.
         | There aren't a ton of Elixir roles, but hiring managers also
         | recognize the shortage of devs so for a junior or mid-senior
         | role they might overlook a lack of formal experience with the
         | language. Elixir roles also seem to have pay scales as well as
         | work arrangement flexibility that are higher-than-average.
         | 
         | Geography-wise, I've noticed growing, "hipster" cities like
         | Columbus (where I live), Denver, and Austin have a pretty
         | decent share of the Elixir job postings (although, again, if
         | you want to live elsewhere there are lots of fully-remote
         | Elixir roles out there).
        
         | derefr wrote:
         | More demand than supply, definitely. It's hard to hire
         | Erlang/Elixir devs from outside.
         | 
         | Some companies just avoid using the platform because of that,
         | but others (like my own company, Covalent) hire devs who seem
         | like they're experienced in learning languages generally, and
         | then train them in Erlang/Elixir internally.
         | 
         | These devs don't move around much, though -- a company willing
         | to do internal promotion/education is usually pretty good at
         | retaining talent. So new companies looking for Elixir devs
         | still don't find as many as they'd like.
         | 
         | (An interesting other side effect of this dynamic is that it's
         | easier to hire _senior_ Erlang /Elixir people than junior ones,
         | since most Elixir devs you'll find that have ever used the
         | language for anything serious, learned it at work, and so
         | usually have a decent chunk of their career already behind
         | them.)
        
         | toast0 wrote:
         | I'm retired but look around a bit for interesting jobs using
         | Erlang, and I don't see a whole lot of listings that mention
         | it. More that mention Elixir. And one company (smarkets) that
         | specifically calls out that they're not using it anymore.
         | 
         | But, some of that is I think because, as others noted, it's
         | hard to find Erlang developers, it's easier to target for good
         | developers and convince them to learn Erlang on the job. So I'm
         | guessing some places use it and don't mention it.
         | 
         | I was working at an Erlang shop and out of all of our hires and
         | interviews I did, we hired one person with Erlang experience
         | (from a conference) and I recall interviewing one other
         | candidate with experience. Oh and we had an intern who did a
         | college course with Erlang, but interned in a client group that
         | was limited to j2me (sorry!).
        
         | pessimizer wrote:
         | It's not a particularly recent trend irt HN:
         | https://www.flickr.com/photos/stilist/3348380060/
        
       | sharmin123 wrote:
       | How Does A Hacker Hack A Phone? How To Avoid Phone Hacking?:
       | https://www.hackerslist.co/how-does-a-hacker-hack-a-phone-ho...
        
       | AlchemistCamp wrote:
       | I like the teaching style and the lower-level BEAM focus.
       | Bookmarked it!
        
       | halotrope wrote:
       | I had a brief love affair with Elixir/OTP recently. The language
       | ist beautiful, the platform very impressive. Genserver and the
       | actor model are very powerful tools for concurrent systems and
       | Phoenix is one of the best web frameworks I ever tried.
       | 
       | BUT the tooling was a bit lacking (e.g JetBrains IDE, good
       | debugging workflow), the library support was a bit spotty (e.g
       | for Auth, everything high quality but often abandoned). Then if
       | you use e.g GCP there is no real first class language support and
       | if you deploy to Kubernetes then there is a lot of overlap with
       | Beam/OTP for deployment management etc. this and I feel for most
       | quick web development pure functional programming is too much
       | mental overhead for me (maybe this comes down to practice). I
       | feel way more productive with e.g Go or Node.
       | 
       | I have mad respect for Jose Valim and the community for
       | delivering such an exceptional project in a world saturated with
       | languages and frameworks. But I fear its not for me. At least not
       | yet.
        
         | ch4s3 wrote:
         | > good debugging workflow
         | 
         | Most of use use IO.inspect/2, pry, :observer, :recon, and
         | Phoenix dashboard for that.
         | 
         | > if you deploy to Kubernetes then there is a lot of overlap
         | with Beam/OTP for deployment management etc.
         | 
         | These things are complementary. Releases are great for multi-
         | stage docker builds. Libcluster is nice for allowing different
         | containers to talk to one another without any messaging glue.
         | Supervision can crash and restart at a sub container level.
        
         | mrjoelkemp wrote:
         | Google does provide elixir clients for most of their products:
         | https://github.com/googleapis/elixir-google-api
        
           | halotrope wrote:
           | Yes I was using them. But its just the repo and the
           | documentation is quite lacking compared to the other
           | languages. Like with most things it I referred to is workable
           | but has just quite a bit more friction.
        
         | [deleted]
        
         | sidkshatriya wrote:
         | I have a problem with a lack of static types. Was that an issue
         | for you?
        
           | halotrope wrote:
           | In fact yes. You can use Typespecs and I tried to make up for
           | it with tests. However it did not really come close to the
           | safety and convenience of static typing for me.
        
           | Teifion wrote:
           | My biggest issue with the language. I make use of typespecs
           | where possible but it's a far cry from anything enforced.
        
           | brightball wrote:
           | This is always a preference issue. You get strong types but
           | the nature of hot loading and communication across clusters
           | doesn't leading to static typing being a practical trade off.
           | The moment you add it, you end up with a need for contract
           | enforcement across nodes that changes most of what the
           | platform is designed around.
           | 
           | In practice, static typing just doesn't add much other than
           | headaches to a project of this style. Doesn't mean you're
           | wrong for wanting them, just that the language might not be
           | for you if you feel like you need them that much.
        
             | sidkshatriya wrote:
             | I understand why dynamic typing might be needed for code
             | reloading and multiple nodes. However for an overwhelming
             | number of uses a single erlang node is sufficient and code
             | reloading itself comes with additional complexity that it
             | is only useful for rare applications. On the other hand
             | hand static types give you cheap and easy freedom from a
             | large class of bugs. Erlang spends a lot of time bringing
             | reliability through sophisticated patterns such a
             | supervision trees etc etc but then totally fails by having
             | dynamic typing. I love Elixir/Erlang but I would say that
             | here (provocatively perhaps) the platform is penny wise and
             | pound foolish: It spends a lot of time on sophisticated
             | strategies while omitting the most elementary one: static
             | types. I like the platform but like every platform it does
             | have weaknesses. To me, personally, missing static types is
             | a weakness.
        
           | [deleted]
        
         | raitom wrote:
         | Same as you. The language looks nice but despite having tried
         | Elixir multiple times this past 4 years, the tooling and lack
         | of Jetbrains support always makes me stop and run back to Ruby.
        
         | franz_kafkaagh wrote:
         | I learned functional programming first and I find it the
         | opposite. And I find the context switch from functional to not
         | is always difficult, namely because I can't just assume things
         | are immutable and I have to go out of my way to make it so.
         | 
         | That's all to say that the mental overhead is just comfort more
         | than anything.
        
       | louissm_it wrote:
       | Great resource, thank you. I've been slowly transitioning my
       | programming time to Elixir/Phoenix the last couple years. Every
       | couple weeks I dive in, but mostly going back to Rails. But
       | recently with the `1.6.0-rc.0` release, this time it might stick.
       | HEEx templates are fantastic, esbuild as the default is a really
       | good choice, LiveView is getting some traction, and the packages
       | seem to be picking up. Fantastic language & framework in general.
        
       | lobo_tuerto wrote:
       | Please someone update the link to the HTTPS version.
        
         | Teifion wrote:
         | Like this? - https://beam-wisdoms.clau.se/en/latest/index.html
        
       | fortran77 wrote:
       | As a long-time professional Erlang developer, I'm frustrated
       | about "Rubyists" sticking their toe into the ecosystem via Elixir
       | and then declaring they don't like it. In many ways, the shift to
       | Elixir has been a bad thing.
        
       | zubspace wrote:
       | I would love to get into erlang and beam. As far as I know, Beam
       | must be a great tool for servers and webservers in general. But
       | can I use the language in other scenarios, too? For example
       | commandline tools, desktop Gui's or games?
        
         | Teifion wrote:
         | Commandline tools yes (though that's not it's strong point).
         | Desktop GUIs could be done though I've not looked into it, if I
         | were then I'd look at making a desktop Electron app and use
         | something like Phoenix LiveView with that to create the GUI.
         | 
         | Games are a tricky one, it all depends on what you are doing
         | with the game. I develop a middleware server for an RTS and for
         | that it shines but it would not suit the gameplay side of
         | things very well (you can of course still use it for
         | anything!).
         | 
         | Repo for reference: https://github.com/beyond-all-
         | reason/teiserver
        
         | toast0 wrote:
         | Command line can work, there's even escript for shorter tasks:
         | "escript provides support for running short Erlang programs
         | without having to compile them first, and an easy way to
         | retrieve the command-line arguments."
         | 
         | GUIs are a challenge, I think there might be some change since
         | this thread in 2017 [1], but the most supported way is
         | wxWidgets and the interface is most unErlanglike. I gather it's
         | similar to GUI programming in c++/mfc style which I never could
         | understand. I do have an erlang program with a small gui (just
         | a fixed sized bitmap output window, no controls, no inputs, no
         | text other than titlebar), and I made it work with wx, but it
         | felt a lot nicer with ex11.
         | 
         | ex11 is ancient, was an academic thesis project/proof of
         | concept and is pretty much raw x11. Erlang and x11 work well
         | together, Erlang is built for distributed systems and x11 is a
         | distributed systems protocol. On the other hand, x11 doesn't
         | include a widget library, the client has to bring one, ex11 has
         | some widgets, but they're very basic. It also relies on x11
         | font rendering which is not very common anymore. If you wanted
         | to build a mainstreamish GUI on ex11, you'd need to spend a lot
         | of time on building a modern looking toolkit. (And make sure
         | people have an X server)
         | 
         | Games are outside of my ability, but while it's certainly
         | possible, I think the confines of immutable data and lack of
         | shared state would tend to make things cumbersome. Screen
         | output would also be a challenge. It might make netcode easier,
         | though, because of the general need to do explicit
         | communication may mean you're already thinking about how things
         | interact and can avoid some of the pitfalls of synchronization.
         | 
         | [1] https://groups.google.com/g/erlang-
         | programming/c/-0uH3DfnYvM...
        
       ___________________________________________________________________
       (page generated 2021-09-12 23:00 UTC)