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

World: r3wp

[!REBOL3 Extensions] REBOL 3 Extensions discussions

Maxim
28-Jan-2010
[550x9]
and we can expand as we go.
I think the pointers stuff is the most complex, then again, I've 
been surprised by REBOL  more times than I can remember.
maybe, I could use the parser I have in Sea to use actuall C code 
as the argument definitions :-)


this would mean, no convertion to a rebol dialect by the programmer... 
it would all be handled by the extension  :-)
so you'd say:

define "mystruct {int index, int count}
myfunc: declare "libname.myfunc (int data, struct *mystruct)"
myfunc 12 1024
oops!

myfunc 1000 [12 1024]
or even easier  ;-)

include cstub.h

myfunc 1000 [12 1024]
oops again...

include %cstub.h
note, I've got the whole C language mapped into PARSE ... its just 
the emitter which is giving me headaches... 

because of REBOL's backtracking, you may end-up declaring/defining 
things several times, until the right match is found.

so I'm in the process of rewriting the rules differently which is 
quite complex ATM.
pekr, read Ladislav's DLL document a bit, and yess, it provides usefull 
information ...  gotcha's mainly which point out a few things, not 
to forget when defining the struct! dialect and other details.
Janko
29-Jan-2010
[559]
I would also be very happy if there was /library in R3. I think many 
of use really don't want to write and compile c code (especially 
for multiple platforms) unless it's really really necesarry (thats 
why we use rebol).  Max I don't work in R3 for now, but if you make 
/library I will port the libharu pdf binding to R3.
Pekr
29-Jan-2010
[560]
Amen :-)
Janko
29-Jan-2010
[561]
and although you say library is limited is is *good enough* for many 
things.
Pekr
29-Jan-2010
[562]
once again - why not have best of both worlds? Carl stated, that 
Extensions might be internalised (packed into main distro). So - 
let's use default interfacing method - Extensions. And let's make 
/library extension. Should work no? If it would allow many ppl to 
wrap thing here or there, and even if it will not be so powerfull 
as full fledged extensions, why not to have it, right?
Janko
29-Jan-2010
[563]
( as it was demonstrated by many comunity members with many bindings, 
and I could also make a pdf binding that is already used for serrious 
stuff, and works on linux and windows without me ever touching the 
hairy low level stuff)
Pekr
29-Jan-2010
[564x3]
OK, I am donating 100 USD to the developer, who brings /library interfacing 
method to R3. But - it shold be developed in cooperations, so that 
it is acceptable for many ppl.
... and if it will a bit more powerfull, than R2 version, even better 
(referring to Ladislav's proposed enhancements)
The thing is, if we can come up with corrent architecture. R3 plans 
on handle! type, as well as custom datatypes (not sure it is needed), 
but surely is R3 not planning to use routine! and struct! ones (IMO)
Janko
29-Jan-2010
[567]
I am without money currently so I donate 50 USD but happily for same 
thing that Pekr
Pekr
29-Jan-2010
[568x2]
license - BSD or MIT - simply for devs being able to use it freely 
...
OK, so we have got 150 USD ... who's next? :-)
TomBon
29-Jan-2010
[570x2]
me, I am in with 100 usd
and another  100 usd if nested structs and clean pointer handling 
are included
Pekr
29-Jan-2010
[572]
ok, thats 250 + 100 USD, upon above defined conditions :-)
Will
29-Jan-2010
[573]
I'm in with 100USD for the os x version of /library if that is usefull 
for porting Che
Andreas
29-Jan-2010
[574]
that will be difficult, as we don't even have an osx hostkit right 
now :)
BrianH
29-Jan-2010
[575x2]
It's not difficult to start; that's just a matter of doing the research 
on dynamic library loading and mocking up some code. And once extensions 
(not the host kit) are available on OS X, then the code can be tweaked 
and compiled.
You can start by going through R3 chat and helping Carl with his 
difficulties with porting the host kit and extensions to OS X.
Andreas
29-Jan-2010
[577x2]
That's exactly what I did
See rebdev message #6332, from 39 days ago
BrianH
29-Jan-2010
[579]
Cool.
Andreas
29-Jan-2010
[580x3]
The extensions are not the problem, they will work on OSX just as 
they work on Linux.
And in rebdev message #6257 I explain how to get extensions working 
on Linux.
(45 days ago)
BrianH
29-Jan-2010
[583]
Good. So once we resume work on such things (we're working on bug 
fixes and tickets now) the information will be there. Thanks.
Andreas
29-Jan-2010
[584]
Besides that I have 10 more patches lined up, which I held back to 
not overwhelm anybody.
BrianH
29-Jan-2010
[585x2]
Um, Carl is *right now* working on integrating community patches 
into a new host kit. Don't hold back.
Community = mostly Maxim, but you could tip the balance if you post 
your patches.
Andreas
29-Jan-2010
[587]
As I said, I posted two already, did not get any feedback so far.
BrianH
29-Jan-2010
[588]
Because we have been working on other things, mostly R2 and the web 
site (and R3 mezzanines in my case).
Andreas
29-Jan-2010
[589]
Mostly a matter of process, though. No idea if Carl is fine with 
dumping patches onto R3 chat.
BrianH
29-Jan-2010
[590x2]
He is OK with that.
If they are mezzanine fixes, you don't have to wait for Carl. You 
can submit them directly, or post them for comment there or here 
if they apply to functions that someone else is in charge of (like 
LOAD or the module system).
Andreas
29-Jan-2010
[592]
The only mezz fix I had for now, is in rebdev #6258
BrianH
29-Jan-2010
[593]
I saw that one, but it doesn't seem to be the right approach. Two 
reasons:

- .so and .dynlib aren't dynamicly linked library formats on Windows, 
.dll isn't on Linux, etc.

- It kind of defeats the purpose of extensions: making all of that 
platform-specific stuff go away.


Don't get me wrong, the current behavior also has the second problem. 
Extensions are imported like modules, and so the code that is asking 
for them has to specify the filename to load them. However, *that* 
code is supposed to be cross-platform, so putting a platform-specific 
filename in their Needs list is inappropriate.


What do you think of using a generic filename extension like .rx 
for extensions, then having LOAD translate to the native filename? 
Or on platforms that don't require a specific filename extension 
for their dynamic library loader (like Windows), you could use the 
.rx extension directly.
Andreas
29-Jan-2010
[594x4]
Sounds good
I'd keep on using .dll on windows, though
And I'd also keep the platform specific extensions in system/options/file-types
Why keep the extensions stored as .dll?: I'd prefer not hiding the 
fact that a rebol extension is really a proper dynamic library
BrianH
29-Jan-2010
[598]
Windows is the one that needs to use the .rx extension the most, 
and the one that we definitely can use it. And system/options/file-types 
has to have the extension we are trying to LOAD, not what it might 
be translated to.
Andreas
29-Jan-2010
[599]
Why does Windows need .rx the most?