Earlier quoted context omitted.
What language are you using that doesn’t have match? Even Java has the equivalent. The only ones I can think of that don’t are the scripting languages.. Python and JS.
Does Java have sum types now?
Migrating away from Rust
581–590 of 799 posts
Re: Migrating away from Rust
#582Earlier quoted context omitted.
The ground floor in lifts isn't "1", it is "G". Same thing.
Country dependent. Like there are 1-based indexing languages (Lua, Matlab, et al)
Re: Migrating away from Rust
#583The fact that people love the language is an unexpected downside. In my experience the rust ecosystem has an insanely high churn rate. Crates are often abandoned seemingly for no reason, often before even hitting 1.0. My theory is this is because people want to use rust primarily, the domain problem is just a challenge, like a level in a game. Once all the fun parts are solved, they leave it for dead. Conversely and…
Re: Migrating away from Rust
#584Re: Migrating away from Rust
#585Earlier quoted context omitted.
> fight the borrow checker I see this and I am reminded when I had to fight the 0 indexing, when I was cutting my teeth in C, for class. I wonder why no one complains about 0 indexing anymore. Isn't it weird how you have to go 0 to length - 1, and implement algorithm differently than in a math book?
I sometimes work on creating my own programming language (because there aren't enough of those already) and one of the things I want to do in it is 1-based indexing. Just so I can do: (defvar names (Vector String) #("Alex" "Kim" "Robin" "Sam")) (elt names 1) ...and get "Alex" instead of "Kim".
(defvar names (Vector String)
#("Alex" "Kim" "Robin" "Sam"))
(first names)
or if being flexible, (defvar names (Vector String)
#("Alex" "Kim" "Robin" "Sam"))
(elt names (lowbound names))
Bonus points for adding a macro or function, to make the second form available as first as well.Re: Migrating away from Rust
#586Re: Migrating away from Rust
#587Earlier quoted context omitted.
I have found that the ClassFactoryGeneratorFactories sneak up on you. Even if you don't want to the ecosystem slowly but surely nudges you that way.
It is ironic how Java got that stigma and other systems that are just as bad, or worse, like Objective-C, have not.
Re: Migrating away from Rust
#588Earlier quoted context omitted.
> GC pauses aren't really acceptable Java has made great progress with low-pause (~1 ms) garbage collectors like ZGC and Shenandoah since ~5 years ago.
People have 240hz monitors these days, you have a bit over 4ms to render a frame. If that 1ms can be eliminated or amortised over a few frames it's still a big deal, and that's assuming 1ms is the worst case scenario and not the best.
Re: Migrating away from Rust
#589Earlier quoted context omitted.
C and C++ do have very different memory models, C essentially follows the "types are a way to decode memory" model while C++ has an actual object model where accessing memory using the wrong type is UB and objects have actual lifetimes. Not that this would necessarily lead to performance differences. When people claim C++ to be faster than C, that is usually understood as C++ provides tools that makes writing fast co…
Try putting objects into two linked lists in C using sys/queue.h and in C++ using the STL. Try sorting the linked lists. You will find C outperforms C++. That is because C’s data structures are intrusive, such that you do not have external nodes pointing to the objects to cause an extra random memory access. The C++ STL requires an externally allocated node that points to the object in at least one of the data struct…
Re: Migrating away from Rust
#590Earlier quoted context omitted.
I’d rather write Java than Rust, personally
Same here, and if I get bored with Java, there is also Scala, Kotlin and Clojure to chose from. 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.