4 ms·
Types are really just a way of applying certain tests to part of your code. In dynamic languages the typing is just moved to the test suite. We can see that wi
by neilwilson 3y ago
Types are really just a way of applying certain tests to part of your code.
In dynamic languages the typing is just moved to the test suite. We can see that with the way type hints are enforced in Python and Ruby - by running a program that takes those hints and essentially runs a bunch of tests.
If you look at the code of Terraform, for example, you'll see that it spends a lot of time trying to get around the limitations of Go typing.
The rise of dynamic languages in the early 2000s was a direct result of the perceived limitations of the type systems of Java, C++, etc. and the ability to use a different way of constraining code (Test driven development, behaviour driven development).
Now it is swinging back the other way with the implementation of more flexible type systems.
Before too long the limitations of those type systems will start to grate and the pendulum will swing back to dynamic languages again - based upon some new innovations there.
Get used to the back and forth in IT. The static/dynamic cycle is but one of many. (Centralisation/decentralisation is the other main one). You'll find lots of work in IT is reimplementing existing stuff in the current fashionable paradigm.
- elcritch 3y agoNo modern type systems are powerful and flexible enough that I don't believe the pendulum will swing back toward dynamic languages, at least to the same degree. Especially with dependent typing becoming more of a thing. Then again perhaps LLM programming will become the new thing. ;)