China is very much repeating the history of Japan, and while we can argue how democratic Japan was in the second half of the XX century it definitely wasn't totalitarian.
On Intel 286 we had a 16-bit machine word and 24-bit addresses. A pointer wasn't just two machine words concatenated - the upper 8 bits were stored somewhere else - a segment register.
On modern machines we don't (usually) need to consider this because we have a single linear virtual address space, though the size is architecture dependant - usually above 40 bits and below 64. Most common size is 48-bits, but also up to 57-bits with 5 level paging enabled.
Either way we round up to 64-bits to store the pointer as one integer. C optionally provides types `intptr_t` and `uintptr_t`, which are integers large enough to hold the value of a pointer. Converting a pointer to `intptr_t` and back to the pointer type results in a pointer that compares equal to the original.
However, there is no guarantee that a pointer converted to `intptr_t` and back to a pointer can be dereferenced! It works most of the time because of our linear address space and non-use of segmentation, but segmentation can still be used - the FS and GS segment registers are still available on x86_64 and are commonly used for thread local storage. If you take a `thread_local T*`, convert it to `intptr_t`, and then convert it back to a `thread_local T*` on another thread and attempt to dereference it, then despite the pointers comparing equal, they dereference to different virtual addresses.
Integers tied to the size of a pointer would have been misguided. Pointers are not integers! (They just happen to use an integer in their representation).
Another one, `size_t` is supposed to represent the maximum size of any object. However, that's also not well-defined. The maximum object size on the Intel 256 would have been 16-bits, because that is all you can fit in a single segment.
On a modern machine, a `size_t` should really be 48-bits (4LP) or 57-bits (5LP), because we can't have an object larger than our maximum virtual address size - but `size_t` is typically 64-bits.
Yeah, but my point is that two pointers can compare equal but point to different addresses, thus it's not necessarily a safe operation to dereference a pointer cast from `intptr_r`.
I don’t know what you mean, if you take the address of a thread local variable you get a regular pointer which is just as safe to dereference as any other pointer, cast through intprt_t or not?
A `thread_local`'s actual virtual address is not merely what the pointer contains - it's an offset from some other virtual address stored in the FS or GS register (on x86-64), which is swapped when you change thread. Casting the pointer to `intptr_t` does not retain the segment base address - only the offset. The pointer is not the absolute address.
If you dereference in another thread, it's the same offset, but from a different base address.
There may be other things besides segment registers on other architectures that also make it unsafe. The C standard makes no guarantee that you can safely dereference a pointer cast from `intptr_t`.
I’m sorry but this is just incorrect. When you take the address of a thread local variable you have to lookup its real address using something like __tls_get_addr or by reading its offset via fs/gs but once it’s in a pointer it’s just a regular absolute address and is fine to dereference on any thread. There is no separate type for a pointer to a thread local variable.
That's an implementation choice. The standard makes no such guarantees.
> An integer may be converted to any pointer type. Except as previously specified, the result is implementation-defined, may not be correctly aligned, may not point to an entity of the referenced type, and can produce an indeterminate representation when stored into an object
The compiler may specify otherwise. GCC specifies that the pointer cast to integer back to pointer must point to the original object, else the behavior is undefined.
It turns out that you don't want integers the same size as a pointer because somebody might squirrel away capability bits in your pointer type (see CHERI) and you definitely do not want integers with capability bits.
Rust originally says that its types usize and isize are the same size as pointers, but this was ret-conned in later Rust to say actually they're the same size as addresses for this reason.
> Our power on the world stage will decrease, our infrastructure will start to be neglected due to lack of investment, quality will diminish in most areas…
We absolutely, 100% do. Not everywhere, just like it isn't universally true in the US, but it definitely is a choice that many in Europe have. We just aren't chained to a car even in this case, public transport is still great even if you don't live in the city center.
It might be great where you are but it definitely isn't where I am in Norway, nor was it in quite a few of the rural places I visited in the UK this summer.
> I don't see other nations reproducing the French institutions
Gaullism and strong governments are not in fashion these days. The main thing that made Messmer plan work was Messmer himself, a strong leader with the power to tell everyone to stfu and do it.
This world has 8.3 thousand thousand thousand humans in 2026. With such mindnumbly vast population, and our feeble primate brains (see Dunbar's number) limiting us to relate to about 150 people, I don't think it's fair to ask for names, intimate or not.
Nevertheless it's certain that there has to be people alive who saw a complex problem and simplified it 10x, even if the solution never got out of their local sphere. Solutions that you and me would implement with automation and sensors, people in developing countries would find a way with less technology or resources. Even our current systems seem needlessly complex and overengineered compared to when hardware was a limitation.
If you want to think about needless complexity being everywhere, take for example the simplicity of the Internet, made when hardware was limited, against modern monstrosities like Bluetooth, now that we can just throw more hardware at problems.
99.9% of humanity don’t derive meaning from their work, sad but true. They don’t care if their life has meaning, if their work is actually valuable etc.
HN just selects for the latter who care. Yes it’s probably much harder for those who care to have a meaningful life in the presence of LLM’s unfortunately.
reply