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

World: r3wp

[!REBOL3-OLD1]

btiffin
26-Mar-2008
[5812]
Note; with the recent blog post; this basic-test-engine.r  may wel 
become part of the build-basic-test-engine-scripts.r reflective test 
generator.  As Carl points out; these are not better than human written. 
 They may cover more bases but still require a lot of attention to 
detail.   My interest in all this is mainly to keep Carl and RT away 
from the potato peeling work, freeing them for building new things. 
 :)
Graham
27-Mar-2008
[5813x2]
Are we going to see a 'currentpoint type of word for 'draw in R3? 
 something that will tell us where we are on the drawing surface?
This is for using draw to do a print preview.
Gabriele
28-Mar-2008
[5815]
where we are
 - do you mean in rich text?
Graham
28-Mar-2008
[5816]
Not necessarily.  If using AGG fonts, I want to know where I am so 
I can calculate how much space I have left on a line.
[unknown: 5]
28-Mar-2008
[5817]
Can someone set me up an account for R3-Alpha?
Gabriele
29-Mar-2008
[5818]
graham, that is in rich text then. i want access to metrix, text 
bounding box, and so on. hopefully we'll get that eventually.
Jerry
30-Mar-2008
[5819]
Reflection in REBOL 3.0 http://rebollovesjerry.blogspot.com/2008/03/reflection.html
, For English version of this article, hit the "Google Translate" 
Link in the page.
Henrik
31-Mar-2008
[5820]
the first OSX version of R3 is released internally. it's currently 
only for unicode testing purposes, so there is no networking or graphics 
yet.
btiffin
15-Apr-2008
[5821]
While feeling stupid giddy today, starting working on the Zen of 
REBOL.  But
>> import 'this
doesn't have the same Zen oomph as
>>> import this
maybe I'll leave it alone.
LuisE
16-Apr-2008
[5822x2]
can anyone help , im new to rebol. im trying to pass a value to a 
function but i get a path error. why? ex. somefunc: func [x] [print 
series/x]
and use it to read a value in a series somefunc 1
Sunanda
16-Apr-2008
[5824x2]
This may be what you want:
   series: ["a" "b" "c" ]
   somefunc: func [x] [print pick series x]
   >>somefunc 1
   == a
This works in recent versions of REBOL:
   somefunc: func [x] [print pick series/:x]
note the ":" before the "x"
Pekr
16-Apr-2008
[5826]
series/:x or series/(x)
Sunanda
16-Apr-2008
[5827]
oops -- remove the 'pic from that second example:
    somefunc: func [x] [print series/:x]
LuisE
16-Apr-2008
[5828]
thank you that worked the .x didn't but the (x) did
BrianH
16-Apr-2008
[5829]
It wasn't a .x, it was a :x in his example - try that.
LuisE
16-Apr-2008
[5830x2]
that works too
thanks
BrianH
17-Apr-2008
[5832x2]
This was in response to a question from Jerry: And what is "the new 
behavior of function!" that you mentioned?
Cross-posted by request.
Jerry, R2 just had one kind of context (2 if you include the autoexpand 
context used by system/words). Functions, objects and USE all used 
this type of context, and words were bound to this kind of context. 
A function! in R2 is bound to one of these contexts, which gets reused 
when the function is called. When the function is called recursively, 
the value block of the context is pushed on a stack but the context 
is reused - this is the main reason R2 could never be thread-safe. 
The only difference that object! contexts have over function! or 
USE contexts is that the word 'self is added to them.


In R3, there is at least one more context type: stack-relative, which 
is used by the function! type. All of the words bound to a function! 
resolve their bindings relative to the context in the executing stack 
frame, rather than directly. When a function! starts it allocates 
a context on the stack; when it ends it deallocates the context. 
This means that the context of words bound to a function only exists 
when the function is running, so there is no point to referring to 
these words outside of the function. Although this slows down word 
references, it speeds up function! calls and reduces potential memory 
leaks due to word references in functions after they have returned. 
This slowdown in word references is the reason that R2-style rebcode 
doesn't make sense to add to R3 without some changes to its semantic 
model to make up for the difference.


A closure! in R3 is like a USE call in R2 (USE in R3 is implemented 
using closure!). The words are direct-bound to a context (so word 
references are faster), but it creates a new context and bind/copy's 
the code block at the beginning of each closure! call. There is still 
no point to bind a word to a closure's context when the closure isn't 
running, since the next time the closure runs it will create a new 
context, but it does make sense to use a context created by a closure 
call after the closure has returned since it is a regular context 
like a R2 USE context. In general, it is better to use function! 
unless you need to refer to the context after the closure! returns 
- mostly useful for generators, currying and other functional programming 
tricks.


In R3, object! contexts are like the R2 system/words context: they 
can expand, but not shrink; closure! and function! contexts can't 
expand though. There will be further changes to the way object! contexts 
work, and module! contexts will behave the same way.
btiffin
17-Apr-2008
[5834]
http://rebol.net/wiki/Brian%27s_Take_on_Context  Docbase Link of 
above.  It's beefee.  Thanks Brian.
BrianH
19-Apr-2008
[5835x2]
I expanded the above article, making it easier to understand and 
with more information.
http://rebol.net/wiki/R2_vs._R3_Contexts
By the way, it turns out that function! word references are around 
28% slower than closure! or object! word references.
Rod
19-Apr-2008
[5837x2]
BrianH, thanks for that context information, very good to keep in 
mind in both R2 and R3.
I'm struggling a bit with the closure! specifics.  I have used closures 
in Ruby (though I'm not clear on the difference between a block using 
yield and a closure at this point) and part of what I thought made 
valuable was the connection to the context they were formed with 
that persists.  I'm probably getting this all wrong but what does 
"next time tthe closure runs it will create a new context" imply 
on that front?
BrianH
19-Apr-2008
[5839x2]
If Ruby is as much like Smalltalk as I remember, a block is like 
an anonymous function, and functions in Ruby are more like closures 
in REBOL. There is nothing like yield in REBOL yet, though I don't 
know whether Ruby's yield is a cooperative multitasking thing or 
an Icon-style resumable return for generators.
Ruby has the general overhead of indirect word binding so it can 
support things like closures directly, which is why it is slower 
than REBOL overall. On the other hand, REBOL has a lot of overhead 
when creaing closures because of its direct binding, but that same 
direct binding is part of what makes REBOL so fast otherwise. It's 
a tradeoff.
Kaj
21-Apr-2008
[5841x2]
That sounds about right
I think Ruby's yield is both for cooperative multi-tasking and generators
BrianH
21-Apr-2008
[5843]
Some languages use multitasking for generators - Icon doesn't. Does 
Ruby have Icon-style resumable return?
Kaj
22-Apr-2008
[5844]
I daren't say. I don't know Icon
Rod
23-Apr-2008
[5845]
I don't know Icon either and I'm not sure about the cooperative multi-tasking 
part for Ruby, only seen the generators use so far.
Henrik
1-May-2008
[5846x2]
A tiny bit of status report:


- Working on ports now. It's a very straight forward system, if you've 
been reading the docs.

- Carl found a bug in the garbage collector that would speed up a 
loop test case from 35.2 seconds to 6.4 seconds.

- After a while of core unicode testing, graphics is finally going 
back in. The third test version of View with unicode is going to 
be released soon.
- Still no unicode support inside View graphics, though.
- 445 bug reports so far.

- HTTP protocol recently done (IMHO a very nice and super-clean implementation 
of http1.1 by Gabriele).

- Test case system temporarily put on hold. Ports are more interesting. 
:-)

- WAIT now switches between efficiency and accuracy. It's accurate 
but CPU intensive when selecting a WAIT lower than 1 ms, because 
in those cases it uses it's own routine for waiting, but it can be 
done much more accurately than the OS timer. When above 1 second, 
it uses the OS timer.
oops, in the last line it should read "WAIT lower than 1 second", 
not 1 ms. :-)
[unknown: 5]
1-May-2008
[5848]
Henrik, sounds interesting.  Thanks for the status report.
Gabriele
1-May-2008
[5849]
note, afaik the wait < 1 s problem only applies to windows. (although, 
other oses may have long context switches too)
Henrik
2-May-2008
[5850x2]
>> ? evoke
USAGE:
        EVOKE chant

DESCRIPTION:
        Special guru meditations. (Not for beginners.)
        EVOKE is a native value.

ARGUMENTS:

        chant -- Single or block of words ('? to list) (word! block!)

:-)
not really sure what it does, but it's used for debugging
Gabriele
2-May-2008
[5852x2]
sets secret internal options.
:-)
Henrik
3-May-2008
[5854]
REBOL 3 Alpha 2.100.10 Unicode
Init System Port
REBOL Host-Init
Built: 1-May-2008/21:33:53-7:00
Language: dansk - Denmark
56 datatypes, 68 actions, 141 natives
1021 words defined
>> stats
== 583680
sqlab
3-May-2008
[5855]
How about wait 0?

I used it a few time just to be sure that an event got really triggered.
Pekr
6-May-2008
[5856x4]
So, as we just decided to make Curl guys to close the Nitro doors, 
because R3 will be much cooler, the last phase of two months plan 
started just 5 minutes ago - http://www.rebol.com/rebol3/next.html
  .... yes, we are back to VID 3, with prior phases more or less 
finished .... just to let you know ....
Ah, I forgot to provide a smiley to the Curl remark :-)
.... or not? ;-)
Simple, Clean VID Requirements - http://www.rebol.net/r3blogs/0132.html
btiffin
6-May-2008
[5860]
I added my 2 cents.
AdrianS
8-May-2008
[5861]
It would be really nice if Rebol 3 included some grid computing functionality 
out of the box. Something as simple to set up and get going as GridGain 
- http://www.gridgain.com.Or is it already very easy to achieve 
a master-worker kind of solution?