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

World: r4wp

[#Red] Red language group

Pekr
28-Mar-2013
[6752x2]
I don't care about Curl, I regard it being an interim solution. Any 
REBOL-like language has to support what makes REBOL being a REBOL 
in a first place. And one of its concepts is abstracted interfacing 
- ports, schemes, that it :-)
I did not say anything against float support. Actually I said - Yes. 
But my (most probably limited) understanding is, that float support 
for Red is easier than ports etc., so that it will be done, and IO 
comes next ...
Oldes
28-Mar-2013
[6754]
If decimal support would be so easy, it would be here already:)
Pekr
28-Mar-2013
[6755x2]
Well, decimal support is in Red/System already, no? To some extend. 
Of course I don't know, if it makes bringing decimal support for 
Red any easier, maybe not ....
extend = extent ....
DocKimbel
28-Mar-2013
[6757]
Right, adding basic float support to Red is not difficult, but as 
floats are not needed internally to build Red, they are low priority 
(but if someone wants to contribute it, it will be welcome). Moreover, 
the runtime lexer is disposable code, it will be soon replaced by 
a new one with Unicode support and more complete syntax support. 
So extending it now for additional literal forms is a bit of waste 
of time.


If someone is interested in implementing float support anyway, the 
decimal! name is reserved for a future BCD datatype, so possible 
names are: real! or float!. It will be a 64-bit float, so mapped 
underneath to Red/System float! type. A support for float32! at Red 
level is not planned, converting float! to float32! at Red/System 
level when needed (i.e. OpenGL API) should be enough.
DocKimbel
29-Mar-2013
[6758]
More screenshots of OpenCV binding progress: http://www.wuala.com/fjouen/Code/OpenCV/Red/pub/
Gregg
29-Mar-2013
[6759x3]
I've started on some Red mezzanines in %Red/mezz/ here. Early days, 
but my hat is off to Doc for how far Red has come already. Yes, I 
crash the console a lot, and I can't DO files yet, but I can paste 
code into the console, play, and still make really good progress.
Doc will have final say over things, particularly what he needs in 
place to make Red self-hosting, but certainly post suggestions for 
your most-used mezzanines.
This is just playground stuff right now, not on github anywhere yet.
DocKimbel
29-Mar-2013
[6762]
Great initiative Gregg! Hope that more people will join.
Gregg
29-Mar-2013
[6763x2]
BTW, Doc, since you did BIND yesterday, I added COLLECT. Need to 
test more, but it works!
HELP and WHAT are next on my list.
DocKimbel
29-Mar-2013
[6765]
Thanks, great addition!
Bo
29-Mar-2013
[6766]
I tried to compile the OpenCV test script for Linux-ARM on a Windows 
system, and I get the following error:

*** Compilation Error: invalid import specification at: libopencv

Is this because I need OpenCV installed on Windows first?
DocKimbel
29-Mar-2013
[6767x4]
Look in %opencv.reds, the mapping of libopencv for Linux is missing. 
If you can add one there it should compile.
The compiler doesn't need that the imported libs be installed locally 
for the compilation process to work.
The Red/System imports are statically linked into the executables, 
they are just declarations.
linked
 is a bad choice there, "encoded" will be more accurate.
Bo
29-Mar-2013
[6771]
OK.  Thanks!  I'll give that a try.
DocKimbel
29-Mar-2013
[6772]
Are you trying it on RaspberryPi? I'll be interested too to know 
if it can work on the RPi already.
Bo
29-Mar-2013
[6773]
That was my plan, to see if it would work there yet.
DocKimbel
29-Mar-2013
[6774]
Bo: this should help you: http://stackoverflow.com/questions/3122448/where-does-opencv-install-its-libs-in-ubuntu
Bo
29-Mar-2013
[6775x3]
I already found it.  Thanks.
Unfortunately, I am getting the same error trying to run it on Windows 
and Linux-ARM:

# chmod 755 opencv-cam-test
.# /opencv-cam-test

./opencv-cam-test: symbol lookup error: ./opencv-cam-test: undefined 
symbol: isNaN
On Windows I get:


The procedure entry point isNaN could not be located in the dynamic 
link library MSVCRT.DLL.
Kaj
29-Mar-2013
[6778x2]
Gregg, you can DO READ %file in console-pro, or DO READ "url"
You can also give console-pro a file or URL to DO on the operating 
system command line
Gregg
29-Mar-2013
[6780x4]
Thanks Kaj!
Ah, then need to get libcurl...
And sqlite3...
Do I need everything in %MSDOS/Red/?
Kaj
29-Mar-2013
[6784x2]
Pretty much, but it's all there, so you can unpack it in one go
Try VIEW ["Hello" button "OK" [quit]]
Gregg
29-Mar-2013
[6786x2]
The zip doesn't want to download for me. Must be a sign I should 
run lean for the moment, and bug Doc for a few features. :-)
I'm really impressed with all you've done Kaj. And since I'm going 
to start on a DLL interface shortly myself, I will no doubt bug you 
for advice.
DocKimbel
30-Mar-2013
[6788]
I will be mostly offline this weekend as I'm making a trip by the 
coast.
Gregg
30-Mar-2013
[6789x3]
Have a nice break Doc.
I've hacked Ladislav's INCLUDE to let me build .red scripts, and 
I built a console with my mezzanines. When you get back, I'll chat 
with you about it, and send it to test. It compiles fine, but some 
funcs fail if compiled in. If I then paste them into the console, 
they work fine. e.g.

negate: func [n [number!]] [n * -1]
zero?: func [n [number!]] [n = 0]
divisible?: func [a b] [0 = remainder a b]
even?: func [n [number!]] [zero? remainder n 2]
even?_a: func [n [number!]] [0 = remainder n 2]
even?_b: func [n [number!]] [divisible? n 2]
remainder: func [
	a [number!]
	d [number!] "Divisor"
][
	a - (d * (a / d))
]

zero? 0 == true
zero? 1 == false
remainder 10 3 == crash!
divisible? 10 3 == false
divisible? 10 2 == false  INCORRECT
even? 10 crash
even?_a 10 == false  INCORRECT
even?_b 10 == false  INCORRECT
Kaj
30-Mar-2013
[6792x5]
Thanks, Gregg. Did you wait for the zip to be prepared? It takes 
the server around two minutes to create your archive of the latest 
versions
You can also use Fossil to download and update it comfortably:
http://web.syllable.org/news/2012-11-18-20-47-Red-high-level-programming-language-first-alpha.html
ZERO? is already implemented as a fast routine in my common deposit:
http://red.esperconsultancy.nl/Red-common/dir?ci=tip
Gregg
30-Mar-2013
[6797x2]
Ah, I didn't konw it built on demand. I was impatient.
I will steal your ZERO? :-)
Kaj
30-Mar-2013
[6799]
That's fine. There are several things in my repositories that may 
not be suitable for inclusion in core Red. Originally, Doc wanted 
natives, but he has also included some mezzanines by now. My Red-common 
repository is self-sufficient, but the others are bindings that core 
Red may not want to depend on, except perhaps functions from the 
C library, because core Red already links to that
Gregg
30-Mar-2013
[6800]
Yeah, I'm posting mezz stuff here so it can be evaluated and discussed, 
along with how to organize things, without polluting the core yet.
Kaj
30-Mar-2013
[6801]
Funny, it looks like you introduced a crash! type next to error! 
above :-)