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

World: r3wp

[Red] Red language group

BrianH
28-Feb-2011
[69x3]
Only string!, no binary!?
I'm wondering about the Unicode strategy...
In Red/System, I mean. Of course Red will have both.
Dockimbel
28-Feb-2011
[72]
Binary! is half-supported. It was part of my initial list of type 
to support, but as I didn't needed it so far, it's not supported. 
That might change when I'll implement the lexical analyzer.
BrianH
28-Feb-2011
[73]
Have you decided yet whether the lexical analyzer will have the same 
source-is-UTF8-binary strategy as R3?
Dockimbel
28-Feb-2011
[74]
I plan to support UTF-8 scripts for both Red & Red/System. The memory 
storage model is not yet decided, could be UTF-8 or UCS-2.
BrianH
28-Feb-2011
[75]
And arguments and locals can only have one type in their typespecs 
for Red/System?
Dockimbel
28-Feb-2011
[76]
In fact, they can have several types as long as they take the same 
space in memory, but support for that has not yet been implemented.
Andreas
28-Feb-2011
[77]
Do you currently compile the above directly to binary machine code?
Dockimbel
28-Feb-2011
[78]
Yes, machine code, then generating an executable.
Andreas
28-Feb-2011
[79]
ABI differences will probably give you the heebie-jeebies :)
Dockimbel
28-Feb-2011
[80x2]
The whole compiler is 40KB, the linker is 20KB.
I did the PE/COFF support, no other ABI can be so screwed up. :-)
Kaj
28-Feb-2011
[82]
Obviously, GCC is superior at 50 MB or so
Andreas
28-Feb-2011
[83x2]
That is only the binary format :)
I assume you currently do x86 stdcall only?
Dockimbel
28-Feb-2011
[85]
Yes, but the support for cdecl is like adding a couple of lines to 
the current code.
Andreas
28-Feb-2011
[86]
Sure. But that quickly gets extremely annoying :)
Dockimbel
28-Feb-2011
[87]
Red/System uses stdcall for its own functions, I found out that it 
was generating shorter code than cdecl.
BrianH
28-Feb-2011
[88]
That's why stdcall was invented :)
Andreas
28-Feb-2011
[89]
Or on x86, fastcall, rather :)
Dockimbel
28-Feb-2011
[90x2]
The really annoying part was having to reverse the arguments list 
to support stdcall. It's a much more difficult when you're compiling 
in one pass directly to machine code.
Fastcall, sure, that would be the target in a future version with 
an optimizing compiler.
BrianH
28-Feb-2011
[92]
Do string references in Red/System have indexes, or are they just 
pointers?
Dockimbel
28-Feb-2011
[93]
They support indexed read/write accesses like in C, but using a REBOL 
syntax, so s/1, s/2, s/3...
BrianH
28-Feb-2011
[94]
I meant offset references an internal pointer to the head and an 
offset index, like s: next s.
Dockimbel
28-Feb-2011
[95x2]
Indexing with a variable should also be possible: 
s: "hello"
c: 1

s/c or s/:c (haven't decided yet which one is the more appropriate)
Nope, no indexes like in REBOL strings, that's too high-level for 
Red/System.
BrianH
28-Feb-2011
[97x2]
Going with the latter (s/:c) would be more compatible with REBOL 
and Red, and leave room for expanding Red/System's capabilities in 
the future.
No offset references means no set-word syntax in FOREACH - good to 
know.
Kaj
28-Feb-2011
[99]
Agreed
BrianH
28-Feb-2011
[100]
And no FORALL and FORSKIP.
Dockimbel
28-Feb-2011
[101x2]
Perhaps, that's what I'm thinking too, but s/c looks more consistent 
with current Red/System abstraction level.
I might add support for FOREACH for string! & binary! if this can 
make me avoid to add FOR. :-)
BrianH
28-Feb-2011
[103x2]
Things would be less confusing if Red/System and Red were compatible 
for corresponding concepts. This would also let you prototype Red/System 
code in Red.
You would still need something like FOR if you don't have offset 
references, because FOREACH doesn't let you modify its argument without 
set-word syntax.
Dockimbel
28-Feb-2011
[105x2]
Well, I already have WHILE, so FOR is optional anyway, just syntactic 
sugar. I should add REPEAT too, if I still miss FOR after that, I'll 
add it.
Enough for tonight, it's very late here. I just wanted to give you 
some taste of what Red/System would look like. I'll work on Cheyenne 
new release and new documentation tomorrow, I should be able to get 
back to Red after that. I hope to be able to put the current codebase 
on github during the weekend.
BrianH
28-Feb-2011
[107]
Good night!
Dockimbel
28-Feb-2011
[108]
Thanks!
Kaj
28-Feb-2011
[109]
Sweet dreams :-)
Dockimbel
28-Feb-2011
[110]
Thanks Kaj, you too.
Kaj
28-Feb-2011
[111]
Thanks
Dockimbel
1-Mar-2011
[112]
Red's web forum now opened : http://groups.google.com/group/red-lang?hl=en
Gregg
1-Mar-2011
[113]
Thanks for posting all hat Doc. Looks like great progress so far.
GiuseppeC
1-Mar-2011
[114]
If REBOL would have been open sourced the force of Doc would have 
improved REBOL and not splitted into RED.
BrianH
2-Mar-2011
[115]
Who says Red can't be used to improve REBOL? They're complementary.
Kaj
2-Mar-2011
[116]
Doc said you will be able to write R3 extensions in Red, instead 
of C :-)
Pekr
2-Mar-2011
[117]
It would still be nice, if Carl would completly open-source R3 though 
:-) Because it could lift certain amount of energy into some ppl 
confidence, and R3 could grow faster. Well - in theory, at least 
:-)
Kaj
2-Mar-2011
[118]
No argument here