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

World: r3wp

[!REBOL3-OLD1]

Pavel
9-Feb-2009
[10946]
Brian you must be looking over the Carl shoulder :)
BrianH
9-Feb-2009
[10947x2]
The only thing I could dispute would be the "huge" part. References 
wouldn't necessarily need to be stored as full 64-bit integers if 
there is an index, so there could be even more space savings, though 
speed would be king for RIF I expect. In any case I expect much more 
space savings than REBOL text syntax.
As for looking over Carl''s shoulder, I've been more following the 
process and discussions. If you know the REBOL semantics and have 
experience implementing this kind of thing yourself, the big picture 
is obvious. Carl's better at this than I am though - I can only guess 
so far.
Steeve
9-Feb-2009
[10949x2]
B: next A: "blabla"

A (contains a logical reference) --> (physical reference)-->"blabla" 
(value)

B (contains a second logical reference to the same physical reference) 
--> 

if "blabla" is expanded the physical reference is modified and "blabla***" 
is stored in another one place.
The references in A and B are not modified.
That why i said there is 2 indirections (2 references)
but perhaps i use wrong words to explain
BrianH
9-Feb-2009
[10951]
I was only disputing "huge", not the rest.
Steeve
9-Feb-2009
[10952]
ok
ManuM
10-Feb-2009
[10953]
Sqlab and Steeve: Thank you for the user-agent issue
Pavel
10-Feb-2009
[10954]
Steeve small typo in your idx.r missing " in the end of line 266 
starting with  "; (notice that binary data.. otherwise works!
Steeve
10-Feb-2009
[10955]
ah ! thanks
Kaj
10-Feb-2009
[10956x2]
Thanks, Brian. Thatīs important info for my optimisation considerations
When surplus memory is preallocated for a block, is the block still 
initialised at the start of the memory or somewhere in the middle?
Steeve
10-Feb-2009
[10958]
one more question: when a value is removed inside the block. Is always 
the tail which is moved, or the head can be also ? (depending of 
the nearest one)
Pavel
10-Feb-2009
[10959x3]
Theoreticaly empty space may be in the middle, that is question of 
implementation with influence to performance of course (and diference 
betwen block, hash, list, map etc.)
diference= performance difference
ie shuffle data or pointers only
Steeve
10-Feb-2009
[10962]
Pavel, i'm talking about the new implementaion of blocks in R3 (it 
was addressed to Brian). There is no empty space in the middle of 
a block, never.
Pavel
10-Feb-2009
[10963]
I have no clue about low level implementation of blocks, but if it 
would be double linked list (from C algorithm POV) it wpould be possible, 
but you are right, doesnt mention it
Steeve
10-Feb-2009
[10964]
The double linked lists was used to implement list! type in R2, not 
blocks.
Pavel
10-Feb-2009
[10965]
OK
BrianH
10-Feb-2009
[10966]
I'm afraid I don't know more about R3's blocks than I've already 
said here - for more, ask Carl. That optimization sounds sensible, 
Steeve, but I don't know whether it is implemented, or what the performance 
tradeoff would be.
Pavel
11-Feb-2009
[10967x2]
Brian, Vector datatype can't be expanded or appended, ie the size 
is fixed in the moment of creation, for use as fix lookup maybe good, 
practically not, it is kind of series and should behave similarly
IMO
Steeve
11-Feb-2009
[10969x2]
there is lot of missing features related to vectors (find, mold, 
to binary!, etc...) It should have the same capabitilies than other 
series...
they are clearly not finished, it's not bugs
Rebolek
11-Feb-2009
[10971x2]
Some are missing features, some are bugs. For example, this one:

>> v: make vector! [- decimal! 32 100]
== vector!

>> v/0: 0
== 0

>> v/0
== 49151558502227733
Or this one:

>> v: make vector! [+ integer! 16 100]
== vector!

>> v/0: 20
== 20

>> v/1: 100
== 100

>> first v
== 100


See? I said that introducing zero based series in REBOL is not good 
idea :)
Pekr
11-Feb-2009
[10973x2]
I don't like Zero based indexing too. We are imo opening can of worms 
here.
I really don't understand, how guys might like new 'pick behaviour. 
The example given looks like very bad desicion was made. Why was 
it added? To enable various forms of loops over series?
Henrik
11-Feb-2009
[10975]
Pekr, read my response in the blog post.
Rebolek
11-Feb-2009
[10976]
Yes Pekr, this has nothing to do with zero based indexing. Series 
are still one based:
>> b: [a b c d e]
== [a b c d e]

>> b/1
== a

>> b/0
== none
Henrik
11-Feb-2009
[10977]
What we need to worry about is clarity of how each series type behaves 
with the series functions (as uniformly as possible) and fixing the 
bugs for AT on blocks and PICK on strings.
Pekr
11-Feb-2009
[10978]
Rebolek - but that is weird, isn't it? So b/-1 will return some word, 
while pick b -1 will return another?
Henrik
11-Feb-2009
[10979]
Pekr, both kinds behave identically here.
Pekr
11-Feb-2009
[10980]
Henrik - I am referring to Carl's proposed change to 'pick. Is it 
already implemented?
Henrik
11-Feb-2009
[10981]
Yes, it's been like this for some time, I believe.
Pekr
11-Feb-2009
[10982]
I will accept anything, as I hope Carl, BrianH etc. are very clever 
guys :-) I would just like things to be consistent. So when blog 
introduced some change, I would like to know also how functions like 
index? etc will behave ...
Rebolek
11-Feb-2009
[10983]
Pekr, [pick b 1] behaviour is not changed:

>> b: [a b c d e]
== [a b c d e]
>> b: skip b 3
== [d e]
>> b/0
== c
>> pick b 0
== c
>> b/1
== d
>> pick b 1
== d
>> b/-1
== b
>> pick b -1
== b
Pekr
11-Feb-2009
[10984]
You are right, those functionalities behave consistently. I probably 
need some "rebol philosophy" explanation for such stuff. Why e.g. 
head is at first series element, and why tail occupies one past last 
series element, etc.
Rebolek
11-Feb-2009
[10985]
the change is that -1 from R2 is now 0. This is logical imo.
Pekr
11-Feb-2009
[10986]
Rebolek - the thing is, that with REBOL, there is no 0th position.
Henrik
11-Feb-2009
[10987]
But there is in math.
Rebolek
11-Feb-2009
[10988]
the indexes in R2 were ...-3,-2,-1,1,2,3... now it's -3,-2,-,1,0,1,2,3
Henrik
11-Feb-2009
[10989x2]
When zero is added, the math for calculating offsets becomes simpler. 
Less code.
(but this is not zero-based indexing. it's not the same thing.)
Pekr
11-Feb-2009
[10991]
I have to think and come up with example, when you use index? something, 
to get your position, I think that then the change shifts the calculation 
in such a case...
Rebolek
11-Feb-2009
[10992]
Exactly, Henrik.
Henrik
11-Feb-2009
[10993x2]
Pekr, I don't know if it makes a difference, because INDEX? seems 
to be used only on positive values. Can INDEX? return negative values?
From what I see here, it can't, so it won't make a difference.
Pekr
11-Feb-2009
[10995]
I remember, in the past, to use index? heavily. But back then something 
like blk/:value was not possible. Can't find any example or use case 
where it could fail ... so it might mean, that current behaviour 
will not harm any code ...