11-19-2016, 09:47 AM
>I'd like to help debugging this but there's a language barrier (erlang) and absolute ignorance of debugging tools
>for same. I've installed erlang, and am starting a tutorial but I'd appreciate any useful pointers and suggestions!
Erlang is a functional language as: Lisp, Haskell, Closure so it's a bit different than the traditional programming languages, if you have programmed a functional language it will be easy to learn since it is very small, if not it will be different :-)
The best part of Erlang is it's concurrent features, which we don't use much in wings right now, Erlang behaves more like an OS with a lot of processes talking to each other.
The best written docs are here:
http://learnyousomeerlang.com/content
We have a debugger, started with debugger
tart() from the erlang shell, which don't work with installed wings code since it's stripped of debug info, so you need to compile wings yourself.
Though the debugger is not used as much there are often simpler alternatives to use.
I have written another tool, observer that gives an overview of the running system
> observer
tart().
First print debugging is the one I/we use the most, it's simple because in erlang you can reload code without
re-starting your program.
The basic debug loop is:
start wings
load model
do your command and see what going wrong.
Add io:format("DEBUG ~p", [Info]), in your code
re-compile file/module
load module to running wings: in shell: l(wings_object).
redo command
add io:format() ... repeat
There are scripts that load new compile code automatically when code is changed, which I use: Google says: https://github.com/oinksoft/reloader
There are other ways, we have really good tracing facilities in erlang where you can trace everything, function calls or process created or message sent/received.
You can do tracing from the gui (the observer application) or from the shell see dbg module.
But that is more complex so you have to google those instructions.
>for same. I've installed erlang, and am starting a tutorial but I'd appreciate any useful pointers and suggestions!
Erlang is a functional language as: Lisp, Haskell, Closure so it's a bit different than the traditional programming languages, if you have programmed a functional language it will be easy to learn since it is very small, if not it will be different :-)
The best part of Erlang is it's concurrent features, which we don't use much in wings right now, Erlang behaves more like an OS with a lot of processes talking to each other.
The best written docs are here:
http://learnyousomeerlang.com/content
We have a debugger, started with debugger

Though the debugger is not used as much there are often simpler alternatives to use.
I have written another tool, observer that gives an overview of the running system
> observer

First print debugging is the one I/we use the most, it's simple because in erlang you can reload code without
re-starting your program.
The basic debug loop is:
start wings
load model
do your command and see what going wrong.
Add io:format("DEBUG ~p", [Info]), in your code
re-compile file/module
load module to running wings: in shell: l(wings_object).
redo command
add io:format() ... repeat
There are scripts that load new compile code automatically when code is changed, which I use: Google says: https://github.com/oinksoft/reloader
There are other ways, we have really good tracing facilities in erlang where you can trace everything, function calls or process created or message sent/received.
You can do tracing from the gui (the observer application) or from the shell see dbg module.
But that is more complex so you have to google those instructions.