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

World: r4wp

[#Red] Red language group

Kaj
28-Jun-2013
[9018x2]
Generating apk...
/bin/bash: builds/tools/aapt: Bestand of map bestaat niet
Signing apk...
jarsigner: unable to open jar file: builds/eval-unsigned.apk
Aligning apk...
/bin/bash: builds/tools/zipalign: Bestand of map bestaat niet
...all done!
Bestand of map bestaat niet
 means the file doesn't exist
Arnold
28-Jun-2013
[9020]
life w be so muchh easier ;-)
Kaj
28-Jun-2013
[9021]
It looks for aapt and zipalign in the wrong place, but they're not 
available, anyway
Bo
28-Jun-2013
[9022]
I'm diving into my first attempt at recursion in Red/System.
james_nak
28-Jun-2013
[9023]
Thanks Doc, that did it.
DocKimbel
28-Jun-2013
[9024]
Kaj: it worked fine on my Ubuntu system. Did the script download 
the binaries in builds/tools/ ? If not, can you please trace the 
reason why it didn't?
Kaj
28-Jun-2013
[9025]
I didn't see any download activity
DocKimbel
28-Jun-2013
[9026]
Try to delete the whole builds/ folder and try again.
Kaj
28-Jun-2013
[9027x2]
It worked now
I ran the script with R3 first, and it bombed out just before the 
downloading. It does very little error checking, so the folder structure 
was already created, and afterwards it skips the download completely
DocKimbel
28-Jun-2013
[9029]
Yes, you're supposed to use R2 for Red. ;-) The download is done 
once only, so it doesn't need extensive error checking, if something 
goes wrong, just delete the builds/ folder and run it again.
Kaj
28-Jun-2013
[9030]
Sure, but nobody knows that's what to do
DocKimbel
28-Jun-2013
[9031]
Now everbody knows. :-)
Kaj
28-Jun-2013
[9032]
Some people claim there's a world outside of AltME
PeterWood
28-Jun-2013
[9033]
They are wrong,  there is only the hell known as Stack Overflow.
Kaj
28-Jun-2013
[9034]
:-)
Arnold
28-Jun-2013
[9035]
:-)
Arnold
29-Jun-2013
[9036x3]
You can't call Red/System functions in Red

 that almost literally made me fall of the chair. Somehow I really 
 expected that to be inherently supported. I cannot make any chocolat 
 from the routine example atm, but as I see it now, it requires me 
 to reprogram/copy my Red/system program to Red and renaming FUNCTION 
 to ROUTINE. This means double maintenance in my eyes. 

This is definitely a point to add to the wishlist if you asked me.
Especially what good is the #system-global for then? Ah like #system 
in R/S documentation chapter 17
Also from this:

It will be possible to export some Red/System functions to be callable 
from the Red language layer. The method for such export hasn't been 
decided yet. Among possible options, it can be:

A special attribute 
in header that will list the functions to export
A function's attribute 
in the specification block
A compiler directive


I can taste that the integration is just around the corner. But which 
one? :)
Why should one want to 'hide' functions in a Red/System script you 
include? And why can one include a Red/System script in a Red script 
when you can't call the functions in it?
What is the most common use of this in practice later on?
Arie
29-Jun-2013
[9039]
Are there prefix equivalents for the infix operators (+ - etc.) ? 
When I enter + 3 6 in the console, it yields 6.  Why?
PeterWood
29-Jun-2013
[9040x5]
I can't authoriatively answer your first question (but I would guess 
the answer is no)


The interpeter  has returned 6 because it is the last value that 
it evaluated.
It would seem to be a bug that no error is raised when + has been 
used with its first argument missing.
The compiler also seems to have a bug:

The following code complies:

Red []

a: func [] [
	+ 3 6
]

print a
Its output is

3
Would you mind adding your finding to the bug tracker - https://github.com/dockimbel/Red/issues?state=open
Arie
29-Jun-2013
[9045]
done
DocKimbel
29-Jun-2013
[9046x5]
Just as a reminder: error handling is not implemented yet in Red, 
so no need to add ticket about not raised errors.
The few error reports you could encounter in Red are right now, just 
hardcoded, to be able to do minimal work with Red without wondering 
what's happening.
Arnold: it seems you didn't get that Red and Red/System are two different 
languages. As they are living in different abtraction layers, you 
can't expect to directly include code from one in the other. There 
are special interfaces for that purpose, ROUTINE is the main one 
for calling Red/System code from Red. That doesn't mean that all 
your Red/System code needs to be in a routine, just the interfacing 
code. The rest can be in different libraries that you load into Red/System 
space using #include in #system or #system-global directives. Including 
Red/System code into Red directly is not possible, because, these 
are two different languages. So you need to wrap your Red/System 
code (and Red/System includes) into a #system* directive.
Remember that Red compiles to Red/System code. The #system* directives 
are ways to inline Red/System code into Red.
...or more accurately: inline Red/System code into the output of 
Red program compilation.
Arnold
29-Jun-2013
[9051x3]
No in my view Red compiled to Red/System code and then to executable, 
so including the lower level Red/System in a Red program even by 
including other scripts would be evident.
And because I am compiling in this two-step rocket Red - Red/System 
and viewing Red/System as the low-level Red program ....
add 1 1
2
DocKimbel
29-Jun-2013
[9054]
What you describe is not #include directive, it's #system. Including 
Red/System code into Red (means mixing both Red/System and Red source 
codes) is simply not possible.
Maxim
29-Jun-2013
[9055]
coudn't it be done with the jit, if given a block to compile on demand? 
 (not saying its implemented, just thinking about how it could be 
done).   sort of like inlining ASM code in C.
Kaj
29-Jun-2013
[9056]
You'd wrap ASM in C with an ASM marker, wouldn't you?
Maxim
29-Jun-2013
[9057]
yes, in the compilers which support it.
Kaj
29-Jun-2013
[9058]
Same thing. You need to wrap Red/System code inlined in Red with 
a Red/System marker
Maxim
29-Jun-2013
[9059]
ok, so isn't that what Arnold is asking, basically?
Kaj
29-Jun-2013
[9060]
No, he wants Red to read his mind. That's a common request among 
people :-)
Maxim
29-Jun-2013
[9061]
I think its a common request in all languages ;-)
Kaj
29-Jun-2013
[9062]
One could think of some constructs to integrate Red/System and Red 
even more closely than through a ROUTINE, but it's questionable whether 
it would be worth it
DocKimbel
29-Jun-2013
[9063]
Android APK build script now works fine on OSX too.
Bo
29-Jun-2013
[9064x3]
Finished my first crack at recursion in Red/System.  Works great! 
 Uncovered a bug (not in recursion, but in pointer indexing), but 
found a way to work around it for now.
My Red/System script (through some technical wizardry) can now process 
10 seconds of video from an HD source at 30fps and isolate motion 
areas of a particular size in a fraction of a second on a 700MHz 
Raspberry Pi.
:-)
PeterWood
29-Jun-2013
[9067]
Impressive !!!