Currently, to use Red/System Code from a Red program you need to use a routine! - http://www.red-lang.org/search/label/routine
At the moment, only integer! and logic! values can be passed transparently between Red and Red/System. Other datatypes have to be converted, inside the routine, to be usable.
For example, if you have a string! datatype as a parameter of a routine, Red will pass the data to the routine as a red-string! structure:
red-string!: alias struct! [
header [integer!] ;-- cell header
head [integer!] ;-- string's head index (zero-based)
node [node!] ;-- series node pointer
cache [c-string!] ;-- (experimental)
]
It needs to be converted to a Red/System c-string! before you can use it in the routine. At the same time, you must cater for the encoding differences between Red string!s and Red/System c-string!s. A red string! may be ISO-8559-1, UCS-2 or UTF-32 encoded.
You must cater for the opposite if you wish to return a string! to a Red program from a routine.
Other datatypes will need to be handled in similar ways.
I'm sure that passing values between Red and Red/System will be made much, much easier in future. However, I wouldn't personally expect that until after Red reaches version 1.0.