Live data from Hacker News

Elixir 1.2.0 Released

github.com

21–30 of 69 posts

Re: Elixir 1.2.0 Released

#22
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…

    $ (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.

Re: Elixir 1.2.0 Released

#23
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.

Re: Elixir 1.2.0 Released

#24
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…

$ (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.

Re: Elixir 1.2.0 Released

#25
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 the super terse anonymous function syntax. You could use the slightly more verbose version with named instead of positional params or put a named function in there instead.

Re: Elixir 1.2.0 Released

#26

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.

Last time I checked no, but it's been supported in FF for quite some time now.

Re: Elixir 1.2.0 Released

#27
This is the best New Years gift I could hope for! :) I've been using and slowly switching towards Elixir for last few months. It is fun, refreshing, enjoyable to work with and community is very welcoming and pleasure to be part of.

Re: Elixir 1.2.0 Released

#28
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.

This is a shorthand for writing anonymous functions. The &() activates the feature for the expression inside, which can then use &1, &2 etc to apply parameters.

For example `&(&1 + 1)` is equivalent to `fn x -> x + 1 end` .

Re: Elixir 1.2.0 Released

#29

This is the best New Years gift I could hope for! :) I've been using and slowly switching towards Elixir for last few months. It is fun, refreshing, enjoyable to work with and community is very welcoming and pleasure to be part of.

Having said all this, still enjoy Ruby as much as always.

Re: Elixir 1.2.0 Released

#30
post #4

Earlier quoted context omitted.

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…

The functional aspects are not really that different. I think the key one is that Erlang has tail call optimization baked in, whereas Scala achieves something close, but not exactly there, by working around the JVM's limitations. Scala's implementation works really well when you have a function calling itself, or two functions mutually calling each other, and that basically supports recursion. But the inability of ar…

I'm actually in the process of writing a scraper using Akka. It's quite complex at first glance but I'm hoping I'll be able to use the main features without digging too deep.

I appreciate the in depth comparison between the VMs. I guess I need to dive into Erlang eventually.

Post reply on HN