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

World: r3wp

[!REBOL3 Extensions] REBOL 3 Extensions discussions

BrianH
29-Nov-2009
[385x3]
The API is versioned for exactly this reason. Carl came up with enough 
of an extensions API to actually function and to let people experiment 
with various techniques to make it better. Carl is not the only designer 
of R3 - we all help, and need to. We can't know how to design the 
extensions API until we get an idea of how it will need to be used.
I'm not as much help in this as I'd like, since the current API is 
just fine for what I need to do - at least until we get device extensions. 
Maxim has been more help, since his needs aren't met by the current 
system. If you are writing a database API, your experience will likely 
help refine the model too.
R3 needs feedback about the kinds of problems that only arise from 
use. Without that feedback, design stalls.
Maxim
29-Nov-2009
[388x2]
I have been waiting for extensions for a decade, and its almost there.
a lot of stuff depends on the improvement of extensions and addition 
of device extensions.  not just for me but for Carl also.

Unfortunately I am not at liberty right now to tell what that is, 
but I can assure you extensions will have to improve in the short 
term because a new player (company) in the REBOL community needs 
this, already.


this company might become one of the levers to propel REBOL into 
adoption in (several) very large corporations (fortune 500) & scientific 
organisations around the world, so RT has vested interest into doing 
as much as it can to make this happen... and right now... the host 
code and extensions is the key to most of it.
Graham
29-Nov-2009
[390]
The Vatican keeps popping up!
BrianH
29-Nov-2009
[391]
Don't be silly - everyone knows the Vatican uses LOLCODE :)
Graham
29-Nov-2009
[392]
Using Roman numerals has always been a challenge for their coding.
Ashley
30-Nov-2009
[393]
It's that damn i word (for I I X ...)!
Gabriele
30-Nov-2009
[394]
Rebolek, that is not really true - the function still takes a fixed 
number of argument, and you're just passing a unset! value to some 
of them (which is a side effect of R2 passing unset! at the end of 
the block, i think R3 does not even do that)
Rebolek
30-Nov-2009
[395]
Gabriele, you're right that it's just a R2 side-effect and it's true 
that it does not work in R3. Not that I miss it.
Micha
3-Dec-2009
[396]
Could someone write gzip compress and decompress functions for rebol3 
extensions? what the cost would be?
Graham
3-Dec-2009
[397x2]
There's already zip for R2 ...
Check the rebol.org library
Rebolek
4-Dec-2009
[399]
I thought about writing extension for zlib, but haven't started anything 
yet. But it should be easy I think.
Maxim
6-Dec-2009
[400]
you can always use the zlib code in putty.  its MIT licensed  :-).
Robert
7-Dec-2009
[401x2]
Doing a R3 extension for this would be a no-brainer if the gzip code 
is simple to call. Getting the data to/from Rebol is easy.
But I must say that I currently use my time on getting SQLite up 
& running for R3. So far works already very good.
BrianH
7-Dec-2009
[403]
Robert, if you are good at C macros and have a good idea about how 
to improve things, make suggestions. Good safe methods for bulk copying 
of string or binary data into the REBOL values to be returned, or 
from values passed in would be great. Look at the existing extension 
source for an idea about how the current macros work. Safety is a 
priority here, so don't forget the bounds checking.
Pekr
7-Dec-2009
[404x4]
Interesting comments in R3 Chat about Commands, Extensions, DELECT 
etc.
Ok, so I've not yet provided everything that you'll need to do it. 
I divided the
 extensions release into a few stages:

1. simple - 
just simple access to commands and args
2. series - access to series 
values of various types
3. objects - access to objects (of all types)
4. 
codecs - support for codecs
5. host-lib - ability to bundle extensions 
with the host-lib itself.

So, I need to get you a bit more... in 
fact along the lines that you mention.
Re #6156: Pekr, we ARE NOT giving up on dialects!! There are many 
dialects in RE
BOL, and it is one of the main concepts.

What we 
are doing is removing the strong overlap in DELECT and COMMAND. If 
you l
ook at the DELECT method, it is a small subset of full dialects. 
It implements a
 form of function with optional arguments.

So, it's 
better to move that code into COMMANDS, and allow them to work that 
way
. This makes it much easier for people to learn and use. Even 
me!

Also, REBOL/Services will use this same method, because COMMANDS 
are not limited
 to just extensions... ah the secret is out: COMMANDS 
can also be attached to a
context, making them generally useful in 
REBOL code.

I will check the blog comments to make sure it's not 
misunderstood.
Please could someone translate to me, what does it mean that COMMANDS 
can be attached to a context, and that it will make them useful in 
REBOL code? :-)
Maxim
7-Dec-2009
[408x3]
The way I see it is  that the code inside a command probably can 
be late bound to a context, rather than the global context, as it 
is now.


when extensions will support objects, this can be pretty powerfull, 
since commands can become virtual and private methods for an object 
where the data is stored in a stuct in the binary (C) side... 


which is EXACTLY what I need for liquid, where I need rebol dispatchers 
but native data storage, so it can scale to hundreds of billions 
of nodes, and yes I already have the solution for the storage/memory 
engine if Carl can give me the means.   :-D
I already found a way to make callbacks extension callbacks in the 
current host distribution, even if nothing in the current rebol native 
code supports it  :-D


will be testing this out tonight and will report on this... I hope 
my idea works.  this would reactivate the OpenGL project along with 
other stuff on the backburner.
oops... one too many callbacks in previous sentence.. hehe
BrianH
7-Dec-2009
[411]
It's the dispatch. Right now with extensions, when you make a command! 
it makes a function that is dispatched by a function in the extension 
based on a number (which you can think of ay a key), to code that 
handles the command (the value associated with the key). In theory 
this is not that different from an object! grabbing data from one 
of its slots based on the keyword you pass it. Apparently commands 
will be able to dispatch to objects soon, and the functions assigned 
to slots of that object will handle the command code.


The DELECT dialect model was based on rebcode, mostly on its JIT 
binding. DELECT added the out-of-order, possibly optional argument 
handling to the dialect decoding phase, but the dispatch phase was 
mostly left out (I commented on this at the time). The command! type 
has the dispatch model, but uses the function call model for calling 
the commands. The overlap that Carl mentions is in the mapping of 
keys to command handlers.


If you unify the command mapping models between DELECT and command!, 
then that code can be shared. This means that the DELECT function 
could do the out-of-order dialect decoding, then dispatch the operations 
as commands. Values of the command! type would continue to be called 
like regular functions in DO code or by APPLY, and then dispatch 
using the same dispatch code as above. On the other end, commands 
would either dispatch to objects (including modules perhaps) or extensions.


By the sound of it, this might also allow the command! type to serve 
as a method pointer, but we'll have to wait to see about that :)
Maxim
7-Dec-2009
[412]
they would be globally bound, but still, usefull  I wonder how extension 
re-entry from a callback will react , if it even works... the stack 
can get a mighty mangled hehe    :-)
BrianH
7-Dec-2009
[413]
That was in reply to Pekr, btw.
Maxim
7-Dec-2009
[414x2]
btw... I wish there more host <-> r3lib hooking.   I really wish 
he'd push some of the extension handling code into the host.  right 
now there is no real extension code within the host, and there is 
no integration possible from new runtime features into the extension... 
basically, the extensions are running blind.
just a single place where we can put data which is accessible by 
extensions.  that would already make the host that much more usefull, 
especially for testing new host models or devices.  which add new 
possibilities for extensions.


the event device is also not useable for my specific task and I'm 
not sure I can really play around with it without breaking the r3lib 
<-> host integrity... testing will provide clues, I guess.
BrianH
7-Dec-2009
[416x2]
He has said that having extensions in the host is part of the planned 
model - check R3 chat.
He has also said that the extension model isn't finished, just the 
overall structure.
Maxim
7-Dec-2009
[418x3]
I know... just stating it out loud... to make it known that this 
is needed... its not just wishfull thinking  ;-)
and we are talking (non web) commercial rebol work here.
but on we go with the callback hack  I think I'll name this a   "hackback" 
   the back door, like a "hatchback"    :-D
BrianH
7-Dec-2009
[421]
I know you are really chomping at the bit for callbacks, and were 
really hoping that the host code would allow you to hack them in 
yourself, but you're out of luck there. Your callback proposals didn't 
take tasks into account anyways. You're still going to need device 
extensions. Fortunately, you can probably help design the model for 
those :)
Maxim
7-Dec-2009
[422]
I think I could have something working for non multi-threaded stuff 
in a little while... I'm working on this now... its the time I have 
to do it ... after that...
I return from a sanity preserving week of vacation.


and yes I hope I can help with the development, especially since 
I have two different devices which need to be added.  

with the current host I might make my hackback do some usefull tests 
to help shape a working model aka prototype.
BrianH
7-Dec-2009
[423]
Well, with the current host code you can add devices in the host, 
and don't need to wait for the device extension model :)
Maxim
7-Dec-2009
[424x5]
I've been 3 times to the dentist in 2 weeks... (and going back next 
week!)...  needles and my gums are practically on first name basis 
as of now  :-(.
but the coupling with the core run-time is practically abscent.  
there is only one function I can use to have the run-time do anything 
and thats a pretty simple... do_rebol_string() which basically runs 
a block of code in the global space... beyond that I've only got 
network/file like ports, which basically are streamed I/O.  


I can't create data directly and leave it at the port, in a block, 
like I'd do for a proper event queue.   This is currently my pet 
peeve about the host... 


but let's not be judgmental... I'm VERY happy I have the host, so 
I can at least try to rig something up with bailing wire, duct tape, 
pliers, a bit of string & epoxy glue.  


 Extensions & the core allows me to hide this under a nice fiberglass 
 body  ;-)
just don't go looking under the hood... its going to look like a 
honda vtec... hehehe
phew... I'd forgotten how much work it was to express this in C...

variable: new-def: make type? other-def none data
that is... when the other-def isnt' a trivial integer... but something 
like a definition of a callback function ...
Pekr
7-Dec-2009
[429]
Max - please share your needs with Carl in R3 Chat .... I mean - 
the need to move some stuff into Host ....
Maxim
7-Dec-2009
[430]
I will, don't worry... but I need to have some meat for him to chew 
on if I can get this callback thing working, then we can talk about 
something concrete, not just thin air.  :-)
Pekr
7-Dec-2009
[431]
I know what you mean, but the thing is, that Carl might be doing 
some design decisions right now. So it might be better to act before 
it is too late for the change ....
Maxim
7-Dec-2009
[432]
good point.  I was planning on getting his attention (by any & all 
means necessary ;-)  tomorrow
BrianH
7-Dec-2009
[433x2]
Maxim, you are taking the wrong approach. If you are having problems, 
don't work around them, fix them. Working around is the R2 way.
I could have something working for non multi-threaded stuff
 Not good enough. Tasks are going to be in R3. Prepare :)