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

World: r3wp

[!REBOL3 Schemes] Implementors guide

BrianH
5-Jan-2010
[10]
We need a new scheme specification dialect though - I have some ideas 
in that regard.
Graham
5-Jan-2010
[11]
Eh?  I can get the source from the console .. how is this not the 
real source?
BrianH
5-Jan-2010
[12x4]
And there is no http server support yet.
The source from the console was generated from the scheme dialect, 
and that source was originally generated from the .rlp. What you 
see at runtime is not what gets written. You need to get on DevBase 
to see the real source.
The R3 and R2 development process uses a lot of code that generates 
code; FUNCT is one such example, but not the biggest.
Heck, 2.7.7 uses two functions that generate and run code at *runtime*: 
APPLY and MAP-EACH, both native in R3.
Graham
5-Jan-2010
[16]
well, this is confusing ...
BrianH
5-Jan-2010
[17x2]
Tell me about it.
It's more confusing to understand the big picture than it is to actually 
develop and use the code. The code generators are quite helpful.
Graham
5-Jan-2010
[19]
ok, so instead of seeing

make object!

the real source says:

make system/standard/port-spec-net
BrianH
5-Jan-2010
[20x2]
Plus, afaict the http spec that Gabriele wrote (the one in the doc) 
was written before most of the helper functions, so it doesn't take 
advantage of their helpfulness. It might be best to start with %mezz-ports.r 
in #26, and then %prot-http.r in #27.
Use LF to see the files.
Graham
5-Jan-2010
[22x2]
so I see prot-http.r and prot-http.rlp
and I use get to fetch the files .. and don't even need %prot-http.r 
:)
BrianH
5-Jan-2010
[24]
Yes you do, because the .rlp was used to generate the original .r, 
not the current fixed .r.
Graham
5-Jan-2010
[25]
I meant you don't need the "%" ...
BrianH
5-Jan-2010
[26]
So, trying to port your http patches to R3? Funny, I was doing the 
same thing this evening. Wanna work together, or should I work on 
the reorg and server support instead?
Graham
5-Jan-2010
[27]
Nope ... I was just peeking at this stuff ...
BrianH
5-Jan-2010
[28]
Ah, cool. Let me know what you figure out.
Graham
5-Jan-2010
[29x2]
but that is an interesting thought ...  a bit out of my depth so 
far.
Just want to understand what is being done a little ...
BrianH
5-Jan-2010
[31]
Not for long. People don't stay newbies for long with R3 :)
Graham
5-Jan-2010
[32]
Is there anything like net-utils ?
BrianH
5-Jan-2010
[33]
Don't know what those do yet in R2. Check mezz-ports.r in #26 - that 
is where that kind of thing would be.
Graham
5-Jan-2010
[34x4]
I see this ...

system/intrinsic/parse-url: make object! [
	digit:       charset "0123456789"
	digits:      [1 5 digit]
	alpha-num:   charset [#"a" - #"z" #"A" - #"Z" #"0" - #"9"]
	scheme-char: insert copy alpha-num "+-."
Shouldn't some of these parse rules be defined somewhere else?
Otherwise people just keep redefining them....
This stuff should be factored out ...
BrianH
5-Jan-2010
[38x2]
Yes, there should be a module full of character sets, all read-only. 
If not read-only, then no.
(UN)PROTECT isn't done yet though - SECURE 'protect works, but what 
it is supposed to secure isn't there yet.
Graham
5-Jan-2010
[40]
That's what I notice about R2 ... these character sets keep being 
redefined because they are hidden deep in the system somewhere
BrianH
5-Jan-2010
[41x4]
And refactoring is later. Right now we're focused on getting things 
to work.
Most of the internals aren't yet modlarized.
I think that a modular rewrite of prebol is needed.
The module system was designed to allow such a thing.
Graham
5-Jan-2010
[45x2]
how does that work?  Is it like a dictionary space in forth?
which allows you to define where to look for words and in what order 
the dictionaries are searched
BrianH
5-Jan-2010
[47x2]
LOAD/header. All of the module requirements/exports are in the header. 
Even Carl's proposed export keyword will be handled like FUNCT - 
at load time, not runtime.
In the case of FUNCT uses in the mezzanine source, the code is run 
and then saved, so there is no FUNCT calls at startup time.
Graham
5-Jan-2010
[49]
So, say we had a module containing all the charset definitions .. 
how would we include them to be accessible to us at run time?
BrianH
5-Jan-2010
[50]
You would include Needs: [charsets] in the header of the organizing 
script of your project. If we do it right, we might even be able 
to selectively import the words, though that might need some thought 
for loaded charsets - I'll give it some thought later, as mixins 
are currently file-based. I have an idea about how to do it though, 
in the preprocessor.
Graham
5-Jan-2010
[51x2]
Ok.
And there's this in prot-http.r

crlfbin: #{0D0A} 
crlf2bin: #{0D0A0D0A} 
crlf2: to string! crlf2bin 

This stuff should be in some reusable module too
BrianH
5-Jan-2010
[53x2]
prot-http.r is itself a reusable module.
I think that the preprocessor will actually mix in the mixins itself, 
as if they were part of the original source of the calling modules. 
That way if you want to do selective import you would split your 
module into two, one that contains the shared stuff, and another 
that contains the local stuff that references the shared module. 
It's not as hard as it sounds.
Graham
5-Jan-2010
[55]
maybe instead of make-scheme there could be something like make-network-scheme 
where these are automatically accessible?
BrianH
5-Jan-2010
[56]
How about let's worry about the refactoring later, and focus on getting 
it to work now. We can refactor on the way.
Graham
5-Jan-2010
[57x2]
still leads to duplication of code
yeah .. always put off today what can be done tomorrow :)
BrianH
5-Jan-2010
[59]
Which we can deduplicate during the refactoring :)