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

World: r3wp

[!REBOL3 Extensions] REBOL 3 Extensions discussions

Andreas
28-Jan-2011
[2355x2]
I hope extload to be a suitable foundation upon which to further 
discuss these matters.
And for this to lead to eventually integrating an improved loading 
mechnism  directly into R3.
BrianH
28-Jan-2011
[2357x5]
You can try them in the order the suffixes appear in system/options/file-types. 
That way your code doesn't have to special-case per platform; let 
the host code special-case it instead. Just in case .rx isn't supported 
on a platform, you might consider searching for 'extension and backtracking 
to get the file! suffixes.
The .rx suffix seems to come first in the platforms I know of.
>> find/reverse/tail find system/options/file-types 'extension word!
== [%.rx %.dll extension]
If you are doing this already, consider it documentation for the 
others :)
Do we need a system/options/extension-paths setting? You could add 
it to system/options in your %extload.r3, and it would let you preconfigure 
your system with a directory of shared extensions, if such a thing 
exists. Or it could just be assigned the same block as system/options/module-paths 
by default.
Andreas
28-Jan-2011
[2362x2]
Yes, Brian, as I stated above I'm already using system/options/file-types. 
Quoting myself:

The actual suffixes tried are by default taken from system/options/file-types.
An extension-paths setting and searching this path would be a good 
option (esp. on platforms with weaker loaders). But more about this 
later, gotta run :)
Robert
13-Feb-2011
[2364x3]
I'm fighting with some "undefined references"

(.text+0x867): undefined reference to `RXARG_SERIES'
The problem is, I'm not sure where it happens in the source-code 
file as the output doesn't tell you. But can't I use the (.text+0x867) 
stuff to locate the usage in the source file?
Or is there a better way to map the error message back to the source 
file?
Andreas
13-Feb-2011
[2367]
Search thru all your source files for RXARG_SERIES and replace it 
with RXA_SERIES
Robert
13-Feb-2011
[2368x2]
OMG... this is a good example of seeing RXARG_SERIES and understanding 
RXA_SERIES... I though I did this already.
But RXARG (the old one) was a shortcut to access the .series union 
member. The new RXA_SERIES one needs a frame pointer and a number. 
Which I don't need. So, the new approach is to access the union members 
directly?
Andreas
13-Feb-2011
[2370]
Yes.
Robert
13-Feb-2011
[2371]
Ok.
Andreas
13-Feb-2011
[2372x2]
At least there currently is no set of macros to work with "standalone" 
RXIARGs.
Only with RXIARGs contained within an RXIFRM (or frame-like array, 
like in the callback info).
Maxim
14-Feb-2011
[2374]
I built my own macros to do exactly this.  I proposed them to Carl, 
he mentioned he'd put them in the official distro... seems like I'll 
have to put them in git hub myself  :-)
Pekr
14-Feb-2011
[2375]
Good aproach, Max. Now If Carl mistakenly uploads r3 core DLL, we 
might get in beta after all :-)
GiuseppeC
14-Feb-2011
[2376]
Just a question: with the extension model complete is it possible 
to interface to .NET ?
BrianH
14-Feb-2011
[2377x3]
The answer to that question is as yet unknown. Noone has tried it 
yet. Do you mean calling into the .NET APIs from native code, or 
calling into native code from .NET?
If the latter, this question is better suited for the !REBOL3 Host 
Kit group.
Maxim, if you want those macros included in alpha 111, today would 
be good.
GiuseppeC
14-Feb-2011
[2380]
Calling .NET API from native code.
BrianH
14-Feb-2011
[2381x2]
I think that there are ways to call .NET APIs from C/C++ using COM 
interop and other methods. MSDN should have the details.
It would be useful to have a general .NET wrapper extension that 
uses Reflection, ActiveX or something to call arbitrary .NET code.
Kaj
14-Feb-2011
[2383x2]
http://msdn.microsoft.com/en-us/library/aa446536.aspx
http://en.wikipedia.org/wiki/Platform_Invocation_Services
BrianH
14-Feb-2011
[2385x2]
Those are both for calling native code from .NET code. Guiseppe was 
requesting the opposite, calling .NET from native.
Exposing .NET Framework Components to COM: http://msdn.microsoft.com/en-us/library/zsfww439.aspx
Robert
15-Feb-2011
[2387]
You can use .NET based DLLs as if there are normal DLLs.
BrianH
15-Feb-2011
[2388]
How does the .NET runtime get called to run the functions in the 
DLL?
Kaj
15-Feb-2011
[2389]
Must be a function of the system's loader
Maxim
16-Feb-2011
[2390x2]
afaik, .net is a dll too.  so its probably just loading the .net 
libs.    


in fact, looking at some stuff related to C# and p/invoke I realized 
that the rebol .dll and  .net stuff are very similar in scope and 
function  :-)
the difference is that the type system in VM allows them to jit compile 
stuff more completely than can be done with REBOL's just-in-time 
evaluation and binding.
Robert
16-Feb-2011
[2392]
IIRC as soon as you load a .NET based DLL, this will trigger the 
startup of the .NET runtime. So, it's hidden. I don't know if a .NET 
DLL has a dynamic link to the runtime DLL and calls an init code 
sequence or if this is done inside the Windows loader.
Kaj
16-Feb-2011
[2393x2]
Pretty much the same concept as REBOL code in R3 extensions, or OCaml 
bytecode for the interpreter in standard shared libraries
The only thing you can't do is fully strip such a library, because 
then the OCaml bytecode is gone
Oldes
16-Feb-2011
[2395x2]
What is error: ** Script error: invalid command format (extension 
function) ?
hmm... it's possible to use max 7 args for command.
Oldes
17-Feb-2011
[2397x3]
What is error: ** Script error: commaned word is not bound to a context
ech.. just a typo!
Is there any other way how to get series index than from RXA_INDEX 
macro?  http://issue.cc/r3/1858
Andreas
17-Feb-2011
[2400x3]
Oldes, no, there isn't.
And it is quite possible that this may not be doable at all (if the 
index is not stored in the "REBSER" structure and the REBSER has 
no back-pointer to the index-containing rebol value).
The workaround/solution is simple: don't pass REBSERs to function, 
but use the RXIARG instead and then access the index via .index and 
the REBSER via .series.
BrianH
17-Feb-2011
[2403]
The command call process does a lot of marshalling to get the values 
into the native code. You only have limited access to the original 
values in REBOL memory.
Oldes
17-Feb-2011
[2404]
ok