Hacker Newsnew | past | comments | ask | show | jobs | submit | dc0d's commentslogin

Thank you for the reference (not finished it yet).

Worth mentioning functions that can error, should follow the {:ok, response} | {:error, reason} pattern. Because if such a function returns response | {:error, reason}, then if we are inside a with clause and we want to capture the response and use it in the next with clause, such capture value can be either response or {:error, reason} - which goes around the pattern matching.

  with response_f1 <- f1(),
       {:ok, response_f2} <- f2(response_f1) do
    # do something
  else
    {:error, reason_f1} ->
      # we will never come here
      # because the returned value from f1
      # is already matched to the variable response_f1 
  end


> There’s a cultural split between Erlang and Elixir that makes life harder than it needs to be.

On that note I have witnessed: "Finding Erlang developers was hard. And I hated Elixir. So, we ported everything to Java."

Maybe that was just one such occasion. Maybe there are more.


"There are only two kinds of languages: the ones people complain about and the ones nobody uses."

― Bjarne Stroustrup, creator of C++ programming language

The fact that Elixir is getting some hate is a good sign - it's reach is growing.


goreuse takes Go, modifies the AST by replacing those parts that are needed to be customized and generates a Go source that is specialized for concrete types. It is "go generate" compatible.


So it basically just monomorphises?


Mostly. But since it is possible to replace/redefine the functions and methods too, it's a bit more capable than that and one can "override" methods or redefine functions.


I have to do web projects from time to time and every time, I reinvented this wheel. Finally got the time to put it together. Might come in handy for somebody else too.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: