On Thursday, 8 December 2022 at 18:03:11 UTC, ryuukk_ wrote:
> https://medium.com/dartlang/the-road-to-dart-3-afdd580fbefa
Some interesting takes, reminds me of Python 3.0
I figured it would be interesting to share
-
Breaking Changes
-
Null Safety
-
Pattern Matching
-
Macros
-
WASM
Interesting. Dart is one of my favorite programming languages (except for D of course), and it's my go-to language whenever doing anything related because I can't stomach Javascript and never really tried Typescript much. However the null safety features I found to be an annoyance. Same with other languages, I feel like I am fighting the language and just explicitly declaring types as nullable or forcing dereference wherever possible. Sure, you will not get a null pointer exception, but in case a null happens, parts of your code will just not execute silently. Maybe I am missing something but I was never sold on the null safety angle.
Patterns look interesting. Dart doesn't have structs, so implementing basic datatypes like pairs was a pain and overly verbose. Pattern matching on class dynamic type is interesting. One might say it's an anti-pattern, on the other hand it's a pattern similar to visitor pattern, just without the usual boilerplate.
Macros may be a big feature. Currently Dart relies on code generation, which comes with a lot of boilerplate code and still requires maintenance. With macros, if you could serialize/deserialize classes without any extra code, it would be a big improvement.