I ask because I suspect there are some solid answers.

To all the JVM users out there, other than momentum/ecosystem, what is the primary elevator pitch for doing JVM-based webdev in 2022? What does the JVM give us compared to Node, PHP, or Python?

@worldsendless It's much faster than any of these options, though how much depends on what you're doing, with PHP and JS often coming close.

It has so much more good code written for it than anything else. Python comes close, but it's the slowest and has the least support for multi-threaded computing (due to the GIL).

For webdev specifically, the JVM doesn't have the very best web frameworks. The currently popular ones are Spring MVC and Play. These are both serviceable frameworks.

@worldsendless Where the JVM really shines in webdev is when you have a lot of JVM-related backend code already (or if you want to use JVM-related technologies).

Then you can just natively use your JVM code and the webdev code is just a thin layer on top of your JVM ecosystem.

Note that you'll still realistically need JS along with the JVM, but it can be relatively simple front-end code (and/or leveraging JS frameworks), with the JVM language(s) doing the heavy lifting.

@urusan Excellent point, sharing with the other non-webdev business logic things. Come to think of it, I have used some of that (ie Mallet for text processing).

About the speed vs Python, though -- isn't that mostly a myth? Very rarely is python itself doing anything heavy. It just wraps the C code, right?

@worldsendless It depends on what you're doing.

The main issues with wrapping C (in general) are:
1. You have to write whatever it is in C, not your high level language.
2. It doesn't compose well, and methods to force this increase the overhead.

So in areas like scientific computing, where you can profitably convert a wide range of problems to vector or matrix math, you mostly are running C. In areas where this isn't possible, you're mostly running Python.

@worldsendless While I'm no expert at how Python webdev frameworks work, both Flask and Django seem to be nearly pure Python:
github.com/django/django
github.com/pallets/flask

So it's probably going to be pretty much all Python or JS code running.

There might also be web servers like nginx involved, so those parts would be highly optimized.

What about Web2Py? I am not a coder, but I wish I was - I find it fascinating.
Follow

@FourOh-LLC I don't know that one, but it's probably pretty cool if it is like some of the tools I use in Clojure

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.