REBOL 3.0

Comments on: Delayed init of built-in modules

Carl Sassenrath, CTO
REBOL Technologies
23-Oct-2009 20:08 GMT

Article #0280
Main page || Index || Prior Article [0279] || Next Article [0281] || 7 Comments || Send feedback

As I start to use R3 more for real apps, specific needs pop up. For example, for writing R3 CGI, I'd really like CGI built-in, but unlike R2, I don't want them to init if I don't need it.

That is I want delayed loading of certain boot modules. This goes for various other useful functions.

The mechanism would work the same was as it does with import. I'd write:

import 'cgi

and it would check first if it's built-in and load/init if so.

This way REBOL can have all the general features it needs, but not require boot time or memory when those modules are not needed. Because such modules are compressed, they don't take much memory when not used... and it let's us put quite a lot of what we need into the standard distribution: protocols, DB interfaces, toolboxes, etc.

Your thoughts?

7 Comments

Comments:

Maxim Olivier-Adlhoch
23-Oct-2009 16:45:12
this is exactly how slim modules work when libs are linked (less the compression) and its been working well for me for several years already (even before first devcon!).

there was a related discussion on R3 chat about command-line shortcuts (like the 'Q word for 'QUIT) which raised an interesting issue... should they be imported by default? we where split roughly 50/50 on the question.

adding above import statements to our rebol.r would allow us to integrate what default modules we want in our console without RT forcing them upon us.

maybe some modules could be part of rebol.r by default, but then we could remove them if we want.

Icarii
23-Oct-2009 19:19:44
this would also allow us to set up import scenarios where we could have meta packages - the ability to call all packages in a group (example protocols / gui / shortcuts) or specific packages like load 'ftp
Steeve
23-Oct-2009 19:29:51
Very good idea. It means, more built-in modules while keeping a decent boot time. Who can be against that ? Nobody i guess.

The further gui could be one of them. So that, we wouldn't need of 2 standard versions of Rebol (core and view)

-pekr-
24-Oct-2009 9:22:36
Definitely supported on my side. We could use words like 'invoke, 'init, but for the simplicity reasons, 'import is probably very right word to use.

I too want R3 for CGI, and was thinking about the speed of booting compared to R2 Core and especially Base. Help system is another candidate to not boot, unless 'help function is called for the first time. It needs to stay transparent = no need for user to import help - it would get imported by calling 'help.

Compression is interesting. I also wonder, what happened to Rebin concept, which woul allow binary "packaging". I think it is time to think about packaging concepts a bit too. We surely dont want components to be delivered in many files, but one ...

Max: don't remove 'q by default, or I am not going to buy you a beer at next Devcon :-)

Brian Hawley
26-Oct-2009 1:09:14
I love this idea. It would give us some of the advantages of host building and library modules, while integrating with both of those if need be. It wouldn't be difficult to make IMPORT look for unloaded modules in an internal list before checking the filesystem. There would be no change to the binding and export process needed, and even mixins could work.

Pekr, HELP is not that large a function. Most of the help system is the doc strings that are loaded with their respective functions. Demand loading HELP won't help much.

What about Rebin? Compressed source has too much overhead, and series shared references are lost. We could speed things up quite a bit by using Rebin, afaict.

DideC
27-Oct-2009 4:36:03
I like it too.

It seems very Rebolish: just 'do what is needed when it's needed... and it's simple (KIS!)

Ben
28-Oct-2009 13:23:25
...we wouldn't need of 2 standard versions of Rebol (core and view)...

I agree. To many packages can be confusing. Very good idea. Can slim way down...load only what is needed.

Post a Comment:

You can post a comment here. Keep it on-topic.

Name:

Blog id:

R3-0280


Comment:


 Note: HTML tags allowed for: b i u li ol ul font span div a p br pre tt blockquote
 
 

This is a technical blog related to the above topic. We reserve the right to remove comments that are off-topic, irrelevant links, advertisements, spams, personal attacks, politics, religion, etc.

REBOL 3.0
Updated 26-Apr-2024 - Edit - Copyright REBOL Technologies - REBOL.net