5 ms·
For me, as an outsider, the JVM looks a bit like .NET: this huge, extremely complex codebase which does everything and anything, very optimized and comes with g
by mablap 10y ago
For me, as an outsider, the JVM looks a bit like .NET: this huge, extremely complex codebase which does everything and anything, very optimized and comes with great tools.
But to me that is a problem. Even though the JVM could do X or Y better than another platform, just the time spent learning about it feels like a waste of time, as I could already be productive in another language which is less optimized and less complex, but much faster to develop with. It seems just learning to use a Java IDE is a job in itself.
I do mathematical modeling, by the way. If I need speed, I use optimised libraries. So I might not be the target user of Java, although I've often heard good things about it for scientific computing.
- formula1 10y agoJava really isnt that bad. I think the biggest issue surrounding it is a package manager, better ui/templating language and a more obvious/documented import and linking api. Outside of that it isnt too bad Edit : also events were annoying in 7. I dont have a particular interest in creating a class just to act as a listener. I believe 8 introduced lambdas which is nice
- aeroevan 10y agoJava 8 with lambdas and streams is actually fairly nice to program. It's still Java, but it is much better than it was before Java 8. Maven is complicated, but Java 9 with project jigsaw might help things out on the packaging side. I don't do ui or any templating in java (analytics and simulations) so don't really know what's going on in those areas.
- agibsonccc 10y agoI'd consider maybe looking at gradle then. The awesome thing about maven is it is os agnostic and is at least stable. Most of the jvm libs are stored in maven central.
- _asummers 10y agoGradle is fantastic to work with. Groovy is nice when you need it, but the DSL is just much better to work with than Maven.
- vorg 10y agoGradle 3, due out soon, will use Kotlin instead of Apache Groovy as its prefered language for writing build scripts and plugins.
- cel1ne 10y ago...which will make it completely typesafe.
- deleted 10y ago[deleted]
- _asummers 10y agoOoooh how exciting! I like that a lot. I can find this out myself, but what do they plan on doing with existing Groovy plugins for gradle pipelines?
- durub 10y agoIt just got released! https://github.com/gradle/gradle/releases https://github.com/gradle/gradle/releases
- Pxtl 10y agoIs Java planning on custom primitives analogous to c# structs, or is copy-by-value semantics still the exclusive province of the core language primitives?
- kasey_junk 10y agoProject Valhalla is supposedly bringing value types to the JVM.
- bitmapbrother 10y agoYes. Value Types, Reified Generics and Generic Specialization (e.g. List<int>) will all be in Java 10.
- mablap 10y agoI'm not saying Java is bad or not. All I'm saying is that, from my perspective, why should I bother? It just seems very big and unwieldy and if I'm not going to do these JVM optimizations anyway, why bother? It's really just an impression.
- formula1 10y agoForces you to 100% commit to oop paradime. Often much easier to test and more clean than counterparts. Its used in enterprises for a reason.
- coldtea 10y ago>Even though the JVM could do X or Y better than another platform, just the time spent learning about it feels like a waste of time, as I could already be productive in another language which is less optimized and less complex, but much faster to develop with. It seems just learning to use a Java IDE is a job in itself. Any other comparable language (basically with static types) would want to use would require an IDE too. Of course you can write C or C++ or Rust, etc without one, but you'll be as unproductive as writing Java without one (nothing inherently IDE-demanding that Java has compared to these). Or at least configuring Emacs for the task, which can be a full job in itself too. Now, if you talk about something like Python or JS etc, maybe. But the JVM != Java, and those languages run there too. Plus, there's nothing really to "configure" to run the JVM, any more than you need to configure Python. There are GC and other options, but you can ignore that for the same (or even more) time than you could in Python.
- agibsonccc 10y agoJava is great for a lot of things. That's why you see large distributed systems projects that power large companies being written in java. See presto at facebook or kafka at linkedin for example. It's not as good at for loops though. If you need it for hpc you should still be using c++ underneath somewhere for simd instructions and other neat tricks only available in lower level languages. I look at java as a better python or: "frontend to c++ code"
- _asummers 10y agoEven with HPC (the Azul Systems folks would object to your claim), you just have to code in a foreign style of not allocating memory. Once you get that style in your tight loops, Java can run very very fast.
- agibsonccc 10y agoI've debated with cliff click about this before actually. There was a consensus that the JVM can support certain kinds of operations for that stuff (eg: basic SIMD) with that coding style. It can't do everything though. It's a lot better to go JNI for 99% of this stuff though. I'd also love to know when java has first class support for gpus (you know where hpc actually runs?). I'll continue relying on c++ for that stuff. It's also what nvidia supports first class. If you have any first hand experience with this stuff I'd also love to hear your thoughts on this as well. Better yet: Here's a mailing list where these people (including me) sit. Go ahead and peruse it. I've learned a lot being on here. I'm STILL of the opinion the JVM can't do most of these things well after having run the numbers: https://groups.google.com/forum/#!forum/mechanical-sympathy https://groups.google.com/forum/#!forum/mechanical-sympathy For cpu I'll be sticking with openmp for the long term. Don't even get me started with cpu specific optimizations (eg: different intel generations)
- agibsonccc 10y agoWe do scientific computing on the jvm (mainly deep learning). We wrote: https://nd4j.org https://nd4j.org which immitates numpy and co on the jvm with builtin gpu support and linking against blas like other frameworks. We also hand implemented a lot of ufuncs for you in c++. It's mainly oriented towards dense atm though. Sparse will come at some point but it hasn't been a big feature for us. It uses: https://github.com/bytedeco/javacpp https://github.com/bytedeco/javacpp underneath. Happy to answer questions!
- mablap 10y agoYeah, I've actually heard about ND4J and was interested in learning about it. But as I said in my parent post, Java seems (from the outside) as this huge unwieldy language that is hard to get into. What could I do with Java/ND4J in scientific computing that I couldn't do with other packages, or that is much easier/better done on the JVM?
- agibsonccc 10y agoYeah and it might be. We're targeting the big data folks with this framework frankly. Anything that does static typing might be overkill for just running matrix math. I created nd4j with the intent of having the same primitives and programming model accessible to me for production environments and also affording me the same privileges of optimizing things in c with nice clean abstractions. scala MIGHT be easier which is why we created nd4s: https://github.com/deeplearning4j/nd4s https://github.com/deeplearning4j/nd4s The JVM and the developers who use it are mainly people with salaries soliving a very specific class of problems not people publishing papers. The one exception to this I've seen is the NLP community. I'd argue it's just a different audience who needs the things the jvm has, eg: static typing, integrations with libraries, etc. For large codebases you really can't beat jvm tooling..if you just need a click repl and throwaway code? It might be a bit much if you don't already know it.
- digler999 10y ago> which does everything and anything, same here. Until I wrote my first android app, used JPG images in a loop, figured "well, they run out of scope, and everthing is a reference, and java has 'garbage collection', so everything should be fine, right?". Wrong. Ran out of memory. The one time I thought I could rely on the JVM and all the delicious java-ness, it lets me down. I'll stick to C++ where WYSIWYG.
- namelezz 10y ago> Wrong. Ran out of memory Android VM(DVM) is different from the JVM we are usually talking about. When developing Android apps, you need to understand the life cycle of components to prevent memory leaking. Your issue may come from your poor understanding of Android platform.
- digler999 10y ago> Your issue may come from your poor understanding of Android platform. possibly. But what is my responsibility as a developer ? If I learn a standardized language do I now have to learn the JVM/DVM standards of how its implemented ? Whats wrong with a destructor being called when an object goes out of scope and have its resources freed ? If I have to now worry about how the VM implements that, learning the language was useless.
- pjmlp 10y agoSure you have to. It is no different than having to learn what gcc, clang, Visual C, aCC, SunPro, xlc, icc ... do to your C code outside of what ANSI C specifies how it should behave. And even for those parts that the ANSI C specifies how it should behave, those compilers do not generate the 100% same code. Also one needs to know how the underlying OS and CPU handle that generated code as well. Specially interesting regarding the understanding of the underlying OS on UNIX platforms, is to learn how much the platform deviates from the POSIX specification in regards implementation specific semantics, because POSIX just like ANSI C, leaves platforms quite some freedom of implementation. Understanding the target platform is always required.
- ams6110 10y agoYou've got that backwards. .NET was Microsoft's attempt to "embrace and extend" java. Early versions of C# were basically copy/paste compatible with Java.