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

World: r3wp

[Red] Red language group

Kaj
4-Jun-2011
[1878x2]
For some functionality, I need to have access to the stdin, stdout 
and stderr identifiers. For syscalls, they're simple integers, but 
in the C library, they're pointers to file descriptors. There's currently 
no way to get their values
C programs import them as external symbols, so it seems to me that 
#import should be extended to do that, as opposed to just importing 
functions
Andreas
4-Jun-2011
[1880x2]
Pekr, as Kaj already said, currently the minimum target is a 32-bit 
CPUs (with an MMU, I'd add). The 8-bit Atmel Arduino will likely 
stay out of reach for a while, but a 32-bit ARM-based Arduino-compatible 
thing (such as the "Netduino" or Microchip's "chipKIT") might be 
realistic sooner.
Kaj, for importing symbols we could use a "value:" keyword similar 
to the "return:" keyword currently used in functions:

#import ["libc.so" cdecl [stdin: "stdin" [value: [integer!]]]]
Kaj
4-Jun-2011
[1882]
Fine with me
Dockimbel
4-Jun-2011
[1883x8]
Msvcrt.dll: thanks, I have pushed a fix for that.
Netduino: this is a platform that could be easily supported by Red/System 
once we'll have an ARM native code emitter.
Andreas: agreed for the #import extension syntax. I am adding that 
feature to the todo-list, and will look into the PE format specs 
to see how it is encoded.  What is required in ELF to support such 
imports?
Pushed a new commit:

- added support for callbacks (just place 'callback in a function 
attribute block, see http://static.red-lang.org/red-system-specs.html#section-6.3)
- specification draft revision 11
Quick-Tests documentation on red-lang.org updated to latest revision.
The callback support has just been tested for correct compilation, 
I haven't tested it with a real case.
Looking at the disassembled code, I forgor to set correctly the callback 
epilog...will push a fix for that in a minute.
Fix pushed.
Kaj
4-Jun-2011
[1891]
Implemented date and time functions in the C library binding
NickA
5-Jun-2011
[1892]
Doc, could you please add a more obvious Paypal donation button to 
the Red home page?
Dockimbel
5-Jun-2011
[1893x4]
Hi Nick, I was waiting to have a new mailbox @red-lang.org set up 
first. In the meantime the donation button at cheyenne-server.org 
can be used, the Paypal account is personal (even if it is @softinnov.com).
I need to read the gmail docs for setting up a custom domain.
Nick, thank you very much for your donation!
I have set up a new account on Google Apps for red-lang.org and added 
MX records, so my new mailbox should be ready by tomorrow. I will 
also create a new Paypal account for Red once the mailbox will be 
ready.
GiuseppeC
5-Jun-2011
[1897]
Doc, I have not read anbything about RED and I am just curious.
Which are the main differences between RED and REBOL ?
Dockimbel
5-Jun-2011
[1898x3]
Red is compiled to native code, REBOL is interpreted.
There is a bit longer description here: http://freshmeat.net/projects/red-language
And more details here: http://www.red-lang.org/p/about.html
GiuseppeC
5-Jun-2011
[1901]
Read ! I have understood the differences and why your are leaveing 
the REBOL world for the RED world.
BrianH
5-Jun-2011
[1902]
Well, "leaving" might be a little strong. Red is based on REBOL, 
can coexist with REBOL very well (in theory), and most of the people 
working on it are part of the REBOL community in one way or another. 
They're complementary projects.
PeterWood
5-Jun-2011
[1903]
and REBOL 4 will be written in Red :-)
Kaj
5-Jun-2011
[1904x2]
Implemented a separate binding for the floating point math library
However, it can't work yet, because floats are 64 bits in most implementations, 
and Red can't pass those by value
Kaj
6-Jun-2011
[1906x4]
Ah, I see Doc will need to implement float support to back up his 
n-body boast :-)
Implemented remaining string parsing and file functions
The C and math library binding is now pretty much complete, at the 
level of the original ANSI standard. I've left out some stuff that 
is too implementation dependent and not strictly needed
A few features are waiting for extra support in Red/System
Mchean
6-Jun-2011
[1910]
Doc, love the painting you used for the  'What is the state of Rebol 
World?'  I've forgotten who the artist is do you know?
Kaj
6-Jun-2011
[1911x4]
I know it from Asterix :-)
The examples in 10.1 and 10.2 use hex numbers in lowercase
Am I right when I assume that #include does not prevent against double 
inclusion of the same file?
Is NOT evaluated left to right? It seems to have lower priority
PeterWood
6-Jun-2011
[1915]
#include was changed to only include a file once a little while ago. 
There was a comment to that effect in the commit notes.
Kaj
6-Jun-2011
[1916]
Cool, thanks
BrianH
6-Jun-2011
[1917]
If Red follows REBOL's evaluation levels, NOT would have lower priority 
than all operators. Two levels: Operators, and everything else.
Kaj
6-Jun-2011
[1918x2]
It would actually make my current code case nicer, but I need to 
be sure it's intended
Does it mean NOT is handled as a function? It's listed as an operator
BrianH
6-Jun-2011
[1920]
Operators are infix. Prefix is functions. But it might be implemented 
as a special case builtin, which would make it what other languages 
call prefix operators.
Kaj
6-Jun-2011
[1921x2]
Operators in Red are both infix and prefix
The REBOL manual also fails to note the fundamental difference between 
NOT and the other logical functions/operators
Dockimbel
7-Jun-2011
[1923x5]
Mchean: the second painting I have used is "The Raft of the Medusa" 
from the french painter Theodore Gericault: http://en.wikipedia.org/wiki/The_Raft_of_the_Medusa
Hex lowercased: thanks for reporting, fixing that for next spec release.
#include keeps an internal list of already included files.
NOT is evaluated the same as other functions. As BrianH says, only 
two levels of evaluation, same rules as in REBOL. In the specification, 
it is listed under the "Infix Operators" category, I should either 
move it out or add some notes.
Operators in Red are both infix and prefix

: right, same as in REBOL, so, same limitation for using an operator 
in prefix mode.