|
|
|
|
|
by llogiq
1085 days ago
|
|
Well, if the programmer writes the type annotation to actually have their code checked, how would a gradually typed language differ in practice from a static language? Yes, you can still do dynamic typing. But I'd argue that using `dyn Any` you can do so in Rust, which is a statically typed language if I ever saw one. Otherwise I completely agree about the languages growing closer together. |
|
Dyn Any is precisely no use here. If it's a simple on/off thing, you can maybe hack up some macro in rust, but that's a completely different (and not very well designed) language, will require you to manually modify all the source you want to instrument, and also if you want do dynamically alter at runtime what gets instrumented based you're out of luck.
Basically, there can be a lot of value in sporadically leveraging the dynamic nature of python or similar languages, even if you use it as a poor man's statically typed language > 99% of the time.