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

World: r4wp

[#Red] Red language group

PeterWood
8-May-2013
[7558]
This really is a mega-wish list. It is very possible that adds far 
too much bulk to Red/System to be added in the language.


At least the list could be the basis for the spec for a Red/System 
lib to provide much of the functionality.
GrahamC
8-May-2013
[7559]
@PeterWood - Red thanks
DocKimbel
8-May-2013
[7560x2]
My first impressions on your proposition:


1) arr[i] is a useless syntactic addition as we already have indexed 
accesses: arr/i


2) #7 and #8 are going way too far from the Red/System application 
domain, it's basically  a series abstraction. Red internal API already 
provides series (the internal API is not yet completed nor formalized 
though), so this is both unneeded and overlapping with Red standard 
library.


What you might not realize is that you already have array-like capabilities 
with Red/System pointers (including structs and c-strings). If you 
want automatic memory management in Red/System, you won't have it, 
low-level programming requires a manual management of memory for 
accuracy and avoiding unnecessary burdens.


The only array-like part that Red/System is really missing right 
now is the literal array-like declarations, which can be achieved 
without a new formal array! type. As I said earlier, adding a array! 
type would only add bound-checking abilities (which is a nice feature 
to have) and provide you with #5 as a side-effect (not very useful 
anyway, as array would be fixed-size).
One of Red/System DSL goals is to be as close as possible to the 
hardware, not as far as possible. This implies that no arbitrary 
abstraction layers will be ever added to Red/System that can't be 
more or less directly mapped onto some hardware features. 


Exceptions exist when some targets do not provide a basic feature 
that others are providing. For example, ARMv5 family do not have 
integer division, nor modulo support, so I had to implement it manually 
in the ARM emitter in assembler:

https://github.com/dockimbel/Red/blob/master/red-system/targets/ARM.r#L372


Another one is the runtime exception system recently added (THROW) 
to Red/System, which also required a specific assembler routine:

https://github.com/dockimbel/Red/blob/master/red-system/targets/ARM.r#L2008
PeterWood
8-May-2013
[7562]
Thanks for the clarificaiton, it's helpful. I keep thinking of Red/System 
as a standalone langauge (because I like it so much).
DocKimbel
8-May-2013
[7563x2]
I like it too and I think we can improve it significantly in 2.0.
Being able to do whatever C does without its outdated syntax and 
bloated toolchains is a dream coming true. ;-)
Kaj
8-May-2013
[7565x5]
Graham, if I/O is stopping you, you can have it right now in my extended 
Red binaries
With the new shared library code, I have been able to compile a shared 
library on Linux for the first time
I can compile a Red/System extension with the R3 bridge and load 
it into R3. However, only two of the COMMAND examples work:
http://red.esperconsultancy.nl/Red-REBOL-3/dir?ci=tip&name=examples
HELLO and INCREMENT work, the others segfault
DocKimbel
8-May-2013
[7570]
Andreas: thanks a lot for this new contribution! Now that shared 
lib generation support is unlocked for Linux, we'll be able to finally 
start working on the Android full support (amongs other new targets).
Pekr
8-May-2013
[7571]
According to Git it seems that global variables and on-load/on-unload 
are not yet supported. How limiting is that?
Kaj
8-May-2013
[7572]
Not very, at the moment
DocKimbel
8-May-2013
[7573]
The main effect is that Red/System init code is not run when the 
shared lib is loaded, this affects floating point exceptions flags 
and runtime error catching routines. Not a problem for now.
Arnold
8-May-2013
[7574]
@Peter I took the liberty of commenting the document here https://github.com/dockimbel/Red/wiki/Ideal-array-capabilities
We could add Nenad's comment on it too. 
It is a giant wishlist indeed :)

@Nenad, "Being able to do whatever C does without its outdated syntax 
and bloated toolchains is a dream coming true. ;-)" it is :)
DocKimbel
8-May-2013
[7575x2]
Peter, you should add an "Author:" field in the wiki page header, 
so that it's not being misinterpreted as being a Red official page.
Oh forgot it, I can edit it directly.
Arnold
8-May-2013
[7577x2]
DId you by accident wipe the page Nenad?
(No history of the document available, strange)
DocKimbel
8-May-2013
[7579x2]
I changed the title, so the URL changed too, sorry.

https://github.com/dockimbel/Red/wiki/Proposition-for-ideal-array-capabilities
Just click on [Pages] menu to list all pages from the wiki.
Arnold
8-May-2013
[7581]
I was afraid I caused this.. thx!
GrahamC
8-May-2013
[7582]
@Kaj do you have a url that takes me directly to these files?
Kaj
8-May-2013
[7583]
http://red.esperconsultancy.nl/Red-test/dir?ci=tip
GrahamC
8-May-2013
[7584x2]
Looking for examples of I/O in Red as mentioned above
Your fossil repo is very hard to follow
Kaj
8-May-2013
[7586x4]
You wanted a direct file link
You can also download as one package:
http://web.syllable.org/news/2012-11-18-20-47-Red-high-level-programming-language-first-alpha.html
It's a binary repository. The examples are in the source repositories
GrahamC
8-May-2013
[7590]
ah.. linux only
Kaj
8-May-2013
[7591]
No, why do you think so? The first link shows folders for all platforms
GrahamC
8-May-2013
[7592x2]
I was looking for hello and increment in the windows folder
http://red.esperconsultancy.nl/Red-test/dir?ci=c2427e44ef51f731&name=Windows/Red
Kaj
8-May-2013
[7594]
Those are not separate programs, they're COMMANDs in the R3 bridge 
example. And there's no binary for that
GrahamC
8-May-2013
[7595x2]
Ok you lost me again
I'm not seeing anything named r3 bridge
Kaj
8-May-2013
[7597x6]
See above:
http://red.esperconsultancy.nl/Red-REBOL-3/dir?ci=tip&name=examples
Most of the I/O examples are in GTK programs:
http://red.esperconsultancy.nl/Red-GTK/dir?ci=tip&name=examples
GTK-text-editor has reading and writing to files and URLs
What I meant when you asked for I/O are the red, red-core and red-base 
interpreter binaries. They're in the Red-test repository, the first 
I gave you
GrahamC
8-May-2013
[7603]
If you have time, a blog/tutorial on how this works would be great
Kaj
8-May-2013
[7604x4]
I'll be setting up a website for them later
Doc is keeping me occupied with coding :-)
Until then, the basic documentation is here in Announce
If you start one of those interpreters, the I/O is very simple: READ 
and WRITE like in R2