3 ms·
When you start transforming the AST, that might be a sign you should switch languages. Kotlin is nice, why not use it.
by MrBuddyCasino 3y ago
When you start transforming the AST, that might be a sign you should switch languages. Kotlin is nice, why not use it.
- rogerkeays 3y agoKotlin is great, but it is a fairly heavy dependency if all you want is extension methods. Java has mostly caught up in many other aspects, so I'm experimenting with Java + one or two compiler hacks. Checked exceptions are my next target...
- javanonymous 3y agoI'm curious about how you plan to work on checked exceptions. If it's just about ignoring forced exception management, Lombok provides the @SneakyThrows annotation. I would need something more before I add a new type of extension. Maybe if you could solve the null-check issue. i.e. rewriting var x = a.getFoo()?.getBar() to var x = a.getFoo() != null ? a.getFoo().getBar() : null In that case I may consider it for my personal projects, and then potentially recommend it at work once it becomes more widespread and has IDE support.
- rogerkeays 3y agoI don't know yet. I'm already using some of my own variations of sneakyThrows, but what I really want is just to disable the whole damn thing in the compiler (checked exceptions are a compiler feature, not a JVM feature). I won't be changing the Java syntax though, sorry!
- zeedude 3y agoI believe Manifold already does this. https://github.com/manifold-systems/manifold/tree/master/manifold-deps-parent/manifold-exceptions https://github.com/manifold-systems/manifold/tree/master/man...
- rogerkeays 3y agosweet
- kaba0 3y agoI think Kotlin differs far too much from Java — I don’t want all those plus features that will inevitably branch too far from the JVM/Java corresponding code, becoming its new thing. I might want a nearly-Java language that only adds trivial syntax sugar, but are otherwise the same. Groovy sort of had a good initial idea here (being a superset of Java, though again, it has grown apart a bit since). For me Kotlin lives in this weird limbo between these two extremes. If I want a different language on the JVM I would rather do Scala or Clojure.
- vips7L 3y agoFor me, if Kotlin is on the table I might as just use C# where the entire ecosystem is built around these concepts.
- kaba0 3y agoI wouldn’t really leave behind the JVM ecosystem, which is much bigger and better quality than the .NET one from what I gathered (though it is still good and bigger than most other languages’). And other people’s code is the numero uno productivity boost, so it’s an important area.
- vips7L 3y agoI think I would be fine with a smaller ecosystem. I've seen a lot of projects that have made bad choices in libraries because there are too many. Sometimes I feel like if there was just one blessed jdk way it would be a lot simpler. Honestly, the only thing that is keeping me from .NET right now is async/await. Pron really did Java a service by pushing for virtual threads.