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

World: r4wp

[#Red] Red language group

DocKimbel
26-Dec-2012
[4845x3]
It's a full REPL, so it's an interpreter + console. I was thinking 
about adding an interpreter since this summer in order to fill the 
gaps until the JIT-compiler will be there. Even when Red will gain 
JIT-compilation ability, for dynamic code with no loops, interpreting 
the code will be faster. Also, on some platforms, JIT-compilation 
is not allowed, so the interpreter will be handy to workaround those 
limitations.
Now, you have a better picture about the "full-stack" approach of 
Red language. :-)
The console is currently just a Red script, once we get devices and 
ports, it will be replaced by a proper console:// port.
NickA
26-Dec-2012
[4848]
This will make it much easier for everyone to pick it up and experiment 
quickly and easily.
DocKimbel
26-Dec-2012
[4849]
It still misses a lot of features, but I think it could be fairly 
complete (on par with Red compiler) in early January.
Henrik
26-Dec-2012
[4850]
I guess all this means we have to think a bit more about how to benchmark 
things rather than simply profile code pieces directly in the console?
DocKimbel
26-Dec-2012
[4851]
Right, if you bench from the console, currently, you're just measuring 
the speed of the interpreter. When the JIT will be there, loops from 
the console might get JIT-compiled, so it will be even less relevant 
to bench from the console. My plan since the beginning is to add 
a profiler to Red, so you'll be able to make precise comparisons 
whatever way the code is run.
PeterWood
26-Dec-2012
[4852]
Great progress Nenad.
Pekr
26-Dec-2012
[4853x2]
oh man, console, wooo hooo :-)
so, what does it mean, in R/S and Red scenario, that console code 
is "interpreted"?
Arnold
26-Dec-2012
[4855x2]
Yes REBOL and Red do case/switch right way agreed!
Great progress Nenad on this console. 
It must be getting more and more fun to use Red now!!
Andreas
26-Dec-2012
[4857x2]
Is the intepreter written in Red/System, or in Rebol?
(Red/System or Red.)
DocKimbel
26-Dec-2012
[4859x2]
Red/System
so, what does it mean, in R/S and Red scenario, that console code 
is 
interpreted"?"


Currently yes, when the JIT will be there, we'll be able to JIT all 
console inputs or some of them only (depending if it is worth the 
trouble of compiling simple expressions).
Jerry
26-Dec-2012
[4861]
The ability of Syntax-highlight will make Red console very attractive.
DocKimbel
26-Dec-2012
[4862]
Jerry: might be fun having lot of colors in the console. ;-)
Jerry
26-Dec-2012
[4863]
It just take 4 months to make the Red codebase double. ( 35K LOC 
=> 70K LOC)  Doc is very productive.
DocKimbel
26-Dec-2012
[4864]
Peter contributed significantly also in this increase, but adding 
most of the unit tests.
Kaj
26-Dec-2012
[4865x2]
REPL: very cool :-)
BREAK/GOTO/FSM: I also try to avoid BREAK, although it can come in 
handy. GOTO would make my 6502 emulator faster, but it's ugly. Having 
FSM support would be brilliant
DocKimbel
26-Dec-2012
[4867]
FSM implementations are the only place I have ever used GOTO in C.
Kaj
26-Dec-2012
[4868x3]
Me too
Oh wow, REPL is an interpreter. My jaw is on the floor :-)
Red just became even harder to explain to the world, though. :-) 
Perhaps we should refrain from mentioning any implementation details
DocKimbel
26-Dec-2012
[4871]
Interpreter: that's the only way to make a REPL currently until JIT-compiler 
is there. I have thought about an alternative way using REBOL for 
the REPL and compiling the code in memory, then running it, but it 
would be a clunky solution (among other issues, would require an 
external DLL for being able to run native code from REBOL).
Kaj
26-Dec-2012
[4872]
I can feel models of complexity collapsing in my brain. It just dawned 
on me that this interpreter will run on all Red platforms, not just 
the ones where REBOL runs, right?
DocKimbel
26-Dec-2012
[4873]
Right, the interpreter will be part of Red's runtime library, so 
it will run on all platforms Red supports.
Kaj
26-Dec-2012
[4874]
I'm so overjoyed right now :-)
DocKimbel
26-Dec-2012
[4875x2]
The interpreter will unlock a lot of features that would have needed 
to wait for the JIT-compiler, like DO/REDUCE/COMPOSE natives. These 
natives can be statically compiled as long as you pass a literal 
block to them, but anything else needs dynamic execution. I was refraining 
from adding them to Red compiler so far, because  they could work 
only partially. Now, I can implement them fully, thanks to the interpreter 
acting as a fallback.
I'm so overjoyed right now
 Being overjoyed is the point of Xmas, isn't it? ;-)
Gregg
26-Dec-2012
[4877]
Wow Doc! Congratulations on getting to this stage. What a great way 
to end the year.
DocKimbel
26-Dec-2012
[4878]
Thanks Gregg. We'll do better for next year. ;-)
Pekr
26-Dec-2012
[4879x2]
for those uneducated - what is the main difference between the rebol 
interpreter, and the red one?
in otjer words - how much is red compiled different to red interprete, 
speed wise?
Kaj
26-Dec-2012
[4881]
Right Doc, thank you so much! I felt shivers going through my spine. 
I admit I also have Natasja on the couch, a cat on my lap, pears 
on the stove and John Lennon's Xmas song on the radio :-)
DocKimbel
26-Dec-2012
[4882x2]
Once the Red interpreter + runtime library will be completed, none 
(modulo the REBOL semantics that Red will change or will not implement, 
which should be very minor).
Kaj: that's a good way to enjoy Xmas!
Pekr
26-Dec-2012
[4884x2]
well, still not clear, what does interpreter do. So it takes a Red 
code, compiles it, and runs it? That would be JIT, no?
Kaj, ssems like a relaxed evening :-)
DocKimbel
26-Dec-2012
[4886x2]
Exactly, but JIT can't be implemented until the self-hosted stage 
is reached, so in the meantime, Red will use that interpreter as 
a fallback.
Also, for the pure console usage, the interpreter is probably a better 
option than the JIT-compiler.
Pekr
26-Dec-2012
[4888]
sorry for extensive typos, having few beers with friends, running 
via teamviewer on my cell phone :-)
Gregg
26-Dec-2012
[4889]
This is really exciting Doc.
DocKimbel
26-Dec-2012
[4890]
Pekr: cheers to you and friends!
Gregg
26-Dec-2012
[4891]
Remember, everyone, I'll match donations made by 31-Dec up to USD$200. 
If we go beyond that, I'll see if I can match more.
Pekr
26-Dec-2012
[4892]
Doc, it wpuld be nice to have cool console, if time permits. Do you 
remember r2 one, with possible cursor positioning? Fond rememberance 
of Amiga and color console :-) Really, some of my user experience 
of r3 was destroyed by crappy console experience ....
DocKimbel
26-Dec-2012
[4893x2]
http://static.red-lang.org/tmp/Rsharp.exe

Would that one from Rsharp be enough? ;-)
(Funny, I now remember that I wanted to rename Rsharp to R2 back 
then for the 0.7.0 release that never made it public)