• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r4wp

[#Red] Red language group

Gregg
8-Mar-2013
[6016]
That's great news Doc! File! is a huge part of what I do with REBOL, 
so this is a great step.
DocKimbel
8-Mar-2013
[6017x3]
It is just file!, no port! nor port's actions support yet.
Though, you can use Kaj's READ and WRITE functions to access files 
from Red already.
Got multiline strings LOADing working, but now I need to find a way 
to efficiently (if possible) output the right delimiters:

    probe load {
        {
    	Hello
    	World!
        }
    }

    == ["
            Hello
            World!
    "]
BrianH
8-Mar-2013
[6020x2]
Wait, " strings are multilined too? How do you help the developer 
when multiline strings are an error?
By "help the developer" I mean trigger a syntax error, or log an 
error in your compiler, whatever. Errors help the developer.
DocKimbel
8-Mar-2013
[6022]
You missed the point, Red's MOLD is not yet able to correctly handle 
multiline strings, I'm right now working on adding that support, 
I'm just wondering how to do it the best (same discussion than in 
SO chat with Ladislav).
BrianH
8-Mar-2013
[6023]
OK, cool.
DocKimbel
8-Mar-2013
[6024]
I'm not satisfied by the Rebol solution of scanning the string each 
time a MOLD is done, I wonder if there's any better solution.
BrianH
8-Mar-2013
[6025]
That seems worth looking into.
Kaj
8-Mar-2013
[6026x2]
Doc, in Red/System, I am currently forced to use the names READ and 
WRITE-string, because WRITE is taken for the syscall. Would you consider 
renaming that, to sys-write or os-write for example? I would really 
like to use READ and WRITE in Red/System like in Red
Not sure if you have time to do that before the release, but it would 
be good to avoid creating legacy code
DocKimbel
8-Mar-2013
[6028x2]
I can do that, but I can't garantee you in the future that Red/System 
won't define its own READ / WRITE functions.
But for now it is unlikely, as I don't plan to add any file or network 
I/O support in Red/System itself. I do plan to use READ-IO and WRITE-IO 
though.
Gregg
8-Mar-2013
[6030]
Doc, understood that file! is just the datatype right now. It's still 
an important step. :-)
Kaj
8-Mar-2013
[6031x5]
Doc, certainly, I'll remove my READ and WRITE when you implement 
yours, like I did REDUCE and COMPOSE
LOAD doesn't understand empty strings:
red>> ""
*** Load Error: string ending delimiter not found!
== """
red>> print ""
*** Load Error: string ending delimiter not found!

The Red interpreter can execute the Fibonacci example now
I did some first measurements. The interpreter takes 1.5 times as 
long as R3
DocKimbel
8-Mar-2013
[6036x2]
Good! :)
Given how much space for optimization we have, it's very good results.
Kaj
8-Mar-2013
[6038]
Yes, that's actually an excellent result. We established before that 
the Red/System compiler is twice as slow as optimised C from GCC, 
so the interpreter could have been expected to be twice as slow as 
R3
DocKimbel
8-Mar-2013
[6039]
So, is Red interpreter faster than R2 for fibonacci test?
Kaj
8-Mar-2013
[6040x2]
It may reach that factor two once it does argument type checking, 
but a rough conclusion would have to be that the Red interpreter 
is pretty much at least as efficient as R3
Good question, I'll add a test. I would expect them to be about equally 
fast, as R3 is usually a third faster than R2
DocKimbel
8-Mar-2013
[6042]
Just a third?? I thought it was twice as fast as R2 on average?
Kaj
8-Mar-2013
[6043x2]
Nope
Diminishing returns. Almost half of REBOL's lifetime was spent on 
a one third speed increase
DocKimbel
8-Mar-2013
[6045]
Good job, now BrianH will flood this group to prove you wrong! ;-)
Arnold
8-Mar-2013
[6046x2]
Is there a way to hide this group from him (temporarily?)
Great progress guys!!
GrahamC
8-Mar-2013
[6048]
any group can be made private
Kaj
8-Mar-2013
[6049x4]
I'm getting strange results now: R2 actually faster than R3
This is Carl's official R3 release that I compiled for i686, so it 
probably has a compilation advantage over R2
In my older benchmarks with Carl's R3 build, R3 was a quarter faster 
than R2 (3 : 4). But I was computing Fibonacci 35 then, and now Fibonacci 
40 to have a better comparison with fast languages on fast machines
The Red interpreter takes 1.7 times as long as 2.7.8 on Fibonacci 
40
DocKimbel
8-Mar-2013
[6053x2]
I just added char! to LOAD. It doesn't support the whole set of escaped 
sequences, only the most used once. Also, the molding of codepoints 
< 32 is not escaped yet, so you'll get strange results on screen.


I'm working on improving MOLD on string! and char!, to better support 
escaping of special characters and correct usage of {} braces when 
required.
I probably won't have time to finish file! before going to sleep, 
so you'll get it tomorrow.
Kaj
8-Mar-2013
[6055]
The Red compiler is 3.6 times as fast as the interpreter. Red/System 
is 265 times as fast as the interpreter
DocKimbel
8-Mar-2013
[6056]
(for Fibonacci test)
Kaj
8-Mar-2013
[6057]
Fibonacci 40
DocKimbel
8-Mar-2013
[6058]
Better specify it clearly each time you announce comparative performances, 
else people will generalize it and get a wrong picture of the real 
performance ratios. 


Fibonacci basically tests the efficiency of the function calls. A 
test with a bigger loop could be interesting. For example, you can 
take the %demo.red script and strip all screen outputs, add a LOOP 
around the main code and  you'll should see much bigger differences.
Kaj
8-Mar-2013
[6059x4]
You know how it is with benchmarks: you can never specify it deep 
enough to prevent all caveats
So either the only specification is some salt, or you actually benchmark 
the readers to see who gets it and who doesn't
I don't know what "real" performance ratios are, but I think that 
computing Fibonacci numbers is a more real task than running the 
text console demo in a loop
I'd measure Mandelbrot performance, but Red can't do it ;-)
Paul
8-Mar-2013
[6063]
Kaj, good thanks for the update on the SDL problem.
Kaj
8-Mar-2013
[6064x2]
I'll test later if that's it
In any case, we just bought an XP machine for testing