loading...

re: Concurrency in Go vs Erlang VIEW POST

FULL DISCUSSION
 

Good article, thank you. I always wanted to take the time reading up, how Go handles this. Just a few notes on Erlang, here:

First, I wanted to make the point Alexander did already. Erlang’s built in functions with a need for performance are written in optimized C. Also you can easily cross compile Erlang code to C and get pretty good performance.

And another thing: you second Erlang program has a bug: in line 4 you reference Code, but Code is unbound at that point.

Furthermore, just as a side note, the Erlang code is not idiomatic (function names should be snake_cased, deep pattern matching like in line 3 should be a descriptive call (e.g.

print_status_code(Url) ->
  %% ...
  {ok,StatusCode} = get_status_code(Res),
  %% ...

get_status_code({_,StatusCode,_},_,_}) -> {ok,StatusCode}.
get_status_code(UnknownFormat) -> {error, UnknownFormat}.

), and I personally wouldn’t take a foreach (ever) but map over the list).

 

Thank you for the corrections!

code of conduct - report abuse