Cello icon indicating copy to clipboard operation
Cello copied to clipboard

Modules

Open xcthulhu opened this issue 11 years ago • 2 comments

It would be great if libcello wrapped libtool's dynamic module system: http://www.sourceware.org/autobook/autobook/autobook_162.html http://www.sourceware.org/autobook/autobook/autobook_163.html

Then you could get namespacing for cheap:

with (https in module('https.la')) {
    var options = new(Table, String, String);
        put(options, $(String, "key"),  $(String, "key.pem")); 
        put(options, $(String, "cert"), $(String, "cert.pem"));

    lambda(run_server, args) {
        var response_writeHead = cast(at(args, 0), Function);
        var response_write = cast(at(args, 1), Function);
        call(response_writeHead,
            $(Int,200),
            $(String,"{\"Content-Type\": \"text/plain\"}"));
        call(response_write,
            $(String,"Hello world!")); }
            /* etc */
    }

    call(https, "createServer", options, run_server);
}

xcthulhu avatar Aug 01 '13 11:08 xcthulhu

Ah this is a very cool idea. I will definitely take a look into it when I get some time. I've written a dynamic module loader type thing before so should be good fun.

orangeduck avatar Aug 01 '13 12:08 orangeduck

Started work on this in 02a55d2c1e1df86553f4d75b34805dde00930f2a

orangeduck avatar Sep 11 '13 16:09 orangeduck