14 ms·
Elixir v1.7 released
- qaq 8y agoThe surprising thing is Elixir has better tooling than many lang. funded by the tech giants.
- amorphid 8y agoI quite like mix and hex. Now all we need is sane, Elixir-y dialyzer errors!
- jeremyjh 8y agoDisclaimer: I'm a maintainer but the next Dialyxir release makes a major improvement on this, thanks to contributions from Andrew Summers. He wrote a parser for the Erlangified term strings and uses the Elixir (1.6) pretty printer to print all the terms the way Elixir would. We're still fine-tuning the error messages and explanations but there is an RC on hex[0] - give it a spin if you haven't yet. [0] https://hex.pm/packages/dialyxir/1.0.0-rc.3 https://hex.pm/packages/dialyxir/1.0.0-rc.3
- qaq 8y agoWow nice. The rate of progress is amazing.
- dnautics 8y agothanks, the current state of dialyxir is quite good! I use it in my toolchain.
- _asummers 8y agoHi Jeremy! If anyone has any questions about this work, I'm willing to answer them!
- amorphid 8y agoI'll check it out tonight!
- mmartinson 8y agoAwesome. Thanks
- bostonvaulter2 8y agoYou should try Dialyxir 1.0.0-rc3! The error reporting is vastly improved by a GSoC student. Now you can get errors like this: ________________________________________________________________________________ apps/activity_feed/lib/activity_feed/push_notification_listener.ex:10:callback_type_mismatch Callback mismatch for @callback push/2 in ActivityFeed.ListenerBehaviour behaviour. Expected type: {:error, _} | {:ok, _} Actual type: :ok ________________________________________________________________________________ apps/activity_feed/lib/activity_feed/push_notification_listener.ex:24:pattern_match The pattern _ = {:error, _} can never match the type :error | :ok
- _asummers 8y agoNot quite -- that was me =). The GSOC student (Gabriel Gatu) is incorporating that work along with the incremental Dialyzer from the Elixir-ls project, and taking some of the new Dialyxir errors and morphing them a bit into a task that can be eventually merged back upstream into a more mainline mix task. You can track his progress here [0]. The lion's share of the work is now extracted into Erlex [1] which can be incorporated into other tools as needed. [0] https://github.com/gabrielgatu/mix-dialyzer https://github.com/gabrielgatu/mix-dialyzer [1] https://hex.pm/packages/erlex https://hex.pm/packages/erlex
- bostonvaulter2 8y agoOoops! Sorry for getting that mixed up! erlex sounds like a neat project! I hope you make an Elixir Forum post about it so that more people are aware of it, I think it probably has quite a few good uses.
- _asummers 8y agoNo trouble! I had unfortunate (or perhaps fortunate for Gabriel!) timing with its completion. Making a forum post is a good call! I need to throw some more docs in there, but I'll make one after that's in decent shape.
- brentjanderson 8y agoI believe much of this is due to the Erlang/BEAM foundations Elixir is built on. Ericsson has invested considerably in Erlang for decades, giving Elixir a boost in the tooling department.
- qaq 8y agoI think the runtime side absolutely, but package mngmnt, unit testing general dev. productivity things major kudos to Elixir team
- sjtgraham 8y agoNo. Elixir has contributed a lot on its own, aside from what it inherits from Erlang. Mix, Hex, iex, Docs/doctests, ExUnit, etc.
- tyurok 8y agoiex runs smoothly because of erlang's console and ExUnit runs in parallel leveraging BEAM, so it's considerable. The foundation was pretty much there from the beginning.
- pejrich 8y agoWhile it's true that Elixir certainly wasn't built from the ground up, and it has benefited heavily from the work of Ericsson on Erlang, Elixir is more than Erlang with different syntax. A lot of stuff in Elixir was rewritten so that people can read the source in Elixir, and not have to know too much about Erlang.
- noncoml 8y agoI don’t think so. Earlang tooling, rebar3 and erlang.mk, is not really the best out there.
- mononcqc 8y agoI'd love to get your feedback on rebar3; I've heard that opinion repeated often, but not really often have I heard specifics that we could address directly.
- nathan_long 8y agoI don't think it's surprising if you consider Elixir's nature. Languages like Go, Rust, and Haskell have to start from scratch. Getting to the point where they work at all is a huge achievement (though of course they do more than that). Languages like Clojure run on an existing virtual machine, but want a very different programming model, so they have to invent a lot. By contrast, Elixir runs on the BEAM and gets 99% of its features from Erlang: you still use processes, supervisors, pattern matching, etc. So in a sense, the only reason for Elixir to exist is to provide a great developer experience for the BEAM. If it doesn't do that, you might as well use Erlang.
- qaq 8y agoVery valid point
- aprao 8y agoNice! Really digging the additions to ExUnit. Curious: why was Behaviour deprecated?
- quaunaut 8y agoNote that it's just the Behaviour module that's deprecated, not the concept of Behaviours. So, `@behaviour` is still there. And the reasoning is that one should instead be using `@callback` and `@macrocallback` which also are typespec attributes: https://hexdocs.pm/elixir/Module.html#module-typespec-attributes https://hexdocs.pm/elixir/Module.html#module-typespec-attrib...
- whitepoplar 8y agoBehaviours weren't deprecated, only the Behaviour module was.
- deleted 8y ago[deleted]
- sergiotapia 8y agoGreat QoL improvements. I'm building a very large complicated product in a very boring market that traditionally has old tech. Building it with Elixir helps me write less code with fewer bugs and test coverage. I love it. It feels strange how I remember Elixir was a "what if" back when Meteor was in vogue, now I couldn't be happy at my job if not for Elixir. It's the best! Jose's vision of developer UX first is really something else and it shines through when you work with Elixir.
- h1d 8y agoHow do people convince their team or management to use a newer language which may not have plenty of alternative programmers and experiences in the team in their projects? I can't even use anything other than PHP if I sense anyone else may touch the project later, otherwise I'm currently using TypeScript throughout the stack.
- tobyhinloopen 8y agoYou don’t except if management are devs themselves. From a business perspective, Elixir is a terrible choice. Ive worker on Elixir over a year and it is great, but there are 0 devs and learning it is hard for newbies
- qaq 8y agoThis highly depends on you business requirements
- tormeh 8y agoThis. The use case needs to fit Elixir so well that it makes up for the difficulty in hiring devs etc.
- the_duke 8y agoAlso, Elixir is a relatively small and simple language. Yes, it's functional, but it doesn't have a lot of complex concepts and is much easier to learn than , eg, Ocaml or Haskell. (at least in my opinion). A good dev should probably be productive within a week.
- jherdman 8y agoDid any of the deployment improvements discussed at Lonestar Elixir make it into 1.7?
- plainOldText 8y agoI've been programming heavily in Elixir for the past 2+ years and I've become increasingly happier with the language, its growing ecosystem, and the Erlang/OTP. I first came across Erlang a few years back, while I was researching more exotic programming languages, but for some reason Erlang never felt like home. I know plenty of people like it, but personally, I found it difficult to get accustomed to its syntax, especially after having spent most of my time in Python. But as soon as I discovered Elixir, I got hooked. All the advantages (and disadvantages) of using the Erlang/OTP programming model, while experiencing a nicer, developer-friendlier, and more familiar interface. Our work is seldom, if ever, not dependent upon the sweat and labor of other people. So, thank you Elixir team! Elixir is truly a joy.
- sidkshatriya 8y agoElixir Erlang/OTP are indeed a joy. Everything seems so organically put together and integrated! I love the OS-like feel of the platform. However, I'm curious: does the lack of types (both Elixir and Erlang are dynamically typed as you know) affect long term productivity on the platform? The lack of proper static typing does make large codebases very difficult to build and maintain, don't you think? People have mentioned dialyzer a lot in reference to Elixir/Erlang but how good/practical is it? Sometimes I wonder: how fault tolerant can the OTP platform be anyways if your process can crash due to an unmatched pattern? A type checker should tell you at compile time that you've not tested all possible combinations and this should not happen at runtime. For a process to crash on an unmatched message and have a replacement process restarted by the supervisor to take its place ("let it crash") is definitely cool but seems like an extreme solution. What could have been fixed forever by a type checker is being deferred to the runtime. Thats really my main gripe. There are probably many scenarios where the whole OTP philosophy of crash recovery is definitely going to help with the robustness of the platform but I suspect a lot of crashes of processes are due to fairly prosaic reasons like unmatched patterns, wrong arguments to functions etc.
- dnautics 8y agoElixir certainly has types, and they are far stronger than python and Ruby. In the end a lot of your crashes are going to be "other people's software, like, say, "an unexpected race condition in nfs". Or "some other library crashes when parsing a really big json". In the end these are not really solved by a static type system. The idea that static types will save you is flawed by giving you a false sense of security and tying up developer time outside of the 80-20 Pareto law... In my short so far experience as an elixir developer I've delivered all of my products on time. Running it I know there are errors since they floated by the console in the background... I didn't care about the 1% error since it did not significantly affect my performance. Not worrying about every last problem has been great for my sanity. Finally, there is a possibily antipattern Dev cycle, I've settled in to. Unit test the happy path, write happy path, conjure errors, unit test them, solve them with an eye for recovery, spec out the type system, sweep away last lingering errors with dialyzer. Occasionally totally refactor. I can usually demo any time after step 2.
- angersock 8y agoI used to be really bullish on Elixir, but having used it in production for over a year (and having worked on libraries since '13), I think people are overselling the daily experience. The language itself is good, the tooling is pretty excellent, but there are issues for things like deployment, ops, and frankly a general excitement about neat things instead of focusing on bread-and-butter stuff like, say, timezones and timestamp formatting (something coming in a couple of releases, allegedly, but which was always an obvious absence).
- qaq 8y agoI would agree that deployment story could be better, thing is you have to allocate time to setup CI/CD and all the relevant integrations regardless of what language you are using so the extra one time effort to get things working smoothly for Elixir is not that bad. This is also an area of strong focus of efforts to improve the tooling so I think it will get better in a reasonable amount of time.
- whalesalad 8y agoWhy does everyone seem to be so upset about deployment? I can't comprehend the issue.
- sb8244 8y agoMy experience has been painful at first (~1 week time to get setup), now takes 15 minutes to get a service deployed. Using Heroku (not good practice and I wouldn't use in prod), it would be really quick.
- bostonvaulter2 8y agoHeroku works fine in prod up to the scale of most pre-series A startups. There are a few limitations you have to accept but for us the easy deployment strategy (and existing suite of addons) makes it very easy.
- sb8244 8y ago
- dfischer 8y agoTo those using Elixir, how are you deploying it? Would love your insight especially if you're on GCP (app engine, super curious). Thanks!
- dnautics 8y agoFor development purposes, I'm deploying it on an on-prem device running ubuntu, inside a singularity container (a little bit laxer on the security front than docker, for dev probably ok, but when we look to productize it we might think about other strategies). In particular since the final product is on-prem, the highly available, let-it-fail philosophy is appealing to reduce the number of issue tickets we're likely to have to deal with. Don't take my strategy as gospel - I am on an open-ended, highly divergent branch of our company's product line and have been given a lot of product leeway by management that is.... "open-minded".
- elcritch 8y agoJust a thought, you might consider a nerves deployment... ahem I’m just curious how an IoT deploy system would work for on prem servers, well other than running on RPi’s that is :-)
- dnautics 8y agonerves is designed to write to an flash disk. My system has 2TB of SSD, dual socket intel, and 8 GPUs!
- elcritch 8y agoThat’s part of the fun! You can write to normal disk too, then mount the rest for data. So it’d leave 1.999500 TB free. ;) Ok maybe I just like extremes..
- bostonvaulter2 8y agoIf you're interested in this, then you should definitely follow this project: https://github.com/cogini/nerves_system_ec2 https://github.com/cogini/nerves_system_ec2 I'm excited to play with it in the future.
- davidw 8y agoAlong the lines of comments below... what are the sweet spots people are finding for Elixir? I've used Erlang a lot in the past and like it, and would love to have an opportunity to use Elixir for some projects, but it seems that for regular old CRUD kinds of stuff, I'm not sure it's a win compared to Rails.
- dudul 8y agoYou may be confusing Elixir and Phoenix. Phoenix is the Rails equivalent in the Elixir ecosystem.
- davidw 8y agoI whipped off the comment pretty quickly. Yes, Elixir is the language and Phoenix the framework. My experience is that most people using Elixir are doing so via Phoenix, whereas Erlang tends to be used for more disparate things.
- freedomben 8y agoPhoenix is great, even for CRUD type stuff. It took a little bit of learning but now I can crank out a CRUD app just as fast with Phoenix as rails. I don't think I'll ever start a new app in rails again.
- amorphid 8y agoThis is a rather simplistic argument... With Ruby I find it hard to avoid using a debugger. With Elixir I never need a debugger.
- rhizome31 8y agoAs someone who resort to IEx.pry daily I'm curious if you have any tip to share about your workflow so that you don't need a debugger. To you use typespecs and Dializer? (I haven't looked into those yet.) My experience is that a good share of bugs is avoided thanks to immutability, but I still get nil-related issues now and again.
- blackrock 8y agoIs there any hope that Elixir can be used for client side programs, with GUI windows? Or will Elixir only be used for server-side programs, that don't require a graphical user interface? I would like to program video games with Elixir. But the examples I see online are rather immature. And it doesn't seem like anyone is interested in using Elixir to program desktop GUI programs.
- freedomben 8y agoI think there's hope, but probably not any time soon. There was a discussion about this recently on the forums and the general consensus was "use java or electron." That said, I've written a CLI in Elixir now and it's pretty good for that. Also the Elixir community if full of hackers so I wouldn't be surprised if somebody makes this comment obsolete very quickly.
- brightball 8y agoSupposedly there’s going to be a massive unveiling by the next Elixir Conf of a library that’s been developed by the guy who headed Xbox Live. It’s called Scenic and there’s a lot of anticipation.
- blackrock 8y agoI'm looking forward to this. https://elixirforum.com/t/3-elixirconf-2017-elixir-native-ui-boyd-multerer/8653 https://elixirforum.com/t/3-elixirconf-2017-elixir-native-ui...
- bostonvaulter2 8y agoThere's definitely interest in using Elixir for GUI programs, in addition to Scenic which will be unveiled at ElixirConf there's also Uderzo which is pretty neat, but definitely still alpha or pre-alpha https://github.com/cdegroot/uderzo_poncho https://github.com/cdegroot/uderzo_poncho
- toast0 8y agoGUI abstractions and Erlang abstractions have a lot of impedence mismatch. wxWindows is really confusing to use in my opinion. ex11 actually kind of makes sense, but it was mostly built in the stone age of x11, so widgets look wierd, and there's not any sort of modern font support. It's not too hard to add things, but you have to understand x11 protocol and do all the work (I added support for window titles)
- fabian2k 8y agoHow well supported is Elixir (and Phoenix) on Windows? I've experimented with it on Windows, and it generally seems to work, but I'm curious if people are actually using it in production on Windows. I personally wouldn't choose Windows, but there are areas where that is a hard requirement.
- passer-by-123 8y agoBoth Erlang and Elixir have CI running on Windows and provide installers. I am aware of many using Windows for development, although I am not aware of people deploying on Windows.
- Djvacto 8y agoI'm currently learning Elixir using my Personal Windows Dev Machine. Haven't run into any problems, but I know if I were to deploy anything it would be on a linux server for sure.
- deleted 8y ago[deleted]
- tomwilson 8y agoElixir/Erlang themselves seem fine. Where you can sometimes run into issues is with libraries that use NIF's and getting them compiled in windows...
- skrebbel 8y agoI like Elixir and the community is amazing, especially for such a young language. Particularly the quality of the standard library as well as the more popular open source libraries is really high. That said, there's one design choice that I simply never understood: the dynamic typing. Bear with me, I'm not trying to start another holy war here, I have an argument. Thing is, Elixir very seldomly uses its dynamic typing. Ruby has method_missing and monkey patching, JavaScript (finally) has Proxies, but Elixir has none of these. In fact, most Elixir code is particularly undynamic in nature. All Elixir code that I've seen looks more like a non-OO version of typical Java or C# code. Notably, variables and seldomly change type. Function arguments are seldomly "a string or an array" like is common in JavaScript. Structured arguments are typically either used as a dictionary, or as a struct (the Elixir word for object, record, whatever), but not really ever "a little bit of both". Modules always have the same set of functions, the functions always have the same signatures. Elixir replaces Ruby's monkey patching with macros. They feel a bit similar, but notably macros are entirely compile time. There's nothing dynamic about them. I feel like if Elixir had unambitious static typing, more akin to C# or TypeScript than to Haskell, it'd have significantly better tool support, code would be much much easier to read and follow, and virtually all code that works now would still, well, Just Work except that you'd need to specify types on function arguments of course. Of course, there's typespecs, but anyone who's ever tried to use them knows how abysmal the development experience is. Dialyzer error messages are impossible to figure out, often showing errors multiple functions down the stack from where the typing or programming error actually is. The syntax is weird, minimally documented and not integrated with the rest of the language. I'm impressed by how well most bigger libraries are typespec'ed, given how hard it is to get that right. All that said, I'm well aware that even an "unambitious" type system would be hard to accomplish. Making a dynamically typed language surely must be easier than an ergonomic statically typed one - especially if the underlying VM does not depend on static types. Maybe the simple reason Elixir lacks a good static type system is that it's a lot of work.
- di4na 8y agoThe main reason is that no research in static typing have found how to type the function self() in an actor model yet. There are some typed language on the BEAM but far from being reliable on prod. Quite simply, noone knows how to efficiently type the actor model on the BEAM yet. It is that simple