4 ms·
> Java will make lower level languages with manual memory allocation like C/C++ obsolete because CPUs are getting faster. Except that this actually happened wr
by zozbot234 1y ago
> Java will make lower level languages with manual memory allocation like C/C++ obsolete because CPUs are getting faster.
Except that this actually happened wrt. a whole lot of application code. Sure, Java was slow and clunky but at least it was free of the memory unsafety that plagued C/C++. What was the mainstream "safe" alternative? There was no Rust back then, even Cyclone (the first memory-safe C style language) was only released in the mid-2000s.
- gompertz 1y agoInteresting! I never heard of Cyclone before. Looks like another Bell Labs contribution.
- jasode 1y ago>Sure, Java was slow and clunky but at least it was free of the memory unsafety that plagued C/C++. What was the mainstream "safe" alternative? There was no Rust back then, Before Sun Java in 1995, companies built enterprise CRUD apps with "safe" memory languages using MS Visual Basic, PowerBuilder, and xBase languages like dBASE and FoxPro. This allowed them to develop line-of-business apps without manually managing memory in C/C++.
- hedora 1y agoOn top of that, when I last had the misfortune of using Java, (17, maybe?) the GC still was a top cause of production outages and a massive productivity drag. They claimed they fixed it a dozen times, starting with JDK 1.4, and continued to claim that with every major release since.
- holowoodman 1y agoJava might be memory-safe. But it is "performance-unsafe".
- Tostino 1y agoFor certain problems. I'm looking forward to Project Valhalla finally landing, and the subsequent improvements that come later. Getting the performance benefits of data oriented programming patterns is very exciting to me for allowing Java to run totally different classes of applications than haven't been practical until now.
- estebank 1y agoValhalla is indeed the one effort that could close the biggest gap with native languages. Java Vs C or Rust for networked applications have comparable CPU utilisation with comparable throughput, but memory consumption can be >100x. Project Valhalla is the only thing that could potentially change that. The problem I do see is that even after the language and JVM have value types, the vast extense of libraries that people use are unlikely to change to leverage them. But for projects that control most of their own dependencies, it will be a clear win.
- Tostino 1y agoI think over a few years, most of the major dependencies will adopt some of the benefits of Valhalla; at least in the performance sensitive parts.
- Twirrim 1y agoIt's perfectly fast. Slower than C/C++ under most scenarios, but not by a particularly large amount, and in some scenarios faster due to optimisations only possible from dynamic runtime observation.
- gf000 1y agoTop cause for production outages? Like what, did you get OOM errors? Also, how can a GC be a productivity drag? Anyways, besides your very questionable "experience" with java, it literally runs half of the internet, and has by far the most mature and performant GC out of any platform, no one else is even close in this category.
- Twirrim 1y agoHow the heck did you manage that? I've been working on two major clouds for well over a decade, both built primarily on Java, and not seen a single production outage caused by garbage collection. Not one. Not even S3 in us-east-1 at its gobsmacking RPS rates had issues with garbage collection. No special coding approaches were taken to achieve that, just standard stuff.
- majormajor 1y agoJava wasn't particularly responsible for that. And non-GC languages didn't even become obsolete - they're so relevant that they're one of the buzziest new-language-development areas. It didn't displace C-family languages on desktop OSes. There was a brief wave of Java-first desktop apps and people generally hated the UI toolkits and lack of first-party-feel and they went away. And on the server, it was just one of many non-C things like Perl, PHP, Python, Ruby, etc. Java became a standard "our dynamic language is too slow, port it to something else" destination but honestly the interpreted languages did more for killing C/C++ from a perspective of "CPUs are fast enough, and we're not CPU bound usually, just write in whatever's easiest." And now we have a whole wave of "rewrite something off of the JVM, or off of Go, or off of some other GC'd language in Rust" projects because "just let the CPU use the spare cycles to GC has never been fully realized.
- gf000 1y ago> And now we have a whole wave of "rewrite something off of the JVM, or off of Go, or off of some other GC'd language in Rust" projects I think you vastly overestimate the size of that wave. Rust is a novelty in a specific niche and is changing/will change the low-level programming niche, but it won't noticeably alter how general business programming goes, not at all.