3 ms·
Mine too. It does gradual typing better than any other language I've tried.
by caditinpiscinam 6y ago
Mine too. It does gradual typing better than any other language I've tried.
- SV_BubbleTime 6y agoI think this means sometimes static sometimes dynamic. but can you explain some use cases for this? I am strongly in favor of static, coming from C.
- scns 6y agoIf you want to convert your data to JSON you put it into a Map<String, Dynamic>.
- mhoad 6y agoEverything is static by default unless you explicitly opt to declare a variable as dynamic for specific use cases. Also worth noting that Dart now also includes fully sound null safety https://dart.dev/null-safety https://dart.dev/null-safety
- caditinpiscinam 6y agoA perfect static type checker would distinguish between valid and invalid programs in all cases. In practice, static type checkers are conservative and occasionally reject valid programs. Gradual typing gives you a way out in these situations -- just like how macros in C can provide type-generic functionality. A sufficiently rich type system (with tuples, union types, traits, generics, higher-kinded types, etc) can lessen the need for a dynamic escape hatch. In the end though, the occasional use of dynamic typing can be easier to reason about.