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

World: r3wp

[Red] Red language group

PeterWood
31-May-2011
[1797]
As far as i know, Red/System executables don't rely on C libraries 
either unless they are explicitly declared in the program.
Kaj
31-May-2011
[1798x3]
Correct. The question would presumably be: "Will the Red C library 
binding link with uCLibC?"
I'm binding against the ANSI C specification of the standard C library, 
so I have no reason to think that not any C library would work
However, Red will probably soon start using parts of the C library 
binding, so it's likely that future Red programs will almost all 
need to link with a C library
ddharing
31-May-2011
[1801]
Kaj, you stated: "In the past two years I made a lot of effort to 
get R3 running on Syllable Server and then Syllable Desktop, and 
just now that it was becoming somewhat usable, it's being abandoned."


What exactly is being abandoned? I tried to read back through the 
previous messages, but I'm missing something.
GrahamC
1-Jun-2011
[1802]
Carl has disappeared for a while .. with no indication as to when 
active R3 development is to recommence
Pekr
1-Jun-2011
[1803x2]
ddhaing - Carl does not do any active R3 development (unless something 
is being done without our knowledge) since 10/2011. That is half 
a year. Carl also does not treat REBOL community well, so some ppl 
get the impression of R3 being "abandoned". Carl replied to Oldes, 
that he is working on some Linux embedded contact, which even does 
not allow him to use the R3. Any question about the R3 development 
plan, stays being unanswered. My take is, that if Carl does not resurface 
soon enough, clearly stating how he plans to proceed with R3, he 
effectively burries R3 under, as ppl might get their free time to 
Red instead.
above - 10/2010
Endo
1-Jun-2011
[1805]
That is annoying, Carl should at least say when he is going to come 
back to R3, even if it is 6 or 9 months later, we should know. Red 
is going great, but I think we'll need them both because Red is a 
compiled language. I use many Rebol scripts on my customer's servers 
to be able to change them easily on the fly.
Dockimbel
1-Jun-2011
[1806x2]
Red will support high-level scripting through thanks to its JIT-compiler. 
So, building or loading new scripts on-the-fly from your compiled 
Red app will be possible.
(-through)
Endo
1-Jun-2011
[1808x2]
That will be great. How about binding? Will be similar to Rebol?
Sorry I didn't follow all the threads about Red. I'm sure you already 
think/write about it.
Dockimbel
1-Jun-2011
[1810]
Binding: only static binding. See my presentation slides: http://www.red-lang.org/p/about.html
Kaj
1-Jun-2011
[1811x2]
When an extra script is JIT-compiled, will it bind to the already 
running environment?
Or an environment of choice?
Dockimbel
1-Jun-2011
[1813x3]
If by "environment", you mean "namespace", I guess it would be wise 
to support both, using a specific DO refinement for the sandboxed 
version.
By default, it would "bind" the script to the global context.
We could optionaly "bind" to a given module (namespace) or to a sandboxed 
execution context.
Kaj
1-Jun-2011
[1816]
I say environment, because I would like it to bind to a stack of 
contexts. If it can do that, it would be enough for me
Robert
2-Jun-2011
[1817]
Only following this whole cool stuff here from the side, but what 
would be really cool is, if Red can live without any specific C lib 
binding. Either by providing the used functions itself in a sideeffect 
free version or by adding support to a OS free lib that can run on 
bare metal.
Dockimbel
2-Jun-2011
[1818]
Robert: being free from any dependency (including C lib) is my intention, 
but:
- C lib is available as system library in any major OS

- C lib functions are more optimized, so will run faster than Red/System 
alternatives


However, as I would like to be able to make Red (or just Red/System) 
run on many embedded platform too (e.g. Arduino and NXT), I don't 
want to have to statically link with C lib there (because of the 
memory footprint). My current idea is to provide both: C lib bindings 
and alternative functions coded in Red/System only, in a transparent 
way for the user.
Endo
2-Jun-2011
[1819]
That is the most preferable way I think.
Henrik
2-Jun-2011
[1820]
Doc, hah! I was about to ask about the Arduino. :-)
Robert
2-Jun-2011
[1821x3]
Doc, the thing is, yes on an OS there is a c lib. But what if you 
don't have an OS or don't need one?
With all the plug computers coming with server sized ARM processors, 
being able to create bare-matel appliances that you just plug in 
and which are than balzing fast, is a pretty cool setup.
So, how about a way to always keep a list of external used functions? 
This make it simpler to make Red totally stand-alone later. The hard 
part to get rid of all the lics & OS stuff is, that you have to find 
out, which functions you have to "clone".
Dockimbel
2-Jun-2011
[1824]
I would be suprized if there was no C compiler for all those plug 
computers, but anyway, I will do my best to have a dependency-free 
Red core option. I will keep all the core bindings in separate per-OS 
files, so it will be easier to track them.


I guess it would be fun to implement a micro-OS in Red/System for 
these micro-platforms, I always wanted to get my hand on a custom 
TCP/IP stack implementation :-) .
Endo
2-Jun-2011
[1825]
I just hope that this will not make development time much longer.
Robert
2-Jun-2011
[1826x2]
There is a C compiler but the clib is mostly dependent on the OS 
as well. So, no standalone, bare metal C lib. That's the problem. 
Using the clib, you need to have the OS as well.
Like this stuff here: http://sourceware.org/newlib/

See section 14.1
Dockimbel
2-Jun-2011
[1828]
Endo: I will not let those sub-projects interfere with the main roadmap, 
they should just blend in. For example, the SheevaPlug could be a 
nice platform to develop and test the ARM port for Red/System: http://en.wikipedia.org/wiki/SheevaPlug
Endo
2-Jun-2011
[1829]
The manufacturer is Marvell, that's fun :)
Kaj
2-Jun-2011
[1830]
Implemented pseudo-random numbers in the C library binding. Everybody 
can start writing console games now ;-)
Henrik
2-Jun-2011
[1831]
and stock prediction tools
Kaj
2-Jun-2011
[1832]
I wouldn't want to put the chimpanzee out of work that they're using 
here
Robert
2-Jun-2011
[1833]
Doc, I have a SheevaPlug here. :-) That's the bare metal system I 
want to use :-)
Dockimbel
2-Jun-2011
[1834]
Well, it runs on Linux I guess, so no issue with libc?
Kaj
2-Jun-2011
[1835x8]
Implemented signals in the C library binding
So you can now for example make a server program that properly reacts 
to system signals
However, it may not yet work until Red generates cdecl functions
To get a handle on why Red/System tries to replace C, I think it's 
interesting to compare this function prototype:
void (*signal(int sig, void (*handler)(int)))(int)
Here's the Red binding, basically the same prototype in Red/System:
on-signal: "signal" [  ; Register handlers for receiving system signals.
	signal		[integer!]
	handler		[function!]  ; Flag or callback with integer! parameter
	return:		[function!]
]
I don't even know if I've translated that right, because I get a 
headache trying to read the C prototype
Andreas
2-Jun-2011
[1843]
typedef void (*sighandler_t)(int);
sighandler_t signal(int signum, sighandler_t handler);


Easier to read :) So yes, the translation looks correct. It does 
not carry the same amount of information, though (the signatures 
of the signal handler functions is missing).
Kaj
2-Jun-2011
[1844x3]
Yes, no typed pointers in Red yet
Implemented ABSOLUTE, quicksort and binary search
Again, SORT and binary search may not work yet, because they take 
a comparison function, that should be cdecl