23 ms·
Elixir Is Erlang, not Ruby
- atonse 6y agoThe biggest adjustment for me was the fact that everything is immutable. Apart from that, everything has been simpler to reason about in elixir. Now objects feel very weird.
- feifan 6y agoElixir seems to encourage simple data structures — everything is made up of basic data structures, and since there's no encapsulation, libraries seem to be built with an attitude of "developers are gonna inspect everything so we might as well make things clear and simple". I only noticed this in contrast to libraries in popular OO languages (most recently Python) where everything is done through objects that often have inscrutable instance variables and "missing" methods/methods that library authors simply haven't gotten around to implementing. Having a small library of functions operating on a small number of data structures makes programming a lot more intuitive than a large number of classes, each with their bespoke set of things you can do to them.
- jake_morrison 6y agoInstead of "lack of encapsulation", it's more "lack of private state". In an object oriented language, you have private instance variables and methods to manipulate them. In a functional language, you have functions which manipulate data structures. If possible, the data structure would have straightforward fields which are public and documented. If necessary, you might make it opaque, expecting only the library which manages the data structure to manipulate it. One way to think about this is that in functional programming, the "verbs" (functions and manipulation patterns like map) are more generic and the "nouns" (data structures) are less important than in OO languages. See http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom...
- chii 6y ago> straightforward fields which are public and documented The rational (whether right or wrong) in OO for private fields and public "manipulator" methods is that the field's representation can be wider than the intended public use. For example, you may store the credit-card number as a string of digits, but only allow the correctly CRC'ed number to be set. Of course, in a more functional paradigm, you would have a credit card number type (which is just a function that strictly enforces the domain and range of the possible valid values), rather than an object which can have independent identity storing the same information.
- leghifla 6y agoThere is no encapsulation like in OOP (data level), but there is another kind of encapsulation (process level): a process is the only one accessing/modifying its own state. And this is very liberating when you need to think about what is going on, what could go wrong...
- eru 6y agoYou should try Haskell, perhaps. It's very much in the functional programming camp, but has oodles of data structures in rather extensive libraries.
- deleted 6y ago[deleted]
- sigwinch28 6y agoIt encourages a functional way of thinking, IMO: since you can't have mutable objects, use immutable data structures and functions which alter them, such that where you may have had: x.f(y) you now have something like: x = f(x,y) I've found that years of functional programming have mangled my brain. Now when I use something like Python, I only use dataclasses and accessor methods on them, or write methods which perform and return the result of some computation based on the values of the object.
- atonse 6y agoYup I find myself wanting to do the same. Writing these static methods that pass around data. But it’s not the same. I also really miss pattern matching when I don’t have it. But more languages have been adding it.
- heatmiser 6y agoI always joke with my team that the best thing I did for my Python was learn Erlang, and that was when I was stuck with NamedTuples and not DataClasses.
- latch 6y agoWhile I agree, the article doesn't really give concrete examples. Elixir is layered, making it easy to learn and master. You can get pretty far with Phoenix without ever understanding (or even knowing about) the more fundamental building blocks or the runtime. In large part, this is because of its ruby-inspired syntax. You'll have to adjust to immutability, but that's pretty much it. Then one day you'll want to share state between requests and you'll realize that the immutability (which you're already comfortable with at this point) goes beyond just local variables: it's strictly enforced by these things called "processes". And you'll copy and paste a higher-level construct like an Agent or Genserver and add the 1 line of code to this root supervisor that was just a file auto-generated in your project. But that'll get you a) introduced to the actor model and b) thinking about messaging while c) not ever worrying about or messing up concurrency. Then you'll want to do something with TCP or UDP and you'll see these same patterns cohesively expressed between the runtime, the standard library and the language. Then you'll wan to do something distributed, and everything you've learnt about single-node development becomes applicable to distributed systems. Maybe the only part of Elixir which can get complicated are Macros / metaprogramming. But you can get far without ever understanding this, and Phoenix is so full of magic (which isn't a good thing), that by the time you do need it, you'll certainly have peaked behind the covers once or twice. The synergy between the runtime, standard library and language, backed by the actor model + immutability is a huge productivity win. It's significantly different (to a point where I think it's way more accurate to group Ruby with Go than with Elixir), but, as I've tried to explain, very approachable.
- searchableguy 6y agoYeah, elixir provides Registry which is what I use for simple state management or directly use ets. See below (jswny) for more clarification.
- laser 6y agoUnfortunately had a bug I found today in which an event_notifier genserver was calling a method that checked against the database for the the state of an Event, to decide whether to send a notification and then update the event to record that notifications were sent and upon successful update send the notifications. But in the query to construct the list of users that should be notified, the User module was not imported at the top of the file and the notifications were failing to send. Of course, if the path had ever been run, it would have obviously failed and been the simplest type of error to rectify. This is why it's generally not an issue and is actually nice as it gives you direct visibility into dependencies. But, on rare exception, when you don't test the path because it's dependent on time-dependent state and are overly confident in the suitability of the untested code you're deploying to production, you get bit by the compiler that quietly warns and lack of static analysis (oh nice writing this comment just made me discover https://github.com/rrrene/credo https://github.com/rrrene/credo)
- phreack 6y agoI find this quite funny because it's my first time hearing I was supposed to be thinking of Elixir as a Ruby thing. I actually learnt about it from a concurrent computing class and it was always an Erlang thing, and now I know it as the magic sauce behind Discord that I always want to try and never find a good reason to.
- linux2647 6y ago> I always want to try and never find a good reason to As someone who learns best by doing, what are some practical projects that someone could do to learn Elixir? I know that Elixir is quite capable of solving certain kinds of problems very elegantly, but maybe my experience hasn’t presented these kinds of problems yet. Outside of building a Discord-like server or a Phoenix web app, what other good practical projects/applications are there for Elixir?
- anko 6y agoif you need to do some batching operations such as read from a queue, do some processing and publish to s3, I can recommend Broadway https://github.com/dashbitco/broadway https://github.com/dashbitco/broadway I have seen lots of codebases in lots of languages do this type of task, but aside from maybe spark on the high end, i haven't see it done better. The beauty of erlang is your code reads like synchronous code so it's easy to read/maintain, but it has all the power of the parallelism of async code.
- searchableguy 6y agoRobotics/iot applications.
- dnautics 6y agoI'm probably the crazy one in the community who is using Elixir for the most super-strange things. For example: - as a custom DHCP server to do multiple concurrent PXE booting (among other things) - as a system for provisioning on-metal deployments (like ansible but less inscrutable). - as a system for provisioning virtual machines over distributed datacenters. I'll probably also wind up doing DNS and HTTP+websocket layer-7 load balancing too by the end of the year. Probably large-size (~> 1TB) broadband file transfer and maybe even object storage gateway by next year. I've rolled most of these things out to prod in just about year. I honestly can't imagine doing all of these things in Go, without a team of like 20. Elixir sucks at: - platform-dependent, like IOS, android, or like SDL games or something, - number-crunchy, like a shoot em up, or HPC. - something which requires mutable bitmaps (someone this past weekend brought up "minecraft server"). Actually even desktop might be okay, especially if you pair it up with electron.
- gosukiwi 6y agoLast time I tried Elixir it had some rough edges where you had to use some other ugly-ass language (I think it was Erlang?) to do some things. I immediately stopped learning after that. It feels like before learning Elixir, you need to learn Erlang, and I was just too lazy. Kind of using Clojure. You don't NEED to, but knowing Java helps. A lot. You need to learn the ecosystem, standard library, etc. You don't just pull a banana, you pull the gorilla holding the banana.
- baby 6y agoyup, I recommend just learning erlang.
- dnautics 6y agomaybe it's just me. I can read and write erlang, but I still think it's harder to read. It's got a lot of baggage behind it (like <<"this monstrosity for binaries">>); map syntax is atrocious, and lexical substitution should probably be considered to be an mistake this day in age.
- baby 6y agoI've reviewed erlang apps and I found them surprisingly easy to read, like really really clear. Perhaps it was the developers who did a good job, but I suspect it is the language. Sure some of the syntax is not super pretty, but I'd bet you would get used to it if you programmed in erlang more frequently.
- dnautics 6y agoI can't believe it's a good job: most of what I read in erlang is the OTP source. There are some real stinkers in there, in modules that barely anyone uses anymore (so there aren't any bug reports), like tftp (but when you need it you need it). And if you've ever tried chasing the ssl code, there's definitely some java-esque factory patterns hiding in there where one module or another drops an interface back to its caller, and the call stack weaves several times between two or three modules even.
- microcolonel 6y agoAfter using Elixir professionally for a while, I still barely knew that it was supposed to have anything to do with Ruby aside from the oversized punctuation.
- perlpimp 6y agoI love how documentation and tests are intertwined - bonus on thinking this way from get go.
- htnsao 6y agoFunny I came across this same article earlier today while looking into a Flow-Based Programming framework for Elixir called Flowex. [1] [1] https://github.com/antonmi/flowex https://github.com/antonmi/flowex
- didibus 6y agoElixir is a little bit of Erlang, a little bit of Clojure, a little bit of Ruby, and a little bit of its own thing. Together that makes it that Elixir is Elixir.
- Kototama 6y agoIt's a lot of Erlang :-)
- samuell 6y agoNow that we have Elixir (Erlang looking like Ruby) and Crystal (Go concurrency dressed up like Ruby[1]), I'd be primarily be interested to see how these two languages stack up against each other, what niches they might address etc. [1] Did a small comparison here: https://rillabs.com/posts/crystal-concurrency-easier-syntax-than-golang https://rillabs.com/posts/crystal-concurrency-easier-syntax-...
- dnautics 6y agoneither Go nor Crystal have the same sort of failure-domain support that Erlang Vm provides.
- samuell 6y agoIndeed, but at the same time, it seems people are using both Go and Erlang/Elixir for a lot of similar use cases (scaleable web-apps), which makes me interested in what specific use cases they do respectively shine.
- yxhuvud 6y agoAnd neither Elixir or Erlang has the raw performance or ability to run without a VM that Go or Crystal has. That was the point of the grandparent - they provide different things. Not everyone thinks immutability is a feature that is good to have on the language level.
- deltron3030 6y agoI'm a few weeks into Elixir and it and the ecosystem definitely feel more techy and mathy than Ruby. It's more comparable to JS and node, it's like a more consistent JS without the OO stuff plus convention over configuration.
- danbmil99 6y agoI don't care about any of these three languages. I will never need to learn them because they are not used in the real world of today's tech stacks.
- dnautics 6y agoMaybe, but our company uses services from at least three companies that use elixir: Divvy, Slab, and Pagerduty. Discord uses elixir. And Whatsapp famously uses erlang. But I suppose those companies are fictional.
- deleted 6y ago[deleted]
- AlchemistCamp 6y agoSo Stripe, Discord and Whatsapp don't count as real world?
- deleted 6y ago[deleted]
- exdsq 6y agoDon’t restrict yourself to real world tech stacks! Regardless of wether these are or are not used by large companies, playing with different languages teaches you stuff to improve how you write your own.
- non-entity 6y agoYes but then you're perpetually depressed when you realize what you have to use day-to-day :P
- exdsq 6y agoDon’t be! I’ve been using Haskell at work for the last year, but recently I discovered how much easier it is to use Java/Scala because of all the great libraries. Grass is always greener :)
- lawik 6y agoComing into Elixir from mostly doing Python but having it strongly recommended by a Rubyist I was a bit surprised to find myself in the middle of an implicit ex-Ruby world. It has been fine. But in contrast to the article, Elixir has always been about Erlang/OTP for me. I've never cared much about Ruby/Rails because it felt equivalent to the Python/Django which I already know.
- dnautics 6y agoI would say that in my experience everything outside of Phoenix is more explicit than python. There's a lot of hidden implicitness in python that drives me up the wall when I'm trying to chase a bug in someone else's code; I rarely have that problem in Elixir (even with phoenix, usually chasing where the code comes from is not terribly hard).
- lawik 6y agoHaha, I was referring to feeling the implicitness of "everyone came from Ruby" which I didn't, rather than anything in the language. Sorry if I was unclear :)
- spapas82 6y agoElixir is like an abstraction on top of Erlang and its runtime(otp). It heavily depends on the data structures of Erlang and its very difficult to extend it beyond Erlang's limitations / capabilities. When you take macros out of the way, Elixir programs can be translated line by line to Erlang. That OTP dependancy is considered the great strength of Elixir by many but it also has disadvantages. The thing with Erlang is that it ain't a general purpose programming language like Java or Python but a niche telecom software language. Erlang is marketised like that and from what I've heard it's really great at that (telecom software). But nobody proposes to write f.e a game or a Gui app in Erlang. Elixir on the other hand is marketised as a general purpose programming language. People that start a journey of learning Elixir must be very careful and understand that there are a lot of applications that Elixir can't be used for because of Erlang's limitations. Also, when you start using it you'll see that common applications outside of the Erlang telecom niche, like the polular phoenix web framework and its ecto orm like library make very heavy use of macros and message passing abstractions that seem strange in a lot of situations. Of course all will fall in place after you understand the Erlang dependecy.
- mvellandi 6y agoWhile the original use case for Erlang was for telecom, it's more accurate to say it's for building networked applications that can be designed for fault-tolerance.
- dnautics 6y agoI can assure you erlang is not a 'niche telecom language's, as I have used it, in prod, in so many ways that have nothing to do with telecoms. One mini-project I'm planning on working on for fun is to use it for HDL simulations, because its message passing concurrency is a nice way of cleanly dealing with eventing voltage edge transition logic. > But nobody proposes to write f.e a game or a Gui app in Erlang. Yet square enix uses elixir for game orchestration
- JohnHaugeland 6y ago> I can assure you erlang is not a 'niche telecom language's, as I have used it, in prod, in so many ways that have nothing to do with telecoms. You are completely incorrect. More than 95% of this language's use is by either Cisco or Ericsson, specifically for telecomms, the domain that the language was implemented for, and for which more than half of its standard library exists. That you used something once doesn't mean that you changed what it is for or who uses it in general. . > Yet square enix uses elixir for game orchestration I'm not sure why you italicized this. There is nothing called "game orchestration," and whenever you rephrase this with actual technical sounding terms, it's going to not sound impressive at all. What did you try to say here? Does Square Enix use RabbitMQ or something? You know that queues are a dime a dozen, and that Kafka, from a whole different programming language, is a common and acceptable drop in replacement, right? Nobody writes games or GUI apps in Erlang, and even if you can pull a random individual instance out of your ass, you haven't proven anything. Civilization 4 uses Lua for scripting. So what? Lua is in no sense a game programming language. Karel uses COBOL to teach robotics control. COBOL is not a robotics control language. There's a jackass out there who used the CSS3 forced checkbox toggle to implement Conway's Life, to make the biggest pain in the ass proof I've ever seen that CSS is technically turing complete. That doesn't make CSS a simulation language. Learn, please, that when you try to dust off single examples like they carry weight, you just make yourself look like a narrow, no context asshole.
- mcv 6y agoI hadn't heard of Elixir yet. I did use Ruby ages ago, loved the syntax, but the language felt a bit flakey at times (for example, I had a project where I needed to use unicode that didn't turn out to be properly supported). Erlang has been on my radar ever since a friend wrote either Tetris or Conway's Game of Life in 3 lines of Erlang. Never got around to learning it, though. If Elixir is a friendlier gateway to Erlang, it might be exactly right for me.
- Gravityloss 6y agoOdd, I've seen so many encoding problems in other languages (Python etc) but unicode has worked completely flawlessly in Ruby always.
- mcv 6y agoAre you sure? I'm reasonably sure that Ruby 1.8 or earlier didn't have flawless unicode support yet.
- Gravityloss 6y agoOnly used 1.8.7 or later versions. That seems to have been released in 2008. https://www.ruby-lang.org/en/downloads/releases/ https://www.ruby-lang.org/en/downloads/releases/
- jakuboboza 6y agoThe best things about Elixir are mix and phoenix. We all can talk about how well under load on multicore machines it behaves but that is the same as we would talk about Erlang. What pushes Elixir beyond Erlang is advanced macro language that allows for things like Ecto, mix with moden Ruby like gem+rake kinda dependency management and really really good solid testing framework. Elixir/Phoenix is really good. And the ecosystem is also pretty solid. Pros: * Functional language * Multicore support built in * Mix * Phoenix * REPL * solid ecosystem of most needed tools Cons are: * Functional language * Still niche adoption, not many talented people to pick from. * If you are deploying via release ( as you should ) mix is going away in production Can be plus or minus depending on people reading it etc. Now things like LiveView are just cherry on top. In general Elixir/Phoenix is a full package.
- lawn 6y agoI haven't done a release with Elixir or Phoenix yet and the documentation about it is quite confusing. There are many different ways but I have no idea which one to choose. Why should I deploy with release?
- nickjj 6y agoYeah it's super confusing, especially since mix releases are now a thing, but weren't before. I've heard Chris McCord (the author of Phoenix) say he doesn't use Elixir releases in production in most of his consulting company's client work. He talked about it in some podcast like 6 months ago. I think they just run the same mix command as you would in development but he wasn't 100% clear on that. But yeah, it's not easy to reason about it, and also if you decide to use releases it's a bummer you lose all of your mix tasks. You can't migrate your database unless you implement a completely different strategy to handle migrations. But then if you ever wanted to do anything else besides migrations that were mix tasks, you'd have to port those over too.
- dnautics 6y ago> it's a bummer you lose all of your mix tasks That's not true at all. Mix Tasks are just code. Assuming you stashed them in /lib (or someplace that elixirc reaches) you can call them in a release using eval. path/to/bin eval "Mix.Task.MyMixTask.run(...)"
- vinceguidry 6y agoI came to the same conclusion as the author, though not quite in the same way. Everything I needed to know about what Ruby was was given to me when I attempted to learn and love Crystal. Similar syntax does not make a similar language. Smalltalk is far closer to Ruby than Crystal ever could be. What makes Ruby so lovable is, in a few words, the pure object orientation. This is the source of all it's flexibility. Any concept can be created and tersely described. It's almost as semantically flexible as Lisp and ultimately friendlier. You'll never get these benefits in a language that looks like Ruby. It's not the syntax at all, it's the semantics, and you can't get Ruby semantics without actually being Ruby.
- grantjpowell 6y ago> [ruby] is almost as semantically flexible as Lisp and ultimately friendlier Elixir for the most part _is_ a Lisp, and inherits almost all of Lisp's semantic flexibility also I write Elixir full time now after writing Ruby for several years. At first I struggled getting out of the ruby meta programming mindset. After reading some advanced lisp books, the concepts of quote/unquote began to click and now I feel like my ability to meta-program in Elixir is much stronger than in Ruby.
- vinceguidry 6y agoNot to take away from the sheer amaze-balls power that lisp offers, you can get Ruby superpowers just from one book, Metaprogramming Ruby 2, which is sadly out of print. Here's a 2005 article comparing Ruby favorably to Lisp: http://www.randomhacks.net/2005/12/03/why-ruby-is-an-acceptable-lisp/ http://www.randomhacks.net/2005/12/03/why-ruby-is-an-accepta... I learned Lisp, went through the whole of HtDP, tried to get into it, but Ruby's friendliness is really special and unique.
- fouc 6y ago[1,2,3].map {|n| n*n }.reject {|n| n%3==1 } [1,2,3] |> Enum.map(&(&1*&1)) |> Enum.reject(&(rem(&1,3)==1)) Still somewhat familiar heh
- philosopher1234 6y agoOver herr
- bigbassroller 6y agoOut of the ashes of Ruby, the Elixir cures and the Phoenix rises. My keyboard is ready!
- joelbluminator 6y agoAshes of Ruby? Look at a jobs board, let me know how many Pheonix jobs you see there compared to Rails.
- pampa 6y agoAnd 99% of thse jobs are legacy RoR codebases, big hairy balls of mud. Good for job security and pays well (somebody has to support it all), but somewhat boring. Also the ruby ecosystem is in decay. A lot of libraries are abandoned or on life-support - just do a random search on rubygems and check release dates.
- joelbluminator 6y ago"legacy RoR" , so if it's not a 2 year old startup "changing the world" - it's boring? Working in Stripe / Shopify / Github is boring? I'm pretty sure btw new projects are being started in Ruby in bigger numbers than Elixir (which isn't saying much, but still). I don't really love those language wars but I don't see why Elixir has to keep trying to assert itself by dissing Ruby. First - at least by numbers, it's way way smaller. Second - it should be more confident in itself.
- pampa 6y agoI'm not bashing ruby or something. I love ruby, I have been using ruby/rails since rails 0.9. Still using ruby with roda/sequel, and i think it is the best language to rapidly prototype and explore ideas. But the reality is, that all the interesting and cool stuff is happening somewhere else now. Ruby is still a great language, but the active community outside rails is shrinking and the creativity isnt there anymore. People prefer to explore novel ideas in different languages now - rust, go, elixir etc, even if they do ruby for a living. And rails is showing its age too. Every rails project i encountered was a petrified spagetti monolyth that had to be broken up and refactored into smaller pieces.
- pantulis 6y agoThe greatest achievement of Elixir is making the Erlang platform and ecosystem accessible to everyone. And that's because its "Ruby-ness". I learned Ruby with Rails, so in the same spirit you could learn Elixir with Phoenix and I really think it's a bona-fide approach to "graduate" to the BEAM world. But, caveat emptor, the BEAM world is like an alien wunder-weapon: everything we take for granted in the modern web development world was already invented --with flying colors too-- in Erlang/BEAM so there is a lot of overlapping in terms of architecture solutions. In a Kubernetes/Istio world, would you go for a full BEAM deployment? I don't say it's not an already solved problem but what's the perfect mix-ratio? It depends.
- dynamite-ready 6y agoThe overlap between K8s and BEAM is a good question. Even amongst experienced BEAM (especially Erlang) programmers, there's a lot of conflicting information. From my limited understanding, Kubernetes is comparatively complicated, and can hamstring BEAM instances with port restrictions. On the other hand, there's a rarely documented soft limit on communication between BEAM nodes (informally, circa 70 units, IIRC). Above this limit, you have to make plans based on sub-clusters of nodes, though I have certainly not worked at that level of complexity. Would be interesting to hear what other people think about this specific subject.
- di4na 6y agoThis limitation is far higher for the past few years and there is more work from the OTP team to raise it. Also there all the hooks needed to adapt and change it as you grow. I would argue that when you reach above a hundred nodes, you will need to optimise yourself in any tech though
- josevalim 6y agoFWIW, the soft limit for 70 units is about using the global module, which provides consistent state in the cluster (i.e. when you do a change, it tries to change all nodes at once). The default Erlang Distribution was shown to scale up to ~300 nodes. After that, using sub-clusters is the way to go and relatively easy to setup: it is a matter of setting the "-connect_all false" flag and calling Node.connect/2 based on the data being fed by a service discovery tool (etcd, k8s, aws config, etc). PS: this data came from a paper. I am struggling to find it right now but I will edit this once/if I do.
- m12k 6y agoAs someone with a background in Objective-C, Swift, C++, C# and Java, and currently using Ruby, I'm looking for my next language for web development. Elixir sounds like a step up from Ruby, but I really miss static typing, and I find it hard to justify investing time in yet another language that doesn't have it. But what are the alternatives? I'm looking for something with static typing, good editor support, mature community projects (e.g. testing on par with rspec), faster than Ruby (though most statically typed languages tend to be) and if it supports some functional paradigms that could be a plus (I dabbled in F# and SML previously). - Scala is an option, but build times sound like an issue, and the JVM is a bit 'heavy' (e.g. startup times, min memory usage). - Haskell sounds cool, but maybe a bit too esoteric? (i.e. is it worth the trouble, does it have all the middleware I'm used to) - C# could be an option, but is the open source/community support there? (if you're not a corporate shop, doing corporate things). - And then there's Rust, which I'm fascinated by, but I'm also worried that I'll be less productive worrying about lifetimes all the time, and that it's less mature (though growing fast, and seems to have attracted an amazing community of very talented people). I'm also interested in ways to use a language like that in the frontend - Scalajs sounds pretty mature, C# has Blazor and Rust seems like one of the best ways to target WebAssembly. So what is a boy to do? Stick to Ruby until the Rust web story is more mature? Try out Elixir in the meantime? Join the dark side and see what C# web dev is like these days? It can be really hard evaluating ecosystems like that from the outside.
- dynamite-ready 6y agoUse whatever you feel it takes to get the job done? The above kind of derails this thread, tbh. Speaking about Elixir/Erlang alone, it's an interesting experience, because learning it properly is very different to almost every other language. So if you're keen on moving to a new language for the sake of intellectual curiosity, then you will probably enjoy the trip.
- marrianeKK 6y agoI feel the same way. I really want to jump into Elixir but the dynamic typing really puts me off.
- smabie 6y ago
- deleted 6y ago[deleted]
- josefrichter 6y agoI guess the point of this all is that there's BEAM underneath all this. And it turns out to be one of the best solutions out there for web apps. Erlang has some bad rep for "weird syntax", but it's completely unfounded, the syntax is actually quite simple and clean. Elixir opens doors mainly for Rubyists, but there are some other paths to discover BEAM. Check out: Luerl – Lua on Erlang https://github.com/rvirding/luerl https://github.com/rvirding/luerl LFE - Lisp Flavoured Erlang https://github.com/rvirding/lfe https://github.com/rvirding/lfe
- dragonwriter 6y ago> Erlang has some bad rep for "weird syntax", but it's completely unfounded, the syntax is actually quite simple and clean. Anything that isn't Algol-flavored and either procedural or class-based OOP tends to be seen as weird syntax, and much more so if it ticks both boxes. It's not as much a matter of simple and clean as familiar in a world where almost everything people will be exposed to first tends to come from a narrow design space.
- strokirk 6y agoI'd say that's very subjective - personally I still dislike the syntax after 2 years of working with Elixir.
- etxm 6y agoI really enjoy writing elixir and I’ve had some really quick wins that have scaled effortlessly on the projects I’ve deployed using it. I would love to use it to build a desktop app. I’ve fooled around with Scenic for building a UI, but haven’t figured out a way to distributed a binary besides a self extracting executable.
- sickcodebruh 6y agoEvery time I think about using Phoenix, I get scared off by warnings about how not knowing BEAM can result in serious problems. I’m not sure if that conclusion is justified but it’s where I end up every time. It’s odd and unfortunate that Elixir and especially Phoenix seem to have invested heavily in being approachable but the rest of the ecosystem seems to have warning signs posted all over the place. Is this a fair impression? Or is it possible to run Phoenix in production and gradually learn more about the BEAM, leveling up as you encounter new challenges?
- shijie 6y agoAs a daily user of Elixir since 2016, having come from a Python/Django background, I can assure you that you can know very little about OTP/Beam and still be immensely productive. But once you learn the underlying concepts that gird Elixir, so many solutions that normally require queues/caching/back pressure/state machines/distributive architectures are all possible with Elixir itself. I can say this honestly that Elixir is the most powerful I’ve ever felt as an engineer in any language.
- josevalim 6y agoWe work hard exactly so that you can run Phoenix in production and gradually learn more about the BEAM along the way! One recent example is the built-in dashboard showing all the different data the VM and the framework provide: https://github.com/phoenixframework/phoenix_live_dashboard/ https://github.com/phoenixframework/phoenix_live_dashboard/ - at first it may be daunting but providing a web-based experience to help familiarize with the building blocks is hopefully a good first step. We also added tooltips along the way to provide information about new concepts. The same applies to Elixir: learning all of functional programming, concurrent programming, and distributed programming would definitely be too much to do at once, so we do our best to present these ideas step by step. For what is worth, this is also true for Erlang. It has tools like Observer (which was used as inspiration for the dashboard) and a great deal of learning materials. One last advice is to not drink the cool-aid too much. For example, you will hear people talking about not using databases, about distributed cluster state, etc, and while all of this is feasible, resist the temptation of playing with those things until later, unless the domain you want to use requires explicitly tackling those problems. I hope this helps and have fun!
- jrochkind1 6y agoAt the time, making a language that on ran on the Erlang VM with Erlang semantics that looked like ruby probably seemed like a huge advantage to Elixir. (Plus, the people who developed it were rubyists and former rubyists who honestly liked the 'look alike' elements they took from ruby, it wasn't just a cynical attempt at manipulation). but these days ruby's popularity seems to be waning (personally I don't think for any technical reasons, especially when compared to it's nearest neighbor python; to me it's like a 'betamax vs vhs' thing, and makes me sad, but nonetheless) -- and the association to ruby may actually be holding it back as people have (IMO unjustified) negative perceptions of ruby. :(
- namelosw 6y agoElixir is basically an Erlang that looks like Ruby instead Prolog. Combined with Phoenix which looks like Rails, this language is really getting traction. I wonder if an Erlang that looks like JavaScript would work. It would be like what ReasonML to OCaml but may works better on the server side.
- lovebes 6y agoI don't know Rails. I know Python and Golang. Worked in a data-intensive, data heavy startup, throwing microservices, nanoservices in a haphazard fashion with K8S backing the "throw and see something sticks" approach. Elixir, and Phoenix makes me think. About three years ago, when we started the company, if we had these two tech... we could've been saved so much dev time focusing on the core tech, instead of making scaffolding work.
- erinan 6y agoSame here. Microservices have their place if you expect to have to scale like craaaaazzzzy or if you know that your platform will be huge with many different parts but you can go a LONG way with a Phoenix monolith while being "happier" and more productive. From my (limited) experience it's an ideal framework for startups or new web apps. I've also heard excellent things about replacing painful microservice setups with one Phoenix app. There is just so much you can do with it at scale and also so much you don't have to do (e.g. channels + integrated pub/sub are a godsend). Definitely my new favorite framework (+ language) for web dev.
- b0rsuk 6y agoI'm getting the impression that Elixir is Erlang in Ruby's clothing, a bit like Rust is (functional language) in C's clothing. Does that sound fair?