Hacker News new | ask | show | jobs
by netvl 842 days ago
Interesting concepts, but dependency on Bazel is meh :(

Also, there are some passionate statements about other languages:

> As it's currently defined, there's nothing requiring the two arguments to actually have the same type. In this trivial example, that may be fine, but if I were to actually want to ensure that two arguments both implement an interface and they both actually have the same type, then I'm out of luck - there's no way to statically encode this constraint in Java!

This is simply not true:

    static <T extends Stringify> void prettyPrintPair(T x, T y)
I personally really dislike when people talk about any kind of language feature with strong negativity, while providing their solution as the superior one. There is a high chance that they are wrong, since different features in the same area have different benefits, and usually no one thing is “better” than another, whatever this means.
2 comments

So, I understand why it seems like that Java signature you gave would work, but it in fact does not work. Check out this replit example to see the full example with your signature: https://replit.com/@JasonSteving1/DemoTypeSystemLimitation#s...
TBH, I see the dependency on Bazel as a plus.