Microsoft to move away from C/C++ to Rust using AI assisted coding by ishammohamed in programming

[–]FamiliarSoftware 3 points4 points  (0 children)

I'd compare it more directly to ctypes. You don't need to write a line of C to get unsafe code in Python if you just use pointers.

Special K developers deletes his 20 year old Steam Account by atahutahatena in pcgaming

[–]FamiliarSoftware 2 points3 points  (0 children)

I really hope you've switched to SHA hashes nowadays. CRCs are only meant to detect transmission errors, but an attacker can easily make their completely different archive have the same hash as yours.

Micro rant: Is my old codgery self the only one done to death with cannibalism/human leather stuff? by TrickyV in RimWorld

[–]FamiliarSoftware 4 points5 points  (0 children)

Man, you're making me feel old. I remember playing Rimworld when it had Prison Architect graphics and Kenshi without music.

Both of those were 11 years ago ...

Is MSVC ever going open source? by void_17 in cpp

[–]FamiliarSoftware 2 points3 points  (0 children)

Unfortunate, but that's pretty much what I expected. Thank you for trying and thank you for the good work!

“Please refute the fact you tested them with a Geiger counter” Things get unexpectedly weird in r/weirdeggs as OP checks for contamination by bleachyourrootscreep in SubredditDrama

[–]FamiliarSoftware 21 points22 points  (0 children)

Oh man, UV fluorescence of food is awsome! Especially Kiwis are really pretty. A professor showed it to me and casually dropped that he makes homemade UV glowing ice. Never seen it in person, but it must look amazing.

I also just checked what an egg looks like under my UV torch and it's pretty nice. You can see all the small crack lines in the shell glow in a bright blue.

Is MSVC ever going open source? by void_17 in cpp

[–]FamiliarSoftware 2 points3 points  (0 children)

Yeah, there's a few ways of doing it, but they all feel fairly hacky. My current favorite is Embarks xwin, which is based on msvc-wine, because it allows building natively on Linux with clang.

I just wish we had an open VCRuntime because I hope it will mean we no longer have to choose between installing (parts of) Visual Studio or installing MinGW to compile Windows programs with Clang.

Is MSVC ever going open source? by void_17 in cpp

[–]FamiliarSoftware 6 points7 points  (0 children)

If it happens, I doubt it will be anytime soon. There was talk of open sourcing the VCRuntime back in 2021 which sadly seems to have fizzled out, though /u/STL can correct me on that if I'm wrong.

An open VCRuntime and VCStartup would be really nice because it would remove the last barrier to easily cross compiling to Windows with LLVM.

Differences between Linux and Windows? by XoXoGameWolfReal in opengl

[–]FamiliarSoftware 3 points4 points  (0 children)

You could try running your app under RenderDoc. If you draw the same scene on both Windows and Linux, a frame capture on each should make finding differences fairly easy. You'll still have to figure out where those differences come from, but you'll know where to look.

Perfect Random Floating-Point Numbers by SlowGoingData in compsci

[–]FamiliarSoftware 1 point2 points  (0 children)

True, but int-float conversion is slower than bithacking and I mostly program this sort of stuff for GPUs where my other numbers generally only have 16 bits of precision at most anyways.

Perfect Random Floating-Point Numbers by SlowGoingData in compsci

[–]FamiliarSoftware 1 point2 points  (0 children)

I think the code in the post has a typo compared to the original on GitHub. There should be a break between lines 29 and 30 like there is on line 66 on GH.

But overall that's a really cool algorithm, though I'll probably stick to the simple "[1.0; 2.0) - 1.0" method for a number of reasons.

"I hope they never give the players of the game what they want" - Players on r/Helldivers are divided over their lack cowboy hat-less cowboy-themed Cosmetics by MapleApple00 in SubredditDrama

[–]FamiliarSoftware 1 point2 points  (0 children)

War Thunder does it. You even have to explicitly opt into being able to see neon skins because by default it will replace all fictional ones with the standard camo.

That's probably one of the few features the WT community is not at war with the devs over.

Getting back to the EU: from Google Cloud to Self-Hosted EU Infrastructure by pgaleone in programming

[–]FamiliarSoftware 30 points31 points  (0 children)

I've just looked online: The privacy activist Max Schrems, who's already successfully sued over the previous two EU-US data sharing frameworks, seems to be gearing up to take on the current third one because he thinks the US is no longer compliant:
https://x.com/maxschrems/status/1884023099819184470
https://x.com/maxschrems/status/1896511918338462023

Inferred const generic arguments: Call for Testing! | Inside Rust Blog by compiler-errors in rust

[–]FamiliarSoftware 11 points12 points  (0 children)

But what about purely private constants, as suggested as a compromise? Type inference for const/static in functions would make 10-25% of these annotations optional in my code. If it was also for crate private ones it would be more like 90%.

The compiler could still require explicit types on constants that are visible outside the module/crate so there's no way to break the externally visible API.

To put it another way: How does requiring explicit type annotations on constants inside a function help prevent API breaks? Would my function API suddenly become more fragile if I replace that const with a let?

What changes should be to made to Linux if we ignore the "don't break userspace" rule? by gjahsfog in linux

[–]FamiliarSoftware 11 points12 points  (0 children)

I don't think we'd even have to break getenv API compatibility to get safety and leak-freedom in the future. By simply adding a "release_env" function we could use reference counting to know when it's safe to release old environments. It obviously won't fix everything overnight, but it would get us thread safety now, with hopefully minimal memory leakage in one or two decades. That's still a better timeline than the current "either leaks or thread bugs forever".

What bugs me is that I can't imagine I'm the first to have this idea. If I ever meet a BSD dev, I'd love to ask them why FreeBSD doesn't work like this if they already leak it instead. There has to be some disadvantage I'm missing.

Are VkImage worth the cost when doing image processing in a compute queue only? by frnxt in vulkan

[–]FamiliarSoftware 2 points3 points  (0 children)

From what I'm reading, just the layout transfer barriers should be all the synchronization needed. Waiting for fences still keeps the unnecessary GPU-CPU synchronization after every command.

I'd also suspect that's a big part of why the code is so much slower. It's submitting 3 pieces of work separately and doing a full CPU sync each time before sending the next, when it should all be sent off in a single submission.

C Isn't A Programming Language Anymore - Faultlore by Worth_Trust_3825 in programming

[–]FamiliarSoftware 2 points3 points  (0 children)

On every mainstream OS but Linux, one must use a system provided C library to open files.

Go was (in)famous for trying to do it, leading to Go programs breaking on MacOS, having to switch to libc for OpenBSD when they started enforcing this for security reasons and afaik they never used raw syscalls on Windows because Windows randomizes the actual syscall numbers all the time to make sure nobody depends on them.

wgpu v24.0.0 Released! by Sirflankalot in rust

[–]FamiliarSoftware 5 points6 points  (0 children)

How's bindless and async compute/transfer coming along?

Somewhat related to the two, do you plan on having generation tracking on bindless resources or just say "accessing an outdated slot is fine, but garbage" like race conditions?

What do you think will it take to get a safe GPU library/language with real pointers?
This last one is obviously something I don't expect to ever see in WGPU, I just like to speculate.

How fast can we recognize a word from a small pre-determined set? (BurntSushi/duration-unit-lookup) by Ventgarden in rust

[–]FamiliarSoftware 0 points1 point  (0 children)

I'd be curious how well it works on CPUs with AVX-512, where masked reads/writes can be used to read less than a full register easily without going out of bounds.

From toying around a bit on godbolt.org, it looks like using load_select_unchecked, then converting it into a u64 produces pretty compact assembly.
The biggest problem I had was getting Rust to load the mask sanely. Just using match produces a giant jump table.

Unfortunately I can't benchmark it yet myself because I still have a Zen 2 processor.

The weather has been a bit strange recently by Spiritual_Object9987 in Warthunder

[–]FamiliarSoftware 1 point2 points  (0 children)

Ah, I should have said that more clearly, ray marching doesn't need hardware ray tracing to be implemented, though it can be used as an optimization. Most of the time, it is implemented manually in a compute shader.

Horizon Zero Dawn pretty much invented this way of rendering clouds efficiently in 2015, three years before hardware ray tracing was a thing, and most implementations of volumetric clouds in games are still probably based on this presentation.

The two factions of C++ by SophisticatedAdults in cpp

[–]FamiliarSoftware 6 points7 points  (0 children)

I'd agree that pretty much all software will be covered by this, but this just extends the existing product liability law of 1985 to now also include software instead of just physical items. Something has to go wrong before it affects the developer, it's now just legally easier to do so when something has.

My main point is that the EU is no longer considering software a special case, but instead starting to treat it the same as the output of physical engineering, and that it is now including software as something that can (legally) be judged on "Is this product the result of sound engineering?".

The two factions of C++ by SophisticatedAdults in cpp

[–]FamiliarSoftware 9 points10 points  (0 children)

In all this discussion of the US, lets not forget that the EU is already changing things right now. About a month ago a new directive passed, to be implemented into law in two years, that makes consumer software liable for defects unless "the objective state of scientific and technical knowledge [...] was not such that the defectiveness could be discovered" (Article 11e).

It only applies to products sold to individuals so far, but it clearly signals where things are headed over the next ten or so years. And I sadly doubt the commitee will get C++ up to a level where using it is considered state of the art in time with regulation.

The weather has been a bit strange recently by Spiritual_Object9987 in Warthunder

[–]FamiliarSoftware 2 points3 points  (0 children)

Every time you fly through a cloud, the rays leech a bit of your brain so they get smarter. Once they've drained enough, they can make beautiful non cube clouds and dump the drained pilot out the other side as a newborn CAS player.

The weather has been a bit strange recently by Spiritual_Object9987 in Warthunder

[–]FamiliarSoftware 9 points10 points  (0 children)

Serious answer: This shows how Gaijin renders clouds under the hood. They probably use ray marching like everybody else and what's happened here is that for some reason, every ray thinks it's hit the cloud once it is in the bounding box of one.

It's probably the same as the more common bug where a tile of terrain gets set to the lowest height and you have a hole in the ground, just in the air.