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

World: r3wp

[Core] Discuss core issues

Graham
1-Jul-2009
[14125]
Janko, I see you were using rebXR in 2002 ... so why not just use 
xml-rpc for this as well?
Janko
1-Jul-2009
[14126x6]
I haven't seen it but heard of doc's task manager, and he uses multiple 
worker processes in cheyenne. I am certain those two (or one if it's 
the same) are much faster and robust. I am mostly experimenting here 
on how a "message passing with actors" system would or could look 
in REBOL , so I am not focused on implementation, but for now more 
on look of code.
I will post the code shortly so you can try it, but I am about to 
do big changes to it.. if actors will remain rebol objects then I 
will make whole lib more OO, refine the methods etc.. I have another 
option where actors would become just functions (this would make 
them more lightweight (which is important at actor systems) and it 
would enable some cool things, but I am not 100% if it will all work.
RPCs and message passing are quite different things and whole code 
logic works differently .. async message passing is " send and pray 
" (quote by Erlang inventor) model while RPC are "request response" 
.. I have been folowing erlang and message passing for so long but 
I wanted to see how it really is in practice thats why I started 
making this actor-net rebol library
I wrote something about XMLRPC into webservices channel..
two processes ping ponging to eachother 10 times with actor-net would 
look something like this now

pinger: make actor [ act-match: [ 

    [ 'pong count addr ] [ ~send addr compose [ ping (count) (get-my-addr) 
    ] ] 
    [ ''bye ] [ print "ok, bye" ]
]
ponger: make actor [ act-match: [ [ 'ping count addr ] [ 

        ~send addr compose ( either lesser? count 10 [ [ pong (count) (get-my-addr) 
        ] ] [ [ bye ] ] )
    ] 
]


and you would add the third actor that would act only once to "lend 
them the ball" to start them


server: make once-actor [ act-once: [ ~send get-actor 1 compose [ 
ping 0 (get-actor 2) ] ] ]


But the library is still quite messy .. especially with adresses 
of actors, global vars, I have a big list of things now to improve 
after I made that thing on the screencast
(ping pong above can run in the same rebol process, multiple on same 
computer or on different computers (it's just the matter of addreses-- 
which are not well thought out yet)
Graham
1-Jul-2009
[14132x2]
I need to view various files in a browser and if I use 'browse, then 
this blocks the UI until the browser appears with the file.  I just 
tried with a xmlrpc server accepting the url and it works fine.
the xmlrpc-exe returns immediately ( with an error though - no matter 
) and the page pops up.
Janko
1-Jul-2009
[14134x3]
btw.. because I think Doc uses TCP with task master I think it should 
be no problem to work over different computers also
how do you get a return value .. with xmlrpc-exe ... what do you 
mean a page pops up?
(the previous version sources , examples and 2 more blog posts about 
actor-net can be found here http://itmmetelko.com/blog/2009/06/08/playing-with-making-an-actor-like-distributed-system-in-rebol-3/
)
Graham
1-Jul-2009
[14137x3]
xmlrpc-exec/async pc [ f ] :local-function
what I mean is that I use xmlrpc to start up the browser and bring 
up the page I want
result: xmlrpc-exec pc [ add 2 4 ]
Janko
1-Jul-2009
[14140]
I have to admit I don't get what borwser (you mean like IE FF?) has 
to do with xmlrpc in this case ... and I.. aha this is a GUI app 
you you don't mean that xmlrpc-exec returns imediately (without waiting 
for result -- thats why I ask how you get the resut then) .. but 
that GUI doesn't block while waiting for it
Graham
1-Jul-2009
[14141x8]
Yes, that's correct.  My gui doesn't block while I wait for FF to 
start up and load the page I want.
Doc wrote async-call which would also work .. except it locks up 
VID when I recently tested it.
How does one determine which of the interfaces reported by get-modes 
tcp:// 'interfaces is the active one??
I see lo0, if11, if25, if13
This is pretty cool ... I am sitting in front of my laptop, and on 
the other side of the room is my 46" LCD screen with my media PC 
attached.  I installed the rebxr xmlrpc server on it .., and I have 
cheyenne installed on the laptop.  I click on a file in my application, 
it gets downloaded to the www directory in cheyenne, and then I send 
a command to the xmlrpc server to browse to that file so that it 
displays on the big screen but is served up by the laptop's cheyenne 
server.
It's now quite remote controlling a browser on another PC because 
all I can do is tell it to open a new page.
not quite
I presume using xmlrpc I can ask the server to spawn more instances 
of itself on different ports so that I cah have a number of different 
"tasks" available
DideC
1-Jul-2009
[14149]
Question : 
I have a script like this :

ctx: context [
	markup: "my script with <%val1%> and <%val2%>"
	val1: "Hello"
	val2: "Bye"
	build: does [build-markup markup]
]

It produce this result :
>> ctx/build

== {my script with ***ERROR no-value in: val1 and ***ERROR no-value 
in: val2}


Its because 'build-markup use 'parse and 'parse looks its word in 
the global context.

Is there any binding tricks to solve this ?
james_nak
1-Jul-2009
[14150]
Smart Guys... What's the trick to using a variable to hold an email 
address when using "Send"
Send/header  some-email-address Some-text myheader
I always get a failed email because  the "To:"  word is not set.
If you directly type in an email address such as
Send/header  [confused-:-rebol-:-com] Some-text myheader

It works. I've tried composing, reducing, scrubbing and washing and 
the stains still don't come out, if you know what I mean.

There must be some trick. (And I know you know)
Henrik
1-Jul-2009
[14151]
what is the type of some-email-address?
james_nak
1-Jul-2009
[14152x2]
It's an email
Its weird. I've tried placing it in a block, etc.
Henrik
1-Jul-2009
[14154]
then it would be a bug, if it doesn't get passed to 'send.
james_nak
1-Jul-2009
[14155]
I can't believe after all these years that it's still there.
Ladislav
1-Jul-2009
[14156x2]
just had a look at the SEND source and from what I saw it is highly 
unlikely that it does not work Moreover, I am actually using the 
SEND function from time to time and no such problem occurrred.
so, I bet, that your description is missing some detail
james_nak
1-Jul-2009
[14158]
Henrik and Ladislav, 

OK, stupid me. I was using a word name that I shouldn't have. Thanks!
Gregg
1-Jul-2009
[14159]
Didier, assuming you can't preface the markup fields with the context 
name, e.g. 

  markup: "my script with <%ctx/val1%> and <%ctx/val2%>"


either manually or programmatically, hacking build-markup may be 
best. e.g., add a /with refinement that takes the object and bind 
to that.
sqlab
2-Jul-2009
[14160]
DideC.
even this does not really use markup, it works at least
ctx: context [
	markup: ["my script with" val1 "and" val2]
	val1: "Hello"
	val2: "Bye"
	build: does [build-markup form reduce markup]
]
DideC
2-Jul-2009
[14161]
Obviously, I was tired yesterday !! If not I would have done this 
without asking. By the way, thanks sqlab!
Janko
3-Jul-2009
[14162]
I wrote a blogpost with code about the usage of actor-net lib that 
we chatted with Graham a little (few days back) http://itmmetelko.com/blog/2009/07/03/rebols-actor-net-used-for-real-distributed-system/
Graham
3-Jul-2009
[14163]
Some type of diagram would be useful.
Janko
3-Jul-2009
[14164]
you mean like who sends who what?
Graham
3-Jul-2009
[14165x2]
where are the actors?  where are the workers?
what does actor mean?  what does worker mean?
Janko
3-Jul-2009
[14167x2]
actor is general name for these units of code that run in "paralel" 
.. each that code block (REBOL object) is one actor ..  (make actor 
, make timer-actor make once-actor .. these are 3 types of actors)
it's somewhat similar to what erlang has
Graham
3-Jul-2009
[14169]
Ah .. so you're assuming your readers know erlang?
BrianH
3-Jul-2009
[14170]
Interesting article - with some polish this could be interesting 
to the http://lambda-the-ultimate.orgcrowd :)
Graham
3-Jul-2009
[14171]
I suspect a lot of rebol readers won't be fully conversant with Erlang.
BrianH
3-Jul-2009
[14172]
Except Maarten :)
Graham
3-Jul-2009
[14173]
who said he was going to implement a distributed Erlang system in 
Rebol .... some time ago !
BrianH
3-Jul-2009
[14174]
However, concurrency fans will definitely be interested in the Erlang 
model, so this is good news for us if it can be efficient.