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

World: r3wp

[!REBOL3 Extensions] REBOL 3 Extensions discussions

Pavel
22-Sep-2009
[203]
exchande=exchange
Maxim
22-Sep-2009
[204]
I've seen no documented way,  so far, but I am assuming this will 
possible when extensions will be fully done.
BrianH
22-Sep-2009
[205x2]
I would guess that they unload when collected by the GC, and definitely 
when R3 quits.
Answers to Pavel: 1) Don't know, but I doubt it. I'll check the port 
model. 2) Probably.
Maxim
22-Sep-2009
[207]
but we *should* be allowed to unload extensions ... eventually... 
if only for testing purposes. even if its "dangerous".  its up to 
the developper to be clean if he wants to  attempt unloading... I 
woudn't want R3 to prevent me.... "for my own protection"
BrianH
22-Sep-2009
[208]
Actually, you don't want to be able to load extensions without freeing 
references to them, as memory corruption would result. Memory references 
including all of the exported commands.
Maxim
22-Sep-2009
[209]
I know... but we can build code around the fact that its symbols 
won't be used for a long time.  like I say, its not something you 
do without knowing what you are doing.  any commands refereing to 
the old lib, can be replaced with no-ops raising errors... this would 
make it safe.
Gregg
24-Sep-2009
[210]
I haven't read everything here--just trying to clear a few groups 
so it's not as overwhelming next time I make it back here, but shouldn't 
it be possible to write the equivalent of R2's library interface 
*as* an extension in R3?
Pavel
24-Sep-2009
[211]
IMO probably yes when you are satisfied with types extensions are 
able to work with so far.
Maxim
24-Sep-2009
[212]
yes, its the way I think it should be done. we could provide pseudo 
type middle ware in the extension to accomodate incompatible types 
like Unsigned integers or structs, much better.


I plan on building a block->struct interface when I start doing my 
more serious extension development... (waiting for next extension 
enhanced release.)
BrianH
24-Sep-2009
[213]
If you are willing to give up support for MAKE, MOLD, built-in reflectors 
and path access, you can implement structs as handles. You would 
access them through accessor commands, and struct and routine declarations 
would be a dialect that would be compiled to calls to extension code.
Maxim
25-Sep-2009
[214x2]
yeah, that's the idea... using a block to struct dialect to build 
the structs from scratch, then just refer to them after.
but the hard part actually is to resolve all the different macros 
which define the types and the enums.
BrianH
25-Sep-2009
[216]
That's what SWIG is for, or human analysis. Or you could reimplement 
SWIG in REBOL if you like.
Maxim
25-Sep-2009
[217]
I already did a header file scanner a few years ago... but it wasn't 
recursive... nor did it resolve macros.
BrianH
25-Sep-2009
[218]
Some C compilers have preprocessors that can be called separately, 
or standalone.
Maxim
25-Sep-2009
[219x2]
but it did resolve all the enums, the functions and their input types, 
generating equivalents in rebol, to build C code dynamically by rebol.
that is a great idea... generate the intermediate C files, and convert 
them into rebol extensions... using only the top-level headers as 
what is exported as commands and defined structures.
BrianH
25-Sep-2009
[221]
Sounds cool. Now all you have to do is run it on the output of the 
preprocessor.
Maxim
25-Sep-2009
[222x2]
I also thought of a very neat way to map c methods and struct access 
 :-)
exactly.
BrianH
25-Sep-2009
[224]
Hey, can you help me with my libjit project?
Maxim
25-Sep-2009
[225x2]
use "." in the words.   just like if they where paths in rebol  :-)
libjit?
BrianH
25-Sep-2009
[227x2]
It's the JIT compiler that is used as the backend of DotGNU Portable.NET, 
among other projects. LGPL, generates x86, x64 and (experimentally 
so far) ARM. SSA intermediate code. We can make a compatible SSA 
REBOL dialect and build up a compiled dialect from there. The *existing* 
extension model is sufficient, no more changes required.
Tiny (about the same size as TCC), and a good first project that 
could be adapted to wrap LLVM if we like, as long as we keep our 
portion of the extension code license compatible with BSD.
Maxim
25-Sep-2009
[229x2]
this is REALLY interesting... that is exactly what my header scanner 
was being used for... indirectly.
it generated C code compiled by a (very high-eng) compositing software.
BrianH
25-Sep-2009
[231]
In case you were wondering, this is the main reason I was working 
so hard on R3 - so I could work on a project like this. Now that 
the parsing advancements are happening, soon R3 will be good enough 
for me to do my projects. For me, R3 will be released.
Maxim
25-Sep-2009
[232x2]
the reason this software (shake, now owned by apple) was so much 
faster at rendering, is that it wasn't a rendering software... it 
was just a C disguised C compiler :-)
when you pressed the render button, it actually compiled your project 
(in a matter of a few micro-seconds) and ran it.
BrianH
25-Sep-2009
[234]
Apple is moving rapidly to LLVM because they can't get the GCC project 
to cooperate. They already use it for iPhone development and OpenGL. 
Having a path to get to LLVM would be a good thing.
Maxim
25-Sep-2009
[235x3]
yes very.
and yes I'm interested.
I need this for ElixirOS.  its part of my roadmap for it  :-)
BrianH
25-Sep-2009
[238]
Cool. Btw, callbacks aren't required, nor are user-defined datatypes 
or function types. It turns out that commands are enough.
Maxim
25-Sep-2009
[239]
the reason I need callbacks is for event handling to be managed outside 
of REBOL.
BrianH
25-Sep-2009
[240]
I understand that you need them for your project - I just don't need 
them for mine :)
Maxim
25-Sep-2009
[241]
creating C binary code on the fly would allow us to go arround callbacks, 
but we still need them if we want external code to interact with 
rebol data on its own... no?
BrianH
25-Sep-2009
[242x2]
Not that I won't integrate devices and utypes when they are implemented.
Devices will handle synchronizing external processes with the REBOL 
interpreter, callbacks, asynchrony. That's the theory at least.
Maxim
25-Sep-2009
[244]
yep, that's what I imagined.
BrianH
25-Sep-2009
[245]
You go through devices so that you don't trip over R3's task model.
Maxim
25-Sep-2009
[246x2]
my callback example, really was similar to a device/port implementation 
IMHO.
its how it could be done and easy to use on both sides (C and REBO).
BrianH
25-Sep-2009
[248]
Your callback example may get raided for techniques that will eventually 
be used to implement the device model :)
Maxim
25-Sep-2009
[249x2]
that was the point  :-D
I like to think that I'm the godfather of extensions ... I did give 
them their name  ;-)
BrianH
25-Sep-2009
[251]
It was a good choice :)
Maxim
25-Sep-2009
[252]
btw, its cool that LLVM is used by apple... I plan to make ElixirOS 
run over apple's BSD kernel so that I have nice shiny boxes to run 
it on  :-).