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

World: r4wp

[#Red] Red language group

Pekr
8-Nov-2012
[3455]
Recent Red tweet: "All path datatypes (path!, lit-path!, set-path!, 
get-path!) implemented. "
DocKimbel
8-Nov-2012
[3456x3]
Jerry: here is a quick overview:


Red values are stored contiguously in series slots (128-bit cells). 
Series buffers are allocated from large chunks of memory of type 
series-frame!. Series value in slots store just a head offset and 
a pointer to a node!. The node! is another pointer to the series 
buffer. So series buffer are indirectly accessed, allowing them to 
be moved in memory (for reallocating with bigger/smaller size or 
moved by GC).
A series buffer has header, with OFFSET and TAIL pointers that define 
respectively the begin and end of series slots. The OFFSET pointer 
allow to reserve space at head of the series for optimizing insertions 
at head. Series slots size can be 1 (binary/UTF-8/Latin-1), 2 (UCS-2), 
4 (UCS-4) or 16 (value!) bytes wide.
From ~Links group: "Could Red eventually become a contender for #6? 
 How strong will support for parallel processing be, eventually, 
in Red?"


#6: yes, that is one of the goals I want to achieve with Red. For 
parallel processing, the model I have in mind is the "parallel collections" 
from Scala. This means that when you are looping over a series, Red 
should be able to parallelize the loop code over n (CPU and/or GPGPU) 
cores at the cost for the user of only a change of the loop function 
name (in Scala, they use a "par." prefix for such functions). This 
requires that the compiler do a deep static analysis of the loop 
body to determine if it can be parallelized (e.g. iterations not 
dependent on results from previous ones). Now, if you also add SIMD 
support in the equation to leverage intra-core parallelism, you get 
a good picture of what I want to achieve. ;-)


So, I think a semi-assisted parallelization/vectorization of loops 
in Red is doable. To what extent and which final efficiency, I'm 
not sure before we build some prototypes.
NickA
8-Nov-2012
[3459]
To what extent and which final efficiency
 may be a key factor in your billionaire-worthiness ;)
DocKimbel
8-Nov-2012
[3460x2]
Remind me to start a space ship building company when I get to that 
point. ;-)
Path notation preliminary support added: you can use it on any series 
with integer! or get-word! values as accessors (nested word! values 
need SELECT action to be implemented first).


See changes in demo script: https://github.com/dockimbel/Red/commit/88fd1ff1da855a383e91566903fe373ea4d41eca
Pekr
9-Nov-2012
[3462]
Doc, apart from Twitter, please don't forget about using another 
marketing channel - Facebook :-)
DocKimbel
9-Nov-2012
[3463x3]
Pekr: I try to use each channel for what it is worth for. :-)
Set-path notation support for modifying series added.
Functions refinements support added. /ONLY option implemented for 
MOLD, much more to come soon.
Jerry
10-Nov-2012
[3466x2]
In R3, There are 56 actions, 159 natives, 21 ops, 56 datatypes. Now 
in Red, there are 19 actions, 21 natives, 10 ops, 15 datatypes, respectively.
Just a simple comparison.
Arnold
10-Nov-2012
[3468]
DO you need all 56 datatypes, 159 natives. Development last years: 
R3 nil Red exponential just a comparison ;)
Henrik
10-Nov-2012
[3469]
There is also the basic work to do, like the lexical scanner, port 
system, etc. Some of the work on actions and natives can be outsourced 
later.
BrianH
10-Nov-2012
[3470x2]
Bad comparison: Active project vs. suspended project.
They aren't even in the same stage of development, as R3 is much 
more mature at this point. This is not a criticism though, as Red 
was years away from existing yet when R3 was at the stage Red is 
at now. There is still much to look forward to from both projects.
Jerry
10-Nov-2012
[3472]
R3 has about 190 mezz functions, Red has none so far, which will 
be supported soon.
BrianH
10-Nov-2012
[3473x2]
Hopefully in a way that allows the compiler to not include the ones 
that aren't used, at least for closed apps. 190 seems like a lot. 
By closed apps, I don;'t mean closed source, I mean apps that don't 
execute external scripts, like iOS apps.
Probably not as much of a problem for Red as it was for Delphi though 
:)
DocKimbel
10-Nov-2012
[3475]
Jerry: interesting metrics. You could keep track of it month by month 
and publish them.
Henrik
10-Nov-2012
[3476x2]
He should write a script, one that runs both under R3 and Red. :-)
if Red is reflective enough to do that yet...
DocKimbel
10-Nov-2012
[3478]
We don't have system/words yet nor file I/O...looks like a challenge. 
;-)
Henrik
10-Nov-2012
[3479]
Is it possible to echo it? Then you can pipe it to a file.
DocKimbel
10-Nov-2012
[3480]
It should be possible, yes.
BrianH
10-Nov-2012
[3481]
You might be able to do source analysis using an external tool, for 
now.
DocKimbel
10-Nov-2012
[3482]
We should have file I/O in a few weeks anyway.
Jerry
10-Nov-2012
[3483x2]
Doc, I will. The metrics will be numbers of 1. Datatypes 2. Actions 
3. Ops 4. Natives 5. Functions 6. Objects 7. Schemes 8. GUI-Components
The completeness and stability of them will be ignored here, which 
is not fair to R3. But like I said, It's just a simple comparison. 
The purpose is to see the progress of Red, not to discredit R3.
DocKimbel
10-Nov-2012
[3485x2]
You can add those two also, no problem. Red is already more complete 
than R3 on some aspects, like Unicode support.
Also, Red will add its own features, like specific datatypes, natives, 
actions,... For example, MOLD and FORM both have a /PART refinement.
Jerry
10-Nov-2012
[3487]
Doc, Unicode in R3 is pretty good for me.
DocKimbel
10-Nov-2012
[3488]
IIRC, it doesn't handle characters above codepoint 0xFFFF.
Jerry
10-Nov-2012
[3489x3]
I write a book for R3 instead of R2 because R3 supports Unicode. 
Without Unicode, R2 is useless in China.
Yes, I've noticed that. By supporting USC-4, Red is better than REBOL. 
But Characters with codepoint > 0xFFFF are rarely used, I think.
I was reading your Unicode.reds earlier, It's really cool to see 
that Red supports UCS-4.
DocKimbel
10-Nov-2012
[3492]
Well, if you look at the astral planes, you'll see things like music 
notes or play cards, I bet they will become quickly as much popular 
as they are useless. ;-)
Jerry
10-Nov-2012
[3493x3]
Many years ago, I found REBOL 2 and liked it a lot, but back then 
REBOL didn't support Unicode, so it was useless in China/Taiwan. 
I wrote e-mail to Carl, but I got no feedback. So I decided to start 
a magazine column in China and Taiwan to introduce REBOL. My idea 
was to make readers love REBOL and felt the same pain (of no unicode 
support). I also kind of encouraged them to write e-mail to RT on 
the Unicode issue.
After a while, Carl said (in somewhere, blog maybe) that he didn't 
know why REBOL had many Chinese users, and they need Unicode. So 
he decided to support Unicode.
Doc, I am glad that Red support Unicode in the first place, so I 
don't have to do the same trick to you. :-)
DocKimbel
10-Nov-2012
[3496]
I remember that Unicode in R3 is mostly thanks to you. :-) No modern 
programming language can miss full Unicode support now, so it's a 
mandatory feature to have, anyway.
Ashley
10-Nov-2012
[3497]
For those of us still dealing mostly in pure ASCII will there be 
a 1-byte per character string alternative?
DocKimbel
10-Nov-2012
[3498x2]
Ashley: Red string! use 1-byte per character by default, so as long 
as you stick to ASCII, it takes the same storage space as C strings. 
As soon as you insert a non ASCII character, the string will automatically 
upgrade to the appropriate format. It's transparent for the Red user. 
Moreover, you'll be able to force string encodings back down to 2-bytes 
or 1-byte when possible.
So, upgrade is automatic, downgrade should be manual.
BrianH
10-Nov-2012
[3500]
0-127 ASCII, or UCS-1 (aka Latin1)?
DocKimbel
10-Nov-2012
[3501]
Latin1
BrianH
10-Nov-2012
[3502]
Cool :)
DocKimbel
10-Nov-2012
[3503x2]
So, I should have said "as soon as you insert a non Latin1 character".
In any case, you can always bypass the whole Unicode layer by reading 
(or converting) strings as binary! values, and then processing them 
the way you want (this is not recommended though, but some users 
might need it).