3 ms·
Go wins for simplicity. however what I have seen is companies end up going with Java coz it's simple enough - not simple as Go, but simple enough + fast enough.
by dzonga 2mo ago
Go wins for simplicity. however what I have seen is companies end up going with Java coz it's simple enough - not simple as Go, but simple enough + fast enough.
though the letdown with Java is the wider ecosystem that makes unwarranted contraptions out of simple things.
- frollogaston 2mo agoGo's big advantage was M:N threads. Java's biggest flaw has been the lack of cooperative multitasking, which people worked around by mangling their code with promises. Now Java has M:N threads too thanks to Project Loom, but there's so much code written before that will never really go away.
- pjmlp 2mo agoJava already had M:N threads in the early days, aka green threads, because the JVM and Java specifications did not assert what kind of threading was to be provided. Thus most JVM implementations had a mix of red (1:1:) and green (M:N) threads, eventually only red threads were kept in the surviving implementations. With Project Loom now both models are officially supported and part of the specification.
- frollogaston 2mo agoYeah I've heard of the Java 1-2 greenthreads, but supposedly those were M:1, ie you could only run them on one core. At least this SCO release note linked from Wikipedia says that: https://www.sco.com/developers/java/j2sdk122-001/ReleaseNotes.html#THREADS https://www.sco.com/developers/java/j2sdk122-001/ReleaseNote... And the pros are more about compatibility than performance
- pjmlp 2mo agoHow have you found a SCO note, which never did nothing relevant for Java? Here from Oracle, as historically taken from Sun documentation for JDK 1.1. => Many-to-Many Model (Java on Solaris--Native Threads) https://docs.oracle.com/cd/E19455-01/806-3461/6jck06gqk/index.html#ch2mt-41 https://docs.oracle.com/cd/E19455-01/806-3461/6jck06gqk/inde...
- foldr 2mo agoI think there's a naming confusion here. You said "M:N threads, aka green threads". However, your linked document clarifies that "green threads" are the M:1 threads that "[do] not exploit multiprocessors" (see the "Green Threads" parenthetical in the first subheading). It is interesting that JDK 1.1 also had an M:N threading model, but that's not what people usually mean by green threads.
- pjmlp 2mo agoI always understood it like that, however maybe it is on me, when reading this with more detail.
- frollogaston 2mo agoWell M:N means green to me, but that got me too, the docs only refer to M:1 as green.
- Cthulhu_ 2mo agoThe other reason why Java is preferred is the hiring pool - there's 10-100x as many Java developers out there than Go developers. It's almost a guarantee that you'll find people, which is arguably more important than what language you use.