Live data from Hacker News

Migrating away from Rust

deadmoney.gg

581–590 of 799 posts

Re: Migrating away from Rust

#581
post #368

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?

Yes via sealed classes. It also has pattern matching.

Re: Migrating away from Rust

#582
post #529
post #491

Earlier 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)

And others like Pascal linage (Pascal, Object Pascal, Extended Pascal, Modula-2, Ada, Oberon,...), that have flexible bounds, they can be whatever numeric subranges we feel like using, or enumeration values.

Re: Migrating away from Rust

#583
post #204

The 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…

Can you speak more of this best in class tooling?

Re: Migrating away from Rust

#585
post #557
post #428

Earlier 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".

Or take a lesson from languages where this isn't a religious question and do

    (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

#586
Using Rust in a project felt less like implementing ideas and more like committing to learning the language in depth. Most projects involve messy iteration and frequent failure. Doing that in Rust is painful. Starting a greenfield project in it feels more like a struggle with the language than progress on the actual idea unless you're a Rust enthusiast.

Re: Migrating away from Rust

#587
post #554
post #478

Earlier 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.

Well I have never used Objective-C so I can't comment on it.

Re: Migrating away from Rust

#588
post #457

Earlier 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.

I don’t think you need to work in absolutes here. There are plenty of games that do not need to render at 240hz and are capable of handling pauses up to 1ms. There’s tons of games that are currently written in languages that have larger GC pauses than that.

Re: Migrating away from Rust

#589
post #380
post #369

Earlier 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…

Except, nothing forbids me to use two linked lists in C++ using sys/queue.h, that is exactly one of the reason why Bjarne built C++ on top of C, and also unfortunely a reason why we have security pain points in C++.

Re: Migrating away from Rust

#590
post #560
post #359

Earlier 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.

I would do C#, but I don’t want to be in async/await hell.

Also it’s subjective but PascalCase really irks me.

Post reply on HN