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

World: r3wp

[!REBOL3]

BrianH
2-Dec-2011
[9840]
It should be if you are doing the loop directly from the console 
or otherwise using a object/module/script/closure context rather 
than in a function.
Steeve
2-Dec-2011
[9841]
console
Geomol
2-Dec-2011
[9842x3]
Under OS X:
Using R2:
>> time [n: 1000000 while [0 < n: n - 1][]]
== 0:00:00.219887
Using R3:
>> dt [n: 1000'000 while [0 < n: n - 1][]] 
== 0:00:00.339793
My R2 time is:

time: func [:f /local t][
    t: now/time/precise 
    do f 
    now/time/precise - t
]
R2:
>> system/version
== 2.7.7.2.5
R3:
>> system/version
== 2.100.111.2.5
BrianH
2-Dec-2011
[9845x2]
Well, that isn't affected by any of the standard slowdowns. I wonder 
if it's an issue with the difference in C compilers between the two 
versions.
There are a lot of problems with R3 on OSX, and different problems 
with R2. Annoying.
Geomol
2-Dec-2011
[9847x2]
Using gcc, I experience up to 33% changes in some tests from compilation 
to compilation, so that could be.
I guess, it has something to do with, how lucky the compiler is maybe 
to get data on 64bit boundaries and make code parts/data fit in cache 
and such technical things.
BrianH
2-Dec-2011
[9849]
Seems that could be tweaked with pragmas, right?
Geomol
2-Dec-2011
[9850]
Could be. I need pragmas in a few places, but I haven't dug deeply 
into that area of compilation. It's boring, I think. :) And I haven't 
had time to look at things like LLVM, but that would probably solve 
some problems and speed things up even more.
Kaj
2-Dec-2011
[9851]
R3 is typically about a third faster than R2 in my tests on Linux, 
even with my CMS that mostly does text processing
Henrik
5-Dec-2011
[9852x2]
Neither R2 nor R3 considers it to be a problem making this directory 
in WinXP:

make-dir %.../


but the directory is never made, as far as I can tell. Doing it from 
a command prompt returns that the directory already exists.
Do you think this is a bug?
Pekr
5-Dec-2011
[9854]
When I try to make three dot dir under Vista, it returns an error, 
and hence R3 hould return an error too imo. Ditto for invalid chars, 
not allowed being a part of the dir names ...
Endo
5-Dec-2011
[9855]
When I trace it, it "sees" the error but returns the path:
...
Trace:  return (word)
Trace:  path (word)
Result: (error)
Result: (error)
Result: (error)
Result: %.../ (file)
BrianH
5-Dec-2011
[9856x2]
There is a cross-platform bug in R3 where it won't see any file or 
directory that starts with two periods, not just . and .. - the ticket: 
http://issue.cc/r3/1899
This may be unrelated though.
Henrik
5-Dec-2011
[9858]
It is possible to make this directory under OSX, as far as I can 
see.
BrianH
5-Dec-2011
[9859]
The particular error triggered in the Windows console when you try 
to make a directory with only periods in its name is that the directory 
already exists; this is probably a bad error. However, when you try 
to MAKE-DIR directories that already exist in REBOL, it's a noop, 
not an error. That is probably why it's not triggering an error here.
Marco
11-Dec-2011
[9860]
wish for R3 / Topaz / Red / World:

callback! datatype so you can "really" use a lot of nice shared libraries.
Geomol
11-Dec-2011
[9861]
Do you have a simple example?
Marco
11-Dec-2011
[9862]
display: make callback! [...] [...]
glutDisplayFunc :display
Kaj
11-Dec-2011
[9863]
Red/System has native callbacks already. I'm using them in most library 
bindings
Marco
11-Dec-2011
[9864]
Right. Red/System seems vary nice.

I am waiting for floats to be implemented in Red/System. Is there 
a "math" library that could be used intead?
Kaj
11-Dec-2011
[9865]
I've bound the standard C math library already, but it's waiting 
for the floats
BrianH
11-Dec-2011
[9866x2]
With R3 you can just callback functions if you want a synchronous 
call, or callback through an event if you want to go asynchronous.
Still, a generator of marshalling wrapper functions would be nice, 
especially since REBOL and C don't have similar data models.
Robert
11-Dec-2011
[9868]
But R3 can't deal very good with multi-threaded libs. You need to 
trick it: Use async with non or integer value to trigger a sync call 
on Rebol side.
Steeve
29-Dec-2011
[9869]
Any info about the algorithms used to construct and perform lookup 
on symbol's tables in R3 ?
People gave some hints back in the day.
But I can't remember who.
Ladislav
22-Jan-2012
[9870]
Wondering if there is an analogy of

    query/clear system/words
BrianH
22-Jan-2012
[9871]
Now that you mention it, I'm wondering that too. There isn't any 
tracking of state changes for R3 objects that I'm aware of, and there's 
nothing like system/words.
Ladislav
22-Jan-2012
[9872]
Well, it is not a big "disaster" for me, since it is not too hard 
for me to adjust the function I am writing for R3 with just a slight 
modification of the behaviour...
Cyphre
23-Jan-2012
[9873]
Ladislav, I think you already wrote something like that for R3?

newly-defined?: func [
	{do the given BLOCK and find the newly-defined words}
	block [block!]
	/local old
] [
	old: append append
		defined? system/contexts/lib
		defined? system/contexts/sys
		defined? system/contexts/user
	do block
	exclude defined? system/contexts/user old
]
Steeve
23-Jan-2012
[9874]
Cyphre, it's not a good approach in R3

To track newly defined words in a context you can check the source 
of the function INTERN.
Ladislav
23-Jan-2012
[9875]
I may be completely missing the point, Steeve. How exactly can the 
source of the INTERN function help with detection?
Steeve
23-Jan-2012
[9876]
Its tracking newly "created" words in the user context after a binding. 
It's maybe not what you're trying to do but it was in response to 
Cyphre.
Ladislav
23-Jan-2012
[9877x2]
What I (essentially) want is described in the help string:

    {do the given BLOCK and find the newly-defined words}

Can the source of INTERN cannot help me with that?
typo: "Can the source of INTERN help me with that?
Steeve
23-Jan-2012
[9879]
I probably mistaken the words "newly-defined" for "newly-created"
Ladislav
23-Jan-2012
[9880]
I originally pointed out how implemented the functionality in R2 
(using the 

    query/clear system/words

expression.
Steeve
23-Jan-2012
[9881x3]
You want to track the "modified" words, right ?
ok
newly-defined
 is confusing :-)
Ladislav
23-Jan-2012
[9884x2]
Terminological problem, yes
However, I do not track "modified", since that is a bit more complicated/slower 
than I like.
Steeve
23-Jan-2012
[9886]
Still I wonder, what is the so called defined? function ?
Where can I find it ?
Oldes
23-Jan-2012
[9887x3]
Steeve... I guess Ladislav is looking for something like this R2 
helper script:
gbl-test: func [
    code
    /all
    /init {returns string with all global variables set to none}
    /local gbl-list words str_init
][
    words: make block! 50
    str_init: make string! 1000
    gbl-list: query/clear system/words
    do code
    if block? gbl-list: query system/words [
        foreach item gbl-list [
            if any [all value? item] [
                insert tail words to-word item
                if init [
                    insert tail str_init join to-word item ": "
                ]
            ]
        ]
    ]
    if init [
        write clipboard:// join str_init "none"
    ]
    words
]
>> gbl-test [a: 1]
== [a]
>> f: func[a][b: a + 1] gbl-test [f a: 1]
== [a b]
The above script I was using to detect leaking variables
>> gbl-test [ o: context [a: 1] ]
== [o]
>> gbl-test [ o: context [a: 1 set 'b 2] ]
== [b o]