Live data from Hacker News

Elixir v1.3 released

elixir-lang.org

41–50 of 125 posts

Re: Elixir v1.3 released

#41
post #13
post #10

I've never really looked into Elixir. I'm a Python guy and readability is the first thing that makes me love or hate a new language. Considering I've always found Erlang fairly obtuse visually I am surprised by how easy on the eye Elixir is. I found this quote very telling: > "Elixir is simply the first language since Ruby to really care about code beauty and UX of the language, libraries and ecosystem." (found here:…

I started out learning Erlang before Elixr had really crossed my radar. I have to say I prefer the Erlang syntax to the ruby-inspired Elixir. Maybe just a matter of what you know, I could see a RoR developer finding Elixir more appealing (I've never really used Ruby or Rails at all).

Agreed. The syntax and benefits would certainly appeal if I were a Ruby developer, but coming from a different perspective, I don't get the reason for all the love.

Re: Elixir v1.3 released

#42

Anyone here switched from a statically typed functional programming language (Haskel, OCaml, F#, Scala...) to Elixir? How would you describe the experience? What do you miss? What do you like/love? Overall, would you recommend taking that step?

I used to do Scala prior to coming to Elixir, mainly by using Play Framework to create web apps. I can tell you that I love Elixir and that I will not be going back to Scala. I miss nothing from Scala.

* Pattern matching in Elixir is superior to Scala's in every way possible (You can pattern match on function parameters!!)

* Async code is a breeze with Task.async()/Task.await() instead of mapping on Future's everywhere and making sure you have the proper implicit globals imported

* Actor pattern is built into the language and it's a breeze to work with. No need to rely on Akka to replicate it

* JSON is a joy to work with

* Documentation is fantastic in the core language and many libraries

* No more JVM!

* Building a release is much easier than dealing with SBT

If you have a functional background, I would recommend reading Elixir in Action as a starting point. It already assumes you have an FP background and takes you into more of the core features of the language. I really enjoyed it and the content is superb.

Re: Elixir v1.3 released

#43
post #39

If you're looking for a reason to migrate from a stack like Ruby/Rails to Elixir/Phoenix you should check out my RailsConf talk on that exact subject: https://www.youtube.com/watch?v=OxhTQdcieQE

Thanks for all the work you and the good folks at Dockyard put into Elixir Phoenix and Ember.js, my entire stack nowadays is run with Ember in the front and Phoenix in the back, so I very much appreciate all the great addons, packages, talks, etc., you guys have given.

We love to reinvest in the open source community. :)

Re: Elixir v1.3 released

#44

If you're looking for a reason to migrate from a stack like Ruby/Rails to Elixir/Phoenix you should check out my RailsConf talk on that exact subject: https://www.youtube.com/watch?v=OxhTQdcieQE

This is a great talk. Have you all at DockYard considered putting these concepts in writing? Sometimes I find that having a detailed blog post about the subject with supporting links and documents can be a fantastic resource for transition discussions. My team has made the decision to move toward all greenfield projects being started in Elixir/Phoenix and we couldn't be happier. We have been a Rails shop for six year…

I should probably write it up. I've been pretty busy traveling for business and doing conf talks. The next few weeks slow down quite a bit so I should have some time.

Re: Elixir v1.3 released

#45

Anyone here switched from a statically typed functional programming language (Haskel, OCaml, F#, Scala...) to Elixir? How would you describe the experience? What do you miss? What do you like/love? Overall, would you recommend taking that step?

There are optional type specs: http://elixir-lang.org/getting-started/typespecs-and-behavio...

which can serve as documentation and are used by a tool called Dialyzer during the build process to find errors based on the type specs.

I have not used this particular tooling first hand, but my sense is that it is well-integrated and works well. Someone else will probably comment with first-hand experience.

The Elixir compiler seems to catch a lot of errors, for what it's worth. If you attempt to call a function that doesn't exist or with the wrong arity, you're going to get an error (even w/o any type specs). The number of compiler errors one has in a statically typed language that are really just about types may not be that many.

w/r/t static vs dynamic, in general, these are the things I'd consider (if you haven't already): you're domain (are you building a rocket or a consumer-facing web app), you're appetite for testing, size of project, size of team, specifics of the tooling w/r/t refactoring (elixir's compiler is pretty good for supporting a big rename, for example; ruby, without a compiler and with so many language features, not so much), how the language makes you feel when you use it (dynamic wins here in general for me; I don't like to be in trouble or interrupted when I'm thinking), the collections library (this is big for me -- I could never go back to a weak collections library -- Go, I'm looking at you), Etc. YMMV, qualifier, qualifier. In general, the specifics really matter -- both of what you're doing and the specific tooling and how they interact.

Elixir seems to strike a very nice balance of all these things with a just right, small, extremely powerful feature set on a rock solid VM with astounding concurrency and distributed computing facilities, if you need them. By all means, I would try it.

Re: Elixir v1.3 released

#47

Earlier quoted context omitted.

Is there a good guide to Ecto? Aside from OTP, it's the part I have the most trouble with in Phoenix/Elixir.

Somehow I've never heard of "sectors" and google isn't any help. Is there a different name for this concept used in Elixir/Erlang world?

Autocorrected from "Ecto" :-)

Re: Elixir v1.3 released

#48
l used to be/still am a ruby on rails developer. I wrote a very naive web crawler in elixir within a week while learning elixir and I'm blown away by the performance. It basically maxes out my 2011 macbook air's cpu while staying under 200MB of RAM (and maybe another 500 for multiple postgres connections). It basically runs in the background on a computer that can barely handle Firefox with multiple tabs open. The only real bottleneck of my crawler is bandwidth (my internet speed). The performance you get out of the box is insane. And my app really sucks (individual database inserts, saving the entire html to the database, etc).

The transition to a functional language is not exactly a cakewalk and I honestly still miss ruby's ability to be able to hack through arrays (no way to easily get the nth element of an array, it's all head|tail recursion) and hashes (nothing like hash[:key]) to make something "work" but the pipe operators and pattern matching are addictive. The eco system is not "opinionated" at all aside from the constraints of erlang. Documentation is crystal clear. Most of the phoenix stack can be used as stand alone libraries/dependencies. There's a lot less magic and most of the "magic" comes from macros which are much more transparent.

I'm honestly excited for web programming again after being burned out on legacy rails app development and deployment. Mix is like gems/bundler/rails {console, server, etc.} in one neat package done right and minus the headaches. Jose Valim and Chris Mc Chord are brilliant but are very approachable and all around nice people to interact with. In my short time with Elixir/Phoenix I'd say the "hype" actually understates the true potential of BEAM for web development and tiny startups. Also there's also LFE (lisp flavoured erlang created by one of the creators of erlang) you can add to the mix (similar to what you have with Scala/Clojure + Java only with concurrency and multicore out of the box with a tiny RAM footprint).

Learning Elixir was one of the best investments of time I've made in learning a new language and made programming a "hobby" again for me. Being able to write a naive implementation/prototype of an app and not dreading a "real" deployment (pulling out a bag of deployment tricks or stringing together a slew if external libraries/dependencies) is the most liberating experience I've had in a long time.

Re: Elixir v1.3 released

#49

Anyone here switched from a statically typed functional programming language (Haskel, OCaml, F#, Scala...) to Elixir? How would you describe the experience? What do you miss? What do you like/love? Overall, would you recommend taking that step?

I switched from Ruby to Scala, and I have had an absolute blast. Elixir is sort of chained to BEAM, which doesn't appear to have as bright a future as the JVM or LLVM does, so Scala seemed like a safer bet.

Reading about Elixir is cool sometimes, but then I look at Dotty, and I feel confident that I made the correct choice.

I've also been keeping an eye on Crystal (statically typed Ruby-esque language, LLVM), but they aren't making great PLT choices so far. Maybe they'll get it together later. Scala-Native will blow it out of the water most likely anyways.

Sort of the opposite of losing statically typed programming, but I've really enjoyed the journey and it's improved my work a lot more than I thought it would. I know Ruby pretty well and I used to feel really dumb all the time when things would break, and it took some time for me to realize that it was a language problem. Looking back and reading some of the Ruby that I ported, it was impossible to reason about, and very difficult to make guarantees for. Nothing was solid at all, and runtime errors could hypotehtically stop the show at any time. With Scala there's a much sharper baseline of what will definitely work or not work.

Types make a LOT of things so much easier, in exchange for making a few things SLIGHTLY more tedious. After doing it, I'd make that trade ten more times if I had to.

Re: Elixir v1.3 released

#50

Elixir 1.3 and Ecto 2.0 are now both released. That means Phoenix 1.2 will be released ASAP. Definitely give the Programming Phoenix book a read if you haven't already. The Elixir/Phoenix stack should be ready for most production environments now. https://pragprog.com/book/phoenix/programming-phoenix

Is there a good guide to Ecto? Aside from OTP, it's the part I have the most trouble with in Phoenix/Elixir.

You won't find anything better than hexdocs and stacked overflow at this moment (not in my experience at least). You don't get the dynamic method calls of find_all or the find(:hash key) magic but once you master Ecto.Query and all the different parts that make up Ecto you'll have much more flexibility and performance out of the box. The information is hard to find on Google but the Ecto source code and official docs are much easier to parse than ActiveRecord.
Post reply on HN