[HN Gopher] Dynamic type systems aren't even simpler
___________________________________________________________________
Dynamic type systems aren't even simpler
Author : ithrow
Score : 6 points
Date : 2021-01-20 18:17 UTC (4 hours ago)
(HTM) web link (hisham.hm)
(TXT) w3m dump (hisham.hm)
| Barrin92 wrote:
| Strange piece. Nobody claimed that dynamic type systems are
| simpler, they're just... well, dynamic. Type system complexity
| and dynamism are orthogonal. What the dynamic and static
| distinction is about is when the program decides to look at what
| your types actually are. At runtime or compile time, nothing
| more.
|
| This has some implications for simplicity but not in the sense
| that the article tries to argue about. The real benefit from
| dynamic languages is not that you don't have types, it's that
| your program becomes more flexible at runtime. This is riskier by
| definition, but it also has the advantage of not eliminating
| countless of valid programs that a static language eliminates, or
| only makes possible through fairly complicated constructs.
|
| > _" [...]One day you open that module which you haven't touched
| in six months, and you see a function call where the third
| argument is null. You need to remember what kinds of variables
| you can pass to that third argument[...]"_
|
| You don't need to remember that at all. The issue here is that
| the author applies the static mindset to the dynamic paradigm.
| The correct behaviour here is to not 'expect' or take for granted
| any particular input, but for the object/function in question to
| on its own deal with whatever input it gets. In Smalltalk style
| OO you would say it's the object that is solely responsible for
| the message it receives. That's not surprising but the very
| essence of late-binding.
___________________________________________________________________
(page generated 2021-01-20 23:02 UTC)