Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy Iterators #45

Open
keean opened this issue Sep 16, 2018 · 1 comment
Open

Proxy Iterators #45

keean opened this issue Sep 16, 2018 · 1 comment

Comments

@keean
Copy link
Owner

keean commented Sep 16, 2018

@shelby3 Another C++ mess:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0022r0.html

We need to think about this carefully in light of wanting to use Pony style references. The immediate solution that occurs to be is that we need a special "bit-reference" type that encodes a bit-shift and mask, so you would effectively encode an address, and a start and stop bit range:

struct bitReference {
   *word address,
   int shift
}

where the dereference operation would be:

((*bitref.word) >> shift) & 1

The real reason I think C++ fails, is because it actually uses the concrete dereference '*' directly, instead of implementing Stepanov's Readable, Writeable, Mutable Concepts. With dereference becoming a type-class you can totally avoid proxy iterators. It is probably too big a change with all that code already out there for C++...

@shelby3
Copy link

shelby3 commented Oct 21, 2018

The real reason I think C++ fails, is because it actually uses the concrete dereference '*' directly, instead of implementing Stepanov's Readable, Writeable, Mutable Concepts. With dereference becoming a type-class you can totally avoid proxy iterators. It is probably too big a change with all that code already out there for C++...

Agreed.

The problem is the assumption that a reference type is an address in memory. Instead we need to have a typeclass for operations of reading from and writing to the object referenced.

Section 3 of the paper you linked to notes that abstraction of referencing is also necessary for example when the referenced objects exist across the network, which may very well be the case with Actors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants