News for hackers. Stuff that matters.
Re:Java for Everything (2014) by cle on Sunday April 25, 2021 @02:00PM (#26934890)
You wouldn't write a web frontend in Java (not anymore), you wouldn't write your Tensorflow code in Java, nor your kernel module or device driver.

You still use the right tool for the job. Java is not always that. Also "right" should factor in your existing expertise, team culture, organizational roadmaps, etc.

Re:Java for Everything (2014) by twic on Monday April 26, 2021 @07:08AM (#26941288)
Perhaps implicit in the advice to use a single language is the assumption that the set of things you will have to write with it is bounded.

If you are a web development shop, you will not be writing Tensorflow or device drivers. You don't need to worry about picking a language which can do those.

You are quite write that you shouldn't write a web frontend in Java, though. For web development, in practice, anyone picking a language which is not JS/TS will have to use two languages. That's still better than more than two!

Re:Java for Everything (2014) by ivan_gammel on Sunday April 25, 2021 @02:12PM (#26935030)
> You wouldn't write a web frontend in Java (not anymore)

I’m pretty sure it’s temporary. There are plenty of projects working in that direction, e.g. https://github.com/i-net-software/JWebAssembly

> you wouldn't write your Tensorflow code in Java

Why?

Kernel modules and device drivers are probably the only example where you need to pick another tool.

Re:Java for Everything (2014) by cle on Sunday April 25, 2021 @02:24PM (#26935172)
You can write TF in Java. Most don't, for a good reason. Python is the first class citizen, everyone uses it, you can find help most easily for it, its data science ecosystem dwarves Java's, you'll have a hard time convincing scientists to port their Python notebooks into Java, etc.

As for web frontends, we've also already had GWT. In most cases you're better off going with the grain and using JS/TS, for obvious reasons.

I can continue for a while with examples where Java is inappropriate. Another one would be system daemons that need to use minimal memory. There is Graal but it has so many caveats that I can't really take it seriously yet (and I've tried, multiple times). In this same vein, serverless applications are generally more painless with languages whose ecosystems emphasize fast startup, which Java historically has been terrible at. And on top of that you'll pay for the memory the JVM hogs.

Re:Java for Everything (2014) by rakoo on Sunday April 25, 2021 @03:10PM (#26935618)
> You wouldn't write a web frontend in Java (not anymore)

I really want to try out htmx (https://htmx.org/docs/#introduction) for my next project because I feel it's the only logical next step to HTML, so yes, I could definitely write it in Java

Re:Java for Everything (2014) by lmm on Monday April 26, 2021 @03:53AM (#26940315)
> You wouldn't write a web frontend in Java (not anymore), you wouldn't write your Tensorflow code in Java, nor your kernel module or device driver.

I absolutely would (well, I'd use Scala myself, but I'd absolutely use a single language for all of those). I think the article makes a good case for it.

Re:Java for Everything (2014) by MaxBarraclough on Sunday April 25, 2021 @02:09PM (#26934993)
> You wouldn't write a web frontend in Java (not anymore)

Bit of a nitpick, but: GWT enables this, transpiling to JavaScript. Rumours of its death have been somewhat exaggerated (it's maintained but it's not getting that much attention). I'm not sure if Vaadin still makes use of GWT.

Re:Java for Everything (2014) by mtmmtm on Monday April 26, 2021 @11:40AM (#26943732)
There is now J2CL which translates java into javascript (superfast). gmail and google sheets is written in GWT.
Re:Java for Everything (2014) by mrkeen on Sunday April 25, 2021 @02:43PM (#26935351)
I bought into GWT back in 2010 maybe. I was sold on the idea of just using one language, and I was wrong.

I really regret not diving into proper html+css+js sooner.

Re:Java for Everything (2014) by cle on Sunday April 25, 2021 @02:19PM (#26935115)
Yeah that's what I was referring to by "not anymore".
Re:Java for Everything (2014) by MaxBarraclough on Sunday April 25, 2021 @03:23PM (#26935720)
Got it, I thought you were referring to the demise of Java applets.
Re:Java for Everything (2014) by kaba0 on Monday April 26, 2021 @03:50PM (#26947159)
Than I would rather use TeaVM with some wrappers.