• 0 Posts
  • 440 Comments
Joined 1 year ago
cake
Cake day: June 21st, 2023

help-circle





  • I made the mistake of starting Frostpunk (1) since I saw that 2 released. It’s an incredibly well-made game. The art style is beautiful, the game is intense, there is a lot of emotion, and it does its one thing just so well. Unlike a lot of modern games these days, Frostpunk wants you to lose, which is fitting for its setting. It sees that you’re behind, then kicks you in the shins for good measure rather than lending a helping hand. I’ve lost so many hours of my time to this game in the past week.

    I’ve read that Frostpunk 2 is a completely different game. That one might be next on my list if I get to it before Factorio updates and the expansion for it comes out.


  • The “‘modern’ development stack” we used at my school when I was in a CS program was C++98 or something, compiled using gcc directly. This was in the last decade. It technically wasn’t C!

    But we did use C in my computer engineering classes so I guess they technically did teach it. I feel very fortunate that I haven’t needed to use it since then.




  • Adding a single unused function should no effect on runtime performance. The compiler removes dead code during compilation, and there’s no concept at runtime anyway of “creating a function” since it’s just a compile-time construct to group reusable code (generally speaking - yes the pedants will be right when they say functions appear in the compiled output, to some extent).

    Anyway, this can all be tested on Godbolt anyway if you want to verify yourself. Make a function with and without a nested unused function and check the output.





  • Pushing HTML even further, one could say it’s a declarative programming language that programs a UI in a mostly-stateless manner (inputs aren’t really stateless but you can argue the state is provided by the UI rather than managed by HTML).

    I’m not sure I’d make this leap myself though, I have a hard time classifying it (or any other markup language) as a PL. As far as I am aware, you can’t really program a state machine with pure HTML, though you can accept inputs and return outputs at least.





  • Two thoughts come to mind for me:

    1. I think people should feel free to use any language however they want for their own needs and projects, but it’s also important to understand what exactly “unsound” and “undefined behavior” mean if you’re going to dabble with them. If it’s a risk you’re willing to take, go for it, but don’t be surprised if things break in ways that make no sense at all. Realistically a compiler won’t delete your root directory if you trigger UB or anything, but subtle bugs can creep in and change behaviors in ways that still run but which make unrelated code break in difficult to debug ways.
    2. The borrow checker is one of Rust’s biggest features, so looking for ways around it feels a bit counterproductive. Feature-wise, Rust has a lot of cool constructs around traits and enums and such, but the language and its libraries are built around the assumption that the guarantees the compiler enforces in safe code will always be true. These guarantees extend beyond the borrow checker to things like string representation and thread safety as well. As an alternative, some other languages (like C++, which you mentioned, or maybe even Zig) might be better suited for this approach to “dirty-but-works” development, and especially with C++, there are some excellent tools and libraries available for game development.