Live data from Hacker News

Elixir 1.2.0 Released

github.com

31–40 of 69 posts

Re: Elixir 1.2.0 Released

#31
post #17
post #9

Since elixir is base on Erlang, it would have the same Repl workflow that you would find in Clojure?

Almost, you definitely have a nice REPL however I find the workflow of Clojure way better. The problem I think lays on the fact that Clojure group function inside very flexible namespace, while Elixir use more rigid modules. However in my limited experience the way you code Elixir feels very different from the way you code Clojure. It's difficult to explain, but I would say that I follow more my gut while I code Cloj…

> the code in Clojure support concurrency and parallelism, while in elixir concurrency is the norm

This makes little sense to me. You feel it is the norm in both?

If you are unsure if a post is readable, why not just rewrite it?

Re: Elixir 1.2.0 Released

#32
post #2

How ironic, I was wondering just last night when 1.2 would be released. I'm a newcomer to Elixir, and have really been enjoying it. As a Python->Rubyist, it's been really interesting to finally hit a functional language, and some of Elixir's most basic features just seem crazy in comparison to what I've come from. Some neat examples: * Pattern Matching. In other words- you don't assign things to variables, you match…

Not knowing Elixir at all, what's with all the & operators in your pipe example? Looks very unappealing to me.

[deleted]

Re: Elixir 1.2.0 Released

#33

Earlier quoted context omitted.

$ (1..10) |> Enum.map(&(&1**&1)) |> Enum.filter(&(&1 This is the equivalent of this piping op done in terse style JS: [for (i of Array(10).keys()) ++i].map(e=> e*e ).filter(e=> e This is not as concise as the example you provided but it's still very neat and powerful.

Are list comprehensions still part of ES7? It's strange that Babel removed the list comprehension transformer recently, but I haven't been following closely. The Elixir pipe syntax is reminiscent of Clojure's ->/->>: (->> (range 1 10) (map #(* % %)) (filter (partial > 40))) It's nice that in languages like Haskell or ML this is trivial: infix |> fun (a |> b) = a b You could modify this to let NONE fall through, etc.

Wouldn't it be "fun (a |> b) = b a"? (call b on result of argument a)?

Re: Elixir 1.2.0 Released

#34
post #2

How ironic, I was wondering just last night when 1.2 would be released. I'm a newcomer to Elixir, and have really been enjoying it. As a Python->Rubyist, it's been really interesting to finally hit a functional language, and some of Elixir's most basic features just seem crazy in comparison to what I've come from. Some neat examples: * Pattern Matching. In other words- you don't assign things to variables, you match…

Not knowing Elixir at all, what's with all the & operators in your pipe example? Looks very unappealing to me.

It's a shorthand. Once you get tired of the long form, the shorthand will be appealing :P

Re: Elixir 1.2.0 Released

#35

Earlier quoted context omitted.

Are list comprehensions still part of ES7? It's strange that Babel removed the list comprehension transformer recently, but I haven't been following closely. The Elixir pipe syntax is reminiscent of Clojure's ->/->>: (->> (range 1 10) (map #(* % %)) (filter (partial > 40))) It's nice that in languages like Haskell or ML this is trivial: infix |> fun (a |> b) = a b You could modify this to let NONE fall through, etc.

Wouldn't it be "fun (a |> b) = b a"? (call b on result of argument a)?

Oops, that's right.

Re: Elixir 1.2.0 Released

#36
Just want to chime in reiterating everyone's thoughts already here that this language is fun, interesting, and worth your time investment to investigate.

The biggest hurdles I had coming from OO Ruby were 1) how to handle state, since you no longer can just hang information off any arbitrary object attributes, 2) pattern matching (but now that I grok it, I love it, it's so useful and leads to more concise code), 3) lack of inheritance (although oddly, I don't seem to miss it, it just leads to a somewhat different code design), 4) OTP semantics (which after you mount the learning curve, make a lot of sense from a resiliency standpoint).

There are a number of neat little details not yet mentioned or emphasized here such as full Unicode support, full-fledged macros that give you full AST access (in a non-homoiconic language, that is a rarity!), custom sigils (http://elixir-lang.org/getting-started/sigils.html), the ability to easily call into any Erlang library, the fantastic :observer.start() utility for visually observing tons of details about a running pid hierarchy, etc.

One possible hurdle unique to languages that feature message passing between independent processes (pids or process id's) as a core feature is that once you have a pid hierarchy, it seems to me that inevitably, one of them will get a backlog of messages requiring you to either apply back-pressure techniques (slowing down upstream synchronous messaging by slowing down replies, basically) or pursue some other strategy (code refactoring etc.) when messages start to get discarded under load due to overflowing the pid inbox.

Re: Elixir 1.2.0 Released

#37
Wow, already home brewed too! (OSX users can upgrade with `brew update && brew upgrade elixir` and it just magically works -- because awesome people have made it so)

What a great way to ring the new year! Happy New Year everyone!

Re: Elixir 1.2.0 Released

#38
post #2

How ironic, I was wondering just last night when 1.2 would be released. I'm a newcomer to Elixir, and have really been enjoying it. As a Python->Rubyist, it's been really interesting to finally hit a functional language, and some of Elixir's most basic features just seem crazy in comparison to what I've come from. Some neat examples: * Pattern Matching. In other words- you don't assign things to variables, you match…

It's also worth mentioning that the Node community took a long time to get streams right, and "Streams 2.0" is still poorly documented.

For example, a major feature of the redesign is backpressure support, but it's not at all obvious how it's supposed to work, and there are no mechanisms available in the standard library to tweak it.

Streams also still have odd issues you would not expect in a mature release. (Error propagation, for example, is quite broken in practice; if you string together a series of pipe() operations, emitted errors won't propagate up the chain properly.)

I haven't looked very closely at Elixir's streams, but the fact that they are based on lazy function evaluation makes them inherently better than what Node.js offers.

Re: Elixir 1.2.0 Released

#39
post #4
post #2

How ironic, I was wondering just last night when 1.2 would be released. I'm a newcomer to Elixir, and have really been enjoying it. As a Python->Rubyist, it's been really interesting to finally hit a functional language, and some of Elixir's most basic features just seem crazy in comparison to what I've come from. Some neat examples: * Pattern Matching. In other words- you don't assign things to variables, you match…

I hear Elixir is great, but I understood and still enjoy what you described in Scala, so I don't see what makes it unique. On top of this, it runs on the JVM, so you get to use the entire history of Java libraries whenever you need it. Your example: >> (1 to 10).map((x) => x*x).filter(_ Of course, Scala is an extremely complex language, but I just take the features I feel are useful and/or relevant to what I'm trying…

Your love for Scala should not prevent you from exploring Elixir. You might discover you like it. And it is not either or...

Re: Elixir 1.2.0 Released

#40

Just want to chime in reiterating everyone's thoughts already here that this language is fun, interesting, and worth your time investment to investigate. The biggest hurdles I had coming from OO Ruby were 1) how to handle state, since you no longer can just hang information off any arbitrary object attributes, 2) pattern matching (but now that I grok it, I love it, it's so useful and leads to more concise code), 3) l…

> the fantastic :observer.start() utility for visually observing tons of details about a running pid hierarchy, etc.

observer is a rather nice tool. It is, -however- not an Elixir feature, but is something that ships with Erlang. [0] As you mentioned, you can call any Erlang code in Elixir (and vice-versa!). IIRC, you do the former by prefacing the Erlang code with a ":". So, ":observer.start()" would be written in Erlang as "observer:start()" and do exactly the same thing. :)

[0] Not that you claimed that observer was an Elixir invention, mind. The whole point of this comment is to point out how easy Erlang Elixir interop is. :)

Post reply on HN