Most active commenters
  • icedchai(3)
  • fuzztester(3)

←back to thread

174 points chhum | 22 comments | | HN request time: 1.476s | source | bottom
Show context
exabrial ◴[] No.44006194[source]
Java performance isn't the fastest, that's ok, a close 3rd place behind C/CPP ain't bad. And you're still ahead of Go, and 10x or more ahead of Python and Ruby.

Java syntax isn't perfect, but it is consistent, and predictable. And hey, if you're using an Idea or Eclipse (and not notepad, atom, etc), it's just pressing control-space all day and you're fine.

Java memory management seems weird from a Unix Philosophy POV, till you understand whats happening. Again, not perfect, but a good tradeoff.

What do you get for all of these tradeoffs? Speed, memory safety. But with that you still still have dynamic invocation capabilities (making things like interception possible) and hotswap/live redefinition (things that C/CPP cannot do).

Perfect? No, but very practical for the real world use case.

replies(14): >>44006269 #>>44006358 #>>44006411 #>>44006567 #>>44006570 #>>44006865 #>>44007100 #>>44007464 #>>44007662 #>>44007666 #>>44009121 #>>44009861 #>>44011219 #>>44011642 #
brightball ◴[] No.44006411[source]
When I got out of college and was still firmly in the "Java is the solution to everything" mentality I didn't realize that my admiration was really for the JVM and the Java App Server tooling that was so much more advanced than anything else at the time. It was basically Docker + K8s for anything running on the JVM more than 2 decades earlier.

Java the language eventually drove me away because the productivity was so poor until it started improving around 2006-2007.

Now I keep an eye on it for other languages that run on the JVM: JRuby, Clojure, Scala, Groovy, Kotlin, etc.

IMO JRuby is the most interesting since you gain access to 2 very mature ecosystems by using it. When Java introduced Project Loom and made it possible to use Ruby's Fibers on the JVM via Virtual Threads it was a win for both.

Charles Nutter really doesn't get anywhere close to enough credit for his work there.

replies(2): >>44006504 #>>44006676 #
cogman10 ◴[] No.44006504[source]
Let me extol the virtues of Java the language.

You can take pretty much any code written for Java 1.0 and you can still build and run it on Java 24. There are exceptions (sun.misc.Unsafe usage, for example) but they are few and far between. Moreso than nearly any other language backwards compatibility has been key to java. Heck, there's a pretty good chance you can take a jar compiled for 1.0 and still use it to this day without recompiling it.

Both Ruby and Python, with pedigrees nearly as old as Java's, have made changes to their languages which make things look better, but ultimately break things. Heck, C++ tends to have so many undefined quirks and common compiler extensions that it's not uncommon to see code that only compiles with specific C++ compilers.

replies(8): >>44006688 #>>44006821 #>>44006953 #>>44009308 #>>44009663 #>>44009839 #>>44010152 #>>44010332 #
1. jsight ◴[] No.44006688[source]
Yeah, that and the portability are really incredible and underrated. It is funny, because I constantly hear things like "write once, debug everywhere", but I have yet to see an alternative that has a higher probability of working everywhere.

Although Python is pretty close, if you exclude Windows (and don't we all want to do that?).

replies(3): >>44006959 #>>44007129 #>>44007192 #
2. bhaak ◴[] No.44006959[source]
I often run into problems running Python code under Linux.

I don’t know if it is a me problem or if I’m missing the right incantations to set up the environment or whatever. Never had that much problems with Java.

But I’m a Java and Ruby person so it might really be missing knowledge.

replies(4): >>44007153 #>>44007475 #>>44009378 #>>44009895 #
3. cestith ◴[] No.44007129[source]
I can run basically any Perl code back to Perl 4 (March 1991) on Perl 5.40.2 which is current. I can run the same code on DOS, BeOS, Amiga, Atari ST, any of the BSDs, Linux distros, macOS, OS X, Windows, HP/UX, SunOS, Solaris, IRIX, OSF/1, Tru64, z/OS, Android, classic Mac, and more.

This takes nothing away from Java and the Java ecosystem though. The JVM allows around the same number of target systems to run not one language but dozens. There’s JRuby, Jython, Clojure, Scala, Kotlin, jgo, multiple COBOL compilers that target JVM, Armed Bear Common Lisp, Eta, Sulong, Oxygene (Object Pascal IIRC), Rakudo (the main compiler for Perl’s sister language Raku) can target JVM, JPHP, Renjin (R), multiple implementations of Scheme, Yeti, Open Source Simula, Redline (Smalltalk), Ballerina, Fantom, Haxe (which targets multiple VM backends), Ceylon, and more.

Perl has a way to inline other languages, but is only really targeted by Perl and by a really ancient version of PHP. The JVM is a bona fide target for so many. Even LLVM intermediate code has a tool to target the JVM, so basically any language with an LLVM frontend. I wouldn’t be surprised if there’s a PCode to JVM tool somewhere.

JavaScript has a few languages targeting it. WebAssembly has a bunch and growing, including C, Rust, and Go. That’s probably the closest thing to the JVM.

replies(3): >>44009322 #>>44009887 #>>44010221 #
4. cestith ◴[] No.44007153[source]
Python can be tricky with the big differences between 2 and 3.
replies(2): >>44009279 #>>44009385 #
5. invalidname ◴[] No.44007192[source]
I just spent 30 minutes trying to get a python package running on my Mac... Not feeling that. Pythons version compatibility is just awful and the mix of native is deeply problematic. Don't get me started on tooling and observability.
6. jonhohle ◴[] No.44007475[source]
For anything more than just a one off script, look into venv. I’ve not written any python until this past year and can’t imagine maintaining an ongoing project without it.

Prior to that I would frequently have issues (and still have issues with one-off random scripts that use system python).

7. loloquwowndueo ◴[] No.44009279{3}[source]
Python 3 came out in 2008. If the 2 vs 3 differences are still biting you you probably have bigger problems to solve (deprecated, insecure, unmaintained dependencies for example).
8. sigzero ◴[] No.44009322[source]
> I can run THE SAME CODE on DOS, BeOS, Amiga, Atari ST, any of the BSDs, Linux distros, macOS, OS X, Windows, HP/UX, SunOS, Solaris, IRIX, OSF/1, Tru64, z/OS, Android, classic Mac, and more.

No, you really can't. Not anything significant anyway. There are too many deviations between some of those systems to all you to run the same code.

replies(1): >>44009506 #
9. kevin_thibedeau ◴[] No.44009378[source]
It's not you. Python packaging has regressed into a worse mess than it was 20 years ago. I limit myself to simple scripts that only rely on builtins. Anything more complicated goes to a more dependable language.
replies(3): >>44010444 #>>44011416 #>>44011445 #
10. icedchai ◴[] No.44009385{3}[source]
As late as 2022, I was at a company still in the middle of "migrating" from 2 to 3. I wouldn't be surprised if the migration project was still going on. The system had gone beyond tech debt and was bordering on bankruptcy.
11. maxlybbert ◴[] No.44009506{3}[source]
Honestly, the main difference I run into is just file paths, and that’s easy to sidestep ( https://perldoc.perl.org/File::Spec ).

There are differences, but they’re usually esoteric ( https://perldoc.perl.org/perlport#PLATFORMS ).

12. vram22 ◴[] No.44009887[source]
Interesting about that long list of languages.

There's also Groovy.

I wonder what other languages run on the JVM. What about Perl, Icon, SNOBOL, Prolog, Forth, Rexx, Nim, MUMPS, Haskell, OCaml, Ada, Rust, BASIC, Rebol, Haxe, Red, etc.?

Partly facetious question, because I think there are some limitations in some cases that prevent it (not sure, but a language being too closely tied to Unix or hardware could be why), but also serious. Since the JVM platform has all that power and performance, some of these languages could benefit from that, I'm guessing.

#lazyweb

13. jsight ◴[] No.44009895[source]
Honestly, it isn't just you. I had to hold off on 3.13 for quite a while too, because of various package conflicts. It isn't terrible, especially thanks to things like pyenv, but it is far from perfect.
14. dotancohen ◴[] No.44010221[source]

  > I can run basically any Perl code back to Perl 4 (March 1991) on Perl 5.40.2 which is current.
Yes, but can you _read_ it?

I'm only half joking. Perl has so many ways to do things, many of them obscure but preferable for specific cases. It's often a write-only language if you can't get ahold of the dev who wrote whatever script you're trying to debug.

I wonder if modern LLMs could actually help with that.

replies(2): >>44010345 #>>44011388 #
15. johnisgood ◴[] No.44010345{3}[source]
> I wonder if modern LLMs could actually help with that.

From experience, they can.

16. icedchai ◴[] No.44010444{3}[source]
I rarely run into issues when using Poetry. If you use pip, add packages to requirements.txt willy-nilly and don't pin versions then you are asking for trouble.
replies(1): >>44011417 #
17. fuzztester ◴[] No.44011388{3}[source]
>Yes, but can you _read_ it?

Java was marketed (at least in its early days) as a WORA language - WRITE ONCE RUN ANYWHERE.

Perl was unmarketed as a WORM language - WRITE ONCE READ MANY (TIMES). ;)

jk, i actually like perl somewhat.

but I think Larry and team went somewhat overboard with that human-style linguistics stuff that they applied to perl.

18. fuzztester ◴[] No.44011416{3}[source]
what languages do you use for the latter?
19. myko ◴[] No.44011417{4}[source]
i like poetry though i've moved to uv - both work really well
replies(2): >>44011708 #>>44012013 #
20. fuzztester ◴[] No.44011445{3}[source]
I don't know about the difference between 20 years ago versus now, but it's certainly doesn't seem to be clear now.

e.g. poetry, venv and pyenv have been mentioned in just the next few comments below yours. and this is just one example. i have seen other such seeming confusion and different statements by different people about what package management approach to use for python.

21. icedchai ◴[] No.44011708{5}[source]
I've heard great things about uv. I plan to try it for my next project.
22. bornfreddy ◴[] No.44012013{5}[source]
I use pipenv and it kind-of-works. Will try uv or poetry though - which one would you recommend?