TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Elixir in Depth – Reading and personal notes

337 pointsby rudi-calmost 8 years ago

15 comments

randomstudentalmost 8 years ago
The author doesn&#x27;t talk a lot about preemptive scheduling, which is probably the best thing about the Erlang virtual machine. This video explains what preemptive scheduling is and why it is extremely useful: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=5SbWapbXhKo" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=5SbWapbXhKo</a><p>First, the speaker creates an application endpoint that runs into an infinite loop on invalid input. Then, he shows how that doesn&#x27;t block the rest of the requests. Using native BEAM (EDIT: BEAM = EVM = Erlang Virtual Machine) tools, he looks for the misbehaving process (the one running the infinite loop), prints some debug information and kills it. It&#x27;s pretty impressive.<p>Another great (and lighter) resource, is &quot;Erlang the Movie&quot; (<a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=xrIjfIjssLE" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=xrIjfIjssLE</a>). It shows the power of concurrency through independent processes, the default debug tools, and the power of hot code reloading. Don&#x27;t miss the twist at the end.
评论 #15037250 未加载
评论 #15037245 未加载
评论 #15038591 未加载
评论 #15041573 未加载
jessesalmost 8 years ago
The author says it&#x27;s &quot;hard to use Elixir with services like Heroku because your instances won’t find each other by default (the way they’re supposed to)&quot;.<p>I just wanted to mention <a href="https:&#x2F;&#x2F;gigalixir.com" rel="nofollow">https:&#x2F;&#x2F;gigalixir.com</a> which is built to solve exactly this problem.<p>Disclaimer: I&#x27;m the founder.
评论 #15039513 未加载
评论 #15039046 未加载
评论 #15037888 未加载
评论 #15038087 未加载
评论 #15040148 未加载
acconradalmost 8 years ago
All of my pet projects are run on Elixir&#x2F;Phoenix. If there is a language&#x2F;framework to learn, this would be it. As approachable as Rails with the benefits of handling real time applications (chats are trivial with Channels) and faster runtimes than Rails (by orders of magnitude).<p>Happy to help anyone out if they&#x27;re interested in learning!
评论 #15036589 未加载
评论 #15036576 未加载
评论 #15036678 未加载
评论 #15038411 未加载
评论 #15036557 未加载
sjtgrahamalmost 8 years ago
I don&#x27;t think the Gartner hype cycle applies to Elixir, and I think that is largely because it is built on top of a very mature, production-tested platform (Erlang OTP). I have been using it in production for almost two years without issue on <a href="https:&#x2F;&#x2F;teller.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;teller.io&#x2F;</a>, so if the GHC applies, it&#x27;s very elongated!
评论 #15036499 未加载
评论 #15036790 未加载
评论 #15036508 未加载
brightballalmost 8 years ago
The only part of that article I&#x27;d clarify is around deployment and devops best practices.<p>You can deploy Elixir exactly the same as any other language. In some cases, it just means making a decision that you don&#x27;t need some of the extra features that are available like hot reloading...which every project doesn&#x27;t need.<p>You can still use immutable images and take advantage of the built in distributed databases by using mounted block storage if need be.<p>You can use everything out there. Early on figuring out some of the port mappings and how to handle things was more difficult but as far as I&#x27;ve seen, those problems have mature solutions all around now.
评论 #15037480 未加载
palerdotalmost 8 years ago
If someone is on the fence to make a jump to the elixir world I recommend elixir koans - <a href="https:&#x2F;&#x2F;github.com&#x2F;elixirkoans&#x2F;elixir-koans" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;elixirkoans&#x2F;elixir-koans</a><p>I have not started looking into phoenix as I&#x27;m still exploring elixir, but I&#x27;m happy to have started learning elixir with koans along with official elixir guide.
sergiotapiaalmost 8 years ago
Great write up! Guys, if you&#x27;re on the fence about learning Elixir - dive on in!<p>You won&#x27;t be disappointed and you&#x27;ll be surprised how many times you&#x27;ll want to reach out to auxiliary services and find out &quot;Oh I can just use ETS&#x2F;OTP&#x2F;GenServer&#x2F;spawn&quot;.
esistgutalmost 8 years ago
I don&#x27;t like the debugging workflow described in the linked article &quot;Debugging techniques in Elixir&quot;, it reminds me of DDD: a separate tool not integrated with my main development environment and requiring extra manual steps. I tested both the Jetbrains plugin and the vscode extension, both failed (unsupported versions, bugs, etc...). To elixir users: what do you think about the state of debugging tools? What is your workflow?
评论 #15037574 未加载
评论 #15037851 未加载
tschellenbachalmost 8 years ago
Yes Elixir handles concurrency better than Ruby. In terms of raw performance it&#x27;s nowhere near Go, Java, C++ though. Rails&#x2F;Django are fast enough for almost all apps, if you need the additional performance improvements of a faster language you&#x27;d probably end up with one of those 3. Wonder how much need there is for a language that takes the middle ground in terms of performance. Looks very sexy though, really want to build something with it :)
评论 #15061436 未加载
评论 #15039608 未加载
bitwalkeralmost 8 years ago
I think the discussion around deployment may have been unnecessarily tainted by their experience using edeliver - it&#x27;s an automation layer for building and deploying releases, but as mentioned it is configured via shell scripts and because it does a lot, a lot can go wrong.<p>The basic unit of Elixir (and Erlang for that matter) deployments is the release. A release is just a tarball containing the bytecode of the application, configuration files, private data files, and some shell scripts for booting the application. Deployment is literally extracting the tarball to where you want the application deployed, and running `bin&#x2F;myapp start` from the root of that folder which starts a daemon running the application. There is a `foreground` task as well which works well for running in containers.<p>My last Elixir gig prior to my current one used Docker + Kubernetes and almost all of our applications were Elixir, Erlang, or Go. It was extremely painless to use with releases, and our containers were tiny because the release package contained everything it needed to run, so the OS basically just needed a shell, and the shared libraries needed by the runtime (e.g. crypto).<p>My current job, we&#x27;re deploying a release via RPM, and again, releases play really nicely with packaging in this way, particularly since the boot script which comes with the release takes care of the major tasks (start, stop, restart, upgrade&#x2F;downgrade).<p>There are pain points with releases, but once you are aware of them (and they are pretty clearly documented), it&#x27;s not really something which affects you. For example, if you bundle the Erlang runtime system (ERTS) in a release, you must deploy to the same OS&#x2F;architecture as the machine you built the release on, and that machine needs to have all of the shared libraries installed which ERTS will need. If you don&#x27;t bundle ERTS, but use one installed on the target machine, it must be the same version used to compile your application, because the compiled bytecode is shipped in the release. Those two issues can definitely catch you if you just wing a deployment, but they are documented clearly to help prevent that.<p>In short, if there was pain experienced, I think it may have been due to the particular tool they used - I don&#x27;t think deployment in Elixir is difficult, outdated, or painful, but you do have to understand the tools you are using and how to take advantage of them, and I&#x27;m not sure that&#x27;s different from any other language really.<p>Disclaimer: I&#x27;m the creator&#x2F;maintainer of Distillery, the underlying release management tooling for Elixir, so I am obviously biased, but I also suspect I have more experience deploying Elixir applications than a lot of people, so hopefully it&#x27;s a wash and I can be objective enough to chime in here.
评论 #15061482 未加载
innocentoldguyalmost 8 years ago
I don&#x27;t know why, because I don&#x27;t think they are all that similar, but I&#x27;m often asked to defend my choice of using Elixir professionally vs. Go. From the article, this is one of the big reasons I chose Elixir over Go:<p>&quot;Go’s goroutines are neither memory-isolated nor are they guaranteed to yield after a certain amount of time. Certain types of library operations in Go (e.g. syscalls) will automatically yield the thread, but there are cases where a long-running computation could prevent yielding.&quot;<p>goroutines also take up about 10 times the memory.
评论 #15040674 未加载
Exumaalmost 8 years ago
This is a really good write up, thank you.
评论 #15036720 未加载
RobertoGalmost 8 years ago
That was a nice article. Thanks.<p>I&#x27;m curious about the first table in the &quot;Interop with other systems&quot; part.<p>It seems to say that an Erlang deployment doesn&#x27;t need Nginx or a HTTPServer, anybody knows how that works?<p>EDIT: I read the cited source (<a href="https:&#x2F;&#x2F;rossta.net&#x2F;blog&#x2F;why-i-am-betting-on-elixir.html" rel="nofollow">https:&#x2F;&#x2F;rossta.net&#x2F;blog&#x2F;why-i-am-betting-on-elixir.html</a>) and it seems that is the case.<p>It looks too good to be true, yet. It would be nice, if somebody with Erlang deployment experience, could comment.
评论 #15036849 未加载
评论 #15038005 未加载
gfodoralmost 8 years ago
One thing I didn&#x27;t see covered that I&#x27;m currently trying to understand with Elixir is the relationship between process state and disk-backed state. (For example fetched via Ecto.) Does the role of a traditional RDBMS change in an elixir system? What are the durability guarantees of process state? Etc. Any real world experience would be super helpful to hear about.
评论 #15061506 未加载
brudgersalmost 8 years ago
I can see why a person might choose Elixr over Ruby or vice versa. The tradeoffs between Elixr and Erlang are a lot less clear to me.