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

World: r4wp

[#Red] Red language group

DocKimbel
2-Nov-2012
[3273x2]
Can't fit a value slot, so it needs it's own buffer.
*its
BrianH
2-Nov-2012
[3275]
If you have support for unboxed intermediate values or unboxed series 
types (like vector) then you can make sure you can do IPv6 types 
that way too.
DocKimbel
2-Nov-2012
[3276]
What do you call "unboxed intermediate values"?
BrianH
2-Nov-2012
[3277x3]
Side effect of compilation. The compiled code retrieves a value from 
a value slot or other indirect type, manipulates the values in typed 
stack or register variables, then puts the results back in the value 
slot or wherever.
You'd likely need to use two 64bit registers unless you use SSA or 
something.
Sorry, SSE.
DocKimbel
2-Nov-2012
[3280]
Ok, I wasn't sure what you meant by "intermediate". Red compiler 
will heavily rely on unboxing for all the optimizations.
BrianH
2-Nov-2012
[3281]
Right, otherwise there's no point to going through the trouble of 
compiling (aside from the challenge) :)
Jerry
2-Nov-2012
[3282x3]
in R3, Date! is not scalar!. In Red, Date! is scalar!. Why?
Also, in R3, Issue! is any-word!, not any-string!. But in Red, Issue! 
is any-string!
Hope I can keep learning Red while your are developing it. So I can 
help in book writing or something like that in the future. :-)
BrianH
2-Nov-2012
[3285x2]
In R3, date! isn't in scalar! because scalars need to be able to 
support +, -, * and /, and two of those don't make sense for dates.
The issue! type was changed from a string-like type in R2 to a word-like 
type in R3, but the R3 behavior isn't completely final. It will continue 
to be a word-like type, but the syntax might get some tweaking and 
some string-like operations might be added back where possible, perhaps 
in a similar way to how tuples are series/like at times but actually 
immutable.
DocKimbel
2-Nov-2012
[3287]
Jerry: I haven't decided yet for issue! datatype. By default, I stick 
to R2 model. For scalar!, Red definition might differ a bit from 
R3 one, we'll adjust that if required when the work on date! will 
begin.
DocKimbel
4-Nov-2012
[3288]
I have pushed a commit yesterday night that reimplements almost fully 
namespaces support in Red/System. It is now cleaner, fixes a lot 
of issues and it is allows faster compilation of apps that heavily 
rely on namespaces like Red's runtime code. For example, the demo 
Red script now compiles 20% faster.


Please test well your current scripts to spot eventual regressions 
caused by this change.
PeterWood
4-Nov-2012
[3289]
james_nak: When you run the Red tests, their output is logged to 
Red/quick-test/quick-test.log. Would you mind taking a look to see 
if any error message was logged.
Kaj
4-Nov-2012
[3290]
I haven't seen any regressions yet in building the bindings with 
the new CONTEXT implementation
DocKimbel
4-Nov-2012
[3291]
Good! Thanks for reporting it.
Kaj
4-Nov-2012
[3292]
Oddly, the Windows (and MSDOS) builds are changed, but I can't see 
where that's coming from
DocKimbel
4-Nov-2012
[3293]
Changed how? Size or content?
Kaj
4-Nov-2012
[3294]
Content, I suppose. Probably not size, as Windows works with pages. 
I checked them in, so they can be retested
Jerry
5-Nov-2012
[3295]
I am studying Red/System. For me, it's good enough, so I am curious: 
What can C do and Res/System cannot do?
DocKimbel
5-Nov-2012
[3296x3]
From top of my head: C has unions and can pass struct by value. Both 
those concerns should be addressed in future Red/System versions.
s/concerns/features
Another missing feature in Red/System that C has: 64-bit integers.
Jerry
5-Nov-2012
[3299]
Yeah, I thought about the lack of union.
PeterWood
5-Nov-2012
[3300]
You can address bits in C but not the current version of Red/System
DocKimbel
5-Nov-2012
[3301]
Right, no bitfields in Red/System (yet).
Kaj
5-Nov-2012
[3302x2]
Stack allocation of local structs
16 bit integers
MagnussonC
5-Nov-2012
[3304]
If I use a foreach on a c-string, how can I tell when I am at the 
last character?

tail? stringname doesn't seem to work. Maybe I need to use length 
to keep track of where I am!?
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
[3318x5]
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.