Do covariant return types moot the need for using double dispatch when implementing Visitor (for statically typed languages)? If so, that'd close at least one ergonomic gap between dynamic and static languages.
--
Whinging:
Virgil is practical. It uses modern techniques to address programmer's actual needs.
I love both functional and imperative programming. Separately. I do not want multiparadigm. I do not want metaprogramming in my bog standard data processing code. I do not want exquisite puzzle boxes (inspired by Haskell and ML).
For most of my code (done in anger), I want data centric, I want composition, I want static typing. To noob me, it appears Virgil is on the right path.
For just one example, Java jumped the shark. Specifically annotations, optionals, and lambdas. (I grudgingly accept the rationale behind type erasure for generics; it was a different time, when backward compatibility reigned supreme.)
We need features, often syntactic sugar, for the 98% of our daily work. String intrinsics (finally!), intrinsic regex expressions, intrinsic null-safe path expressions (not LINQ), tuples, multiple return values (destructuring), etc.
I want concision without magic.
In Java's defense, specifically, I love many of the JEPs of the last decade. Project Loom is a game changer. Switch expressions are great. Ditto values types and records. (There's more, but you get the idea.)
Also, project Zig embraces the practicality vibe. And shout out to D language.
--
Invoking methods with tuples. https://github.com/titzer/virgil/blob/master/doc/tutorial/Tu...
Just terrific. Similarly, I've wondered about the symmetry of maps (dictionaries) and named parameters, and the potential to invoke methods with maps.
--
"Functions are contravariant in their parameter type and covariant in their return type" https://github.com/titzer/virgil/blob/master/doc/tutorial/Va...
Terrific. This "hole" in language design has always frustrated me. As a noob, I've been wondering:
Do covariant return types resolve "the expression problem"? Thereby reducing the number of 'instanceof' type checks? https://en.wikipedia.org/wiki/Expression_problem
Do covariant return types moot the need for using double dispatch when implementing Visitor (for statically typed languages)? If so, that'd close at least one ergonomic gap between dynamic and static languages.
--
Whinging:
Virgil is practical. It uses modern techniques to address programmer's actual needs.
I love both functional and imperative programming. Separately. I do not want multiparadigm. I do not want metaprogramming in my bog standard data processing code. I do not want exquisite puzzle boxes (inspired by Haskell and ML).
For most of my code (done in anger), I want data centric, I want composition, I want static typing. To noob me, it appears Virgil is on the right path.
For just one example, Java jumped the shark. Specifically annotations, optionals, and lambdas. (I grudgingly accept the rationale behind type erasure for generics; it was a different time, when backward compatibility reigned supreme.)
We need features, often syntactic sugar, for the 98% of our daily work. String intrinsics (finally!), intrinsic regex expressions, intrinsic null-safe path expressions (not LINQ), tuples, multiple return values (destructuring), etc.
I want concision without magic.
In Java's defense, specifically, I love many of the JEPs of the last decade. Project Loom is a game changer. Switch expressions are great. Ditto values types and records. (There's more, but you get the idea.)
Also, project Zig embraces the practicality vibe. And shout out to D language.