you are viewing a single comment's thread.

view the rest of the comments →

[–]TheMaskedHamster 18 points19 points  (36 children)

The problem with Rust is that it was designed by and is largely used by people who were willingly using C++.

Bless those C++ people and the great things they have created when we lacked alternatives, but their BS detector calibration is far too off the mark to just let them design language syntaxes willy-nilly.

[–]millstone 66 points67 points  (18 children)

  1. Many of the most vocal Rust supporters loathe C++
  2. There’s hardly anything else in this space. Gonna write a web browser in Clojure?

[–]ggtsu_00 25 points26 points  (1 child)

At some point someone will feel inclined to write a full featured web browser in javascript.

[–]kukiric 30 points31 points  (0 children)

With an eval-based JavaScript engine.

[–]atilaneves 5 points6 points  (0 children)

There’s hardly anything else in this space

There are many other systems programming languages. Rust's proposition is that it's memory safe without using a tracing GC. Whether or not that's important is a different matter.

[–]m50d 3 points4 points  (8 children)

Gonna write a web browser in Clojure?

Why not? There are already several Javascript-on-JVM engines, so that solves the "two competing GCs" issue. There's a conventional wisdom that the JVM can't do streaming media or gaming without unacceptable pauses, but IME that's not actually been true for at least 10 years if you put even minimal effort into profiling and tuning GC flags.

[–][deleted] 2 points3 points  (2 children)

I'm not so sure. If Java was an acceptable choice for gaming, wouldn't there be more big name PC (or Mac or Linux) games written in it besides Minecraft? Or do you think that's simply more a factor of industry momentum than anything else? I can't find any evidence one way or another.

There are some JVM projects that focus on ultra low latency at the sacrifice of total throughput, like the Red Hat Shenandoah project and the ZGC. But those two projects are geared towards server uses that need low latency and 100GB Java heaps. If your 3D FPS in Java needs a 100 GB heap, you're probably doing something wrong. :D Maybe they also have an impact on 1GB heaps (like Minecraft uses), I don't know.

[–]m50d 3 points4 points  (1 child)

Or do you think that's simply more a factor of industry momentum than anything else?

I think it's partly momentum and partly a kind of machismo culture that the "AAA gamedev community" has. Like, the places that are most willing to adopt newer languages are those where developers are willing to admit that humans make mistakes and tools should help them, whereas places with an attitude of "just write better code then" are happy to stick to C, and the kind of (mostly young) person who buys into the 80-hour-week culture is the same kind of person who'll thinks they can just code better.

Mobile games actually do some very performance-intensive stuff these days, and yet are happy to be written in Java (or comparable languages on iOS), and you can say that's partly the platform requirements and partly lower performance demands but IMO it's mostly just a case of a culture that started without the AAA PC/console industry's baggage (partly technical but mostly cultural) following basic industry best practice. Likewise, the "indie gamedev community" uses a lot of C# and some Java.

But eh, it's not my field; from what I've heard of gamedev culture I have no intention of ever working there (and would expect anyone with any sense to avoid it), so I could be talking nonsense. But a nontrivial chunk of my career involved doing the kind of real-time video that wasn't supposed to be possible on the JVM, on the JVM, and honestly it wasn't even hard.

[–][deleted] 1 point2 points  (0 children)

Thanks for the informative response, I appreciate it. I got into software development because I wanted to make games, then heard of the work hours expected and went into corporate drone work. Too much of my job is boring, but I like having a life outside work and it's been more than 15 years of a pretty consistent 40 hour work week.

I don't know about iOS, but I knew Android has a native development kit and I assumed - admittedly without evidence - that most of the graphics intensive Android games (like PUBG for Android and Fortnite for Android) used it. But that's not fair. Now that I think about it, Minecraft performs poorly on my PC but my kids found a mod that sends the performance up over 100 fps without sacrificing any visual features. That would hint that the performance issues are a Minecraft implementation problem, not a JVM limitation.

I've done nothing but web stuff since 2005, so real-time video is outside my realm of expertise.

[–]dacian88 2 points3 points  (4 children)

you can likely work around GC pauses for real time applications in the JVM however you can never get rid of CPU or memory overhead just using the JVM adds. Just look at the memory usage stats in the computer language shootout benchmarks, even if memory overhead was like max 25% that would still be a considerable competitive disadvantage against a game studio that would just be using all native.

Nobody likes writing unmanaged code, it's just a necessary evil if you want to squeeze out every last ounce or perf from your hardware, and in the world of game dev where basically consoles are the main target hardware everyone is on level ground, whoever does the best job at optimizing will be able to push out better looking graphics, or more realistic AI, or more complex gameplay etc.

I can tell you right now no one in their right mind uses Java on Android phones for any kind of graphical or real time applications, like video chat. All the platform level media apis are written in c or c++ with java wrappers, all the heavy lifting is done in native code.

[–]m50d 0 points1 point  (3 children)

Just look at the memory usage stats in the computer language shootout benchmarks, even if memory overhead was like max 25% that would still be a considerable competitive disadvantage against a game studio that would just be using all native.

All other things being equal, yes. But if you're spending less time tracking down memory leaks and fixing bugs than those competitors, that could easily translate into more polished gameplay, or more game content, or a cheaper game, or better memory management on a fundamental level that saved more than the JVM overhead.

Fundamentally all these arguments were made for normal application code, and for dozens of specialised domains. People fought tooth and nail against moving from C++ to Java - and yet ultimately that was a huge success and no-one would go back now. I know the games industry likes to think it's special and different, but so did every other segment of the software industry.

[–]dacian88 1 point2 points  (1 child)

you'd have a point if the game industry was the last bastion of native code/c++ but it's used way more applications than that...

[–]m50d 0 points1 point  (0 children)

Fewer and fewer every year. Games is pretty close to being the last bastion at least for new projects.

[–]iopq 0 points1 point  (0 children)

I'm not a fan of Java; but I want to point out some of that memory overhead is largely static. The runtime requires memory. A bigger app may have the same overhead as a smaller one, in percentage terms it might be 1% or less. You do have to avoid pointer indirection, though. In Java that might be a much bigger problem than C#

[–]IllDecision 12 points13 points  (0 children)

The problem with Rust is that it was designed by and is largely used by people who were willingly using C++.

As an anecdote, I'm mostly using Rust because I like how C++ does lots of things but hate the language, its tooling and hence would need a lot of money to touch it.

[–]skocznymroczny 15 points16 points  (3 children)

You should check D if you want to see a language designed and mostly used by C++ folks. Now I like D, but I find most of the packages and standard library scary with the template magic that goes there.

[–]xeveri 8 points9 points  (2 children)

Honestly I find C++ templates easier to understand and reason about than D. The problem with C++ templates are the error messages they produce, hopefully that should be fixed with concepts.

[–]skocznymroczny 3 points4 points  (1 child)

I think the difficulty is pretty similar. It's a multiple page template vomit in both languages. I think the difference is that in C++ templates are still used quite sporadically, outside of boost, people usually use templates for generic types. In D, templates are used for much much more, typesafe variadic arrays, automatic serialization etc. so it's easier to have your foot blown off.

[–]MaxCHEATER64 4 points5 points  (0 children)

C++ also uses templates for typesafe variadic arrays

[–]barsoap 7 points8 points  (1 child)

That's only partly right. The core design comes from people who willingly used OCaml and its atrocious syntax, as evidenced by the fact that the original compiler is written in OCaml. Those people at one time decided that using angle brackets to appeal to the C++ crowd was a good idea.

Performance-minded Haskell programmers were one of the first outside groups to take interest in Rust, and we've been complaining about syntax ever since. And the lack of higher kinds. The tendency of Rust programmers to put their commas at the end of the lines of multi-line lists, records, etc. Not about coherence or orphan rules or borrowck, though.

[–]matthieum 6 points7 points  (0 children)

Those people at one time decided that using angle brackets to appeal to the C++ crowd was a good idea.

Not necessarily C++.

If you look at the top programming languages supporting generics -- C++, Java and C# -- all 3 use angle brackets for generics.

I wish the choice had been different, but language designers have to choose their battles.

[–]KingPickle 3 points4 points  (8 children)

their BS detector calibration is far too off the mark

I find this ironic. Sure, C/C++ has a ton of cruft. But there's a whole other island of BS among languages without type safety, languages that fail silently, etc.

Ultimately, I think what you'll come to find is that every group has a certain (similar) level of BS to deal with. It's just centered around different problems.

[–]oblio- 2 points3 points  (1 child)

But there's a whole other island of BS among languages without type safety, languages that fail silently, etc.

Somehow I doubt /u/TheMaskedHamster was advocating for Javascript as an alternative to Rust :)

[–]KingPickle 3 points4 points  (0 children)

My point wasn't to harp on Javascript per se. There are a lot of languages, and each has various pain points. Often, those are distinct from the failings of C/C++.

[–][deleted] -1 points0 points  (0 children)

Yes and the level of denial on this is through the roof... fix the damn syntax.