RebDev Mobile   [New]   [Top]   [Users]
Path: Top / R3 / Host-Lib /

P
7990

Seems that callbacks using series from multi-threaded DLLs don't work. If I use integer! it works. Any examples for callbacks from multi-threaded environments would help a lot.Robert
829d

P
7891

has Rebol been used for build apps on google app engine?emptest
934d

P
7804

Re #7796: I don't understand what you mean, I'm not saying that he doesn't have access, we don't want them to screw with a command which is meant to work on the user context or access it.

maybe you see extension as handy tools, but I see them in an entirely different light. It allows us to extend rebol with as close to native access as we can get. extensions enable low-level use and tweaking of REBOL. its not a thing about security and danger... if you don't want extensions, don't allow them in your secure setup. I don't want extensions to be limited because they are a security risk. by definition, they *are* a security risk. so limiting them based on security concerns is basically an oxymoron .. no?

maxim
965d

P
7802

Re #7796: I'm sorry, but extensions are the way to extend rebol. I want extensions to be powerfull and NOT just something the *user* uses. they have to be able to augment the interpreter in ways which are similar to what the core can do.

I specifically do not want the user of an extension to have to fiddle around with

maxim
965d

P
7798

Re #7779: All of the binding options could just be to an optional context arg. The user context or extension module context could be provided as a command argument. But I am wondering if the bind-afterwards model would be preferable. We don't want to bloat the extension interface too much. At some point you are better off doing some things in REBOL code. Extensions aren't just native, they also include a REBOL module.BrianH
967d

P
7797

Re #7777: TRANSCODE *is* the system version of LOAD. However, there might be a useful subset of its behavior that would work in extensions.BrianH
967d

P
7796

Re #7776: Under those circumstances where the user doesn't have access to the user context, we *definitely* don't want extensions to have access to it.BrianH
967d

P
7779

Re #7778: sorry, I'm not sure on the choice of words. it was late, even I'm having trouble understanding my response to brian. ;-/

really, all I'd like to be able to do is get similar functionality to load/transcode directly within the C API.

where things are bound (*if at all*) would be options for the mode argument. possibly there could be an additional arg (optional i.e. when non NULL) to provide a context to bind to.

binding to the extension's module sounds like a nice feature as well as normal user context support.

maxim
974d

P
7778

Re #7777: Maxim, can you summarize the LOAD issue? Is it: to LOAD into a module's or extension's context rather than user context?Carl
974d

P
7777

Re #7769: Having a switch to use the system (and NOT user lib) version of LOAD with some *possible* refinements. Though I guess not all apply in the context of an extension.

when I say NOT user lib I mean not the reference which is within the current user context for the value of the word 'LOAD.

the idea of post 7769 is to make it *easy* to integrate into and out of REBOL data for the many cases where it is directly possible.

this could be a single datatype (a tuple, a date, etc) or complete block-like datasets.

maxim
974d

P
7776

Re #7768: brianH that is exactly what I meant by a reference. the issue being that forcing the user to *supply* the user context is both inconvenient, error prone and sometimes something we explicitely do not want the user to be allowed to do.

some tools will want to be able to explicitely get access to the user context because they must not be tampered with by the user script itself.

for example a tool to list current unset user words. could be part of a debug extension. something of a get unset list ... do something ... get new unset list provide some causality on effect of user code.

maxim
974d

P
7769

Re #7767: LOAD is mezz. Think in terms of TRANSCODE, but with fewer options.BrianH
977d

P
7768

Re #7761: Your assumptions about the user context are incorrect. There are no references to other contexts, except through the normal values assigned to the words. The user context is just an object, like any other context. As long as you have a reference to that object available to you you can use the field operations.BrianH
977d

P
7767

6. RL_Mold_Value(RXIARG value, u32 type, u32 mode) RL_Load_String(REBCHR *string, u32 mode) ---- this request is twofold... -helping to debug from within extensions. -easy access to store or retrieve data from/to REBOL and external sources/destinations.

debugging and utilities: -- Currently, debugging and inspecting data coming from the core within extensions is very complicated to achieve because we basically have to make our own print statements which build-up the data, often requiring loops and several lines of code for even simple values (ex: a tuple!).

If we had access to the molded string of any RXIARG, (in plain, serialized or even its 'FORM variant) we could do this MUCH more easily. The mode argument above would switch between these 3 modes.

tool integration: -- Also, REBOL relies on its transparent concept of data as code, and IMHO, a big part of that is that it can be manipulated to/from strings with no fuss.

currently, we cannot serialize or load from within an extension and this limits how easily we can inter-operate with other APIs which we want to merge to rebol.

Many tools save or provide serialized datasets which are very close to rebol's native format, so they can be used as-is within rebol... but right now, we can't provide that native interface from within the extension...

The same is true on output. We can't provide Rebol data as strings to external tools, without a lot of hoops.. (ex, converting a tupple to a text string so it can be displayed in an OpenGL text polygon.)

All of that stuff is complex, and its already built-in... we need it and don't want to redo what's already there.

note that the mode argument of RL_Load_String could be used to switch string loading in different ways... 'LOAD, 'TRANSCODE, /only /next /all /unbound, etc.

maxim
978d

P
7765

---------------------------------------------------------------- 6. RL_Mold_Value(RXIARG value, u32 type, u32 mode) RL_Load_String(REBCHR *string, u32 mode) ---- this request is twofold... -helping to debug from within extensions. -easy access to store or retrieve data from/to REBOL and external sources/destinations.

debugging and utilities: -- Currently, debugging and inspecting data coming from the core within extensions is very complicated to achieve because we basically have to make our own print statements which build-up the data, often requiring loops and several lines of code for even simple values (ex: a tuple!).

If we had access to the molded string of any RXIARG, (in plain, serialized or even its 'FORM variant) we could do this MUCH more easily. The mode argument above would switch between these 3 modes.

tool integration: -- Also, REBOL relies on its transparent concept of data as code, and IMHO, a big part of that is that it can be manipulated to/from strings with no fuss.

currently, we cannot serialize or load from within an extension and this limits how easily we can inter-operate with other APIs which we want to merge to rebol.

Many tools save or provide serialized datasets which are very close to rebol's native format, so they can be used as-is within rebol... but right now, we can't provide that native interface from within the extension...

The same is true on output. We can't provide Rebol data as strings to external tools, without a lot of hoops.. (ex, converting a tupple to a text string so it can be displayed in an OpenGL text polygon.)

All of that stuff is complex, and its already built-in... we need it and don't want to redo what's already there.

note that the mode argument of RL_Load_String could be used to switch string loading in different ways... 'LOAD, 'TRANSCODE, /only /next /all /unbound, etc.

maxim
978d

P
7764

5. RL_Words_Of_Object() doesn't return number of words.

it would be much more practical if the RL_Words_Of_Object() function returned the number of words it returns as its first argument, just like the RL_Map_Words()... as per its spec.... The [0] value is the size.

it took me a while to realize this, especially since the documentation refers to RL_Words_Of_Object() saying: "Returns a word array similar to MAP_WORDS()"

maxim
978d

P
7763

4. GOBS DON'T have an explicit RXA_GOB accessor macro... ---- I think it should be in the RXA_xxx macros: note that I included gobs in the RXV_xxx macros above

#define RXA_GOB(f,n) (RXA_ARG(f,n).series)

but shouldn't it be : #define RXA_GOB(f,n) (RXA_ARG(f,n).addr)

maxim
978d

P
7762

3. non argument-frame RXIARG AS VALUES MACROS... ---- The RXA_xxx macros do not work when addressing RXIARGs directly.

These are easy to setup, I've added them within my includes because when using words in objects, we don't have a stack frame, but a naked RXIARG to set/get.

note that to use these with dynamic allocation just use the macro with *(arg) instead of arg... ex: RXV_OBJECT(*(arg)) = my_object;

#define RXV_INT64(a) (a.int64) #define RXV_INT32(a) (i32)(a.int64) #define RXV_DEC64(a) (a.dec64) #define RXV_LOGIC(a) (a.int32a) #define RXV_CHAR(a) (a.int32a) #define RXV_TIME(a) (a.int64) #define RXV_DATE(a) (a.int32a) #define RXV_WORD(a) (a.int32a) #define RXV_PAIR(a) (a.pair) #define RXV_TUPLE(a) (a.bytes) #define RXV_SERIES(a) (a.series) #define RXV_INDEX(a) (a.index) #define RXV_OBJECT(a) (a.addr) #define RXV_MODULE(a) (a.addr) #define RXV_HANDLE(a) (a.addr) #define RXV_IMAGE(a) (a.image)

#define RXV_GOB(a) (a.series) // gob examples used RXA_SERIES...

but shouldn't it be : #define RXV_GOB(a) (a.addr)

maxim
978d

P
7761

2. RL_Get_Word( u32 word) RL_Set_Word( u32 word, RXIARG val, int type) ---- These would be equivalent to their object "Field" couterparts but effectively get values in the user context directly

Since the user context has references to the other resident contexts, this allows us to pick and set values anywhere in REBOL as if the command where a normal rebol script (with usual restrictions).

maxim
978d

P
7760

1. RL_Remove_Value(REBSER *series, u32 index) RL_Remove_Char(REBSER *series, u32 index) RL_Set_Tail(REBSER *series, u32 index)

returns 1 or 0 (if we actually shortened the series or not) ---- These would allow us to shrink a series "in-place" effectively allowing 'REMOVE or 'CLEAR like functionality from within extensions.

I would expect RL_Series(prim_obj, RXI_SER_TAIL) to be up to date after calling RL_Remove_xxx .

Right now I can't process state flags in a block and remove them... I have to actually rebuild a new block each time.

This isn't optimal and its possible a block needs to be shared.

In my opengl rendering loop, I may be manipulating hundreds of primitive state blocks 50 times a second... it REALLY adds up.

maxim
978d

P
7759

After several weeks of hard-core A107 host-kit use and intensive research (implementing Custom Gob Renderers), I want to share some feedback.

Mainly, there seems to be a few core functionalities missing in the current Host-Lib (RL_xxxx) API.

I'll list each one as a separate post so it can become a thread.

maxim
978d

P
7738

Re #7737: thanks! :-)maxim
1001d

P
7737

Congratulations Maxim! Realy exciting to see your progress.patrickp61
1001d

P
7735

I finally got HW OpenGL rendering to work directly within view's R3 graphics architecture.

http://www.pointillistic.com/open-REBOL/moa/files/first-opengl-R3-Application-ever.png

I did a quick integration of the custom rendering gob within the latest R3, just to see how hard it would be to wrap it into a higher-level frame which I didn't control... it was a breeze.

the system is using the custom rendering API which I discuss on the rebol wiki here: http://www.rebol.net/wiki/Custom_Gobs

though the document is a flying target, it does give a idea of the scope and seriousness of this endeavor.

as I encounter issues and approach new architectural topics, I lay them down there.

maxim
1001d

P
7722

Re #7721: Thanks for the reply, I took time today to properly document what I am trying to achieve.

basically the idea is to allow ANY rendering package to embed itself within a standard gob with minimal fuss for the user.

imagine something like:

web-gob: make gob! [renderer: 'web-kit custom: http://www.rebol.com size: 800x500 offset: 0x0] view/as-is web-gob

and poof, there is a web browser with rebol.com within it.

I spent the better part of the day documenting the whole idea as a proposal on the doc-wiki

it has a lot of the requirements, changes and even some code examples with file names identified.

http://www.rebol.net/wiki/Custom_Gobs

don't hesitate to comment here on any issues.

maxim
1008d

P
7721

Re #7720: You are asking a few questions...

1. On GOB types: they are defined in reb-gob.h

2. On custom GOB types: no. GOBs are primitives, and the TYPE defines how they map to and from REBOL constructs. If you want to define your own graphics constructs, do not use GOBs. However, that being said, it would be possible to allow a CUSTOM type, where the content field could be whatever you want. But, there would be no map to REBOL.

3. GOBs created by the interpreter have their own allocator, so you cannot change size of a GOB. However, I suppose you can have an external GOB that defines whatever you want.

Of course, the fundamental question is what are you trying to do? What additional features do you want in a GOB?

Carl
1008d

P
7720

I have a question relating to low-level GOB! usage within the file agg_compo.cpp.

In the method compositor::cp_process_gobs() there is a switch statement which selects the process to use based on the GOB_TYPE ( rebol_gob->ctype ). I do not see any where else in the complete host-kit where this is Assigned.

this fact leads me to think that we cannot create our own gob types within the host kit.

am I wrong? if not, if I manually set this to another value, will it cause mayhem in the system?

I have successfully increased the size of the rebol_gob struct without any crashes in actual use, so I am thinking that with the use of another extension or some tricky host-kit alterations that I might get something working... but I fear to go to far only to discover that what I am doing is basically going to corrupt the interpreter.

maxim
1009d

P
7691

Re #7685: No, I did not use that. I tried put and submit with various versions of file and 'ask. It seems, that 'ask works, but generates a error message after.sqlab
1021d

P
7690

Re #7684: I know there are some flaws with my submission. I did not understand how the input buffer gets filled, so I checked the final input line. That should work with any readline.

I have a new version with a few bugs less, but I guess your version is better.

sqlab
1021d

P
7685

Re #7682: Sqlab: did you try typing just: submit That should work, at least here it does, but not tested it on other systems.Carl
1022d

P
7684

Re #7672: Sqlab: I looked at your input line code that you submitted to host-main.c, and I think it should be added as a separate .c file, not as part of host-main.

And... various users will want it to work with Linux, etc., which use the read-line code that I wrote earlier to handle line editing in a simple way (or whatever substitute might become available that runs on all other OSes.)

Also... I've got some C code here from R2 for it's method of doing similar input handling, I just need to publish it to the site.

Anyway, thanks for the submission... and something like this is useful to all programmers.

Carl
1022d

P
7682

Re #7674: these are the messages when trying to upload Add comment (/ to cancel submit): submit 'ask --- Note: file submitted as: 7681 --- Note: checking for new messages --- Note: updating messages: 7681 --- Note: invalid command or argumentssqlab
1023d

P
7675

Re #7674: I mirrored sqlab's file at http://bolka.at/2010/rebol3/contrib/host-main-101.c for your convenience.Andreas
1024d

P
7674

Re #7673: Sqlab: let's figure out why upload is not working for you here. (I tried the sharing site you linked above, but I'm not sure it's safe... and I clicked on download of the file, nothing happened.)Carl
1024d

P
7673

Re #7672: version 104 http://www.mediafire.com/?8tplmfkdfk4zglcsqlab
1024d

P
7672

Re #7661: I uploaded the file to a public available store http://www.mediafire.com/?ck4qi98vlkhfgtp. I hope you excuse the many ads.sqlab
1024d

P
7661

Re #7660: I used Win XP. The requestor worked and after it seems to load something up, but in the end I got an error.sqlab
1030d

P
7660

Re #7654: Oh... actually, it may not work quite write on non-windows, because it opens a requestor. SQLAB, what OS are you using to do it?Carl
1031d

P
7659

Re #7647: Yes, that's the main difference, that it's a refinement elsewhere.

DECODE is actually a lower level function, probably not used much in code because it's mainly part of the LOAD function.

However, I do understand your concern about the order, and if we're going to change it, needs to be very soon. We should look around other functions and see if there are many other examples for it. I made the assumption that the codec should be the first arg, but that was just my gut intuition on it.

Let's figure it out.

Carl
1031d

P
7654

Re #7639: Never tested for other systems, but Win32. I tried uploading to R3/console, but no success. Maybe I did not understand the syntax of put and submit. If there is really something uploaded, I can't check, if I got the right file, I wanted to upload. I will try to put the file somewhere else over the weekend.sqlab
1034d

P
7654

Re #7639: Never tested for other systems, but Win32. I tried uploading to R3/console, but no success. Maybe I did not understand the syntax of put and submit. If there is really something uploaded, I can't check, if I got the right file, I wanted to upload. I will try to put the file somewhere else over the weekend.sqlab
1034d

P
7647

Re #7640: Not realy. I though Rebol args order was "action what how", like enbase/debase (I know, Base arg is used with /base refinment so it is the last arg), secure dialect (it's "file allow", not "allow file"), encloak/decloak, get-modes/set-modes and series functions. I can live with that, it's was just my realtime feeling as I read the line. But, I would like to know what others think ?DideC
1034d

P
7646

Re #7643: Carl - you haven't given us a download link, and the file I found using the previous naming convention is missing the host-ext-test.c file.Graham
1034d

P
7643

Ok, if you want to try Callbacks in the host-kit, look at the host-ext-test.c file for a couple examples.

CALLBACKS HAVE SPECIAL RULES! And I'll be updating the documentation to cover them. For now, just keep things simple. Avoid callbacks to commands to callbacks to commands unless you really know what you're doing. Remember that REBOL can GC at any time, and poof goes your data... if you're not referencing it properly.

Carl
1034d

P
7640

Re #7638: No, it's ok. The order is: DECODE codec data ... so the codec type is superior to the data being encoded or decoded. Do you agree?Carl
1034d

P
7639

Re #7637: Is it a mod to host-main.c for win32 or any system? Will it work with the readline function used for non-win?

Perhaps post it somewhere, and I will take a quick look.

Carl
1035d

P
7638

Re #7636: Just a thing that hurt me a bit : I see in the previous doc "decode 'markup binary" and it looks akward compared to the usual params order of Rebol funcs (that would be "decode binary 'markup"). Why is this or did I misunderstood something ?DideC
1035d

P
7637

I have a crude modification of host-main-c, that allows multiline commands and strings in the console. It does not use Unicode. Is that interesting?sqlab
1035d

P
7636

Final call for A103 submissions. See http://www.rebol.net/wiki/Host-Kit_Development_Notes for prelim change doc.Carl
1035d

P
7611

www.rebol.com/r3/downloads/r3-host-kit-a102.zip

and for those who want it:

www.rebol.com/r3/downloads/libr3-a102.so

but, you'll need the posix host parts from an earlier host kit release. Merge them with the above zip host-kit sources, and the build for Linux should work.

Carl
1055d

P
7564

There is a release of the host-kit with the externalized graphics library. It's still preliminary because the DRAW interface works through commands now, and there are many more than need to be converted (Cyphre will be working on that.)

If you are interested in this host-kit, contact me.

Carl
1073d

P
7328

Re #7320: Hostkit for windows has been built according to latest bloglet.Graham
1128d

P
7320

Any ideas when an updated (say, A99) hostkit will be available?Andreas
1135d

P
7313

Has the A98 Host package already been released? I can't seem to find it.meijeru
1138d

P
7284

For example, the latest problem is that if I use BROWSE, Opera will not open the requested window until I quit REBOL. Quite strange... but you've got the Host code, so if you see the problem let me know.Carl
1139d

P
7283

BTW, I still see odd effects on my system from the R3 console. For example, in some cases it hangs other unrelated apps. Figure that out! My guess is that there must be some kind of global lock we're using... any ideas are appreciated!Carl
1139d

P
7282

Re #7248: Cyphre, that's great to know, and I'll add it to A99. Thanks!Carl
1139d

P
7277

Re #7257: I am using Windows with rlwrap, so this session was lauched as I:\rebol>\usr\bin\rlwrap r3.exeRobertS
1140d

P
7257

Re #7256: because the console I/O handling is a super-simple 5 line affair in R3. there is no real console handling code within the host.

We could go for more powerfull shell stuff, Like python uses in IDLE, but it has to be coded and for the factual benefits,. I'd rather have Carl concentrating on MUCH more serious stuff.

anyone else can step up to the plate though... and so far it isn't bothering us enough to do so.

I don't even miss multi-line pasting, cause i never do so... it fills up the history with many lines...

much better to: >> do read clipboard://

maxim
1141d

P
7256

Re #7255: If we can have multiline mode or even console GUI (don't need that one right now), then why don't we have it? Multiline mode is essential for quick prototyping, cut&paste of source-code, etc.pekr
1141d

P
7255

Re #7254: There is nothing about the current Windows console that prevents us from handling R2-style multiline mode or console GUI. We just aren't doing that right now. The only limitation is the "can't be properly sized" thing. Even the cut&paste thing is fixable with the current console if we want to.

Which is not to say that I wouldn't want the option of an R2-style GUI console for REPL development, and maybe the text-mode chat. At runtime though, I would either want a real Windows console, or an embedded console, or no console at all, but not the R2-style console.

BrianH
1141d

P
7254

Re #7252: That is exactly what I mean - if current Windows console can't be a "real" console, then it is absolutly worthless piece of crap, ruining R3 experience a big way, at least for me ... it can't be properly sized, cut&paste is a pain, it can't work in multine mode, you can't do special R2 console tricks (console GUI)pekr
1141d

P
7252

Re #7249: "nor can it work for admins in OS gui-less version ...." Bringing the R2 console back won't solve this problem. For that we would need a real console build. So we probably need both. Stupid Windows :(BrianH
1142d

P
7251

Re #7248: I do that manually from the system menu, so agreed.BrianH
1142d

P
7249

Re #7248: I second that - any tweak making the work with default Windows console more pleasant is welcome. I still think, that we need R2 console back, as Windows console does not provide us with multi-line capability, nor can it work for admins in OS gui-less version ....pekr
1142d

P
7248

Carl, maybe this could be a good enhancement in some next R3 Windows version.

I have found one useful trick how to set the R3 Windows console to the "QuickEdit Mode"(ie enable context menu with copy/pase functions and text selection/copy/paste using mouse buttons directly) by default when R3 is executed:

In src\os\win32\dev-stdio.c file inside function Open_IO() put right after this line:

if (!Redir_Inp) Std_Inp = GetStdHandle(STD_INPUT_HANDLE);

following call:

SetConsoleMode( Std_Inp, ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT | ENABLE_QUICK_EDIT_MODE | ENABLE_ECHO_INPUT );

What do you think?

cyphre
1142d

P
7203

Re #6344: Another piece for your OSX linking puzzle. If you are using the toolchain from Xcode 2.5 or earlier, the linker defaults to "multi module" mode, meaning that the resulting library contains one module for each object file linked in. In this mode, -x stripping won't do what you want.

To prevent multi-module linking, pass -single_module to the linker (e.g. -Wl,-single_module). Single module linking is the default since at least Xcode 3.2.

I've now tried the example code I posted in #6332 on an OSX 10.4 on PPC using Xcode 2.5, and after adding -Wl,-single_module the resulting library looks clean.

Hope that helps. I'd really love to see a OSX version accompanying A98.

Andreas
1157d

P
7158

Host kit info here: http://www.rebol.net/r3blogs/0301.htmlSunanda
1170d

P
7156

Re #7153: WOuld you mind telling me where?meijeru
1171d

P
7153

Re #7152: the host kit is publically available as far as I recallGraham
1172d

P
7152

Re #7139: I would like it too, but am almost despairing of it ever being released.meijeru
1172d

P
6627

Carl; anyone; Is there going to be a Reb_Get_TOS, or Reb_Form_TOS in libr3.so. I'm using a hack of host-main.c to host-embed.c splitting out the r-e-p-loop. All good for playing, the results being printed, but I'd rather return the resuly to COBOL, not just the screen. Is this type of embedding part of the plan? Much fun regardless.btiffin
1262d

P
6355

Re #6345: Carl, could you outline a bit (probably in web related thread), what's the transition plan for rebol.com website redo? I am interested into seeing a wireframe, and I would also like to know, how will site separate R2 vs R3. As for me, I would probably concentrate upon R3 only, as it is our future, and would put R2 into some "legacy" container. This way, the segmentation of all R2 related stuff would be easier to solve. I would also like to know, what is the timing for new website to appear, if we are going to do in in multiple steps, who does gfx artwork, etc. IMO having nicely looking and gfx-wise up-to-date site will greatly help our effort ...pekr
1270d

P
6348

Re #6347: I agree. But a bit more docs could help. I'm mostly using the Extension stuff at the moment, not doing anything special with the Host-Kit.

Of most interest would be to add callbacks. This will enable a bunch of new applications.

Robert
1272d

P
6347

Re #6346: Yes, I think the Host Kit could be release to more testers.Paul
1273d

P
6346

Are we ready to release the Host Kit to more than just the few first testers?

It seems that it works well enough, no?

Carl
1273d

P
6345

Re #6334: Paul, that's great to hear! Let us know what we can do to help... there's a lot of talent here, and even RT would like to be of help.

So, WRT R3, it is the top priority, and there are various areas of development on it. The most recent was the host-kit, and soon we'll do another build to address the new bugs in CureCode.

Mixed in with R3, we're also working on the website... for "marketing" reasons. This is long overdue, but absolutely necessary.

And finally, we want there to be a "background job" where we again release R2 updates. Personally, I'd like to see a new version each month (but, maybe I'm the only one who wants that.) The reason is simple: if we only release a new R2 every year, then there's too much to add and to test at the same time, and it becomes a very large project... often getting delayed for long periods.

Thanks again for the note.

Carl
1273d

P
6344

Re #6332: Abolka, I tried that earlier with strip -x, but it would not load because the internal symbols were missing.

However, with the success you posted here, I am encouraged to give it another try... will let you know, thanks for the posting.

Carl
1273d

P
6334

Thanks Carl, just interested and especially want to know the direction that R3 is heading in. I just got the go ahead today to use REBOL (2.7.6) for our corporate environment. This is a very large company (one of the biggest in the world) and going to be installing this on all of our huge productions sites.

My department is the last stop for escalation issues. We have the say so when it comes to what impacts production and how long we can hold up recovery just for the sake of discovering root cause. This is a major inroad to advancing the REBOL namespace. Developers escalate debugging issues directly to my group. I'm excited as you can probably tell. Hopefully, R3 is not restrictive and advances rapidly. I'm eager to see it hit the street in my domain..

Paul
1275d

P
6332

Re #6306: Carl, passing -x to the linker (i.e. gcc -dynamiclib -Wl,-x) or stripping the library with strip -x after it was built, should to the trick.

Here's a simple example.

foo.c:

extern void bar();

__attribute__((visibility("default"))) void foo() { bar(); }

bar.c:

#include <stdio.h>

void bar() { printf("bar"); }

If we build a dynamic lib from this using:

gcc -fvisibility=hidden -c -o foo.o foo.c gcc -fvisibility=hidden -c -o bar.o bar.c gcc -dynamiclib -Wl,-x -o lib.so foo.o bar.o

We get the following output from nm:

lib.so(single module): 00000fce T _foo U _printf

Hope that helps. The above used gcc version 4.0.1. I've put up the above (including a Makefile) at http://bolka.at/2009/misc/exports.tar.gz.

Andreas
1276d

P
6331

Re #6306: Carl, passing -x to the linker (i.e. gcc -dynamiclib -Wl,-x) or ibrary with strip -x after it was built, should to the trick. Here's a simple example. foo.c:

extern void bar(); "))) void foo() { bar(); }bar.c: stdio.h> void bar() { printf("bar"); } build a dynamic lib from this using: dden -c -o foo.o foo.c bar.c gcc -dynamiclib -Wl,-x -o lib.so foo.o bar.o t the following output from nm: lib.so(single module): 00000fce T _foo U _printf above used gcc version 4.0.1. If anyone wants to play with above example, I've put it up at http://bolka.at/2009/misc/exports.tar.gz (including a Makefile).

Andreas
1276d

P
6330

Smile! We're on OSNews again: http://mobile.osnews.com/story.php?news_id=22639

Maybe someone there will know what to do with OS X.

Kaj
1276d

P
6329

Re #6322: Carl, (not really checked) but what I use for DLLs on windows with GCC is: -shard -static -Wl,-s,--exclude-libs,ALL further I use a DEF file to only state the functions I want to get exported.Robert
1276d

P
6323

Re #6318: Paul, quite soon, once I'm sure the first step was a go. A small script will do all you need for that.Carl
1276d

P
6322

Re #6316: Thanks BrianH. So, here's what to try: compile 2 files that contain just a few misc functions each.

Then, use gcc -dynamic-lib -o test.dl a.o b.o

Then use nm on test.dl -- you will see all the funcs in both a and b. Try _attributes_ and __private_extern__ and see if you can keep them from showing on nm -s and other options. If so, you've succeeded.

If so, let me know what I need. Also, I use gcc 4.01. Perhaps that's the source of my problems, but it is > 4.0.

Also, try gcc -fvisibility=hidden which in theory removes all non-exported symbols.

Let me know... and thanks!

Carl
1276d

P
6318

Carl, are you going to expand on the host build instructions and tell us how to create our own encapped builds that include our own R3 scripts?Paul
1278d

P
6316

Re #6306: If you send me some test code that demonstrates the problem, I can trial-and-error it until I find something that works. It doesn't have to be R3 code, just code that is similar enough in structure to cause the problem.BrianH
1279d

P
6315

Re #6313: I also found a lot of information here: http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/ld.1.html and here: http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/libtool.1.html

These get called internally by gcc, which passes arguments on to these.

BrianH
1279d

P
6313

Re #6306: It looks like the -exported_symbols_list option of gcc is your best bet here. Start on this page: http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html#//apple_ref/doc/uid/TP40002013 The "Dynamic Library Design Guidelines" page, the "Symbol Exporting Strategies" section is a good place to start. There is also a link to the compiler docs.BrianH
1279d

P
6308

Re #6302: That doesn't sound like a job for our tool - which synchronises stdout and stderr, because stdout is block buffered while stderr is line buffered.Kaj
1279d

P
6306

I must set OS X on the back burner... I've wasted far too much time on it.

There are three choices on it: 1. find a tool that does what I need 2. make a tool that does what I need 3. join all the sources into one large .c compile

Note that gcc -fvisibility=hidden does not work, nor does __private_extern__ work either.

I've got to get on with other projects now. So, if you happen to find the solution, let me know. (PS, yes, using GCC > 4.0.)

Carl
1279d

P
6305

Re #6304: We've almost got enough confirmation that the first stage works (very basic build.) Next week, we'll go to the next stage, if all goes well.Carl
1279d

P
6304

Carl - I am runing r3-a96 under EeeBuntu 3 on a netbook - I build a lot of tools on this little gizmo (variants of ICON, ObjectIcon, Gnu Smalltalk, Converge) - is there something I could help test with host kit? Embedding Jetty or the like? .RobertS
1280d

P
6302

Re #6294: It's an internal mold buffer... the conflict is only on UTF-8 systems. Hopefully a minor fix.Carl
1280d

P
6297

Which CPU is the R3 core lib compiled for, i386 or higher?Kaj
1281d

P
6294

Re #6286: What buffering issue is that? My Syllable project lead recently implemented a small tool for our build logs that may be relevant.Kaj
1281d

P
6293

Re #6285: Hm, I don't think it took that long. I'm also not sure if it was reproducable. I reposted the entire text scraped from the terminal screen, but that came out garbled. I didn't want to loose it again, so when I scraped it line by line, I chunked it too, in multiple messages. :-)

The error message points to a condition that should be prevented or guarded by the REBOL code.

Kaj
1281d

P
6292

Re #6281: Glad to hear that, that's why I'm pedantic about it. It makes a lot of difference to open source people to feel that a vendor "gets" them.

Most open source packages use the GNU AutoTools for configuration. That means that the makefiles are generated, and very long and indeed unreadable. The source files are usually fairly clean, but in practice, you often end up debugging in the generated makefiles.

REBOL programs and configurations are usually much cleaner for two reasons. They usually execute their models directly instead of generating intermediate code in different languages. And mainstream programs tend to want to adapt to and use many peculiarities of host systems and support libraries. For which they need the many compile time configuration checks. REBOL and a very few other projects go in the other direction by minimising dependencies and concentrating them in a library interface.

I often wonder if I was the last one they taught in university that loose coupling between components is to be preferred over tight coupling, or if I was the only one paying attention.

Kaj
1281d

P
6291

Re #6280: I can't imagine Steve didn't build in a method to hide the internals of Apple software. ;-)Kaj
1281d

P
6290

Re #6283: Cool, thanks for that! I'm posting from Syllable Server now. -fpack-structs was the culprit. Dropping -O1 seemed to take it a little further but then I got segfaults again. Without -fpack-structs I've tested -O1 and -O2 with success.

It makes no difference on Syllable Desktop, though, so that must be an earlier error.

Kaj
1281d

P
6289

Re #6280: I remember comming accross information about how to prepare the external symbol table. it has to be prepared manually afaik. maybe in one of the pages of the library bible. Note that I'm not an expert on OSX by any means, just trying to help you get it sorted out, cause I could REALLY get into coding on OS X.

for one thing, I'll be supporting my OpenGL work on OS X as soon as I can.

maxim
1281d

P
6286

Also, I can add a verbose pref to Chat if you want to see where it's failing. Or, you can try using: secure none trace on -- but TRACE on Linux still has a buffering issue.Carl
1281d

P
6285

Kaj, on Chat bugs... there was a problem if the HTTP connection timed out on a large load of all the messages. I think it's set for 30 seconds.

Back in April, I modified the code to get the message base in chunks to prevent this problem. I was at a different location that had long lags, and that's when I first noticed that the timeout was happening.

Carl
1281d

P
6283

Re #6264: I have encountered trouble with the Linux builds too, but I was blaiming the fact that I use the 32b builds on a 64b OS.

After debugging the segfaults a bit, I decided that it was GCC to blame for what looks like a miscompilation. Either dropping -fpack-structs or -O1 fixed this for me, and I've since been sucessfully using my locally built R3 core for R3 chat. In fact, this reply is posted this way.

Andreas
1282d

P
6281

Kaj, ok... we'll get them setup as best we can for what Linux users would expect. Also, we can update the makefile to remove the build from clean.

When it comes to the host build, I want to make sure we can eliminate as many "barriers to builds" as possible. So, using standard accepted makefile format is good... as long as it's kept simple. (Many of the makefiles of primary tools are very difficult to read... so we won't be doing that.)

Carl
1282d

P
6280

Back to OS X, the problem is that they're not really libs, they're .a's. This even appears to be the case when -dynamic-lib is used.

I should mention that I've had -dynamic-lib built OS X libr3 and host working for several days. But, the libr3 isn't in the form I want, because it's not internally linked and resolved. Examining it with nm it looks like just a concat of .o files.

Specifically, I want all internal symbols resolved, and I only want to export the library interface.

If OS X only builds libs (dynamic or otherwise) as concatenated .o files, that's a serious breach of coding ethics! There are two reasons:

1. it means I can link against the internal interfaces - a serious short circuit in code encapsulation rules.

2. it means I can discover the entire internal structure of any product... say I want to peek inside Photoshop to see how it does something.

If I nm a lib that's been properly prepared, I should only see its API, nothing else. So far, this has not been possible on OS X.

I suppose I could easily confirm this by nm'ing some of the various apps I have on OS X and checking if I can see their internals. Let's hope not.

Carl
1282d

P
6279

Re #6257: Abolka, very good. I guess it's about time to put the files here in chat. I'll work on that later this week, and we can go from there.Carl
1282d

P
6276

Re #6253: It's normal for make all not to purge, but it's not normal for make clean to do the build. For example, if I make one modification to the R3 recipe I wrote for my Syllable build system, I can have it install the pre-built Fedora binary instead of doing the source build. However, this currently doesn't work because make clean is still executed and that surprisingly does the build. I can be done, of course, but it requires going outside the normal procedure.Kaj
1282d

P
6275

Re #6252: Yes, the object files are also in the distribution. I guess they and the executable are one extra tool for someone to get it working if they are having trouble with the source build. In any case, it makes little difference in the distribution size because GZip very nicely catches the duplicate data.Kaj
1282d

P
6274

Re #6273: In conclusion, a build for Linux should note on which version of which distro it is done. Then in the documentation, to safe the user from having to research it, it should be noted which library versions this distro had. If you want to produce one build that covers as many distros and versions as possible, and you were to take Ubuntu as a standard, the best course of action would be to take the Ubuntu LTS release of five years ago, the last one still supported, and then test to see if a build on that will also run on newer distros.Kaj
1282d

P
6273

Re #6272: Nevertheless, it helps to try. For example, GLibC is maintained by Red Hat, so it probably does this symbol versioning because their customers demand it. The LSB defines a standard base of libraries, but it's very small: basically GLibC and X11. Maybe REBOL/View could almost stay within that. If you regard Ubuntu as a standard, it has a Long Term Support release every 18 months. The Desktop version is supported for three years and the server version for five years. (But every release has its own binary repositories.)Kaj
1282d

P
6272

Re #6271: So, the library versions a system provides, and the versions requested by the executable which you get from ldd or readelf, do not tell you whether the combination will work. The only way to be reasonably sure is to build on a defined base system and then make sure future system releases are backwards compatible. Both these concepts are basically absent in the Linux world. Everything is based on the mantra that the source code will always compile, anyway. (It doesn't, but that's for another bedtime story.) Binary-based Linux and BSD package managers make hardly a distinction between the system and the rest (because people would never agree on drawing the line), and their respective geeks get a kick out of upgrading to every new GLibC before their peers. So if they also produce binaries, it's very common to have binaries that require a GLibC version that your system doesn't have.Kaj
1282d

P
6271

Re #6270: There is no libc.so.7; currently only libc.so.6. Although new GLibC versions come out regularly, the main library versions rarely change. It was disruptive last time. These days, symbol versioning is used. If an API changes, GLibC also keeps offering the old interfaces for older binaries under the same symbol name.

This works great when running older programs on a newer library. However, when an executable is built on a system with a newer library and then transferred to another system with an older version of GLibC, it still just bombs out with hardly a clue.

The Fedora builds of REBOL, both 2 and 3, do run on newer Linuxes, from the last two years or so. On older distros, or conservative distros with older libraries, they bomb out with a floating point exception. So that would be a case of libm.so.6 being too old.

Kaj
1282d

P
6270

Re #6269: Good image, eh? I think eFishAnt taught me that. :-)

Ah, fair enough if one build is meant to cover as many Linuxes as possible. However, it remains to be seen how far this will go. In any case, it's essential information for people to know on which OS version a binary was built.

Kaj
1282d

P
6269

Re #6268: Aargh, I got this when first trying to post this:

--- Note: login initiated--- Note: fetching user list pt error: cannot use subtract on word! value msg either either post-text either post-reply parse try either either forever command-loop make context do catch either either applier do try chat** Near: - 1 = length? msgs-base [ append-msgs reduce [r]] [ ... logged to error-log.txt

I'm afraid I will have to copy it again from the screen line by line.

Kaj
1282d

P
6268

Re #6250: r Good image, eh? I think eFishAnt taught me that. :-) enough if one build is meant to cover as many Linuxes as possible. However, any case, it's essential information ch OS version a binary was built. ently only libc.so.6. Although new GLibC versions come out ularly, the main library versions rarely change. It was disruptive last time. PI changes, GLibC also keeps offering the lder binaries under the same symbol name. en running older programs on a newer library. However, when an transferred to another it still just bombs out with hardly a clue. s of REBOL, both 2 and 3, do run on newer Linuxes, from the last two with older libraries, they ption. So that would be a case of libm.so.6being too old. , the library versions a system provides, and the versions requested by the not tell you whether the to be reasonably sure is to build on a defined then make sure future system releases are backwards compatible. . Everything is based on always compile, anyway. (It doesn't, but dtime story.) Binary-based Linux and BSD package managers hardly a distinction between the system and the rest (because people would ective geeks get a kick out of fore their peers. So if they also produce binaries, common to have binaries that require a GLibC version that your systemdoesn't have. ple, GLibC is maintained by Red Hat, so it symbol versioning because their customers demand it. The LSB efines a standard base of libraries, but it's very small: basically GLibC and X11. that. If you regard Ubuntu as a standard, Support release every 18 months. The Desktop version is supportedfor three years and the server version for five years. conclusion, a build for Linux should note on which version of which distro it is he user from having to research it, it ibrary versions this distro had. If you want to produce one ild that covers as many distros and versions as possible, and you were to take on would be to take the Ubuntu LTS release the last one still supported, and then test to see if a build onKaj
1282d

P
6267

Re #6246: As others have said, OS X does have shared libraries. At a guess, they're basically quite similar to other POSIX systems, because OS X is based on FreeBSD userland, and Apple is heavily involved in development of GCC and LLVM (sort of a successor to GCC).

At a glance, Apple seems to be using a -dynamic linker directive instead of -shared, and as others mentioned, .so is suffixed .dylib instead. Environment variables for search paths to libraries are also different, if you need those. (Syllable Desktop uses $DLL_PATH instead of $LD_LIBRARY_PATH on Linux, but I didn't need that in the "port".)

Kaj
1282d

P
6264

Re #6230: It looks like there are broader issues with chat on the Linux R3 host, so it may not be specific to the Syllable Desktop hack. I tried to start chat on several Linuxes and got segfaults, in several phases of chat initialisation.

A very old Ubuntu just says segfault when I try to start chat fresh.

Syllable Server gets a little farther and is more specific. It creates the empty database, but then segfaults on login. When I start it again with the empty database, it segfaults immediately. Here's one of them:

Script: "RebDev Command Line Interface" Version: 0.4.21 Date: 3-Dec-2009/0:00 r3[2966]: segfault at 14 ip 08049c9b sp bfe9a880 error 4 in core[8048000+6000] Segmentation fault

Syllable Desktop doesn't segfault but already errors out on creation of %base/, so maybe at the same point as the old Ubuntu, with a REBOL error that seems to come from CREATE.

Note that monolithic A96 has no problem with chat (I'm on it now).

Kaj
1282d

P
6260

Re #6246: just found the OS X dynamic library bible:

http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/DynamicLibraries/000-Introduction/Introduction.html

maxim
1282d

P
6259

Re #6246: OS X does have libs... they are .so files but with .dylib extensions.

here is the apple reference page on the subject... scroll down, you will see some info about using and compiling them:

http://developer.apple.com/mac/library/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html

hope this helps!

maxim
1282d

P
6257

For what it's worth, I put up a patch to enable extension loading on POSIX:

http://bolka.at/2009/patches/posix-loading.patch

This patch, another patch to reb-ext-lib.h, and a fix to bug #0001382 allows me to load the extension compiled from the sample shown on the R3 docs page [1]:

>> append system/options/file-types [%.so extension] >> import %ext/sample.so >> add-mul 10 20 30 == 900

[1]: http://www.rebol.com/r3/docs/concepts/extensions-making.html

Andreas
1282d

P
6254

Ok, did I miss anyone's comment? Just post the #1234 and I'll check it out.Carl
1283d

P
6253

Re #6240: There's some minor makefile cleanup still needed. I'm open to inputs on it. Make clean purges all objs then rebuilds all, whereas all does not purge.Carl
1283d

P
6252

Re #6239: I'm split on whether to include a pre-build host or not. (It's there as a result of me testing the build. The objs are probably also there.

Suggestions?

Carl
1283d

P
6251

Re #6238: Great to hear! On that little warning, it was a last minute change in the cleanup pass. I didn't want the main() decl to have a typedef'd arg (REBCHR), but rather the classic char*. Will make it explicit in the reference to get rid of the warning.Carl
1283d

P
6250

Re #6237: Lol on crabs-in-a-bucket. Need to think about the naming. I call it "fedora" because I've never been able to get it to run on anything but a fedora system, where as the ubuntu builds seem to run just about everywhere. It's a lib thing, probably 7 vs 6. Maybe that would be better for naming than using OS distro names?Carl
1283d

P
6249

Re #6236: Kaj, right on .gz. Force of habit. Next rel will be .tar.gz.Carl
1283d

P
6247

Kaj, thanks for the feedback! Let me go over your comments and get back to you.

Needless to say, send me any makefile corrections you've made, and I'll integrate them into the releases. Thanks.

Carl
1283d

P
6246

OS X has a problem. I've yet to determine how to build linked dynamic libs.

In other words, OS X does not appear to have libs. It uses concat'd objs (like the old BCPL Amiga libs.) Please tell me I'm wrong, and let me know what it takes to build one.

So OS X goes on the "wait list" until we figure this out.

Carl
1283d

P
6245

FreeBSD Host Kit built. If you want it, contact me.Carl
1283d

P
6240

The clean target in the makefile does a make core. This is rather unexpected and, I would say, wrong. People and tools expect the build to happen in make all, not in make clean.Kaj
1283d

P
6239

The Fedora package has a pre-built host binary in it, but the Ubuntu package does not. Is this an oversight, or did something go wrong when building?Kaj
1283d

P
6238

I have ported hundreds of software packages to Syllable, including ten languages or so, and I can tell you that the REBOL source code is very, very clean. It feels wonderfully light to navigate around the source tree, because everything is almost immediately obvious, and I know how convoluted it usually is.

GCC produces one warning when compiling the host code, the same with GCC 4.1.2 on Syllable Desktop and GCC 4.3.2 on Syllable Server. So if you can fix that, it will be perfect:

src/os/host-main.c: In function 'main': src/os/host-main.c:110: warning: passing argument 2 of 'Parse_Args' from incompatible pointer type

Kaj
1283d

P
6237

The Fedora host package is indicated with "fedora" in the name, but the Ubuntu version has "linux". This is not clear, and it's also a sensitive issue in the Linux scene to seemingly appoint one distro as THE Linux.

(It's the bucket of crabs pattern. All the crabs are angry and decide that they want out, cheering each other to climb up. But when one crab gets ahead of the others, they get angry at him and pull him back in the bucket.)

Kaj
1283d

P
6236

The host distribution packages have .gz suffixes. It took me a while to figure out that the file contained in them is a tarball. The standard suffix for that is .tar.gz, so you can make it a lot clearer by using that. Or .tgz.

Many tools expect that just like humans, so for example the way most Linux shells are configured, with tab completion per command, tab completion with the tar command doesn't work with a .gz file, and my build has never before come across a .gz with a tar in it.

Kaj
1283d

P
6235

Things may get confusing now, because our other system, Syllable Server, IS based on the Linux kernel. So I can run and build the Linux versions of REBOL on that in the normal way.

I tested the pre-built host version for Fedora and compiled the host versions for Fedora and Ubuntu. They all worked. This is on a highly experimental development version of Syllable Server 0.3, currently with Linux 2.6.25, GLibC 2.8 and GCC 4.3.2.

I do have some recommendations to make the process even smoother.

Kaj
1283d

P
6234

I did some more testing. The only thing I can find on Syllable Desktop that doesn't work is the initialisation of chat. It seems to bomb out on creation of a file port when creating the %base/ database.

We'll have to investigate whether this is an incompatibility with Desktop or a weakness in the hack with the Linux binary.

Kaj
1283d

P
6233

There are split trees with overlay recipes for Syllable Desktop and Syllable Server, to allow variations while maximising code sharing. For R3, there's an extra overlay recipe for the library versions hack in Syllable Desktop:

http://syllable.cvs.sourceforge.net/viewvc/syllable/syllable/system/apps/utils/Builder/packages/Syllable/REBOL-Core--current/REBOL-Core--current.recipe?view=markup

Kaj
1283d

P
6232

By the way, I integrated the R3 build in my build system for Syllable. For anyone interested, here's the build recipe I wrote for it:

http://syllable.cvs.sourceforge.net/viewvc/syllable/syllable/system/apps/utils/Builder/packages/REBOL-Core--current/REBOL-Core--current.recipe?view=markup

Kaj
1283d

P
6230

Ehm, I got R3 to work on Syllable Desktop. :-) I've only been waiting for that for a decade.

It's not supposed to work at all, because Syllable Desktop is our non-Linux based system (our own stack from the kernel all up to the GUI) and R3 isn't ported to it yet. However, Syllable is closely aligned to Linux, or better said GNU, using much of the same infrastructure (you could picture our own software stack as vertical, and the ported infrastructure as horizontal). Syllable uses the GNU C library, GLibC, like most Linux distros, and REBOL uses the C library to interface with the system. Now we use the GNU versioning of GLibC, which is different from the GLibC library versioning as used in Linux (for some historical reason from before my time with Linux). So I compiled the R3 host source code on Syllable Desktop and linked it with a binary R3 core library from Linux, a trick we have done before with a Linux binary codec. The result can't find the libc.so.6 and libm.so.6 libraries from GLibC, but symlinking those to Syllable's libc.so.2 and libm.so.2 makes it work!

This works because the libraries are basically the same, because the way they are used by Linux and Syllable are much the same, and because R3 is very well isolated from the host system. This is not normally the case, and to illustrate that this is a fragile hack: it works with the R3 library compiled on Ubuntu, but not with the one from Fedora. Not everything works, either, and I have to do more testing. For example, initialisation of chat doesn't work, so I couldn't proclaim total victory by posting from it. ;-) But HTTP works. I can even load the GUI demo, but it doesn't work, of course.

So, R3 still needs to be ported to Syllable Desktop for real, but I think it's interesting that it works even without porting, while other platforms require real porting work. :-) I didn't even have to make any changes in the host source code as configured for Linux. The binary library just working makes it very likely that porting the R3 library to Syllable Desktop from source will also require very little if any modification.

Kaj
1284d

P
6229

For the mingw builds, I suggest updating the docs to just updating the systems path statement with the path to mingw/bin and then go to your r3 host build directory and type mingw32-make and that is all that is needed.Paul
1284d

P
6228

Re #6223: Here's a cross-compiler for WinCE: http://cegcc.sourceforge.net/ Don't know how well it works yet, or how well it integrates with the MS tools for developing for CE. If you can compile a host with one compiler and r3-lib with another, that would expand our options. Being able to cross-compile the r3-lib from Linux or OS X, that would help with the build process. But WinCE developers would want to build hosts with their own tools.BrianH
1284d

P
6227

Re #6223: It would probably be easiest to develop an ARM port in the QEmu emulator. If the target can be Linux, it would be easiest to install a full-blown Linux that is self-hosting into QEmu, so you don't have to cross-compile.Kaj
1285d

P
6223

Re #6218: I mentioned it in my recent blog. So, if someone wants to point to a gcc for ARM, and someone else wants to port the host kit... then that's a start.Carl
1285d

P
6222

Host doc updated: www.rebol.net/wiki/Host-Builds Changes to plan and added Linux sections.Carl
1285d

P
6218

Re #6216: I admit that now that its a possibility we could run rebol directly from an android phone... I'm a bit uneasy about my iphone...

I could just jailbreak it and convert a port to it I guess... but we still need the hosts in the native cpu's format.... unless ARM cpus are compatible with x86 instructions?

maxim
1285d

P
6216

OK, who's after Windows Mobile and Android ports? :-) I am tempted to try R3 on my HTC TouchPro2. I would like to see View, but I think that initially I would love if I could access R3 Chat from my cell phone :-)pekr
1285d

P
6212

Released Host-Kit for Linux/Fedora. Send me a private message if you want to try building it (very easy.)

Next, will build for Linux/Ubuntu. Let's see if there are any diffs.

Carl
1285d

P
6211

Chat message from Linux using an R3 host via a dynamic lib!Carl
1286d

P
6210

Re #6199: Very cool. Somehow, I'm not surprised.Carl
1286d

P
6209

Re #6184: Right, -DUNICODE is required to put win32 into wide char API. Thanks for noting it for others; it's a tought one to figure out otherwise.Carl
1286d

P
6208

Re #6182: Static lib: eventually.Carl
1286d

P
6199

Carl, you might be surprised to know that I've got REBOL code callbacks working within extensions. :-)

I'll be doing a lot more tests in the next few days.

maxim
1286d

P
6184

I added a step in the host-lib documentation for Visual Studio. http://www.rebol.net/wiki/Host-Builds#For_MS_Visual_Studio

making sure the project is set to using unicode.

the first time I setup the host, all compiled without issue. then after a few tests, changes and a completelly rebuilt solution which now contains all my projects related to r3 binary stuff (r3 host, OpenGL extension, and others) the app compiled with ascii versions of Windows strings functions, complaining of type mismatch in compilation, and showing mangled text for local, version and other strings... (all OS-based).

so I did a diff between this new project file and the old one, and saw that the character set in the new one was set to multi-byte by default.

maxim
1288d

P
6183

Re #6172: robert... did you know you can move and remove posts? if you wanted 6171 to be in extensions, then you just need to type move 6171 5045 at the prompt and the message will change heading :-)maxim
1288d

P
6182

is it planned for a host relese to include a statically linkable .lib version of the r3lib (i.e. no dependency on r3lib.dll)?maxim
1288d

P
6172

Please see #6171, posted in wrong heading.Robert
1289d

P
6161

MingW works too. No problems.Robert
1290d

P
6160

soooo... the experiments begin :-)

In a castle up on the mountain, electric storm and lightning rods pointing to the sky, chains dangling...

parts sprawled around, files here and there... all linked by bits and pieces...

lever is pulled... the storm roars... the machine starts turning, things move, it groans, compiles... it pulls on its links...

... its alive!!! yes... Frankenrebol stands up stairing at me against the black background and just waits for me to give it orders...

rubbing my chin I ask myself: "shall I take over the world?"

Or should I just help the invasion .... like it says in the headers?

:-)

maxim
1290d

P
6143

Ok, Cyphre reports that he is able to build and run R3 using Code:Blocks IDE!Carl
1293d

P
6116

Uploaded MS Visual Studio project file (XML) as example for Host Kit. These settings work.Carl
1294d

P
6104

Once the release is out, I'll review all comments that were posted here, and get you my thoughts.Carl
1295d

P
6103

Status update: R3 Host-kit A96 has been completed. I'm going to do one last test on it, to confirm that the dist zip is valid, and then I'll be contacting the initial developers.

Because I'm not sure how much feedback to expect or immediate corrections to make, I'm only going to send it out to a few developers (as I mentioned much earlier.) I am hoping that by later this month, with enough effort, we can do a larger release, and have a mechanism in place to manage it (via Curecode or whatever.)

Also, just to note, this is the first stage of the Host-Kit, as defined on the wiki host-build page.

Carl
1295d

P
6093

Re #6092: From the Wiki, it's stated that Fog is not stable and won't be for a long time, but anyhow, it's an interesting project.Henrik
1301d

P
6092

Re #6091: DideC, Petr Kobalicek (author of Fog) is another fine good Czech coder. I think that Cyphre is aware of his work. IIRC, Fog library is based upon Antigrain, he just further optimises it. As his work is MIT licensed, we could use it. It might be also interesting to invite him to join REBOL :-)pekr
1301d

P
6091

Re #6090: BlitJIT is used (and was done for) Fog. I have read the benchmark page and there is an interesting performance comment regarding AntiGrain in the conclusion :

http://code.google.com/p/fog/wiki/Benchmarks

p

DideC
1301d

P
6090

Re #6089: There are also BlitJit and ASMJit libraries to consider, BlitJit is even done for AGG IIRC, the license is MIT:

http://code.google.com/p/blitjit/

http://code.google.com/p/asmjit/

pekr
1301d

P
6089

Re #6065: "LLVM is getting A LOT of industry attention." Industry = Apple. Apple hired the lead developer of LLVM because GCC's GPL license made it hard for Apple to integrate with the closed-source Xcode. Outside of Apple, LLVM is mostly used in research projects. MacRuby's LLVM port is sponsored by Apple. Although LLVM has some good tech in there, the industry attention is hype.

However, that same licensing issue affects us. The best alternative to LLVM is libjit, but libjit is LGPL - this means that we can't incorporate its code into R3 itself to build a new rebcode on. We have to wrap libjit in an extension.

LLVM is BSD licensed, so we could in theory use some of its code. The problem is taking the JIT out of the rest of the 12MB binaries, and hopefully it will be small enough to use. We can't just link to the system supplied LLVM, because no system supplies it: It's optional on OS X, third-party on other platforms.

Technically, the only advantage LLVM has over libjit is PPC support, and likely better ARM support. Those are not insignificant.

BrianH
1302d

P
6084

Hi Carl, moving the graphics interface to command! sounds reasonable. FYI I started to play with JIT compilation for REBOL. I thought this could be interesting for you: http://cyphre.mysteria.cz/tests/rebol-jit-test.txtcyphre
1303d

P
6067

Re #6066: read carefully, it would be an extension... the host can already link to code on the fly. basically just linkin an industry-standard tool with REBOL. same goes for OpenGL. Although adding all the vector maths directly within REBOL would be very handy, especially since R3 now supports vectors as a datatype. the overhead of accessing datatypes in interpreted REBOL is enough to make it MUCH faster in the host, as is the obvious advantage of doing the math there too.maxim
1304d

P
6066

Re #6065: Max, as for LLVM - the industry traction or not - how big actually would REBOL distro became just because of use of LLVM? If LLVM is not already preinstalled on target machines, it means you have to distribute it with REBOL. I am not sure making R3 10MB+ package just because LLVM is popular/cool/"in" is the way to go. Marketing wise, it would surely be an advantage.pekr
1304d

P
6065

Re #6064: I have an intel mac (mac-mini), winXP 32 bit, I will have to install at least one linux distro in a short while.

I would also like to install and test haiku... especially since they support the latest mesa drivers which include the experimental gallium OS agnostic HW 3d drivers. one HW driver for any OS which uses mesa for any of the gfx cards which have a gallium driver... this could be our solution for a stand alone OS running REBOL with HW accelerated 2D&3D out of the box.

I also want to start looking at LLVM as soon as possible, especially with rebolek's rebC dialect, which I would use as a basis for run-time compilable REBOL command! & extensions.

LLVM might not be the smallest jit engine out there, but it has a lot of traction, and its use with REBOL is a definite marketing advantage. LLVM is getting A LOT of industry attention. Ruby already uses it on Mac.

one possible use for LLVM would be for the compilation of 3D shaders and geometry deformers, using rebol code as source code.

we could also use it for the creation of fast 2D filters and pixel effects.

maxim
1304d

P
6064

I now have 3 physical test platforms for R3 development: - WinXP 32bit, laptop and netbook - Win7 64bit - Mac OS X 10.5 PPC (G5 iMac)

Other x86 or x64 platforms can be added virtually as needed.

It might be a good idea to follow Fedora's lead and make the Win32 version of R3 optimized for Atom processors. People who want high-end performance on Win are going 64bit nowadays. On 32bit, most of the laptop and desktop processors are massive overkill. The only areas in Windows where 32bit performance is a real problem is in the netbook/top and microserver space, and most of those processors are Atom or much like them. Out-of-order execution can handle a lot of the subtle differences for a lot of code, but Atom is in-order.

More recent GCC versions (like the one Robert linked) have Atom optimizations. We should use them, at least for 32bit x86. For 64bit we can go all out though.

BrianH
1305d

P
6063

Re #6062: Great catch, I'll download it right away :)BrianH
1305d

P
6062

Carl, there is a more modern GCC release for MinGW. It's named "TDM". Take a look at: http://www.tdragon.net

It's worth using the newe GCC version.

Robert
1306d

P
6049

Re #6046: cool, cause I'm no guru myself in that specific sense... :-)maxim
1308d

P
6048

Re #6046: Cool to hear, so I have MSVC here, so I might try to let it compile to Windows Mobile. Finally owning HTC Touch Pro2 would make more sense :-)pekr
1308d

P
6047

Re #6041: Pekr, I'll blog it. Yes, long pause this month.Carl
1308d

P
6046

Re #6042: Hi Maxim, yes it's interesting. Although R3 already compiles on OSX (Intel and PPC), BSD, Linux, etc., there was no provision for anything other than MSVC on Win32.

The build configuration system for R3 is done in REBOL itself, in order to make it manageable, because other methods are too complex.

In fact R3 uses different scripts from R2, because the R2 scripts evolved to became over time too complex to understand. So, a lot of simplifications were applied to R3 build methods.

The end result for Host code will be such a simple build... that it seems as simple as a beginner's C project, allowing almost anyone with C basics to be able to help support the host environment or port it to other OSes. We won't need gurus for that.

Carl
1308d

P
6045

Re #6040: Hi Cyphre, it's great to hear from you again. It has been interesting to build with other compilers.

For the graphics, I want to move the interface to use the command! datatype. So, the first step is to just get the core OS interfaces released, then go from there.

Carl
1308d

P
6042

Re #6041: great news :-) cross-compilation is an art unto itself. so the code now compiles on win32 in MinGW and MS visual studio?

have you tried MinGW on the POSIX platforms to get GCC and MinGW working there or where you already supporting it on POSIX?

maxim
1308d

P
6041

Re #6040: I agree with Cyphre. It is kind of "milestone". Deserves special blog :-) Some ppl might wonder, why R3 release cycle slowed down, so this would be cool news to share ....pekr
1308d

P
6040

Hello Carl, that's great news about the new Host build progress. Looking forward to touch the new codebase again.cyphre
1308d

P
6034

Typing this message from a host build from MinGW!

Some cleanup to do, but getting close now.

Carl
1308d

P
6033

An update: was able to compile the host and link with the R3 lib.

Problems with MinGW solved by not using Posix OS model, but using the Win32 model.

Now, on to debugging (it crashes.)

Carl
1308d

P
6029

MinGW chokes completely on file io functions. Will remove for right now, and see what other files choke.Carl
1309d

P
6028

Most files compile, with a few minor warnings. That's good.

However, the host dev-stdio.c errors out: SIGHUP not defined. So, it looks like we cannot use a pure Posix mode for Win32 core builds.

Carl
1309d

P
6027

So... MinGW gcc crashes with an "internal error" when compiling one specific file. Will set it aside and continue.Carl
1309d

P
6026

Downloaded MinGW as a test platform for Host builds. I'm hoping that MinGW is good enough to compile the C code. A lot of effort goes into making this code very transportable... meaning that the special C tricks are kept to an absolute minimum.Carl
1309d

P
5999

Re #5987: anytime you want to release it, I'm actively programming right now. ;-)maxim
1313d

P
5987

Finally... got the host build for Win32 working again in such a way that it does not break the primary release builds. I should have some source for you by tomorrow (PST).Carl
1314d

P
5927

Re #5913: cool, I'll be able to test extensions right away when I get it. by trying my rebol opengl extension inside of it.

that should be a good initial test from source host to running compiled version using an extension.

maxim
1322d

P
5913

I'll be adding to this page as the project advances.Carl
1323d

P
5912

http://www.rebol.net/wiki/Host-Builds (just type g to goto it)Carl
1323d

P
5911

Status: ran into some snags (due to host and lib being combined for so long). Debugging it this week with the goal to be a core build of host and lib. Will build a wiki page on www.rebol.net/wiki for this project and notes.Carl
1323d

P
5901

Began work on limited release of host building code. This will be in small steps at first, to one or two developers (to reduce support issues.) I will post notes and status here. There are also some private discussions on REBOL3 world, but I only access that world from one specific machine (as opposed to this R3 Chat that I can access from anywhere, any OS.)Carl
1324d

P
5055

Moved the discussion about the DLL interface to #1356, since it wasn't on topic here. This is the place to discuss the R3 host library/program and its source.BrianH
1408d

P
5041

Going to modify command! datatype to use the module object rather than the dll handle. That makes it more reflective... so, a user can determine which command goes to which plugin, etc. "Should be" a minor change.Carl
1414d

P
5040

Re #5038: Yes, it can be extended at runtime. Currently, it's a block only, but in the future we might want to allow an object too.Carl
1414d

P
5038

Re #5036: Can you extend the list of words uusable in the plugin interface at runtime as well? I mean the list mentioned here: http://rebol.com/r3/docs/concepts/plugins-making.html#section-16 That list of words looks like just a block. Is that block only used at plugin initialization time, or is it used at runtime as well?BrianH
1414d

P
5036

Re #5034: That is correct. MAKE command! can be called anywhere, at any time if you have the handle and know the index for the function.

It should also be noted that COMMAND func can be defined within your plugin as well. It is a plugin local function that stores the index counter for you.

Carl
1414d

P
5034

Carl, please tell me that you will be able to call make command! at runtime, not just within a plugin spec. I could use the ability to create new commands for a plugin *after* the plugin is loaded. In theory, all I would need is the handle of the plugin and a RPI_Call that can handle new values for its cmd parameter, rather than just a fixed set of constants...BrianH
1414d

P
5032

Carl, please tell me that you will be able to call make command! at runtime, not just within a plugin spec. I could use the ability to create new commands for a plugin *after* the plugin is loaded. In theory, all I would need is the handle of the plugin and a RPI_Init that can handle new values for its cmd parameter, rather than just a fixed set of constants...BrianH
1414d

P
4340

Re #4336: Correct. It's a "hidden function" (someday) used for IMPORT.Carl
1482d

P
4336

Re #4332: IMPORT is a mezzanine that registers a module, and loads it if it is not loaded already. LOAD is also a mezzanine, and the DO native calls the DO intrinsic - intrinsics are REBOL code. Somewhere down there you need a native function to actually load the plugin: LOAD-PLUGIN. The rest hasn't been changed to use LOAD-PLUGIN yet, afaict, but it will be.BrianH
1483d

P
4334

Re #4332: IMPORT is a mezzanine, so it will need something native to call to load the plugin. IMPORT just hasn't been changed to use it yet (afaict).BrianH
1483d

P
4212

Re #4209: I think you are underestimating the decreasing use of C APIs on the Windows platform, the use of Objective-C APIs on OS X, etc. Yes, you can define the FFI as a dialected wrapper around C-style APIs and datatypes, but for many platforms there are much better ways to do this, especially when they use data types and structures that are not directly C compatible.

The advantage to the plugin model is that you can implement the other models as plugins. We can implement a plugin that is included by default that provides a dialect to describe and dynamically link to DLLs with C APIs. This will give us the capabilities that R2 has, and more if we do a better dialect, as Ladislav suggests.

We can also have the community make other plugins to wrap other APIs that are not C compatible. Even a generic wrapper dialect for these other API models would be easier to use, since almost all of them provide reflection facilities.

I do think that we need a simple wrapper dialect for C APIs, and that this can be provided for all platforms by default. However, I think that we need to do it with a (internal) plugin, if only to make sure that thee plugin API will be powerful enough to implement such wrapper dialects.

BrianH
1495d

P
4211

Re #4199: "...peoples forget to pass pointers (the fastest way) just because they are not implicit in your new syntax" - I disagree. If you forget to pass a pointer, then it will not work correctly, that one *is* true. But, if you need to pass a struct, you currently (in R2 syntax) need to circumvent the impossibility to define substructures. Moreover, it is currently impossible to obtain a structure as a return value, the only possible thing is to obtain a pointer to a structure, which is something totally incompatibleladislav
1495d

P
4210

Re #4199: "It will cause needless copy of data." - I disagree. My claim is, that it will never cause copying that would be unneeded if REBOL datatypes were allowed in structs.ladislav
1495d

P
4209

BrianH, regarding the "focus" on C level I don't agree. A DLL interface is language independent on the OS layer. You have to follow a specific ABI (application binary interface) which specifies how parameters and return values are exchanged.

Then there are things like COM, which is mostly just an "agreement" how to layout a specific form of a DLL and how to use it. Mostly the language independent vtable structure is in there. Overall, COM is quite a smart approach.

And finally you have the runtime structure of languages like C++ and how objects are layouted. This varies a lot from language to language.

Overall, as long as a language can support the standard DLL ABI for a platform it will be useable with the DLL interface.

Robert
1495d

P
4208

Carl, for me also the dll access is a major feature, as it is a very powerful way to use the os resources as well as to bring to rebol the capability to interface the real world, or to execute tough and demanding processings (image processing for instance).jocko
1495d

P
4207

Re #4206: Carl, it is far from true that noone is interested in it. I just recently pointed Ladislav to that doc, as I thought he might have some ideas for it. We are also all waiting for your opinion, because few weeks ago you said, that there was some problem with your former method of thought because of dynamics draw for e.g. needs. So we are all waiting for your ideas - you said you need a bit more of a time to work on those principles before you show them to us. So - is it the time now? :-)pekr
1496d

P
4206

On DLLs etc., I've got a few more months of thoughts to add to that document. Will review it soon.

I'm glad to see there is some interest in this area, because I was thinking no one was needing it.

Also, just a note, it's not necessary to rebuild the host for doing codecs like TIFF. A lot of such addons can be done with plugins. I'll be saying more about those very soon.

Carl
1496d

P
4205

Re #4194: Added a note to Option 4, making it clear that the generalized plugin paragraph was referring to an implementation of Option 1 as a plugin. Ladislav made it clear that the paragraph was being missed.

Option 1 is limited to wrapping C-compatible libraries, and that is way too limited for us. We need to be more interoperable than that.

BrianH
1496d

P
4204

Re #4194: I like it. We definitely need a control when the returning value is a struct! directly or a pointer to struct! But to be able define own native functions from host-lib would be also fine. it depends what we want to do. If I would like to connect SDL with REBOL, it would be better to use it from host-lib, but if I would like to use for examle PDF library, and or load TIF image, I don't want to compile own host because of that.Oldes
1496d

P
4203

Re #4202: Another document that belongs in the Cookbook list. That would solve the problem of lost documents.Henrik
1496d

P
4202

The link: http://www.rebol.net/wiki/DLL_Interface This is not easy to find anymore, due to the ongoing wiki reorg.BrianH
1496d

P
4199

Re #4194: I see you point, moslty you're asking for a non ambigous notation (for people who practices structures in C). But maybe there is a drawback in Rebol. It will cause needless copy of data. Most of the times peoples forget to pass pointers (the fastest way) just because they are not implicit in your new syntax. Only my opinion.Steeve
1496d

P
4194

I added a couple of notes to the DLL_Interface discussion articleladislav
1496d

P
2585

I'm going to change things around in it... based on thinking more about DLLs and plugins (from our prior discussions, with Robert, etc.).

Also, I've got to get the GUI code up first, since that was promised even earlier.

Carl
1563d

P
2576

Re #2569: That would be very nice.Kaj
1564d

P
2571

Re #2570: I guess the host source could be available sooner as Cyphre needs it to improve the AGG support for View.Oldes
1564d

P
2570

Re #2569: Wouldn't it be better to connect to SDL with library interface? (of course once we decide, how to treat external system interfacing ...pekr
1564d

P
2569

Any hint when we can expect the Host sources? I would like to try connect R3 with SDL library.Oldes
1564d

P
1875

Something else: Incompatibility between different platforms of R3 *is* a bug, and it is the kind of bug I have trouble testing since I don't have computers that run those other platforms. So thanks, PeterWood, for your OS X testing :)BrianH
1582d

P
1874

Re #1870: A Wish is not a downgrade, the code in question is *not* native code and the feature PeterWood suggests to be ported from R2 has cross-platform issues that need to be thought out before it is implemented, most likely by me since I am the one who wrote the relevant code in the intrinsic portion of DO. If I thought the feature was a bad idea I would have marked it as "not a bug" and dismissed the ticket.

For those new here, an "intrinsic" is a built-in function written in REBOL that is called by a built-in native code function. DO is one of those native functions in R3 that calls an intrinsic, system/intrinsic/do, which I wrote. All of the script handling code of DO is in the intrinsic (string! url! file!) and all of the rest of the code is in the native portion.

This means that not only can PeterWood's feature be implemented easily, but that is can be implemented by *anyone* at runtime if they want to. It doesn't have to bu built into REBOL, and there is good reason not to - it might break files on non-Unix platforms. It *absolutely should not* be built in *only* on Unix platforms, since that will make REBOL scripts for Unix incompatible with other operating systems, which is against REBOL principles (in R3 at least).

This all means that either this feature can be loaded in a module, or it will be built in for *everyone*, not just Unix users. No compromise.

Of course you can build in whatever you like into hosts you build yourself :)

Apparently it needs repeating: Incompatibility with R2 does not make something a bug in R3 - it needs to be a bug on its own merits. We are making deliberate changes in R3 relative to R2, and some functions in R3 are completely new, including functions named the same as functions in R2 that acted differently. Incompatibility between different platforms of R3 *is* a bug.

BrianH
1582d

P
1872

Re #1869: (continued) Not that bug fixes aren't important, but we are doing triage with those, picking which need to get fixed first. Whole classes of bugs are getting deferred until we get to them (i.e. vector, money, task, module). We will get to them eventually, or sooner if they are mezzanine or intrinsic fixes since those don't have to be done by Carl, Cypher, or Gabriele, who are all busy doing other things right now (docs, DevBase, day jobs, ...).

Just be patient in the meantime, and submit (or do) those feature requests :)

BrianH
1582d

P
1871

Re #1869: (continued) Not that bug fixes aren't important, but we are doing triage with those, picking which need to get fixed first. Whole classes of bugs are getting deferred until we get to them (i.e. vector, money, task, module). We will get to them eventually, or sooner if they are mezzanine or intrinsic fixes since those don't have to be done by Carl, Cypher, or Gabriele, who are all busy doing other things right now (docs, DevBase, day jobs, ...). Just be patient in the meantime, and submit (or do) those feature requests :)BrianH
1582d

P
1870

Re #1869: Brian, while I understand your reasoning, what PeterWood describes is clearly a bug, not a wish. We should not use excuses that Carl is not available right now or that we can't fix native code, to downgrade clear bug to just something like "wish".pekr
1582d

P
1869

Re #1865: A "Wish" is a feature request, and feature requests are currently more important than bug fixes in this alpha, design stage of R3. It is not a downgrade in any way. We want feature requests now, before the semantics of R3 get too settled and people start writing code they will expect to contine to work in the future.BrianH
1582d

P
1868

Re #1865: A wish is not a downgrade.BrianH
1582d

P
1865

I reported a bug where the ~ is not being properly interpreted in a file! datatype. It is clearly a bug,. It works in Rebol 2. It is important to anybody using Rebol in a unix-like environment. Why has it been downgraded to a wish?PeterWood
1582d

P
1863

Re #1859: It was intended that REBOL plugins for other systems (like browsers) would be targets for REBOL host builds, mostly community builds. The plugin model for REBOL is more intended to go the other way. It might work though for apps that have a seperate-process-intercommunication extension model.BrianH
1583d

P
1861

Re #1859: Post your idea to wiki, please. I think those ideas need to be posted in one place. What I would like to see is some kind of "API", to be able to access REBOL datatypes from the C level. I manipulated images in the past in my DLL, but images are easy - just RGBA bytes. It would be cool to have API access to blocks, etc. Would that be even technically possible? If you find it as a good idea, please add it to wiki too :-)pekr
1583d

P
1860

Re #1859: Why don't you add this as a wish in CureCode, Robert?PeterWood
1583d

P
1859

On thing the DLL interface should provide (maybe it's better located somewhere else but I'm not aware of this yet so this idea go here) is a structure that Rebol can be used to write plug-ins.

Plug-ins like for iPhoto, Editors, Filemanagers etc.

Being not able to use Rebol to write plug-ins is really something I'm missing.

Robert
1583d

P
1716

Re #1696: I will do so, but I have some other doc things to take care of over the next couple days.Carl
1593d

P
1696

Re #1695: Carl - it would be probably good to post such info into wiki DLL related doc. Maybe even with description of plug-ins, as you stated some time ago that their definition was from some 80% done? That way we will keep info into one place ....pekr
1594d

P
1695

Carl, yes pleae. Because the first step is to get an understand of the "old" approach. Than I can structure it down into pieces to care about. And finally we take a look how the R3 environment looks like and what needs to be done.

IMO it's not a waste of time because we need to analyze the old approach anway.

Robert
1594d

P
1683

Re #1666: Robert, if you are willing to shoot at a moving target, I can start providing some C code for you to begin...

But, I am also considering changing the primary external interface method to use "direct-rebin" because if I don't then there's no decoupling between internal and external, and we'll create all kinds of version incompatibilities for ourselves.

Carl
1595d

P
1671

Re #1670: I guess you were only referring to this Host-Lib channel. Carl is doing the ports to other platforms now, which is the most important prerequisite for defining the Host-Lib interface.Kaj
1595d

P
1670

Re #1666: There are very different interpretations of quietness around...Kaj
1595d

P
1667

Re #1666: First the core issues should be fixed. For example missing change/part and map! related bugs.Oldes
1595d

P
1666

How to proceed? It's quite here.

IMO getting DLL interface into R3 could really boost the testing. I would immediatly begin to port my app to R3.

Robert
1595d

P
926

R2 feedback / notes / proposal: Can all please help to collect every piece of information about the DLL interface in R2? I will do so too but the more help the better.

Goal is to get the most complete overview about current R2 situation.

Robert
1604d

P
802

Gregg, the goal is to create a DLL interface that is simple to use by non-c-experts, can play with all kind of available DLLs. I think integrating something like your DLL dialect makes absolutly sense. This would be the Rebol part of my hybrid model.

So, we have to make two sides simple and clean: 1. The Rebol side 2. The C level side

For 2nd we need a way that existing DLLs don't need to be changed etc. I just want to use them as one can find precompiled libs etc.

Take the DLL, read a bit of the API, plug the DLL into the host-lib environment, create a Rebol side DLL interface, use it.

Robert
1605d

P
761

Who is the target audience, and what are the goals/constraints? The R2 system isn't awful, but it could be nicer (my wrapper dialect is here: http://www.rebol.org/view-script.r?script=lib-dialect.r). The biggest pain is mapping structures--especially those with char arrays--COM stuff, and callbacks.

Is the DLL interface meant to cover the system port functionality as well, or will we still have a system port?

Are there five or six prime libraries we can identify, that we can use as guinea pigs, to see how they are best integrated into REBOL (e.g. PCRE, ImageMagick)? I've done middleman DLLs as well, which is fine for more advanced users, but not for your average REBOLer. Today, you don't need to know C, have a compiler, etc. and you can use DLLs, even if you have to suffer a bit.

Gregg
1606d

P
752

Does this makes sense?Robert
1606d

P
751

Option 3 clarification: I see Option 1 like the R2 interface today. You create a DLL, export some functions, write the C level interface spec in Rebol.

Option 2 is bringing your DLL into host-lib context (statically linked or dynamically loaded), maybe you add some helper functions to the DLL to call Rebol code etc.

Option 3: Is a mix of both. You control the DLL integration from Rebol (for people like Petr) and include the DLL into the host-lib context. Option 2 is a C-level only approach, Rebol gets what's defined in the host-lib. Option 3 makes it possible to tweak this a bit from Rebol side.

Robert
1606d

P
744

Tweaked the Plug-In option on the wiki page. That is the option I am leaning towards now, as it can be used to implement the other options if need be.BrianH
1607d

P
735

I've done some editing on top part of pros and cons. I am not sure about option 3... seems the same as option 2?Carl
1608d

P
734

Please help and add all R2 DLL Informations to the R2 section.Robert
1608d

P
733

Ok, created Wiki page: DLL_Interface First rough sketch and added all posted information so far.Robert
1608d

P
726

As long as we copy the results of the conversation here for posterity :)BrianH
1608d

P
724

While rebdev is fine for testing purposes, unless there is GUI version, I think that for some strategic topic which needs some comfort to chat, we could move back to AltME, no? :-)pekr
1608d

P
723

plug-in or device, I think it does not matter, as far as the interface is robust, crash prone to some extent (not bringing REBOL to knees), and the wrapper model contains more facilities to use (e.g. arrays and more). I don't agree letting it being just part of host code, if that is what some prior reply suggested. We imo need some interface/rules/framework for that. It should be also OK with modules, to have such wrapper functions isolated, and if possible thread safe ...pekr
1608d

P
706

Of course, the issue that will surely become our greatest challenge will be threads. We will have a lot of control over that.Carl
1608d

P
705

In addition, I did some work on a plugin model, but have not pursued it for more than a year now. In that method, a script calls a function that returns to the host code and loads the DLL. The DLL has standard entry points that allow REBOL to query it and manage it.

Of course, that method will not work for system DLLs unless they are wrapped with a plugin dll that provides the standard entry points.

Carl
1608d

P
704

Regarding option 2: there's already a strong model in R3 for decoupling: Devices.

Devices use a standard method API entry and event-driven results.

We will need to determine if this same mechanism will be what we need for DLLs.

Carl
1608d

P
702

Fast way: type DOCS at the prompt.Carl
1608d

P
701

I see it this way (don't know if this is right): 1. We have DLL functions called from Rebol following a call/result pattern. 2. We have async DLL functions starting new threads or so in the DLL and somehow later return with a result (message, event, ...)

Option 1 shouldn't be that hard to do nor have a influence on the Rebol internal timing. Option 2 needs to be strongly decoupled from the rest of R3 and just do its job.

Robert
1608d

P
700

Wiki: Ok, trying to get my hands on it.Robert
1608d

P
697

On DLL methods: difficult to answer, and we will need to work out such details. There are many issues, and it can get very complicated unless we keep our heads on straight (not sure German idiom for that).

For example, in R3, there is a constant stream of data moving through the event system and the WAIT function. This includes high precision delta timers for keeping the timing accurate. If a DLL causes problems in that flow, then that will buble up into REBOL code. We must avoid it.

Anyway, we can get this outlined on the wiki page.

Carl
1608d

P
696

On wiki: ok to start a new DLL Interface page.Carl
1608d

P
690

Wiki: Ok, is there already a DLL page or should we include this into the host-lib page?Robert
1608d

P
689

I think a hybrid model might be a good idea: 1. A dialect to describe which DLLs and functions should be loaded by the host-lib. Maybe in which context/namespace/module to import them etc.

2. A DLL loader that brings the specified functions to the Rebol world. I expect that we are more flexible to deal with DLLs on the C level.

3. A generic way how to do callbacks (or do you have a better idea)? The only one I have is to make a callback-catcher that translates this to something like a localhost interface. But maybe the new architecture of R3 allows to call Rebol code from C level.

Robert
1608d

P
687

Robert, I welcome your help on DLL, thanks. A few comments...

1. I think the wiki page is a good idea for keeping track of it. 2. The DLL interface in R2 was pretty complicated. Not really that much code, but not easy code. Jeff Kreis wrote and debugged it. (See, I did not write everything!) 3. And here is really the most basic question: do we want to do it like R2 as a dialect, or is it better/easier/faster to do it in the host part of R3.

The reason I mention this is because the host is the wrapper around REBOL, so in theory, anything is possible. REBOL itself just runs like a DLL within it.

So, that's really the starting point on all this. I think perhaps it gives major advantages. For example, for video in a window, all of the window handles, funcs, and interfaces are accessible at the host level.

Carl
1608d

P
680

Collecting all ideas, statements etc. about the DLL interface into one Wiki page is a good idea. So that we get an structured overview. Than we can decide which parts still make sense or not.Robert
1608d

P
679

I agree with Robert - there is many nice libraries around to miss on their possible integration. R2 DLL interface lefts much to be desired for. There was some talk about how to possibly improve DLL interface in terms of rebol3 world, dll.so group, some year or more ago.

There is many guys interested in Core functionality more than in GUI. What about setting up wiki page, like we did with Parse? That way our ideas get recorded, and someone (e.g. Robert :-) would moderate it.

Carl would have to say, what is his plan here, as IIRC he said that DLL interface might be best added via plugins. But plugins are not ready yet.

pekr
1608d

P
678

Things I would like to see improved: - Much better callback support, including callback from multi-threaded DLLs - Better dialect to specify the DLL interface with structs, pointers, arrays I thin with these two improvements the DLL interface would be really cool.Robert
1608d

P
677

I can spend some time helping to get it up & running. These days I use a lot of DLL functions to augment my Rebol scripts.Robert
1608d

P
676

Carl said he has some questions regarding the DLL interface. So here I am :-)Robert
1608d
19-Jun-2013/9:35:57 REBOL.com .net