by nrjdhsbsid · 9y ago · 0 comments
I personally really like Java and I've used a ton of languages over the years. Not a perfect design but it's hard to think of any big downsides. The syntax is annoying at times but once you learn to use the IDE to poop out boilerplate it's not an issue
Java is a compiled language.
in my mind: interpreted = why would you ever use a language like this? VM = fast, safe, but going to use a lot of memory machine code = fastest, low level HW access, usually unsafe
This distinction doesn't make much sense in 2017: most languages are blends of all these things with technologies like VM's, JIT, Ahead-of-time compilation, etc...
Then there's interpreted code which has worked the same way for forever
A really important aspect of using an intermediate language like Java, .NET but also LLVM does is that it reduces the amount of required code. If you have M languages each targeting N different platforms, then you need M * N traditional compilers. If you first compile to a common intermediate language and then from there to the targeted platform, then you only need M + N compilers.
Do you have examples (incl. measurements) for optimizations actually performed by a Java JIT compiler, which an ahead-of-time compiler can't perform due to a lack of runtime info? It is my understanding that those analyses and transformations which eke out the last few percentage points are so expensive that they're infeasible to do at runtime.
Forcing all objects to be heap allocated which makes things like Optional introduce even more memory indirection because thrashing your cache is totally fine
No primitives in generics which therefore means no primitives in containers
Which then leads to the fun of autoboxing so that way your bools can be true, false, or null!
This whole setup helped me develop surprisingly large number of useful tools and apps which proved successful enough that snippets of my code and pattern are copied in proper 'enterprise class' projects at our company.