Discussion of a general library in native code prompts me to note I've
been working over the past few days on a V8-based web server
programming environment I call 'rainforest'.
https://launchpad.net/rainforest
It's still early days yet, but it happens I've just this moment
arrived at a design for an interface to external code (including
native code of course) with which I am reasonably pleased.
It turns out dlopen is not at all scary unless you want it to be
portable. :-)
On startup, the server enumerates a particular sub-directory
structure, using the names to build an object hierarchy whose leaf
nodes are defined by external code. The native code lives in a garden
variety shared library which happens to link to V8 and returns Local
<Value> which gets attached to the global object.
None of this is terribly relevant to a discussion of a standard
library except that [a] I suspect that such a thing would be very
useful to/for rainforest and [b] somebody might like to peek at my
code as a sample of how part of something similar might be done for a
command line sort of tool.
When requests come into the server, it forks (which I am given to
understand is trés cheap under Linux), which has the effect of copying
the global object and everything in it, and the specified script can
make whatever mess it likes because the fork just gets thrown away
when the request completes.
Now I've clearly blathered on way beyond the original charter of this
message, so I'll stop.
--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---