4 ms·
Static types enable better static tooling. Dynamic types enable better dynamic tooling. :) These days, most programmers are very familiar with high quality sta
by munificent 8y ago
Static types enable better static tooling. Dynamic types enable better dynamic tooling. :)
These days, most programmers are very familiar with high quality static tooling (IDEs) but less familiar with high quality dynamic tooling.
- ridiculous_fish 8y agoRight on. Here's an amazing example. Pharo Smalltalk has a feature where you can find methods by giving an example of the input and output you expect. Forget how to uppercase a string? Just write: 'eureka' . 'EUREKA' and the IDE will suggest the method asUppercase. It does this by dynamically invoking all of string's methods until it finds one whose output matches!
- naasking 8y agoNeat, but not generalizable because methods often have side effects. You could easily know when this search is safe in a language that types side-effects, like Haskell. So types can enhance this feature too.
- deleted 8y ago[deleted]
- marcosdumay 8y agoThis actually exploits a static component of the type. This would not work on a fully dynamic type system.
- ridiculous_fish 8y agoI don't get it, why not?
- marcosdumay 8y agoOn a fully dynamic type system, static analysis can't know what functions accept strings. It would have to try every single function, what is not viable, because many have side effects.
- zaphirplane 8y agoDoes the language have rm -fr method ? ;) Still. nice
- naasking 8y agoMaybe! But you have to admit that having static types with an AST available provides considerably more program synthesis and intellisense possibilities than only having an AST.
- ridiculous_fish 8y agoThe dynamically typed case is not "only an AST," it's a living and breathing program. It made this HTTP request and performed some computation and read that file, and you can talk to it and learn all about its state!
- naasking 8y agoDon't confuse dynamic typing with metaprogramming or fexpr. These are all orthogonal. Tooling for dynamically typed languages as a whole only have access to the AST, although some with the above features may have access to more.
- xigency 8y agoExactly. I think the dynamic tooling are things like macros. It seems that JavaScript is being used as the dynamically typed foil, where a better example would be Scheme.