Live data from Hacker News

Flirting with Elixir

eng.localytics.com

21–29 of 29 posts

Re: Flirting with Elixir

#21
post #20

Earlier quoted context omitted.

Fallacy of composition. You're saying that any language with HOFs, immutability and "idiomatic way to contain state" is ergo Haskell-like, which is insane. None of these are even properties of Elixir, but of Erlang, which Elixir inherits. Erlang is self-evidently not Haskell-like. At best such a language would be merely functional. The actor model isn't even about anything analogous to monads, it's a concurrency mode…

> insane Rather than sling around heavy duty words like "insanity", you might try putting yourself in their shoes: perhaps their only exposure to a functional language is Haskell. Elixir is going to look a lot more like that, than, say, C++.

Irrelevant. Ignorance does not make inapt comparisons retroactively correct.

Re: Flirting with Elixir

#22
post #2

I've been "obsessed" with Elixir lately, and it truly is a breath of fresh air in the current programming language landscape. I've started with C, built a career with backend Python services/dashboards, and spent some time on the "fringe" learning about Lisp, Scheme, Haskell, Clojure. And once you rewire your brain with functional programming constructs or immutability, it is really hard to go back to Python, using l…

Haskell without purity and types I'm getting quite tired of this "Every functional language I can't precisely describe is like Haskell" sentiment. It's the "tastes like chicken" of programming languages. Then again, the original article is remarkably devoid of content, so I suppose it's only fitting. Interestingly, avoidance of excessive magic is a large reason why I stick to vanilla Erlang.

I stick to vanilla Erlang.

Erlang + optional type annotations + optional dialyzer verification is perfection.

Re: Flirting with Elixir

#23
post #20

Earlier quoted context omitted.

> insane Rather than sling around heavy duty words like "insanity", you might try putting yourself in their shoes: perhaps their only exposure to a functional language is Haskell. Elixir is going to look a lot more like that, than, say, C++.

Irrelevant. Ignorance does not make inapt comparisons retroactively correct.

In technical terms, you are of course correct, and it's helpful to point that out where people are wrong. But being wrong is not "insane" - that's incorrect in and of itself :-)

Re: Flirting with Elixir

#25

Earlier quoted context omitted.

Haskell without purity and types I'm getting quite tired of this "Every functional language I can't precisely describe is like Haskell" sentiment. It's the "tastes like chicken" of programming languages. Then again, the original article is remarkably devoid of content, so I suppose it's only fitting. Interestingly, avoidance of excessive magic is a large reason why I stick to vanilla Erlang.

I agree that the comparison with Haskell is ill fitting. The sentiment I wanted to express is that Elixir, like Haskell, is built around function (or module) composition, is immutable, and state is idiomatically handled separately (with separate processes and message passing, instead of monads).

Separate process are monads! They just might not call them that. ;)

Re: Flirting with Elixir

#26
post #19

Are macros useful in a web development context? I don't feel like I've been missing them in Django, but maybe I've just forgotten because it's been a long time since I wrote anything substantial in Scheme. (Are Elixir macros similar to Scheme macros?)

Macros are the most powerful tool for making DSLs, which means they pop up in a lot of "specialized" niches, like web dev. You can make DSLs in other ways, but without the ability to inspect and decompose code at the per-token level, there are limitations to what can be done. Elixir macros are like Scheme macros; they're fully hygienic (no variable namespace issues), and they evaluate at compile time. The main differ…

Thanks for this interesting answer! I read most of the getting started guide last night and I'll probably try Elixir for a toy project sometime soon :)

Re: Flirting with Elixir

#27
post #2

I've been "obsessed" with Elixir lately, and it truly is a breath of fresh air in the current programming language landscape. I've started with C, built a career with backend Python services/dashboards, and spent some time on the "fringe" learning about Lisp, Scheme, Haskell, Clojure. And once you rewire your brain with functional programming constructs or immutability, it is really hard to go back to Python, using l…

I too am obsessed with Elixir and LFE, being a Lisper. I am currently learning both to see, if I will choose one, or just learn and use both. This dialogue between Jose Valim (creator of Elixir) and Robert Virding (originally worked on the Erlang team, and creator of LFE) has some interesting contrastting points [1]. Summary: Elixir cannot define new syntax in the true Lisp sense, while LFE can. Elixir has improved the interface to the Erlang libraries, while LFE uses them "straight" from Erlang. I think Elixir has more momentum due to the resurgence of interest in the BEAM, and the Ruby-like syntax and Ruby's and ROR's already-large community. I've never chose a language for popularity, hence why I still use Lisp. I do like Elixir and LFE a lot. Choices...

[1] - https://groups.google.com/forum/#!topic/lisp-flavoured-erlan...

Re: Flirting with Elixir

#28
post #19

Are macros useful in a web development context? I don't feel like I've been missing them in Django, but maybe I've just forgotten because it's been a long time since I wrote anything substantial in Scheme. (Are Elixir macros similar to Scheme macros?)

Macros are the most powerful tool for making DSLs, which means they pop up in a lot of "specialized" niches, like web dev. You can make DSLs in other ways, but without the ability to inspect and decompose code at the per-token level, there are limitations to what can be done. Elixir macros are like Scheme macros; they're fully hygienic (no variable namespace issues), and they evaluate at compile time. The main differ…

Elixir is great, and I would loosely say it not homoiconic as Robert Virding, one of the original Erlang team and creator of LFE (Lisp Flavored Erlang), posits in an exchange with Jose Valim, creator of Elixir here[1]. In terms of qualifying a JSON-equivalent data structure as richer, compared to lists in Scheme or Lisp, I would disagree. I think you lose the code-as-data (down to the languages fundamentals) win in Scheme. Devin Torres makes the statement that Elixir is 'strongly homoiconic' [2], but his reference's definition does not fit Elixir [3]. You cannot add new constructs or operators in Elixir. I would say 'weakly homoiconic' if you are going to prefix an adverb on a page that invents terms, which I still think is like 'a little bit pregnant' - not logically consistent. I do not code for a living, so I can choose things on an interest basis, not a popularity or job market index. I am learning both Elixir and LFE, and Erlang by default, but I am gravitating towards LFE. I think LFE on the BEAM and Clojure on the JVM, makes for a good argument for me to stay in the Lisp world, and not the Ruby, ROR, or Elixir one.

[1] https://groups.google.com/forum/#!topic/lisp-flavoured-erlan...

[2] http://devintorr.es/blog/2013/06/11/elixir-its-not-about-syn...

[3] http://c2.com/cgi/wiki?HomoiconicLanguages

Re: Flirting with Elixir

#29
post #28
post #19

Earlier quoted context omitted.

Macros are the most powerful tool for making DSLs, which means they pop up in a lot of "specialized" niches, like web dev. You can make DSLs in other ways, but without the ability to inspect and decompose code at the per-token level, there are limitations to what can be done. Elixir macros are like Scheme macros; they're fully hygienic (no variable namespace issues), and they evaluate at compile time. The main differ…

Elixir is great, and I would loosely say it not homoiconic as Robert Virding, one of the original Erlang team and creator of LFE (Lisp Flavored Erlang), posits in an exchange with Jose Valim, creator of Elixir here[1]. In terms of qualifying a JSON-equivalent data structure as richer, compared to lists in Scheme or Lisp, I would disagree. I think you lose the code-as-data (down to the languages fundamentals) win in S…

Thanks for the reply! I read the "[1]" link you posted, and the word "homoiconic" doesn't appear anywhere. Elixir code and data share the same native data structures, ergo Elixir is homoiconic. Virding's point is that Elixir lacks reader macros. For real-world usage, I consider that more of a strength than a weakness. :)
Post reply on HN