4 ms·
Honest question: what do you consider the advantages of the JVM over native code?
by irrelative 13y ago
Honest question: what do you consider the advantages of the JVM over native code?
- hellrich 13y ago"Write once, run anywhere"
- qu4z-2 13y agoI've heard this far more commonly from Java programmers as "Write once, debug everywhere", but maybe that's changed. (this was quite some time ago)
- threeseed 13y agoDefinitely deployment flexibility. Write on OSX, Test on Linux, Run on Solaris. But also performance. JVM can be faster than say C/C++ code in many cases.
- danieldk 13y ago- "Write once, run everywhere." as the sibling poster mentions. I can build on my Mac, deploy on whatever the server platform is. Snapshot and release builds of our build server are distributed via a Nexus-managed repository. So, everyone codes against exactly the same dependencies, regardless of the platform. - Hotswapping/JRebel. - Good interoperability with other languages. E.g. the Typesafe folks implemented Akka in Scala. Java gets it for (well, almost) free. - Easy monitoring and instrumentation. Obviously, there are downsides as well, such as startup times (twofold: starting the VM and Hotspot detection/compilation), preset heap size, expensive JNI (native interface), etc.
- dualogy 13y ago> Write once, run everywhere Well, so Go is "write once, build 3-9x, run anywhere".. close enough ;)
- cthackers 13y agoi think i would rather build a binary for each platform and run as fast as possible than to build once and run slow on all platforms.
- mercurial 13y agoJava is a damn memory hog, but for server-side kind of stuff, not really slow.
- danieldk 13y agoExcept that Java code typically runs as fast or faster in the JVM than compiled Go code[1]. Of course, Go is still new and gc and gcc-go will be optimized further. But Java bytecode execution is definitely not slow and usually within 2x the execution time of a C implementation, which is faster than the vast majority of other language implementations. [1] At least in the language benchmarks game. Yes, I know that microbenchmarks are not representative, etc. etc. etc. (Until your favorite language is faster ;).)
- coldtea 13y agoOnly it's the reverse. Java runs faster than Go.
- voidlogic 13y agoFor now, if this continues to narrow it will not be true much longer: http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?test=all&lang=go&lang2=java&data=u64q http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
- brown9-2 13y agoThis is a false dichotomy.
- lmm 13y agoWell-defined semantics, including for "errors" like integer overflow or null dereference. A community that's converged on a deterministic, crossplatform way of representing library dependencies (maven). An ABI that includes a notion of objects, which makes cross-language interoperability with objects easier (though counterbalanced by not having a cross-language notion of functions).