Python and Ruby are not known for "extremely weak typing".
Ruby: duck, dynamic, strong.
Python: dynamic, strong.
JavaScript: dynamic, duck, weak.
Elixir: dynamic, strong.
https://wiki.python.org/moin/Why%20is%20Python%20a%20dynamic...
Re:Elixir v1.7 released
by bostonvaulter2 on Thursday July 26, 2018 @11:48PM
(#17623305)
I think the idea is that pattern matching and guards give you some additional guarantees above normal "strong typing". But I do agree with you.
static typing is somewhat of a programming religious wars. I mean sure, extremely weak typing is IMO horrible (python, ruby, js, I'm looking at you) but being dynamic does mean that quickly testing out an alternative code path. Just today I realized I needed to forward some information to a somewhat polymorphic data structure, a process which I hadn't planned for, I found a map structure that is encapsulated state in a gen_server in exactly the right place, so I just shoved it into the map under a new key. That is effectively breaking what could have been a static type system. And it was two lines of elegant code, no refactoring necessary, and probably a line of documentation saying that in this corner case the structure will contain this extra info.
IMO the right approach is compromise. You could do this in a statically typed system by just making everything a map... which is effectively what the BEAM languages do, but at least there's a type analysis tool that can introspect deep into the built in "flexible" types.