News for hackers. Stuff that matters.
Re:My gamedever wishlist for Rust by amelius on Thursday October 01, 2015 @11:15AM (#10311704)
Shouldn't it be "gamedevver" instead?

Anyway, on my personal wishlist: Allow customized pointers. For example, if I use a mmapped file that is mapped at a different base address every time it is opened, the pointers within that file are always relative to the base address. I'd like to use "special" pointers inside the mmapped file, that are aware of this. Also, I'd like to use standard data structures (associative arrays, lists, sets) inside the mmapped file, meaning that the solution should be generic.

Re:My gamedever wishlist for Rust by masklinn on Thursday October 01, 2015 @11:28AM (#10311801)
> Anyway, on my personal wishlist: Allow customized pointers.

It's already there isn't it? Isn't a custom pointer just a stack struct implementing Deref (and possibly DerefMut)?

Re:My gamedever wishlist for Rust by devit on Thursday October 01, 2015 @12:18PM (#10312238)
I think this can be implemented on current Rust, although you will have to define specific array, list and sets for this situation.

However, you would probably want a different implementation anyway due to the different performance characteristics of disk/SSD vs RAM.

Re:My gamedever wishlist for Rust by pjc50 on Thursday October 01, 2015 @11:23AM (#10311768)
That's a rather difficult sort of generic type to implement: it would have to include the base address in the type somehow.
Re:My gamedever wishlist for Rust by JoeAltmaier on Thursday October 01, 2015 @11:28AM (#10311803)
Construct ptrs with the base address? At that point, why not just use '+' and be done with it.
Re:My gamedever wishlist for Rust by doomrobo on Thursday October 01, 2015 @11:48AM (#10311974)
Can't you use raw pointers and .offset()? You can put them in a struct that mutates itself for every method call so it keeps track of the mmap. You'd also probably have to make sure that it has exclusive access to the mmap so another thread won't invalidate its pointers.