Java has the stigma of ClassFactoryGeneratorFactory sticking to it like a nasty smell but that's not how the language makes you write things. I write Java professionally and it is as readable as any other language. You can write clean, straightforward and easy to reason code without much friction. It's a great general purpose language.
Unfortunately it's not a good gaming language. GC pauses aren't really acceptable (which C# also suffers from) and GPU support is limited.
Miguel de Icaza probably has more experience than anyone building game engines on GC platforms and is very vocally moving toward reference counted languages [1]
Also here is how great his new Swift love performs in reality against modern tracing GCs,
I wonder how the performance would be with Swift 6.1 which has improved support for Linux.
In reality, a lot of Swift apps are delegating to C code. My own app (in development) does a lot of processing, almost none of which happens in Swift, despite the fact I spend the vast majority of my time writing Swift.
Swift an excellent C glue language, which Java isn't. This is why Swift will probably become an excellent game language eventually.
Do you have a counter benchmark? The burden is on you here to disprove the data presented. What that benchmark shows is that you spend A TON of time counting references, much more than tracing GC, unless you enter Swifts C++ networking code. I would think games don’t spend most of their time calling into networking code.
> In reality, a lot of Swift apps are delegating to C code. My own app (in development) does a lot of processing, almost none of which happens in Swift, despite the fact I spend the vast majority of my time writing Swift.
So what you’re saying is that any language will be good for gaming since they all can delegate to C?
> Swift an excellent C glue language, which Java isn't. This is why Swift will probably become an excellent game language eventually.
What makes swift better at calling C than Java? AFAIK Java has a perfectly good and brand new foreign function interface.
> This is why Swift will probably become an excellent game language eventually.
I would take this bet that it won’t. Purely on the sheer fact that gaming occurs on Windows and Swift is barely capable there.
Exactly. That is why the out-of-date networking example being touted as evidence is irrelevant here.
What it boils down to is that Java and C have fundamentally incompatible memory models. Direct access to C memory is impossible because of the managed heap and GC.
> I would take this bet that it won’t. Purely on the sheer fact that gaming occurs on Windows and Swift is barely capable there.
This is a very odd comment - gaming occurs in a lot of places. Quite a lot happens on mobile these days. Turns out a lot of mobile devices run Swift, on which it appears to be reasonably capable.
> Swift is a successor to the C, C++, and Objective-C languages. It includes low-level primitives such as types, flow control, and operators. It also provides object-oriented features such as classes, protocols, and generics.
-- https://developer.apple.com/swift/
If developers have such a big problem glueing C libraries into Java JNI, or Panama, then maybe game industry is not where they are supposed to be, when even Assembly comes to play.
Java has made great progress with low-pause (~1 ms) garbage collectors like ZGC and Shenandoah since ~5 years ago.
Additionally they have HPC#, which is a C# subset for high performance code, used by the DOTS subsystem.
Many people mistake their C# experience in Unity, with what the state of the art in .NET world is.
Read the great deep dive blog posts from Stephen Toub on Microsoft DevBlogs on each .NET Core release since version 5.0.
For the competitive Minecraft player, I suspect starting their VM with XX:+UnlockExperimentalVMOptions is normal.
A casual gamer is however not going to enjoy that.
Here, enjoy https://github.com/Quotation/LongestCocoa
There is even a style guide on it,
https://developer.apple.com/library/archive/documentation/Co...
However, I would still prefer C# or F#.
Hence why I enjoy both stacks, lots of goodies to chose from, with great tooling.
Also it’s subjective but PascalCase really irks me.
But yeah it is subjective, also don't have much qualms with other alternatives.