So the API assumes pointers can't be larger than 64 bit?
So the API assumes pointers can't be larger than 64 bit?
One of the things that jumped out to me about that changes, was that I assume that this will allow for unsafe pointer math. I suppose this is a low level api, but I thought that was an interesting choice.
Not many machines currently, but CHERI has 129-bit pointers (yes, 129), and there's already some work on for instance Rust to be able to work with that (see https://faultlore.com/blah/fix-rust-pointers/ and https://faultlore.com/blah/tower-of-weakenings/), and also on GCC and glibc (https://lwn.net/Articles/909265/), and it's not completely improbable that this becomes more common. Creating a brand-new API today which cannot handle pointers wider than 64 bits seems a bit short-sighted.
See this paper for details: https://www.cl.cam.ac.uk/research/security/ctsrd/pdfs/201904...
2^64 can address over 16 petabytes. I’m not sure when I’ll be working on that scale, but n by the time it happens, Java can introduce new data types like BigLong to handle it.
https://github.com/GavinRay97/panama-liburing/blob/6a80673e7...
In Java 19, there was a notion named MemoryAddress used for “pointers to memory” and function
addresses. In Java 20, MemorySegment::address returns a raw memory address in the form of a
long rather than a MemoryAddress object.You can see that a bit further down below when ".toRawLongValue()" is called:
long iovecs_ptr = fi.address().toRawLongValue() + file_info.sizeof();
liburing.io_uring_prep_readv(sqe_ptr, file_fd, MemoryAddress.ofLong(iovecs_ptr), blocks, 0);
liburing.io_uring_sqe_set_data(sqe_ptr, fi.address());
int ret = liburing.io_uring_submit(ring_ptr);Finally had somewhere to post this obscure project, haha
I thought a potential CPU of the future could have 128 bit "word size" for integer calculations and as a side effect also 128 bit pointers to reuse registers/instructions for both of them (just like today with 64 bit CPUs, indeed you don't need to map the entire address space but pointers are still 64 bit because it's the CPU's word size). And then address space layout randomization in a future OS could choose to map very high address ranges for the process, which can't be represented with Java's long.
More likely: If 128-bit address space really takes off, they can create a new largest integral type long128 that is 16 bytes/128 bits, and either extend the existing MemorySegment, or create MemorySegmentLarge to allow for bizarrely large address spaces, like up to 1024-bit.
Another one that people like to pick on Java about: Arrays are limited to max size of 2^31-1 (non-negative part of a 32-bit signed int). To rephrase your question: <<So the API assumes arrays can't be larger than a 32 bit signed int?>> Yeah, I guess.
Point is, your reply is exactly right. Arrays can't be 64-bit large? Yeah, I guess.
I thought of something like IntPtr in C# (native size int). Although, to be portable, JVM would have to disallow doing pointer math on it, to make IntPtr fully opaque.
Things have gotten exponentially larger in the meantime... with your average home computer going from < 1GB of RAM to 8GB and ever increasingly larger (my cell phone has 12GB of RAM and 512GB of storage for what it's worth).
Having storage ranging in the Terabyte category is simply the norm, and things like Petabytes of storage are rapidly becoming more accessible for average users.
Saying "X is enough" - ever - in computing is foolhardy.
This is not true, no one seriously thought 65 KB was ever going to be any sort of a limit. If you're talking about the Bill Gates quote, it's basically a myth that never happened or was taken WAY out of context. Bill Gates himself has given interview where he talks about the entire state of released and upcoming computers of that time and exactly what everyone thought was going to happen and what actually did happen.
Every time someone in tech has said "that number is large enough", the number gets surpassed in no time.
So while 64 bit memory addresses seems way more than ample today, it will not be forever. That was the point...
It truly is in so many cases. Not stupidity, but perhaps hubris. The same hubris that says nobody will need more than 64 bits today. Given time, 64 bits will fall waste to 128 bits and more.
The people who designed IPv4 truly thought the number of IP's would be more than enough forever. They literally had no concept that one day your average person would own multiple computing devices and require multiple IP's just to get through a normal day. They were very wrong, and found out in only a few year's time.
The only constant in tech is our assumptions today will be wrong tomorrow. Assuming "X" is big enough is foolhardy in just about every scenario.
Every year was another iteration of these limits being updated, no one ever thought any of these numbers were going to stay static. It took 1MB of memory just to have a 24 bit color frame buffer at NTSC resolution.
IP addresses were set at 4 billion when you could print out a list of known computers and put it in a binder and we still use it today.
This idea that people had a general lack of foresight was completely untrue. What people did with limitations like 3,510 transistors is astounding.
That said, I completely agree with your sentiment about "X is enough". What has changed in the last 20 years: When we double RAM/storage/network now, the increase is enormous. It does feel like GPUs are still in the insane growth period. Very soon they will be more powerful and have more on-board RAM than whole rest of the computer.
* As for photons, this estimate finds 4*10^84 photons since start of universe:
https://cosmosmagazine.com/science/physics/how-many-photons-...
Maybe we need to use 1024-bit types?
The size of memory is a power of two because the bits in a pointer have two possible values.
But why do you need the length of a pointer to also be a power of two? Are you addressing the bits in the pointer?
Indeed. The entanglement code will crawl without easy direct addressing of the bits. We wouldn't want the universe to run even slower, would we now? It would also make the development emulator impossible to run leading to even more bugs and missed deadlines.
Plus Panama won’t go stable until Valhalla, which is necessary to actually have a “long long” in the language.
6502: 8-bit registers / 16-bit address space (1975-)
68000: 16 / 24 (1985-1992 then 32/32)
ARM1: 32 / 26 (1985- 32/32 in 1992 and finally 64/64 in 2011)
X86: a complete address space mess but lately 57-bit:
https://en.wikipedia.org/wiki/X86The morale of the story is humans are insecure fragile little creatures, half of us are blind and the other half are pessimists because we can imagine what the truth/future looks like. Lies only last the time you can use energy to hide them.
Anyhow the arch of binary evolution is over; to build a MMU that can adress 64-bits of data is probably impossible with electrons. Just going from 64GB to 256GB is hard and makes things slower! Caches appeared in 1985, so since then the bottle neck has been RAM latency:
https://gettotext.com/largest-ram-bar-in-the-world-consumes-...
The biggest server from Oracle currently has 16 TB of RAM, good luck multiplying that by the difference in energy content per mass difference between oil and uranium (1.000.000x).
And good luck paying your energy bill. 64-bit RAM would consume 5120W * 1.000.000 = 5GW (you want 5x nuclear power plants with that server?)
Personally I'm staying on 32-bit for my ARMv8 cluster, my processes are limited to 4GB RAM each but since I only have 8GB of total RAM there is ZERO difference in switching to 64-bit as it effectively halves the RAM.
I made a comment about the virtual memory space of most desktop CPUs in use. I have no idea what you are talking about, did you mean to reply to me?
Anyhow the arch of binary evolution is over;
I don't think these words together mean anything.
to build a MMU that can adress 64-bits of data is probably impossible with electrons.
It's strange to call something impossible when it has already been done.