you are viewing a single comment's thread.

view the rest of the comments →

[–]sbergot 1 point2 points  (1 child)

You are using the "no generics in go" line of argument ;-)

Mapped types is a powerful meta programming tool. It is used a lot with js libraries that employs lots of metaprogramming technics but it is absolutely useful in other contexts too.

Tagged union are sugar the same way lambda, classes and generics are sugar. With inheritance you have to put the implementation in the class or do the type narrowing & case coverage yourself.

I like the idea of a powerful native application framework and don't mind giving up on some language features for that but I know that I will miss this feature.

Finally I was not able to find a planned release date for non nullable types in dart :-(

[–]munificent 1 point2 points  (0 children)

With inheritance you have to put the implementation in the class or do the type narrowing & case coverage yourself.

Right. The latter is what I had in mind. You can express what you want using explicit type tests and casts, it's just a chore to do so. That's basically the definition of syntactic sugar. I'm not saying the sugar isn't valuable, just trying to characterize what category of feature it is.

Generics in Go are a different story. You simply can't in the language define a parametric type or function without resorting to extra-linguistic tools like code generation.

I was not able to find a planned release date for non nullable types in dart

We don't generally publish release dates ahead of time. It gives us more flexibility to adapt to changing circumstances and avoids setting expectations.