upvote
> But ultimately the string templates proposal should come back and fix this at the language level.

They tried, its opponents dilluted it to the point of uselessness and now will forever use this failed attempt as a wedge.

I'm sorry, I don't believe Java will get sensible String templates in our life time.

reply
Yeah, Java is pretty fast despite the fact that it still has these kinds of obviously suboptimal things going on.

I love how Zig, D and Rust do exactly what you say: parse the format string at compile time, making it super efficient at runtime (no parsing, no regex, just the optimal code to get the string you need).

I say this but I write most of my code in Java/Kotlin :D . I just wish I could write more low-level languages for super efficient code, but for what I do, Java is more than enough.

reply
I admire Rich Hickey's approach of building on top of the Java ecosystem for this reason, adding a functional first approach with emphasis on data structures, where using the right algorithms comes naturally.
reply
> Zig, D and Rust

Also C++, which works the same way.

reply
Sometimes running strace on jvm software you will see some sycall patterns that are incredibly inefficient.
reply