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

World: r3wp

[Rebol School] Rebol School

Dockimbel
23-Nov-2011
[4001]
/SHOW is a late addition to CALL, we used to live with the DOS window 
for years.
Singy
23-Nov-2011
[4002x2]
Well - looks like I might be living with it for a few more yet - 
grins.
I have another question - probably a dumb one - can you use make 
routine! to tap into .Net or is this impossible because it is a managed 
language?
Dockimbel
23-Nov-2011
[4004]
make routine!

 only works on LOADable libraries, so you guessed right, you cannot 
 do that for managed code.
Singy
23-Nov-2011
[4005]
Thanks Doc. However, is there a way to tap into .Net from REBOL? 
As a network admin it would be useful at times. I know you can use 
call to draw upon powershell which in turn can use .Net but that 
seems a bit convoluted. Also I can use wmic via call as well. Any 
other thoughts on REBOL and .Net integration?
Dockimbel
23-Nov-2011
[4006x4]
Doing a quick search on this topic (as it's interesting also to me 
for Red), it seems that LOADing a .Net library is at least possible 
from C++: http://stackoverflow.com/questions/757298/loading-managed-c-dll-from-plain-c-program-via-loadlibrary
From REBOL, you could set up a TCP communication channel with a .Net 
app to pass commands and receive data. You can achieve that using 
plain REBOL code or using a messaging library like 0MQ.
Maybe you could just make a simple powershell script for making it 
work as slave for REBOL.
(using a TCP channel)
Singy
23-Nov-2011
[4010]
Using a powershell script definitely works because I have tried it 
- I just used: call "powershell scriptname.ps1" and it worked. But 
of course I need to know 3 languages to do this - REBOl, powershell 
and .Net.
Dockimbel
23-Nov-2011
[4011x3]
I meant using a powershell script for writing a server that would 
receive commands from a REBOL client through TCP. The REBOL client 
could then hide the powershell commands inside adequate REBOL functions, 
making it feel more natural.
It seems to be possible to write C wrappers for managed code too: 
http://www.dotnetmonster.com/Uwe/Forum.aspx/dotnet-interop/5678/Can-Unmanaged-Code-call-LoadLibrary-on-a-managed-DLL
But, as for C++ wrappers, you need to statically make the bindings 
to given managed functions.
Singy
23-Nov-2011
[4014]
Hosting the Common Language Runtime - as per that last article sounds 
interesting - I wonder how large that would be. What about running 
REBOL in the DLR like iron python etc. Is such a thing doable? Or 
is that a blasphemous though to REBOlers?
BrianH
23-Nov-2011
[4015]
You would have to rewrite REBOL from scratch to run it in the DLR.
Singy
23-Nov-2011
[4016]
LOL - not much chance of that then!
BrianH
23-Nov-2011
[4017]
That's how the Iron* languages did it :)
Singy
23-Nov-2011
[4018]
It will be interesting to see how Doc pulls it off then when he gets 
to that stage in Red (interfacing to .Net I mean). I love REBOL but 
as a netwok admin who lives in a world of Windows being able to interact 
with all things Windows from REBOL would be heaven :))
BrianH
23-Nov-2011
[4019x2]
As someone who uses MS SQL Server a lot, being able to call R3 from 
.NET could lead to stored procedures written in REBOL, maybe :)
In that case, reimplementation starts to look pretty good, or maybe 
even a Red port if it gets PARSE support :)
Dockimbel
23-Nov-2011
[4021x2]
PARSE support: certainly! Supporting .Net  as a target for Red compilation 
(more accurately: for Red/System compilation) is in the roadmap, 
but not a high-priority though.
(but we're moving out of Rebol Schoold channel topic)
Singy
23-Nov-2011
[4023]
Well guys, I gotta go now, but thanks for all your help and for the 
stimulating discussion!
Dockimbel
23-Nov-2011
[4024]
You're welcome, thanks for bringing that interesting topic. ;-)
Pekr
23-Nov-2011
[4025]
IIRC, Max worked on R3 interfacing to .Net for some commercial entity. 
Not sure what' the current state, nor if it is going to be released 
to the public ...
Awi
24-Nov-2011
[4026]
Hi, I am trying to write a Rebol app that download some .png map 
tiles from OpenStreetMap, and display them.  Since Rebol does not 
support multithreading, while downloading every map tile, the user 
will face a non responding screen, which is not very nice. Is there 
a known trick to download in background, or something like that? 
Many thanks..
Henrik
24-Nov-2011
[4027]
Awi, maybe this is useful:

http://www.colellachiara.com/soft/Libs/async-http.r
Kaj
24-Nov-2011
[4028x2]
Not sure if this will be usable for you, but I have Red bindings 
to two OSM GTK+ libraries lined up that I will present at the GeoFreedomDay 
meeting December 10
http://www.geofreedomday.nl/2011/Red-System.html
Dockimbel
24-Nov-2011
[4030]
Looks good :-)
Kaj
24-Nov-2011
[4031]
There's the minor issue that I still have to make them, so I hope 
it will work :-)
Marco
26-Nov-2011
[4032]
@Awi: http://www.rebol.org/view-script.r?script=threaddemo.r&sid=w2hg
Awi
29-Nov-2011
[4033]
Henrik, Kaj, Marco, thanks for the help, I will look into those. 
Sorry for the late reply.
Awi
30-Nov-2011
[4034]
@Kaj: Sorry, a little of the topic. For the future, I'm planning 
to replace the Rebol 2 UI side of my app to use libchamplain or osm-gps-map. 
Hopefully I can already use red by then (currently python is in my 
mind). Which one do you think is more mature and easy to use? My 
app would only display OSM tiles and draw some objects and lines 
on it. Thanks for your opinion and pointing me into these libraries.
Kaj
30-Nov-2011
[4035x2]
Champlain is much more complete and generic, except maybe the GPS 
track functionality. However, it uses Clutter, so OpenGL, so that 
must be available on your target platform
OSM-GPS-Map is thus simpler to roll out, but it is GPL instead of 
LGPL, so it can't be used in closed applications
Awi
30-Nov-2011
[4037]
Thanks Kaj, I really appreciate it.
Marco
3-Dec-2011
[4038]
I don't know where to post this request, so I put it here:

I am translating some .h files of useful shared library to rebol 
( fmod,sdl,opengl) so if you know of a useful-multiplatform-publi-shared 
library

please give me lonks to binaries, .h files and test programs, thanks.
GrahamC
3-Dec-2011
[4039x2]
I thought someone had done fmod already ?  Was it pekr or anton ?
Oldes and R3 https://github.com/Oldes/R3-extension-FMOD
Oldes
3-Dec-2011
[4041x2]
I'm mainly using ImageMagick in a real live (R2) - here is a minimal 
set of routines - https://github.com/Oldes/rs/blob/master/projects/imagick/minimal/imagick.r
For imageMagick you can find useful parsed specs for magick_wand 
and pixel_wand routines https://github.com/Oldes/R3-extension-iMagick
Marco
3-Dec-2011
[4043]
@Oldes: Is that set minimal ?! Are there much more things to translate? 
Why don't you put it on rebol.org?
Oldes
3-Dec-2011
[4044x2]
I guess it could be even more minimalized.. this subset was enough 
for my needs. As you can see in the parsed routines, there is much 
more what can be done, but it requires time to work on it. Also I 
don't consider R3 evolving so I stoped experimenting with it and 
in the free time I would rather play with Red (but Red is missing 
decimal support so it cannot be used with bindings like FMOD or imageMagick)
Also for me it's more easier to put scripts on github than rebol.org 
as most of scripts are build from multiple files.
Janko
20-Dec-2011
[4046]
is there already any way to turn block to object like data: [ a 1 
b "c" ]  ===> data: make object! [ a: 1 b: "c" ] so I could >> do 
bind [ print a ] data ; or do I have to do that "manually" ?
Geomol
20-Dec-2011
[4047]
One way:

	data: [ a 1 b "c" ]
	forskip data 2 [change data to set-word! data/1]
	data: make object! data


I don't know, if there is a simpler function call, but you could 
wrap that into your own new function.
Janko
20-Dec-2011
[4048x2]
ah.. i forgot about change function, so my solution was more ugly
and I was thinking that there has to be something default already 
made .. thanks! I will create some func our of your code
Steeve
20-Dec-2011
[4050]
in R3:
>> append context [] [a 1 b "c"]
== make object! [
    a: 1
    b: "c"
]