3 ms·
Funny you ask that, since I have indeed refactored OTPCL (a sort of Erlang-flavored Tcl-flavored scripting/config language I've been on-and-off hacking on for t
by yellowapple 4y ago
Funny you ask that, since I have indeed refactored OTPCL (a sort of Erlang-flavored Tcl-flavored scripting/config language I've been on-and-off hacking on for the last couple years) multiple times now, namely to rewrite the parser and to rewrite how command exports work - so the commit history should reflect some of the pitfalls and boons I encountered.
I actually did pursue static typing (w/ type annotations and Dialyzer) at one point, but quickly lost interest, since it didn't really seem to add much. Having comprehensive tests, on the other hand, was crucial - especially since I could use pattern matching within those tests to make assertions about expected inputs and outputs.
I will say that there were bugs that compile-time type checking probably would've caught, but tests also readily caught them. The same can likely be said for current bugs. It's ultimately the same idea: validate that your code adheres to the expected API and behavior; only difference is that the validation happens in different places.