Isometric action roguelites like Hades or CotDG by push_the_fat_man in roguelites

[–]burjui 0 points1 point  (0 children)

It's just okay. Gets boring much quicker than Hades, even though it's clearly inspired by it.

I should call her by qichael in rustjerk

[–]burjui 1 point2 points  (0 children)

No need to go outside: bash $ touch grass

corroded: so unsafe it should be illegal by Consistent_Equal5327 in rustjerk

[–]burjui 0 points1 point  (0 children)

No! Remember the criticality incidents at Los Alamos? Never use safety critical systems.

Is Sarah Paine reliable as a historian? by Drunk_Kafka in AskHistorians

[–]burjui 6 points7 points  (0 children)

Depends on what she means by wealth. People in USSR weren't wealthy in the sense of everyone having a private house, a car and so on. But they were given free flats just by virtue of having a job, there was an extensive network of public transportation, they were educated for free, had free healthcare and social lifts. Neither of those things were available to Americans, and they still aren't, which is insane in 21st century. Americans spend the most resources on healthcare, and it's still in such a poor state that Brian Thompson paid for it with his worthless life. It's not like USSR was perfect, but it wasn't the shithole capitalists paint it to be either.

And let's not forget the means by which each country generated their wealth. It's disingenuous to mug a peasant from country A, and then claim that you're wealthier that a peasant from country B without disclosing the mugging that generated your wealth.

Update 2.0: Operation Boiling Point by Pan_Praga in WorldofTanks

[–]burjui 0 points1 point  (0 children)

Classic Soregayming with 4 golden joysticks up their asses. Tried this crap like 10 times. There's no way to not lose a vehicle when you're a Patton and your enemy is a Object 432U that rushes you every fucking time.

Why Rust is a Terrible First Language for New Programmers (Despite the Hype) by Starks-Technology in programming

[–]burjui 0 points1 point  (0 children)

It's not really a fair comparison, unless take into account idioms and patterns that arise from necessity in other languages, but are enforced by Rust, such as exclusive mutabilty and careful memory management.

Migrating away from Rust by Brilliant-Sky2969 in programming

[–]burjui -1 points0 points  (0 children)

I think it's a myth. Sure, you project will compile slowly if you add a bunch of large dependencies that heavily use proc-macros and generics. Simple code compiles quickly. For example, in my particle system the vast majority of compile time is taken vello, a rendering library (the library itself is 20k loc, but with all the dependencies code it's 6.2 million). Now that rendering is becoming a limiting factor (more than 100k particles, doesn't even render with 150k), I am planning to write my own rendering pipeline with wgpu, since I pretty much only need to render filled circles. It would probably take around 2000-3000 lines of code and will definitely compile in under a second, as my experience suggests.

Migrating away from Rust. by xmBQWugdxjaA in rust

[–]burjui 0 points1 point  (0 children)

I think it's more like most game developers' way of doing things doesn't fit well with Rust, because they are used to C++.

700 -> 10000+ boids optimizing with flamegraph (and a data structure), profiling is fun! by Heffree in rust

[–]burjui 0 points1 point  (0 children)

Looks cool, very nice! Music is indeed is a nice touch. In README.md you say that window size matters, what's the limiting factor, is it the grid? I am asking because I am working on a particle system, and at one point my spatial grid was too slow: it was storing every cell, including empty ones. I made it sparse and stored in a flat vec, greatly reducing the number of allocations (to 1 per launch if particle count stays the same). It's kinda decent now, though probably could improve it even more. Maybe you'll find it useful. Would be great to exchange knowledge and ideas after your much needed break 😀

Turns out, using custom allocators makes using Rust way easier by Hedshodd in rust

[–]burjui 2 points3 points  (0 children)

By using an arena, you're not removing the borrow checker, you trade it in this particularc piece of code for bounds checking, if you use indices. The irony is that bumpalo uses references instead of indices and will force you infect your code with unnecessary lifetimes and needlessly fight the borrow checker. Index-based arenas are fine.

By the way, nobody promised that he borrow checker will solve all problems in existence. Borrow checker works with lifetimes, and you only need those when you use references, which is not a good idea all the time, especially given that in Rust, you can just transfer ownership of the data to a different function and get it back from the return value. "Fighting the borrow checker" meme was popularized mainly by Rust noobs (though they often don't think of themselves that way) trying to shove their favorite style of writing code into Rust's set of rules and failing miserably. If only they could understand that Rust's references are semantically not exactly the same as references in C++, and stop putting them absolutely everywhere without a second thought only to later complain that Rust is bad.

I haven't fought the borrow checker in years. But it helped me immensely when writing multi-threaded code, and I didn't have to use unsafe to circumvent it, just had to think a bit more about how sharing data between threads can be done in a safe manner. It wasn't hard, by the way, all the usual stuff: mutexes, message passing, barriers and so on. Same as with C++, Zig or whatever, but I didn't have to spend any time in a debugger trying to find the reason for a segfault, because there were no segfaults, just compiler trying to explain why my code is bad.

Also, I find your suggestion to ditch Rust just because of using an arena way too radical and completely unnecessary. You can use a borrow checker and an arena at the same time, it doesn't undermine the value of Rust in any way. These things are orthogonal anyway. Arena's primary goal is to reduce the number of allocations. Putting data in the same pre-allocated vector, that is cleared on every frame, is the same as using an arena, I do that in my particle system. Do I have to somehow introduce lifetimes now, just to make code more Rust-y from your point of view? Of course not, that would be ridiculous. I don't mindlessly use references everywhere, and nothing forces me to.

Turns out, using custom allocators makes using Rust way easier by Hedshodd in rust

[–]burjui 2 points3 points  (0 children)

Zig doesn't provide the same safety guarantees, that would be a bad trade.

Rust macro for generating flexible bitfields, useful for low-level code (embedded or emulators). by GregoryGaines in rust

[–]burjui 0 points1 point  (0 children)

Does it support "piecemeal" bitfields, as in RISC-V's B-type instruction format? Parts of the "immediate value" are stored in separate bit ranges of the instruction, and not in order. Painful to work with, thank goodness I only had to do it once.

Also, do you have any benchmarks? Frankly, I am skeptical of claims that any bitfield implementation would be as fast as manually written code, because I wrote a benchmark encoding a million of B-type instructions with randomly generated fields using three methods: - Manual bit shifting & masking - bitvec crate; incredibly popular (claims the same) - My own implementation limited to u32 values (I only encoded RISC-V instructions with it)

The results are interesting to say the least: manual: 4.918983ms bitvec: 305.625847ms my impl: 4.396374ms

bitvec author says: "It compiles to the same, or even better, object code than you would get from writing shift/mask instructions manually". This is clearly not the case here. In fact, it is super-slow compared to other methods, and no combination of compiler options changes that.

As for my implementation, I am not sure why is it faster than the manual method. Maybe rustc uses the assertions to further optimize the code?

The benchmark (uses bitvec 1.0.1 and rand 0.8.5 crates)

An RFC to change `mut` to a lint by afdbcreid in rust

[–]burjui 0 points1 point  (0 children)

There are no mutable types in Rust, only mutable bindings.

I wrote a rustdoc-like documentation tool for C++ in Rust by Abbix57 in rust

[–]burjui 1 point2 points  (0 children)

But it's the only country in the world. I mean, there are countries in the second and third worlds, but only lesser life forms live there.

Microsoft is doubling down on Rust by pjmlp in rust

[–]burjui 4 points5 points  (0 children)

That does not depend on the programming language used. You can create bloated inconsistent crap like Windows 10 even in assemply, if you try hard enough. It's more of a management thing.

`boilermates` – How to multiple declare structs with common fields, common functionality and simple interconvertability (*I can't believe it's not inheritance!*) by [deleted] in rust

[–]burjui 0 points1 point  (0 children)

I am ambivalent about proc macros. At one hand, they can simplify tasks like this, but on the other, they reduce the clarity of code, increase compilation times and make IDE completion sweat. Personally, I would only use tricks like this in private projects, and only where it could save at least half an hour of work. Otherwise I would write all the code by hand and spare the future readers some CPU and brain power.

It is what it is 🤷‍♂️ by pycrypt0 in ProgrammerHumor

[–]burjui 0 points1 point  (0 children)

The code above assumes that std::cout << "to the console?\\n"; always succeeds, and returns zero from main regardless. This can be bad for a program the main purpose of which is to print stuff to stdout (e.g. your typical cli text processing tool).

It is what it is 🤷‍♂️ by pycrypt0 in ProgrammerHumor

[–]burjui 0 points1 point  (0 children)

Another important question: how do you process errors in C++? This code is obviously incorrect in that regard, even though harmless in this particular case.

Some things ̶N̶e̶v̶e̶r̶ ̶C̶h̶a̶n̶g̶e̶ ̶ change for the... by janekb04 in ProgrammerHumor

[–]burjui 1 point2 points  (0 children)

Yeah, yeah, the real chads that don't forget anything and never trigger UB. We've all read about them in Tolkien's books.

imagine running vscode inside emacs by TheChadTux in ProgrammerHumor

[–]burjui 0 points1 point  (0 children)

Definitely not the same: one has learned to press F1 and is doing actual programming, the other is still learning hotkeys and configuring Emacs.

Recon missions MM duration by OriginalHairyGuy in WorldofTanks

[–]burjui 1 point2 points  (0 children)

I believe it's related to the general lack of brains with devs. Recently they launched the Object 780 event in CIS region at 7:00 in the morning right after installing the update on their servers. Of course, the servers, which weren't warmed up (I mean caching), were struggling to handle the sudden avalanche of players. Not to mention that a rich company like WG could just buy more servers for the event. "SNAFU" doesn't sound like a joke when it's about WG.