News for hackers. Stuff that matters.
Re:Fil-Qt: A Qt Base build with Fil-C experience by fooker on Monday January 19, 2026 @06:47AM (#46677911)
None of these have anything to do to do with memory layout or how data is formatted in the memory. You are arguing a different point than the one being discussed here.

These are fundamentally hacks around the compiler’s inability to understand ownership and lifetimes, at least the way Rust (and C++) are designed.

These exist in Rust because otherwise you would have to use unsafe blocks all the time to write any reasonable code.

Re:Fil-Qt: A Qt Base build with Fil-C experience by timschmidt on Monday January 19, 2026 @06:54AM (#46677963)
Safe threading seems like fully exploiting hardware features to me. That's the biggest thing smart pointers and Rc, Arc, and Cell types enable. Perhaps I could have been clearer.

The comment about memory layout was an additional point that dealing with hardware requires that you format, align, and position information in memory as the hardware expects, which requires either exposing those details, or encoding them in a runtime.

Re:Fil-Qt: A Qt Base build with Fil-C experience by fooker on Monday January 19, 2026 @07:04AM (#46678028)
Safe threading sounds great, as long as the language gets out of my way when I absolutely do not care about safe threading.

I write compilers (and have contributed to the Rust compiler!), and there has been approximately zero times in twenty or so years that thread safety has been a concern.

Re:Fil-Qt: A Qt Base build with Fil-C experience by timschmidt on Monday January 19, 2026 @07:08AM (#46678065)
I write a bit of everything, including a little Rust CAD library which is a continuation of work I did in C++ 20 years ago. The C++ version was never multithreaded. The Rust library was fully multithreaded in an afternoon by importing Rayon behind a cargo feature, and using par_iter in place of iter in a few hot loops. That alone made the rewrite worth it.
Re:Fil-Qt: A Qt Base build with Fil-C experience by fooker on Monday January 19, 2026 @07:24AM (#46678212)
Great, how much faster was this multithreaded version for a real use case?
Re:Fil-Qt: A Qt Base build with Fil-C experience by timschmidt on Monday January 19, 2026 @07:30AM (#46678253)
That afternoon effort on the hot loops netted ~3x improvement on the test suite on an 8 core machine. The test suite is intentionally minimal, so I'd say that represents a reasonable low bound. The greater the number of polygons in an operation, the more it would benefit.
Re:Fil-Qt: A Qt Base build with Fil-C experience by vlovich123 on Monday January 19, 2026 @09:34AM (#46679412)
I don’t buy at all that you’ve coded in a language like C++ and thread safety has never been a concern. Either:

1. You work on esoterically simple problems where nothing is worth threading (implied by you questioning whether it bought any meaningful performance).

2. You code in languages like Rust where it’s not a problem or significantly less of one (Go, Java, c#, Haskell, Ocaml, etc).

You’re being awfully dismissive of people who’s experiences don’t match yours, especially when it seems like your experience isn’t the norm.

Re:Fil-Qt: A Qt Base build with Fil-C experience by fooker on Monday January 19, 2026 @11:52AM (#46681240)
Thread safety has not usually been a concern because it’s pretty rare to use raw threads in C++.

Rust folks always seem to assume people write C++ like it is 1995.

> implied by you questioning whether it bought any meaningful performance

This is the first thing you should always ask when you do anything with parallelism! Are you familiar with Amdahl’s law?

Re:Fil-Qt: A Qt Base build with Fil-C experience by vlovich123 on Monday January 19, 2026 @04:07PM (#46684522)
Whether you use raw threads or not in no way changes the issues around thread safety. And also I’ve worked on a lot of different codebases, from iOS at Apple to Android at Meta, from machine learning to VR video streaming. Claiming that people aren’t using raw threads in C++ a) isn’t borne out by the evidence b) is ignoring the challenges of writing thread safety code. Hell, my team hit a libc++ bug around std::conditional_var.
Re:Fil-Qt: A Qt Base build with Fil-C experience by fooker on Tuesday January 20, 2026 @04:48AM (#46689968)
IOS and related codebases at Apple are not using raw threads unless unavoidable.
Re:Fil-Qt: A Qt Base build with Fil-C experience by LexiMax on Monday January 19, 2026 @06:26PM (#46685999)
> Thread safety has not usually been a concern because it’s pretty rare to use raw threads in C++. Rust folks always seem to assume people write C++ like it is 1995.

What kind of charmed life do you lead to where use of reliable abstractions over threads is common in C++ codebases you touch?

My experience has been the exact opposite.

Re:Fil-Qt: A Qt Base build with Fil-C experience by fooker on Tuesday January 20, 2026 @04:49AM (#46689978)
> My experience has been the exact opposite

Okay, can you try and find a relatively modern large open source C++ codebase that actively uses raw threads?