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

World: r3wp

[!REBOL3 Schemes] Implementors guide

Gabriele
6-Jan-2010
[195x2]
ah, aws. there is no direct way currently. that's what you get when 
people abuse http. :-) it should not be difficult though to allow 
the user to specify a callback for aws-like signatures etc.
or, just define a aws:// scheme inside the same module as http:// 
so that 99% of the code is reused.
Graham
6-Jan-2010
[197]
so these functions are inaccessible outside of the scheme?
Gabriele
6-Jan-2010
[198]
well, back when this was written, there were no modules yet, so everything 
was actually global.
Graham
6-Jan-2010
[199]
And now it's a module and hidden !
Gabriele
6-Jan-2010
[200]
now, in principle, prot-http.r should be a module. so, they can be 
imported from there, in principle. where the module is i don't know 
(this was much after i worked on this), i guess inside system/something 
, like system/modules or something like that.
Graham
6-Jan-2010
[201x3]
oh ...there it is
system/modules/http/make-http-request
Anyway, there does appear to be some type of bug that is setting 
state to none in the port .. and so query returns none
Gabriele
6-Jan-2010
[204]
it is possible... it's not like this was greatly tested (back then, 
not many people volunteered to test...), and it was written for a 
very different R3...
Graham
6-Jan-2010
[205]
there doesn't seem to be any inbuilt trace as in r2 ....
Gabriele
6-Jan-2010
[206x2]
except from using print directly in the scheme code, there was no 
way to do that at the time.
R3's trace function is very good now though, maybe that is enough.
Graham
6-Jan-2010
[208]
trace true   ????
Gabriele
6-Jan-2010
[209]
it has more options than that :)
Graham
6-Jan-2010
[210x3]
oh .. have to restart rebol and set secure
secure allow
yeah ... very detailed
Gabriele
6-Jan-2010
[213x2]
one of the things i wanted to do, but never got to, was to parse 
the output of R3's trace, and then show you a step-by-step code execution 
like in debuggers.
if trace were to add timestamps as well, then it could be used for 
both debugging and profiling, even on programs running on other people 
systems (they just save the trace, and you just load them).
Graham
6-Jan-2010
[215]
sounds good :)
Gabriele
6-Jan-2010
[216]
now someone with free time should start writing it :P
Graham
6-Jan-2010
[217x3]
I think that's Carl :)
Well, this has been useful... we need to test http a lot more ...
I think my proposed changed still stand http://rebol.wik.is/Rebol3/Schemes/Http/Prot-http.r/Make-http-request
Steeve
6-Jan-2010
[220]
it appears to me that if all the properties of the header was kept 
as strings.
then we could construct back the header's response with 
>>enline form headers
(no need to make a foreach anymore)
BrianH
6-Jan-2010
[221]
Gabriele, I didn't modify the .r, Carl did. I'm working on it now 
though. Pardon my memory lapse, but could you post a url to RLP?
Graham
6-Jan-2010
[222]
I think you mean WETAN?
BrianH
6-Jan-2010
[223]
Yeah. I'd like the literate programming to stay if we can manage 
it, because otherwise we'll have to reorganize the code from scratch. 
Reorganizing it from existing source would be easier.
Graham
6-Jan-2010
[224x3]
http://www.colellachiara.com/soft/MD3/emitters/wetan.r
and http://www.colellachiara.com/soft/MD3/emitters/wetan.html
google is your friend ...
I use LEO for my literate programming needs
BrianH
6-Jan-2010
[227]
I use the code story model.
Graham
6-Jan-2010
[228]
So, are you reviewing all the networking code now?
BrianH
6-Jan-2010
[229]
Documentation in the code itself using comments, and you structure 
the code for human reading. To any programmer of a language that 
is designed for readability - like REBOL - reading the flow of the 
code is like reading a story. You can understand it immediately.


Reading a literate programming document is like reading a manual 
though, so unless it has story or essay structure it will be difficult 
to understand. Reading the code generated by literate programming 
is like reading a stack of 3.5 index cards that were going to be 
used as research for a story or essay, but were instead just taped 
together at random. The overall structure of the code and every hint 
of the author's intentions are lost.
Graham
6-Jan-2010
[230]
Looks like everything is opened in binary mode as there are no refinements 
yet to 'open.


So, to implement a line oriented protocol like pop, do we read until 
we get a CRLF pair?
BrianH
6-Jan-2010
[231x3]
I am reviewing the networking code now, in my available time.
Yes.
There won't be a string-mode refinement to open.
Graham
6-Jan-2010
[234x2]
shame ..
so used to doing read/lines on a text file
BrianH
6-Jan-2010
[236]
OPEN has the refinements it is going to have. The port model of R3 
is lower-level than R2. Higher-level stuff is handled in the schemes.
Andreas
6-Jan-2010
[237]
read/lines is already there in R3
BrianH
6-Jan-2010
[238x3]
READ is going to have a /text refinement, but not OPEN.
OPEN is lower-level than READ.
Sorry, READ/string, not READ/text (I forgot the proposal was renamed).
Graham
6-Jan-2010
[241]
The daytime:// protocol must be the very easiest to implement ... 
how would that be done under R3?
Graham
7-Jan-2010
[242]
Gregg you haven't finished the docs on schemes in the wiki !
Gregg
7-Jan-2010
[243]
I'm sure there was a reason Graham, or I just forgot, or...
Graham
7-Jan-2010
[244]
hehe ..