Earlier quoted context omitted.
I'd rather write rust than java, personally
Note that I mentioned JVM languages. There is Scala, Kotlin and others. Kotlin is the default for Android, and it is really nice.
Migrating away from Rust
641–650 of 799 posts
Re: Migrating away from Rust
#642Earlier quoted context omitted.
I think the choice of C++ vs JVM depends on your project. If you're not using the benefits of "unsafe" languages then it probably doesn't matter. But if you are after performance how do do the following in Java? - Build an AOS so that memory access is linear re cache. Prefetch. Use things like _mm_stream_ps() to tell the CPU the cache line you're writing to doesn't need to be fetched. Share a buffer of memory between…
> but there is a reason that commercial gamedev is typically C++. Sure, and that's kind of my point. There are a few use-cases where C++ is actually needed, and for those cases, Rust (the language) is a good alternative if it's possible to use it. But even for gamedev, the article here says that they moved to Unity. The core of Unity is apparently C++, but users of Unity code in C#. Which kind of proves my point: out…
Then we had C++ for all our low level code and Lua for gameplay.
We were floating a middle layer of Rust for Lua bindings and the glue code for our transformation pipeline, but there was always a little too much friction to introduce. What we were particularly interested in was memory allocation bugs (use after free and leaks) and speeding up development of the engine. So I could see it having a place.
Re: Migrating away from Rust
#643Earlier quoted context omitted.
People that haven't tried this are downvoting with prejudice, but they just don't know. Rust is an absolute gem at web backend. An absolute fucking gem.
We know, it stil isn't at Spring/ASP.NET level, coupled with Scala/Kotlin/F#.
On the JVM I'd prefer Kotlin/http4k/SQLDelight any day over {Java,Kotlin}/Spring(Boot)/{Hibernate,sql-in-strings}.
Re: Migrating away from Rust
#644Earlier quoted context omitted.
Can you speak more of this best in class tooling?
The official `go` command does dep management, (cross) compilation, testing (including benchmarks and coverage reports), race detection, profiling reports, code generation (metaprogramming alternative), doc generation etc. Build times are insanely fast too. The only tooling I use personally outside of the main CLI is building iOS/Android static libraries (gomobile). It’s still first party, but not in the go command.
Re: Migrating away from Rust
#645I really like Rust as a replacement for C++, especially given that C++ seems to become crazier every year. When reasonable, nowadays I always use Rust instead of C++. But for the vast majority of projects, I believe that C++ is not the right language, meaning that Rust isn't, either. I feel like many people choose Rust because is sounds like it's more efficient, a bit as if people went for C++ instead of a JVM langua…
Re: Migrating away from Rust
#646Earlier quoted context omitted.
We know, it stil isn't at Spring/ASP.NET level, coupled with Scala/Kotlin/F#.
I hate Spring(Boot): too much magic due to overuse of annotations. On the JVM I'd prefer Kotlin/http4k/SQLDelight any day over {Java,Kotlin}/Spring(Boot)/{Hibernate,sql-in-strings}.
Re: Migrating away from Rust
#647Earlier quoted context omitted.
C# has aged better but I feel like Java 8 approaching ANSI C level solid tools. If only Swing wasn't so ugly. They should poach Raymond Chen to make Java 8 Remastered I like his blog posts. There's probably a DOS joke in there. Also they should just use the JavaFX namespace so I don't have to change my code and I want the lawyer here to laugh too.
Java current version is 24.
Re: Migrating away from Rust
#648Earlier quoted context omitted.
While there are many technical reasons to use C++ over Java in game development, many commercial games could be easily done in Java, as they are A or AA level at most. Had Notch thought too much about which language to use, maybe he would still be trying to launch a game today.
Minecraft was Indie then. And anyway, it's now in C++.
Re: Migrating away from Rust
#649Earlier quoted context omitted.
> These crates also get "refactored" every few months, with breaking API changes I am dealing with similar issues in npm now, as someone who is touching Node dev again. The number of deprecations drives me nuts. Seems like I’m on a treadmill of updating APIs just to have the same functionality as before.
I wish for ecosystems that would let maintainers ship deprecations with auto-fixing lint rules.
Re: Migrating away from Rust
#650Earlier quoted context omitted.
Does Java have sum types now?
Yes via sealed classes. It also has pattern matching.
public abstract sealed class Vehicle permits Car, Truck {
public Vehicle() {}
}
public final class Truck extends Vehicle implements Service {
public final int loadCapacity;
public Truck(int loadCapacity) {
this.loadCapacity = loadCapacity;
}
}
public non-sealed class Car extends Vehicle implements Service {
public final int numberOfSeats;
public final String brandName;
public Car(int numberOfSeats, String brandName) {
this.numberOfSeats = numberOfSeats;
this.brandName = brandName;
}
}
In Kotlin it's a bit better, but nothing beats the ML-like langs (and Rust/ReScript/etc): type Truck = { loadCapacity: int }
type Car = { numberOfSeats: int, brandName: string }
type Vehicle = Truck | Car