by rohshall on 12/6/13, 10:25 PM with 51 comments
by rdtsc on 12/6/13, 11:17 PM
Not only does it have a clean, pleasant syntax, macros, but it has all the good parts from Erlang, namely:
* BEAM VM (isolated heaps, very well tuned scheduler, concurrent garbage collection)
* Pattern matching, once you've tried it, it is hard to go back.
* Ability to call Erlang code
BEAM VM is really a secret gem and many didn't get a chance to play with it because they didn't like Erlang's syntax (personally, I do like Erlang's syntax, but I think many don't). Well there is little excuse now.
If you like DSLs and macros (yes, yes, I know it makes many people scared) this you can do neat stuff like these projects:
https://github.com/elixir-lang/ecto -- DSL to query databases
by john2x on 12/7/13, 1:41 AM
I'm still going to be reading up on Erlang/Elixir for fun and to expand on how I approach problems, but right now I only associate Erlang with large distributed systems and I want to add other stuff to that association.
by jweir on 12/6/13, 11:46 PM
by troutwine on 12/6/13, 11:21 PM
- - -
EDIT
It occurs to me that the HN crowd might like Lisp Flavored Erlang: http://lfe.github.io/ It's a lisp-2 written by Robert Virding, co-creator of Erlang, and is backed by a great group of folks.
by Erwin on 12/7/13, 12:34 AM
Source code:
def test_function():
assert f() == 4
Output: def test_function():
> assert f() == 4
E assert 3 == 4
E + where 3 = f()
Here's how it works: http://pytest.org/latest/assert.html#assert-details -- when importing the test module, all simple asserts are rewritten (which has some limitations if side effects are involved).No more verbose self.assertTheItemIsInThisList(item, list) at least.
by bitwalker on 12/7/13, 6:48 PM
OTP is really what makes Elixir (and Erlang for that matter) so impressive. Supervised, lightweight processes just seems so obvious as a solution to fault tolerance and concurrency - coming from C#, where doing multi-threaded programming is error-prone at best, Elixir/OTP is a dream. I do miss the type system from C# or Scala, but type specifications help to mitigate the loss.
The one other feature that has been really pleasing to work with is pattern matching. Scala is the only other language I've used with some form of it, and after using Elixir/Erlang's pattern matching, Scala's seems deficient in comparison. It's an insanely powerful construct, I wish more languages had it.
by pselbert on 12/7/13, 2:09 AM
by thyrsus on 12/7/13, 6:07 AM
if(condition, do: a, else: b)
looks like a function, but that implies Elixir does lazy evaluation so that only one of a or b gets evaluated. Or is something else going on?by adambard on 12/6/13, 11:57 PM
> For years I’ve wanted to be able to write my own control flow structures, such as an each...else that runs an else block if the each is empty (Handlebars templates have this).
Actually, python does have a (little-known) `for...else` structure that does what you want.
by thedudemabry on 12/7/13, 12:10 PM
by mml on 12/7/13, 1:40 AM
by alanning on 12/7/13, 10:09 PM
Is the purpose of implementing upcase this way to make it more easily parallelizeable in the map/reduce sense?
by eonil on 12/6/13, 11:36 PM
Is this type inferencing language?
by craigyk on 12/7/13, 6:27 AM
by twic on 12/7/13, 1:24 PM
by coolsunglasses on 12/6/13, 11:52 PM
Has a cool Leiningen (clojure) inspired build/dependency tool.
by ternaryoperator on 12/6/13, 11:36 PM
by andyl on 12/7/13, 12:06 AM
Elixir was just what I needed. Makes the power of Erlang accessible. I like Elixir's docs, tooling, and syntax, and look forward to seeing it progress.