r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3]

Andreas
20-Jan-2011
[7195x2]
In another reality, you of course did mutate the value.
Only that it's not of any importance to call what you mutated "value".
Ladislav
20-Jan-2011
[7197]
In another reality
 == depending on the definition used
Andreas
20-Jan-2011
[7198x2]
Yes, exactly.
So, for example, if we talk assembler you would of course use an 
XOR instruction to mutate the new-line bit of the value slot.
Ladislav
20-Jan-2011
[7200]
In my definition, I mutated a value, but it was the block B, not 
1
Andreas
20-Jan-2011
[7201x2]
Yes.
And I think the point why your definition makes a lot of sense is 
that we can neither observe nor does it matter, if the new-line bit 
is modified directly by XOR or a MOV,XOR,MOV sequence.
Ladislav
20-Jan-2011
[7203]
if we talk assembler

 - well, I actually do not have any problem to use the same definition 
 there - if I mutate the memory, I say, that I mutate the memory, 
 not the value it contained
Maxim
20-Jan-2011
[7204]
and what happens when you mutate the memory of the value it contained? 
 nuclear holocaust  ?  ;-)
Andreas
20-Jan-2011
[7205]
And of course I think we also agree, that the new-line bit being 
observably a value attribute is an implementation detail that should 
not leak through either.
Ladislav
20-Jan-2011
[7206]
hmm, but it does leak, as opposed e.g. to the "immediateness" of 
values, which does not leak, in fact
BrianH
20-Jan-2011
[7207]
Yup. That matches what I said. We use the term "immutable" for these 
values because mutations to a value slot don't propagate to other 
value slots, and assigning a value to a value slot makes a copy. 
This is useful when compared to "reference" types, where the "value" 
is not copied, just the reference, so changes to the value are seen 
by other references. In R3 we now have real immutability of value 
slots as an option, but that doesn't affect the "immutability" of 
values that we had before. And for the purposes of reasoning about 
the language using CS methods, the "immutability" of values we had 
before is close enough to be considered a useful distinction.
Andreas
20-Jan-2011
[7208]
Or in Brian's words above, the new-line attribute should not get 
copied over to new value slots when the value is copied.
BrianH
20-Jan-2011
[7209]
I don't see a problem with copying the new-line attribute. Without 
that we wouldn't be able to format our code and make it stick.
Andreas
20-Jan-2011
[7210x3]
I don't see that problem.
Copy the new-line attributes when you copy a container where the 
items' new-line attribute is display significant.
_Where_ the new-line attribute is stored should not leak. The current 
behaviour resulting from the _existence_ of the new-line attribute 
is perfectly fine.
Ladislav
20-Jan-2011
[7213]
What is more serious, though, is the fact, that we have lesser values, 
than possible line break positions
Andreas
20-Jan-2011
[7214]
Brian, as an aside: by "we now have real immutability of value slots 
as an option" you mean PROTECT?
BrianH
20-Jan-2011
[7215x2]
? I'm having trouble following that sentence (no offence intended). 
What do you mean?
Andreas, yes, that is what I mean.
Ladislav
20-Jan-2011
[7217]
[1 2 3 4 5 6] I see seven positions for possible line break(s)
Andreas
20-Jan-2011
[7218]
Does a value slot have a protect bit?
BrianH
20-Jan-2011
[7219x2]
Again, in theory, through the PROTECT bugs are a counterargument.
Value slots of objects can be protected individually. Value slots 
of blocks are protected as a group.
Andreas
20-Jan-2011
[7221x2]
My point would be: are the value slots really immutable, strictly 
speaking, or is there still a mutable protect bit?
Ladislav: Yes, we can't control the new-line at the tail.
BrianH
20-Jan-2011
[7223]
I don't know whether the protection is in the value slot itself, 
but I doubt it because the peotection doesn't propagate when you 
assign the value to another value slot.
Andreas
20-Jan-2011
[7224]
(Ladislav: if that is what you were going at.)
Ladislav
20-Jan-2011
[7225]
Yes
BrianH
20-Jan-2011
[7226]
As an example of the CS tricks that immutability gives us, protecting 
a series should make it safe to share between R3 tasks without needing 
to copy it or synchronize access. That's nice :)
Maxim
20-Jan-2011
[7227]
can we still "unprotect" ?
BrianH
20-Jan-2011
[7228x2]
See the PROTECT bugs. The problem is that once the PROTECT tickets 
are all implemented, we will have a sufficiently capable system, 
but it will be too difficult to use. I think we need to rethink the 
model a little when we do the security/multitasking revamp.
The underlying model is good; the functions are awkward.
Andreas
20-Jan-2011
[7230x2]
Any idea how many bits are currently used for the types attribute?
(In R3, of course.)
BrianH
20-Jan-2011
[7232]
There are currently 56 types that we can see, so at least 6 bits 
rounding up. 8 would be generous.
Andreas
20-Jan-2011
[7233x5]
In the hostkit/extensions we the type as 8-bit byte.
So it probably is less than 8.
(<=)
What's the largest "immediate" datatype in R3?
80 bits for tuple!, 96 bits for money!.
BrianH
20-Jan-2011
[7238]
More than 80 for tuple - it has a length attribute in there somewhere.
Maxim
20-Jan-2011
[7239x2]
AFAIK 96 bits are reserved for immediate values with the 32 bits 
left for flags and stuff.
this was hinted at when the decimal pair was being worked on. IIRC
Andreas
20-Jan-2011
[7241x2]
Would make sense.
Considering that typeset! is supposedly immediate as well, we'll 
probably have 6 bits for the type.
BrianH
20-Jan-2011
[7243]
This is why I mark any suggestion to introduce a new datatype with 
the major flag in CureCode. We have a budget.
Ladislav
21-Jan-2011
[7244]
Considering that typeset! is supposedly immediate as well, we'll 
probably have 6 bits for the type.

 - I do not follow. I my calculations are correct, then the typeset 
 could have 96 bits, which means 96 different types at most. Nevertheless, 
 96 different types would need 7 bits, 6 is not enough.