Live data from Hacker News

Learning Elixir: My side-project

adrian-philipp.com

11–20 of 38 posts

Re: Learning Elixir: My side-project

#11
I've been learning elixir for past 10 months and will be releasing a project to the public hopefully by the end of the month. Is anyone interested in any specific topics? I plan to write an accompanying blog post when I release.

Stack: Elixir, RethinkDB, Inferno (react alternative) + Redux (The goal when I started was to learn new things, hence the unusual stack)

Re: Learning Elixir: My side-project

#12
This looks awesome! It's also a kind of perfect companion piece to an Elixir/Phoenix project a friend of mine, Travis, did over at Stride[1].

I also have my own social-good oriented learning-phoenix/ecto project[2], OpenPantry, which I started some months ago after I'd learned Elixir pretty well and done a little Phoenix micro-service, but still hadn't done anything full stack or involving Ecto or Channels... We're actively looking for help building out the feature set and it's for a great cause if anyone's interested, helping those with food-insecurity to get food more easily and with more choice than many pantry programs are currently able to provide!

[1]https://github.com/stride-nyc/remote_retro [2]https://github.com/MasbiaSoupKitchenNetwork/open_pantry

Re: Learning Elixir: My side-project

#13
post #11

I've been learning elixir for past 10 months and will be releasing a project to the public hopefully by the end of the month. Is anyone interested in any specific topics? I plan to write an accompanying blog post when I release. Stack: Elixir, RethinkDB, Inferno (react alternative) + Redux (The goal when I started was to learn new things, hence the unusual stack)

First time I've ever seen that stack. +1

Re: Learning Elixir: My side-project

#14

Picking up new languages is fun. I have to say things like this tickle my funny bone though: > def backlog(board_id) when is_integer(board_id) do What happened to good old fashioned function foo (int bar) :) Is there an equivalent to typescript for elixir?

An Elixir macro guru would have to verify, but you could do some funny stuff with a macro that takes a keyword list to get syntax like:

    function foo: [int: bar] do
      bar * bar
    end
But, no the Erlang type system is not what you'd normally expect. I really like this paper on success types that kind of goes over the type system: http://user.it.uu.se/~kostis/Papers/succ_types.pdf

Re: Learning Elixir: My side-project

#16

Picking up new languages is fun. I have to say things like this tickle my funny bone though: > def backlog(board_id) when is_integer(board_id) do What happened to good old fashioned function foo (int bar) :) Is there an equivalent to typescript for elixir?

I've been reading about Erlang recently, and guards (the when clause) seem much more expressive than something like type annotations for function parameters. For example, TypeScript's annotations can't express something like this (which also shows Erlang's pattern matching): right_age(X) when X >= 16, X = true; right_age(_) -> false. http://learnyousomeerlang.com/syntax-in-functions#guards-gua...

Unless you're telling me Elixir has static analysis that can tell me that `right_age(18) == true` then I'm not sure how that competes with types much less is so different from any other runtime conditional.

Re: Learning Elixir: My side-project

#17

Picking up new languages is fun. I have to say things like this tickle my funny bone though: > def backlog(board_id) when is_integer(board_id) do What happened to good old fashioned function foo (int bar) :) Is there an equivalent to typescript for elixir?

> What happened to good old fashioned function foo (int bar) :)

It doesn't let you do things like:

"for (int bar) and 0 <= bar <= 3" while the "when" guard construct can do that. Moreover it lets you have multiple function heads as well. So you can defined multiple for (int bar) with different conditions. Or even a "foo" with a string bar.

Re: Learning Elixir: My side-project

#18

Earlier quoted context omitted.

I've been reading about Erlang recently, and guards (the when clause) seem much more expressive than something like type annotations for function parameters. For example, TypeScript's annotations can't express something like this (which also shows Erlang's pattern matching): right_age(X) when X >= 16, X = true; right_age(_) -> false. http://learnyousomeerlang.com/syntax-in-functions#guards-gua...

Unless you're telling me Elixir has static analysis that can tell me that `right_age(18) == true` then I'm not sure how that competes with types much less is so different from any other runtime conditional.

> Unless you're telling me Elixir has static analysis

Sure does: http://erlang.org/doc/apps/dialyzer/dialyzer_chapter.html

> I'm not sure how that competes with types much less is so different from any other runtime conditional.

You can write:

  f(5) ->
     "got a 5";
  f(X) when is_integer(X), X > 1000 ->
     "got an integer greater than 1000";
  f(X) ->
      "not 5 and not an integer greater than 1000".
Sure you can do it with an if statement in some languages. Except in Erlang can also have the same guards on process message receive expressions. There would have to process all messages then check the type and somehow re-insert it back into the message queue.

Re: Learning Elixir: My side-project

#19
post #5

I had a brief stint of working with Elixir a while ago, and got side-tracked and spent that time going down the GraphQL/Relay rabbit hole instead. During that time I was ramping up to help out on the GraphQL Elixir project [1]. I don't know its current state, but it might be worth looking into vs Absinthe (which I'm pretty sure was branched off that project originally). EDIT: Looks like the repo is pretty abandoned a…

Absinthe is completely separate from that project. I think the whole community effort is around Absinthe at the moment and it's shaping into a great library. There's also a PragProg book coming out in Autumn "Craft GraphQL APIs in Elixir with Absinthe" [1]. [1]: https://pragprog.com/book/wwgraphql/craft-graphql-apis-in-el...

It's not completely separate. The maintainer of Absinthe got started working with the maintainer of GraphQL-Elixir. I'm not purporting they still work together, just that they have common roots.

Though that's cool a book is coming out! I remember when these projects were just getting started.

Post reply on HN