3 ms·
worked with Erlang lately in a side project, I think the actor model is really cool (and the FP style), but the error messages are not helpful at all (at least
by vasilakisfil 7y ago
worked with Erlang lately in a side project, I think the actor model is really cool (and the FP style), but the error messages are not helpful at all (at least for a beginner), I wonder how other people manage.
- rapsey 7y agoRuntime error messages or compilation error messages? I assume compilation. This is true. Compilation messages are bare bones. But on the other hand the language compared to other modern languages is tiny and figuring out why something does not compile is a non-issue beyond an absolute beginner.
- samvher 7y agoI'm using Erlang for a production system at work and I completely agree, the error messages tend to be terrible. Once you've run into many errors you start recognizing patterns though (part of the problem is that the errors are not English sentences but data dumps with indicators like `badfun`, these you just have to learn to interpret) and Erlang makes up for the bad error messages in other ways. But yes, often I end up reasoning through the code to solve the problem, with the error message only roughly pointing me in the right direction, to a larger extent than in other languages.
- joekinley 7y agoMore often than not after I did figure out what the error was, looking back at the initial error message it told me exactly what I should have looked at to begin with. So, if you can read them right, they are pretty good. I use Elixir in production and Erlang in side projects.
- fyfy18 7y agoElixir gives you much more friendly error messages at runtime (I believe part of this feature was contributed to the Erlang VM, so improved it for all languages): 10:21:21.525 mid=1 [error] GenServer {Registry.WatcherManagerRegistry, 1} terminating ** (CaseClauseError) no case clause matching: {:ok, <snip>} (core) lib/core/http.ex:64: Core.Http.request/7 (core) lib/core/monitors/built_in_monitor.ex:99: Core.Monitors.BuiltInMonitor.perform_request/1 (core) lib/core/monitors/built_in_monitor.ex:76: Core.Monitors.BuiltInMonitor.perform/1 (core) lib/core/watcher.ex:40: Core.Watcher.perform_check/1 (core) lib/core/watcher_server.ex:91: Core.WatcherServer.handle_info/2
- h91wka 7y agoWhere else do you get line numbers in stack traces by default?