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

World: r3wp

[Red] Red language group

Dockimbel
9-Mar-2011
[147]
The linker needs to be extended to add an "export" section and the 
compiler needs to prepare some data to populate that section.
BrianH
9-Mar-2011
[148]
The R3 module system uses an export keyword for marking its exports. 
Perhaps Red/System can use the same keyword.
Dockimbel
9-Mar-2011
[149]
Sure, that part is the easy one...Having quick look at "export" section 
format, it seems to be as messed up as the "import" one. Would probably 
need several days to make it work reliably.
BrianH
9-Mar-2011
[150x2]
For that matter, will Red/System be getting a module system, or some 
other kind of packaging facility?
We won't want to be limited to one-file programs forever :)
Dockimbel
9-Mar-2011
[152x2]
I'll extend it to allow compiling several sources in a single executable, 
but I won't go past that. Red/System will live as a Red dialect, 
so will benefit from the whole Red environment. The only time it 
needs to work alone will be to produce the Red's runtime layer. But, 
as said in my blog, Red/System could be extended to a full-featured 
language if someone want to invest in it.
In fact, support for incremental compilation is almost done, just 
needs testing/debugging. With that, you could feed the compiler with 
several sources while preserving its internal states and ask to "finalize" 
the job on the last one (means link the project).
Gregg
9-Mar-2011
[154]
Works here Doc. Congratulations!
Dockimbel
9-Mar-2011
[155]
Thanks Gregg.
Rebolek
9-Mar-2011
[156]
Build hello.exe under OS X and works under Windows :)
Dockimbel
9-Mar-2011
[157]
Red/System is a cross-compiler. ;-)
Henrik
9-Mar-2011
[158]
Let me get this straight: Is this instead of using C?
BrianH
9-Mar-2011
[159]
Yup.
Henrik
9-Mar-2011
[160]
ok. that's all I need to know. :-)
Maxim
9-Mar-2011
[161]
great work doc!
Dockimbel
9-Mar-2011
[162x2]
Thanks.
Henrik: what an overwhelming enthusiasm! :-)
Henrik
9-Mar-2011
[164]
:-)
Kaj
9-Mar-2011
[165]
I went through the code and it's very impressive to me. Most people 
these days wouldn't think it would be possible
NickA
9-Mar-2011
[166]
Doc, do you have Paypal account for donations?
GrahamC
9-Mar-2011
[167x2]
he does .. see his cheyenne page for the address,
http://www.cheyenne-server.org/about.shtml
NickA
10-Mar-2011
[169]
Thanks :)
Dockimbel
10-Mar-2011
[170]
Thank you very much for your donation Nick, that is very much appreciated!
amacleod
10-Mar-2011
[171]
the helloworld.reds script exe opens a console, writes stuff and 
then closes. Is there a way to keep that wndow open so I can see 
the output?
Cyphre
10-Mar-2011
[172]
yes, run it from already opened cmd.exe
Dockimbel
10-Mar-2011
[173]
amacleod: It's mentioned in the README file:

4) The resulting binary is in red-system/builds/hello.exe, open a 
DOS console and run it.
Ashley
10-Mar-2011
[174]
Just wanted to say I really like the minimalist approach and am following 
this project with great interest.
Steeve
10-Mar-2011
[175x2]
I wonder Doc, why did you you choose to make your own compiler ?
And was OTCC behind your inspiration ?
Kaj
10-Mar-2011
[177]
There's some explanation in the comments on the Red website
Dockimbel
10-Mar-2011
[178x2]
I've looked at TCC sources for inspiration (don't know about OTCC). 
Making a compiler is at the heart of the project, Red (as Red/System) 
are compiled languages.
I've looked at TCC code emitter to be more specific, not at the compiler 
part.
Steeve
10-Mar-2011
[180]
OTCC is the ancestor of TCC
Maxim
10-Mar-2011
[181]
could LLVM also be a target for the emitter, eventually?
Dockimbel
10-Mar-2011
[182x3]
Right, looking at it right now, the one Bellard used to won the C 
obfuscated code contest.
Maxim: see http://groups.google.com/group/red-lang?hl=enfor the 
anwser to that question.
Short answer: sure, but it's not in the roadmap, I don't have a need 
for it.
Steeve
10-Mar-2011
[185]
But you know, I woud prefer a DSL like emiter, something using parse's 
rules exclusively
Dockimbel
10-Mar-2011
[186]
I needed to prototype a direct native emitter for the upcoming JIT-compiler. 
So compilation speed was a critical.
Maxim
10-Mar-2011
[187]
thanks, I was just wondering if the compiler was structured in a 
way to make it possible.


as for when/how that's obviously not a priority if you're already 
able to spit out code for the various platforms easily.
Dockimbel
10-Mar-2011
[188]
was a critical
 => was critical
Steeve
10-Mar-2011
[189x2]
Parse is fast
But I guess, you intend to recompile the emitter with Red itself, 
as soon as possible.
Dockimbel
10-Mar-2011
[191x3]
Yes, that's the idea. It's currently in a boostrapping phase, temporary 
relying on REBOL.
bootstrapping
I'm not sure I get your "DSL like emiter"? Do you mean compiling 
to an intermediate dialect, that would be compiled to native code?
Steeve
10-Mar-2011
[194x3]
No, I mean writing each target emitters/assemblers (IA32.r) with 
a dialect.
In a way to ease porting
But it's true that it's a matter of taste.