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

World: r4wp

[#Red] Red language group

PeterWood
5-Nov-2012
[3305]
As I understand, there is no foreach in the current version of Red/System 
and no c-strings in the current version of Red.

The best loop to use in Red/System is until:

str: "1234567"
until [
  print str/1
  str: str + 1
   str/1 = null-byte
]

Will print the characters in a c-string ( as would print str).
MagnussonC
5-Nov-2012
[3306x2]
Hmm, OK, I was using Red so probably it is a string! , but there 
seems to be a foreach.
Thanks for the suggestion about until. Will try it.
DocKimbel
5-Nov-2012
[3308x2]
MagnussonC, you're mixing Red and Red/System. The above suggestion 
from Peter is for Red/System, not Red. What you are looking for in 
Red is FORALL or REPEAT iterators.
Though, you can also use UNTIL in Red, but string! is not c-string!, 
the + 1 part and final test are not valid in Red.
MagnussonC
5-Nov-2012
[3310]
I realize I mixed string and c-string, but it was possible to use 
foreach on the string. The problem was to find the find the last 
char.
DocKimbel
5-Nov-2012
[3311]
In such case, you should not use FOREACH, but an alternative. FOREACH 
doesn't handle a series offset, so you can't test for a position 
in the series.
MagnussonC
5-Nov-2012
[3312]
Thnx :)
GiuseppeC
5-Nov-2012
[3313]
Doc, now that REBOL is Open Source, I ask which are the differencies 
between REBOL3 and RED to create a different language ? Can't you 
propose your view and have it merged into REBOL3 ?
DocKimbel
5-Nov-2012
[3314]
Giuseppe: no, R3 is an interpreter based on C, Red is a compiler 
based on Red/System. I hardly can see how they could be "merged".
GiuseppeC
5-Nov-2012
[3315]
Doc, I am talking about the semantinc differences. Are those languages 
so different ?
DocKimbel
5-Nov-2012
[3316x2]
Semantically, no, very close.
But there are some things that we might do differently, like concurrency 
handling.
GiuseppeC
5-Nov-2012
[3318x6]
Before I continue, I just want to say I don't want to convince you 
but let you think.
You will be involved in a 2 year commitment to make something that 
it will be quite close to another product with very few differencies.
RED/System is a "different" low level language. It is nice.
I see a great future for it.
RED is only a REBOL clone.
With few differences in the semantic.
BrianH
5-Nov-2012
[3324]
Keep in mind that R3's concurrency model isn't really set yet. That 
is an area where you can make a lot of impact.
DocKimbel
5-Nov-2012
[3325]
Agreed, but implementation is totally different.
GiuseppeC
5-Nov-2012
[3326x8]
I would like to see RED/System mature.
REBOL3 Improved with your contribution.
And when RED/System will be ready for prime time... the community 
could extend and port all/parts of REBOL3 to RED/system.
Doc, lets suppose I am a customer:
I need a veicle with 4 wheels and and engine.
You can make it however you want but I need 4 wheel and and engine.
If the result is the same why care abut the building process ?
-- END OF MY ARGUMENTATION --
Pekr
5-Nov-2012
[3334]
Giuseppe - in few months, Red will gain 80% of Core functionality, 
and even surpass it in some areas. Just let it live ...
Arnold
5-Nov-2012
[3335]
my vote is already a 100% for Red :)
Jerry
5-Nov-2012
[3336]
I would like DocKimbel to stick with his own idea, not to be affected 
by the Open-source of R3.
BrianH
5-Nov-2012
[3337]
but implementation is totally different

 - That's what I meant by "isn't really set yet". They will likely 
 be different because of the different language semantic models, but 
 they might be more alike than you think once both are set.
GiuseppeC
5-Nov-2012
[3338x2]
Yes but I will have 4 wheel and an engine. The same of  REBOL3. It 
is the result which counts.
However I understand the pleasure of reimplementing everything in 
my own way.
Arnold
5-Nov-2012
[3340]
Yes but do you need a family car or a Formula1 car? Or a truck?
Pekr
5-Nov-2012
[3341]
Giuseppe - let's really be fair to Doc here! You are asking him to 
give-up on what was really a strong decision for him, which even 
has influenced his life. Doc moved from France to Montenegro, in 
order to work on Red. And all that would not be necessary, if Carl 
would not let us in the water. So really - just let Doc alone for 
few moments, to think about all new consequences ...
Jerry
5-Nov-2012
[3342]
ditto.
Pekr
5-Nov-2012
[3343]
BrianH: I think Doc's answer was to Giuseppe claiming that Red is 
just a REBOl clone ...
GiuseppeC
5-Nov-2012
[3344]
Arnold. We are talking about minor differences like a car with 2 
doors instead of 4 and electric glasses in place of manual ones. 
The comparison doesn't suit here. If BOTH languages are "Very Close" 
(read above), which are the advantages ?
DocKimbel
5-Nov-2012
[3345x2]
Giuseppe: they might seem similar on the surface, but I can garantee 
you that you'll see and feel the difference when Red will be mature 
enough.
Giuseppe: you seem to not understand the difference between a interpreter 
and a compiler.
GiuseppeC
5-Nov-2012
[3347x4]
Yes I understand.
But I want to make the DEVIL ADVOCATE.

When RED will be mature. In which scenario should a developer choose 
it instead of REBOL3 ?
(And let me state again: I apreciate your commitment)
It is a question that must be answered. It is the core of your project, 
it is the motivation for your "customers".
Henrik
5-Nov-2012
[3351]
GiuseppeC: Red/System is a language to build other languages using 
a similar syntax as REBOL, one of which is Red. R3 is based on C. 
There is no way for R3 to tap directly inline into C's performance, 
while Red will be able to. I think this is quite a feat that might 
make Red much more flexible than R3. You also get encapping right 
out of the box with the current compiler. I can't come up with an 
appropriate car analogy.
GiuseppeC
5-Nov-2012
[3352]
Henrik, PERFORMANCE. It is the first difference. Now the car can 
run faster.
Any other differences ?
Henrik
5-Nov-2012
[3353]
Red/System also offers a nicely compact and clean toolchain, which 
R3 doesn't even focus on. As far as I know, not many people like 
the current C toolchains.
GiuseppeC
5-Nov-2012
[3354]
I am talking about RED and not RED/System.