4 ms·
I feel like 2/3s of posts on here are people spending tremendous amounts of effort recreating OTP (things Erlang/Elixir already does natively).
by cpursley 3y ago
I feel like 2/3s of posts on here are people spending tremendous amounts of effort recreating OTP
(things Erlang/Elixir already does natively).
- asplake 3y agoOn that, and slightly further off topic, if there’s a tutorial, cookbook, or worked example of using OTP but written in Gleam, I would lap it up. Enjoyed learning the language but kinda got stuck there. I didn’t want to have learn Elixir or Erlang just for that.
- neonsunset 3y agoA small disclaimer - proceed with Gleam only if you are okay with its and overall BEAM’s poor performance compared to compiled languages.
- cpursley 3y ago[flagged]
- victorbjorklund 3y agoMostly an issue if you are doing number crunching.
- throwaway743950 3y agoWhat aspects of BEAM perform poorly? (Genuinely asking. I’m not very familiar with it.)
- faizshah 3y agoI could be wrong but I don’t think OTP natively implements a load shedding strategy or concurrency controls or request hedging. You would implement a supervisor to do so if you don’t want to overload an external system like a DB or microservice (e.g https://github.com/fishcakez/sbroker https://github.com/fishcakez/sbroker).
- cpursley 3y agoErlang/Elixir is an especially good language runtime for the type of problems you bring up (backpressure, etc)
- kasey_junk 3y agoDo you see the circular argument you are making “these libraries are just what otp does natively”. “Here are some things in this library that otp doesn’t do natively.” “You could build a erlang library for that” Having enthusiasm for erlang/otp is fine. It’s a pretty great stack. But there are lots of reasonable reasons not to use it and lots of distributed systems knowledge we’ve picked up since it was designed. Some of which are encoded in libraries like these.
- Thaxll 3y agoKuberentes does most of what OTP does but better and completely language agnostic.
- cpursley 3y agoLol have you ever actually used k8s?
- mplewis 3y agoI have, and I agree with the sentiment that k8s does it better.
- cpursley 3y agoOkay then, do you have experience with deploying and operating distributed Erlang?
- rohansingh 3y agoI do, at somewhat medium scale. My experience was similar to other posters here, where we ran into production issues that were incredibly difficult to pin down. If you'd like, you can attribute that to lack of Erlang experience or skill on my part. But in practice, we instead replaced that system with Go running on a Kube cluster and it's now been rock solid.
- sethammons 3y agoI've run high scale, high availability Go clusters involving thousands of nodes, dozens of eng teams, and it leveraged k8s. I've also worked at an Elixer shop with a few dozen engineers at a low scale ecommerce solution. The Go system was doing around 100k api calls a second, the Elixir system peaked at about 3k rps. I would choose Go every single time. It has a better story for teams working together, largely due to better typing. Lacking types (and specs don't cut it), I still found I had to go up multiple function calls to understand what the parameters were, how they could be used, etc. so much state has to stay in your head, which I did not expect from a functional language
- Cthulhu_ 3y agoI suspect it's easier to apply a pattern to a language than it is to learn and introduce a new language to use a pattern.
- cpursley 3y agoErlang has been around since the 80s and OTP the early 90s. Elixir for a decade.
- DandyDev 3y agoAnd yet people are reinventing parts of OTP in other languages and through tooling and infrastructure (e.g. Kubernetes). What does that tell you?
- cpursley 3y agoIt tells us that people aren’t aware of OTP.
- DandyDev 3y agoOr that people find OTP/Erlang/Elixir hard to use. OTP has either a usability issue or a marketing issue
- eyelidlessness 3y agoIt doesn’t even necessarily say that. People may reasonably evaluate OTP/Erlang/Elixir[/other BEAM languages] and find them appealing, but elect to use another stack because it appeals more for reasons beyond OTP/etc’s appeal. I made that choice once, but I wouldn’t hesitate to consider OTP/etc again the next time I’m working on a problem they solve well.
- DandyDev 3y agoThanks for proving the whole point of this thread (No snark meant). People are indeed recreating parts of OTP in other languages because there are all kinds of reasons to pick a different language than Erlang/Elixer and still want some of the advantages of those languages
- preommr 3y agoI've always heard a lot of good things about elixir - I feel like if it was statically typed, the landscape for network oriented programming langauges would be a lot different. And with how popular microservices have become, how big and complex a lot of cloud architecture has become, that could've been a big difference. To some extent golang fills that void because of net, it's application in projects liks k8s, and it's concurrency dx through goroutines. But it's also had problems that I don't want to dive into here that I think make it more divisive than would be expected.
- cpursley 3y agoAnd that's my point, a lot of these things like microservices, "severless" and k8s are just poor and overly complex imitations of OTP. Many of these problems have already been solved by this humble stack which has been around since the 1980s. - https://medium.com/coryodaniel/from-erverless-to-elixir-48752db4d7bc https://medium.com/coryodaniel/from-erverless-to-elixir-4875... - https://elixirforum.com/uploads/default/original/2X/f/fdd70a4b0535040bca8d0a3310ec5c4a03647dce.jpeg https://elixirforum.com/uploads/default/original/2X/f/fdd70a...
- arccy 3y agoand yet we barely see any production software from elixir
- cpursley 3y agoThis is absolutely not true and you know it. Perhaps you’ve heard of Discord, Pinterest, WhatsApp, Spotify, Moz, PepsiCo? I’m sure I’m missing a whole bunch of names as I’m in the bootstrapped world where you’re seeing a lot of Elixir (especially now that LiveView is stable).
- lakomen 3y agoThose are all not using Elixir? Maybe for some obscure cronjob Tell me, why would you pick something that needs 8 servers to do the job Go or Rust could do with only 1?
- kbolino 3y agoThere's a usability lesson in there. If it works so well but most people can't figure it out, then it doesn't help them.
- cpursley 3y agoExactly, this is why I prefer OTP over k8s.
- kbolino 3y agoAnd it's why people prefer damn near anything over Erlang. I have been knee deep in RabbitMQ code trying to solve a massive performance issue in a production system and all I was able to learn from that experience is that I hate Erlang. Trying to learn something in anger isn't a great way to do things but using a language that looks nothing like most languages in common use is a recipe for niche status and a reason for people who need the things they run to be understandable to choose a different tool.
- deleted 3y ago[deleted]
- nicce 3y agoSimilarly, if there is a god-sent feature in your application, but the end-user don't know how to use it, or find it, there isn't god-sent feature.
- cjk2 3y agoI would expect if the problem is reducible to that argument, Prometheus and Kubernetes would have been written in Erlang.
- cpursley 3y agoYou just made my point. K8s is a poor mans OTP. And there's some Elixir based loggers: https://logflare.app https://logflare.app
- cjk2 3y agoMy budget does not run to people who can write or maintain Elixir.
- cpursley 3y agoWhat do you mean by budget?
- cjk2 3y agoCash. I can't even afford to hire people who are moderately competent because FAANGs keep herding them away.
- cpursley 3y agoOne perspective is you can get more done in Elixir with less people, at least that's been my experience vs say Rails + React.
- cjk2 3y agoThat would be fine if I could hire one person, which I can't. Also, we shot ourselves historically with Scala which had the same promises.
- arrowsmith 3y ago
- pjmlp 3y agoCommon trend in Go circles, I would say Recreating programing language stuff, after telling us we don't need them.
- Rexxar 3y agoIt was like that with java too in 2000/2010
- KingOfCoders 3y agoWhat came to your mind? Not sure what Java said wasn't needed in 2000 but added in 2010? Lambdas?
- pjmlp 3y agoThey might be referring to generics, released with Java 5 in 2004, 5 years before Go 1.0.
- KingOfCoders 3y agoAh yes. But it looks like Java had lots of discussions about generics in 1998, I can't find a quote of "Not needed." https://wiki.c2.com/?JamesGoslingOnGenerics https://wiki.c2.com/?JamesGoslingOnGenerics
- pjmlp 3y agoOne would expect that a language designed in 2009 would have taken some lessons out of it.
- KingOfCoders 3y agoI guess something like this will slowly be added to the Go stdlib. Just as adding more routing functionality recently.
- KingOfCoders 3y agoWhatever someone does, some other jumps up: But Lisp! But Erlang! But Haskell! While others nod and think, "I did choose Go for some valid reasons, great library."
- deleted 3y ago[deleted]
- zer00eyz 3y ago> recreating OTP Imitation is the sincerest form of flattery that mediocrity can pay to greatness... Im guessing that pretty much sums up how you feel. "Why isn't my tool more popular" is really the subtext of your question here. A lot of GO devs came from java,ruby,python,php ... For 3 out of 4 of those static typing is an upgrade. For all of them compile to executable is a massive change and a good one. We're not moving code and runtime to a box to execute... Its a breath of fresh air that if I need a tool I can quickly write it in go, compile it, throw it on to the server its needed on and be done with it. I dont have to instal vm/runtime/server to make that code work. Dont think that matters? I have a Rpi camera server that is just a go binary running... All I did was wget it and turn it into a service. Furthermore every one who is coming from those languages has seen upgrades go all sorts of directions.. php 4-5-6-7 were somewhat smooth but evolved the language, there is a way. Python 2 v 3 you can evolve a language and there is a BAD way. Python venvs are a pain... and ruby gems have their issues... Go's no breaking promise and packaging choices speaks to all the things that these devs lived through. And the laments of "go lacks" or "too much boiler plate" are features not defects. Write dead simple, easy to read code. Deal with your errors on the spot in a pattern that everyone will recognize. Im not sure that I qualify Erlang/Elixir easy to read or "simple" (effective I will give it). So yes, people are stealing OTP... take the compliment and go out and invent something else cool that we can "borrow".
- whereistimbo 3y agoBut what about go slices? https://news.ycombinator.com/item?id=39477821 https://news.ycombinator.com/item?id=39477821
- zer00eyz 3y agoI write a lot of GO? Do you think I'm unaware of its warts? Do you think I'm not sick of typing err != nil? Do you think I dont sometimes cut corners and NOT deal with that error on the spot or just _ it cause it's a throw away chunk of code? Pick a language, any one, and there's probably a post by someone complaining about a bad design decision or a wart on its fuzzy ass... Nothing is perfect. Yes go has flaws... I find that first class, high speed, testing makes the fact that I screw these things up all the time moot. Test, fix move on to the next project.
- citizenpaul 3y agoI see comments like these all the time Haskell/Erlang/Elxir/Elm/Ocaml are the greatest thing ever. However basically no one uses them for work. There was a post on HN about how OP has given up on using Haskell in production after 10 years of trying to do so because its just not feasible. (I couldn't find the story on a quick search.) But they still use it in all personal projects. They appear every now and then and have scared me away from non popular languages for the most part. I just see too many comments on HN from people that have decades more experience than me that say that the theory of these amazing languages simply does not survive contact with the real world most of the time. I'm sure there are great things built with them somewhere out in the world. I just don't think its worth it for the vast majority of developers to worry about.
- tome 3y agoI don't know if I have decades more experience than you but I can confirm that the amazing language Haskell survives contact with the real world. Here's what I made with it: https://groq.com https://groq.com (amongst other languages!)
- citizenpaul 3y agoNot trying to start a war but are you using an example of a personal project that basically proves the point I just said? The other people that comment on it say the same thing. They use it for personal projects but can never make it work at a corp job. I was a little bit unclear though in my previous comment. I mean production as in at work with lots of people besides yourself.