Earlier quoted context omitted.
I'm not arguing that there isn't a tradeoff, or about "git gud". I'm literally and genuinely baffled about how one can magically elide knowing if a file is open or closed (or the equivalent) when using a resource. Like I can't think of a single language that doesn't make you explicitly obtain resources, and most of the GC languages do the same thing as rust for casual closing - just let the handle go out of scope. Ev…
> I still don't know what people mean when they talk about "having to think about memory layout" The best example I'd give is the degree to which you have to ask yourself if you want to use String or if you want to use &str--is this struct, or this function, going to own the string or borrow it from somebody else? If you're borrowing it, who is owning it? Can you actually make that work (this is really salient for pa…
My negative views on Rust (2023)
171–180 of 308 posts
Re: My negative views on Rust (2023)
#172Earlier quoted context omitted.
A bit off topic, but how do people usually write code here or on Reddit, I always find it to be really cumbersome to make sure there's two spaces etc in front of everything? Is there some formatting tool that I'm not aware of that everyone else uses? Because in both forums I keep coming back to edits, and it takes forever to edit some of the things, manually. I feel like I'm being stupid or the UX of all of that is j…
I actually use a formatting tool online if on mobile, or just vim if on the computer, which can add two spaces in front of every line.
I use Firefox + Tridactyl + the native extension, so with the cursor in any text field I can hit Ctrl+i and it pops up a gvim window with the contents of that text field. When you save+quit, it copies the contents back into the field.
So glad someone figured out how to do this again once Vimperator died.
Re: My negative views on Rust (2023)
#173Earlier quoted context omitted.
FYI this site doesn't use ``` for code blocks, it uses indentation (two spaces). https://news.ycombinator.com/formatdoc
A bit off topic, but how do people usually write code here or on Reddit, I always find it to be really cumbersome to make sure there's two spaces etc in front of everything? Is there some formatting tool that I'm not aware of that everyone else uses? Because in both forums I keep coming back to edits, and it takes forever to edit some of the things, manually. I feel like I'm being stupid or the UX of all of that is j…
Re: My negative views on Rust (2023)
#174Earlier quoted context omitted.
> I still don't know what people mean when they talk about "having to think about memory layout" The best example I'd give is the degree to which you have to ask yourself if you want to use String or if you want to use &str--is this struct, or this function, going to own the string or borrow it from somebody else? If you're borrowing it, who is owning it? Can you actually make that work (this is really salient for pa…
The way memory allocation and management becomes part of the paradigm of how we write and structure programs, is actually something I really enjoy about rust. It's like how you can do the exact same thing in C++, using the same concepts and tools (for the most part) with different names, but it never felt the same, or as natural. It's definitely helped the way I think about programs as a whole.
Re: My negative views on Rust (2023)
#175Earlier quoted context omitted.
Games themselves, not game engines. Systems code, game engines, and games. This isn't meant to be an exhaustive list--it's just the domains I have experience with that Rust was a good fit for. Lest it seem like I'm saying Rust is a good fit for everything I've done, I also worked on Firefox where the UI was JavaScript, and I wouldn't hurry to rewrite that code in Rust. Nor would I want the throwaway stuff I write in…
I'm just saying, games are exactly one of the things I would assume Rust would be a natural fit for. :)
Did you leave out a "not" here?
Re: My negative views on Rust (2023)
#176Earlier quoted context omitted.
I'm just saying, games are exactly one of the things I would assume Rust would be a natural fit for. :)
>Rust would be a natural fit for Did you leave out a "not" here?
Re: My negative views on Rust (2023)
#177Earlier quoted context omitted.
>Rust would be a natural fit for Did you leave out a "not" here?
No, I don't think so? I would have predicted games as a sweet spot for Rust. Most significant game projects are done in C++, and I look at Rust as basically obsoleting C++.
My guess was that since almost no one will pay more for a game's having fewer security vulns, there is less benefit to incurring the expense of Rust (takes longer to learn, development speed is slightly less)
Re: My negative views on Rust (2023)
#178Re: My negative views on Rust (2023)
#179Earlier quoted context omitted.
Rust makes you think about your memory layout, memory allocation and avoiding thereof, about the specific time you grab and release other resources, about specifics of your inter-thread interactions, etc. If such considerations are natural for your problem domain, you likely do "systems programming" and also happen know C, have an.opinion on Zig, etc. If such considerations are the noise which you wish your language…
What does "think about your memory layout" mean? Can you provide an example? I've seen this brought up a few times on this thread and have no idea what people are referring to when they say it. As for the rest of your list - I'm not sure why rust is special in regards to "the specific time you grab and release resources" or "inter-thread interactions". Seriously - I have to think about when I acquire and release reso…
Here are some of the typical concerns:
- How exactly fields of a record sit in memory, how much room do hey take, taking into account things like padding for aligned access?
- Are related data sit next to each other, and can stay in the CPU cache together while needed?
- Are chaotic memory accesses thrashing the cache?
- Do the data structures avoid gratuitous references / pointer chasing (at least mostly)?
- Are local variables mostly allocated on the stack?
- Does your code avoid heap allocations where possible?
- Do fields in your data structure match a binary format, such as of an IP packet, or a memory-mapped register?
- Are your sensitive data protected from paging out to disk if free RAM is exhausted?
If these questions are not even relevant for your problem domain, you likely are not doing systems programming.
Re: My negative views on Rust (2023)
#180Earlier quoted context omitted.
No, I don't think so? I would have predicted games as a sweet spot for Rust. Most significant game projects are done in C++, and I look at Rust as basically obsoleting C++.
OK. Thanks. My guess was that since almost no one will pay more for a game's having fewer security vulns, there is less benefit to incurring the expense of Rust (takes longer to learn, development speed is slightly less)