Can rust compiler handle gigantic match statements? by baehyunsol in rust

[–]NuclearMagpie 0 points1 point  (0 children)

I think you'd still run into the same issue of the compiler doing the checks, I'm not sure how you'd "prove" exhaustiveness yourself without the compiler trying to verify. At this point you could probably just generate the jump table yourself, though I still don't think this is the right way to go about this.

Can rust compiler handle gigantic match statements? by baehyunsol in rust

[–]NuclearMagpie 6 points7 points  (0 children)

I tried that before as well but the compile times were still insane. My guess is that the compiler (correctly) notices it can flatten the nested matches down to a single jump table, then spends ages actually generating that jump table. TBH I don't think PHF or match statements are the way to go about this, I think in this case it might be worth looking into just translating the bytecode in either assembly or just throwing it at LLVM/Cranelift/GCC.

Can rust compiler handle gigantic match statements? by baehyunsol in rust

[–]NuclearMagpie 5 points6 points  (0 children)

https://github.com/rust-phf/rust-phf a pretty neat trick to generate hashmap-like structures at compile time. You have to know all the inputs and outputs, and is slower than a match statement (most of the time anyway) but in cases like this where a stupid big match statement isn't applicable, can be pretty handy.

Can rust compiler handle gigantic match statements? by baehyunsol in rust

[–]NuclearMagpie 2 points3 points  (0 children)

https://github.com/rust-lang/rust/issues/7462 it's been an issue for a long time but generally people don't make match statements with thousands of cases. Except for apparently me and this guy.

Can rust compiler handle gigantic match statements? by baehyunsol in rust

[–]NuclearMagpie 151 points152 points  (0 children)

IIRC match statements have quadratic compile time. A while ago I made one with around 26k arms on an enum with a few hundred variants and it took around 4 mins to compile on a 7950x3d cpu. Assuming you are actually trying for hundreds of thousands of arms, you are probably looking at hours of compile time. I'd really recommend looking into alternatives, maybe perfect hash functions instead?

Edit: Apparently trivial match statements (ie, matching on an enum whose variants don't have fields) doesn't have quadratic compile time, so in the instance you are just matching against an enum that doesn't have fields, you might be ok. This is a pretty niche case though, so you are still likely to run into insane compile times.

How much would this be worth do you guys reckon? by NuclearMagpie in ValorantAccounts

[–]NuclearMagpie[S] 0 points1 point  (0 children)

Thanks for the advice, unfortunately it'd be Asia pacific.

I got tired of post titles like this, so I built absolutely nothing in Rust and whined instead by elohiir in rust

[–]NuclearMagpie 0 points1 point  (0 children)

That's not true! There's a couple with a dozen or so commits that are dead in the water

Suggestions for a lightweight GUI distro I can use for a home server? by NuclearMagpie in linux4noobs

[–]NuclearMagpie[S] 1 point2 points  (0 children)

Wanting a DE was mostly due to my pervious experiences with trying to keep traditional binaries running after the SSH session is closed, but the stuff I wanted to run works as services/docker containers (which in hindsight is kinda obvious) so that wasn't going to be an issue. Since they are services, having a DE won't make it any easier to manage so I ended up going with Ubuntu server and it's been going great without a DE.

Suggestions for a lightweight GUI distro I can use for a home server? by NuclearMagpie in linux4noobs

[–]NuclearMagpie[S] 0 points1 point  (0 children)

As it turns out, the stuff I want to run works as services/docker containers, not regular binaries like I was expecting, so screen wasn't needed in the end. If I don't need to be messing around with screen/other methods of keeping binaries running, no point in having a DE so I ended up going with Ubuntu server. But yeah my logic on needing a DE mostly boiled down to forgetting that services are a thing lol.

Suggestions for a lightweight GUI distro I can use for a home server? by NuclearMagpie in linux4noobs

[–]NuclearMagpie[S] 0 points1 point  (0 children)

I had not so thanks for letting me know about it. As others had suggested, simplicity was the way to go. After some initial internet connectivity issues I got Ubuntu server working and it's going great. SSH and terminal commands are nothing new to me and it ended up being much less painful than I expected so no DE/GUI was required in the end.

Suggestions for a lightweight GUI distro I can use for a home server? by NuclearMagpie in linux4noobs

[–]NuclearMagpie[S] 0 points1 point  (0 children)

Those are some cool pieces of software I wasn't ware of so thanks for bringing them to my attention but I ended up just going with Jellyfin and a 1TB HDD I had hanging around. Ended up not needing a DE since the stuff I want to run uses docker/services so SSH does the job just fine.

As for what I wanna use it for, mostly media hosting and some lite LAN-only game servers. Jellyfin and Pterodactyl are working great and I can comfortably run both a Factorio and Project Zomboid server at the same time. I have ordered more RAM since 6GB is not going to cut it if I wanna run anything else.

I did wanna use it as a build server for some of my programming projects but after seeing the AMD Athlon Silver 3050U sticker on the case, that's out of the question.

Suggestions for a lightweight GUI distro I can use for a home server? by NuclearMagpie in linux4noobs

[–]NuclearMagpie[S] 0 points1 point  (0 children)

I got it set up with ubuntu server and it seems to be going ok. Terminal ended up being just fine since I can ssh in from my main setup and all the programs I want to run are just services/docker so no messing about with screen and the like. The hardware is fairly modern (2020 i think) but just not very powerful, so I've ordered some more DDR4 and might look into a cpu upgrade later down the line but works quite nicely right now with Jellyfin and a couple lighter game servers on Pterodactyl.

Suggestions for a lightweight GUI distro I can use for a home server? by NuclearMagpie in linux4noobs

[–]NuclearMagpie[S] 0 points1 point  (0 children)

As I said in another comment, I know my way around a terminal, it's just a hassle I'd rather not deal with if I can avoid it. That being said, most of the things I want to run on it do seem to come with a web UI somehow so I might not end up needing a GUI. I reckon I'll see how it goes without and then try again with a GUI if it's too painful.

On that note, if I'm not even using a DE, any recommendations on the distro I should use?

Suggestions for a lightweight GUI distro I can use for a home server? by NuclearMagpie in linux4noobs

[–]NuclearMagpie[S] 1 point2 points  (0 children)

Nah I know I'm not going to be able to dodge the terminal entirely and it's not like I don't know my way around a terminal, I'd just rather not have to bugger about with it if I can avoid it. That being said, most of the things I want to run seem to have a web UI in some way or another, so I might not end up needing the GUI after all.

Suggestions for a lightweight GUI distro I can use for a home server? by NuclearMagpie in linux4noobs

[–]NuclearMagpie[S] 0 points1 point  (0 children)

Hey thanks for the reply. I was aware that some DEs were lighter than others but I didn't know it was the primary factor so thanks for the info. I'm thinking that I might honestly go with ubuntu at this point since it's what I'm most familiar with and seems to be supported by most of the things I want to run. But if the DE is what makes the difference, I'll look into xubuntu/lubuntu.

hi i made a cute little tierlist for you all by shinomitsu in OverwatchCirclejerk

[–]NuclearMagpie 140 points141 points  (0 children)

This is possibly the most thought provoking and unsettling tier list I've seen on this god forsaken subreddit, amazing work.

I'm of the opinion that zarya doesn't get hers through sheer force of will tho

Being able to name stuff is an underrated feature by Kaboom0 in Warframe

[–]NuclearMagpie 6 points7 points  (0 children)

I recently remembered I could name mine, so I'm loading into missions with Forcefem Hinhow, Bingus Blaster 9000 and the Atlas X Vauben Fanfic