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

World: r3wp

[!REBOL3]

BrianH
26-Nov-2010
[6299x2]
I'm sure that you had other objectives as well when you got involved 
in the most recent parse project 6 or 7 months after it started. 
Were you involved in the first round of parse proposals about 6 years 
ago? I remember Gabriele making a page for them after they had been 
discussed for a while, but not whether the initial discussions were 
here or on the mailing list.
Your recent work on the project has been much appreciated.
Ladislav
27-Nov-2010
[6301x4]
To be concrete, the resons, why I objected to "drastic" were:

1) R2 parse rules work in R3

2) R3 parse rules either work in R2, or can be translated easily 
to R2 (using e.g. the

http://www.rebol.org/view-script.r?script=parseen.r

functions)


Thus, everybody - don't be afraid of any "drastic" changes, nothing 
you learn or prepare in R2 will be lost, in fact.
When I look at the parse project, I see these changes as very useful:


1) the FAIL keyword - has been used as an idiom and proposed before 
the parse project started

2) the NOT keyword - has been used as an idiom and proposed before 
the parse project started
3) the AND keyword - a new and useful addition

4) the QUOTE keyword - used as an idiom and proposed before the parse 
project started

5) the REJECT keyword - a new and useful addition allowing to stop 
a parse cycle with a failure

6) the IF keyword - used as an idiom and proposed before the parse 
project started


As far as other improvements are concerned, I do not find them useful, 
and do not plan to use them, in fact. (YMMV)
When I look at the REJECT keyword - the FAIL idiom was used frequently 
before to obtain exactly the REJECT effect
As far as the speed statements go, I perceive them too inconcrete, 
and, therefore, misleading.
Steeve
27-Nov-2010
[6305]
My 2 cents. 

It appears to me that the new RETURN command is underated currently.
It can compete in many places with idioms involving FIND + COPY.
Ladislav
28-Nov-2010
[6306x2]
This result looks quite unbelievable to me:

>> time-block [quote (x:)] 0,05
== 1.983642578125e-7

>> time-block [first [(x:)]] 0,05
== 2.46047973632813e-7

, how is that possible?
(the only reason, that looks probable to me is, that FIRST calls 
PICK...
Steeve
28-Nov-2010
[6308]
You're right, FIRST and LAST call PICK
I discovered it while writing  my first scheme in R3.
BrianH
28-Nov-2010
[6309x3]
That was done to make datatypes and schemes easier to implement and 
more consistent, and because we dropped reflection with ordinals.
I agree Steeve, and use PARSE RETURN a lot in adhoc code. I use all 
of the new addidions quite a bit, except for REJECT, which I had 
forgotten existed (don't remember the proposal for it).
addidions -> additions
Pekr
28-Nov-2010
[6312]
There was one wiki/doc/blog/curecode page, describing differences 
between various possibilities of copying or not stuff during e.g. 
object construction. Could someone help me to find it? I would like 
to re-read it ...
Kaj
28-Nov-2010
[6313x2]
It's on rebol.net, so down, but the bookmark I have was
http://www.rebol.net/w/index.php?title=Copy_Semantics&redirect=no
Andreas
28-Nov-2010
[6315x2]
rebol.net is up again, at the moment. In case it is done when you 
try to follow the "copy semantics" link, Yahoo has a copy cached.
down*
Jerry
29-Nov-2010
[6317]
Have we had REBOL 3 for 64-bit OS yet?
Kaj
29-Nov-2010
[6318]
Don't think so
Jerry
29-Nov-2010
[6319]
I ran out of memory using R3 because of a huge map!. I was doing 
a Chinese social-network-graph analysis. If R3 supports 64-bit OS, 
I will have the 64-bit HW, 64-bit OS, and 8 GB RAM  ready. Too much 
data to analysize, too less memory.
Henrik
29-Nov-2010
[6320]
interesting :-)
Kaj
29-Nov-2010
[6321]
Indeed :-)
Jerry
29-Nov-2010
[6322x2]
Actually, Sharp phone using our Tapas OS (which is based on Android) 
is shipping in China. (http://www.udeek.com/archives/628) I hope 
that R3 with View can be port to android soon.
So I can introduce it to Chinese mobile phone users.
Ladislav
29-Nov-2010
[6324]
Jerry, have you considered to put your wish to CureCode?
BrianH
29-Nov-2010
[6325]
Yes, please! I am glad that someone has finally run into the 32bit 
memory limits in R3 with real code rather than just test code :)
Ladislav
29-Nov-2010
[6326]
Nevertheless, there may be a problem with a map! hash limit, so, 
I am not sure, that just a simple solution would suffice
BrianH
29-Nov-2010
[6327]
We already resolved that problem earlier - maps rehash with a bigger 
limit when they run out of room now. All we need to do is provide 
Carl with an appropriate number of items to hash, where Ladislav 
would know what I mean by appropriate.
Sunanda
29-Nov-2010
[6328]
R2 would populate the block below with 200 (or so) random values.
R3 populates it with one value replicated 200 times.
Bug, nasty gotcha, or inexplicably elegant feature?

    random/seed now/time/precise
    blk: copy []
    loop 200 [append blk random/secure "abcdefghi"]
    print length? unique blk
    == 1    ;;R3's result (a110)
Andreas
29-Nov-2010
[6329x5]
R3 64-bit wish added to CureCode:
http://www.curecode.org/rebol3/ticket.rsp?id=1785
Sunanda: RANDOM of a series in R3 modifies the series and returns 
a reference to the modified series.
So you append the same series 200 times to blk, and also shuffle 
this series 200 times.
So the behaviour you observe it's just another instance of missing 
COPY" :) `random/secure copy "abcdefghi"` will work as expected.
And yes, that is an incompatible change in R3 over R2. RANDOM in 
R2 was not modifying a series argument.
BrianH
29-Nov-2010
[6334]
I expect that it was because we are trying to make R3 more efficient, 
so it is left up to the developer to decide whether a copy is appropriate 
rather than just assuming it is. But yes, incompatible, and without 
a change in function name, just like we rejected for UNIQUE and the 
other set functions. Oh well.
Andreas
29-Nov-2010
[6335x2]
Actually a good example of how arbitrary those "efficiency" decisions 
can become.
As we could also choose to optimise for efficiency of the copying 
RANDOM.
BrianH
29-Nov-2010
[6337x2]
It's not so bad when they are documented, at least in CureCode, but 
that particular change seems to predate CureCode by at least a year. 
And predate PROTECT, hence the bug with that.
I understand that there are limits to how efficient you can make 
copies. Making a copy is itself an inefficiency, since efficiency 
isn't just a CPU thing, memory usage matters too. However, this might 
not work as well when we are making a lot of series non-modifiable 
not just for protection, but in theory to make them sharable without 
conflicts. I'll put my concerns in the ticket.
Pekr
30-Nov-2010
[6339x6]
Can we consider R3 being mature enough, to ask general R3 questions 
here? Or should we setup R3 Core (or Core R3) group?
I tried to look into Rebol Tutorial request for the JS 'prototype 
like functionality:


http://stackoverflow.com/questions/4272018/does-rebol-really-have-an-equivalent-for-javascript-prototype-property
Of course his speed claims are relative. I added some reaction to 
show how to extend objects, but studying JS prototype documentation, 
I wonder if something like that would be possible to simulate using 
REBOL? I know that we can have sub-objects shared/referenced. But 
JS Prototype is not just that - it is not about classes. It is more 
about the ability to have linked objects, and when querying a value, 
it is being looked-up down the road:

obj/value 


If 'value is not found in the object, then JS looks down to obj/prototype/value. 
And 'prototype here can be referenced from different constructor. 
I think, that it is similar to find/deep, but with simple/single 
accessor.
More is here - http://mckoss.com/jscript/object.htm
Generally I remember two enhancement requests in REBOL:


- find/first - from the list of objects find first one matching the 
query

- find/deep - look-up in nested structures. Most probably blocks 
were meant, so not sure it would work for objects ...
Any ideas if some enhancement request would be helpful (e.g. to allow 
JS 'prototype simulation) in that regard, to get us more flexibility? 
I am more interested in practical usefullness, than in some over-complicated 
object/class system ....
Cyphre
30-Nov-2010
[6345]
I wonder what is difficult to simulate on the JS prototyping? IMO 
it is possible to do it easily in REBOL.
Ladislav
30-Nov-2010
[6346]
Why do you bother to try to help Tutorial translate a non-working 
code example?
Oldes
30-Nov-2010
[6347]
It is working example.
Ladislav
30-Nov-2010
[6348]
OK, but then it is a trivial example, as I see it