I thought it would be interesting to extend the work done by PLV8, by 
including not just V8 but also Node's deps and source so that I could have 
access to all of Node's features inside Postgres through it's PL extension 
framework.  Doing so required using Node as a shared library, so for anyone 
who is curious about how this can be done you can check out the fork:

https://github.com/hoonto/plnode

There have been some previous messages concerning embedding Node into other 
applications as a library and as a result of that project I have some 
questions, being new to hacking at node's core.  I had to make a couple 
modifications to src/node.cc, splitting the:
    Start(...) 

method into two functions which I called:
    buildContext(...) 
    runContext(...)

so that I could request Node create a V8 context and share it with the 
application wrapping Node (in this case, plnode) as well as request Node to 
invoke libuv after incrementing the reference count through standard Node 
libraries like http.

I'm hoping some folks with a much deeper understanding of the core and the 
potential implications of these modifications will help guide me in a 
direction that makes sense, I can't imagine my first stab at embedding Node 
was done in the best way, probably lots of room for improvement.  

It also brought up a thought though, that it may be important to provide 
easy embedding instructions, as in "the right way" as prescribed by those 
with deeper understanding than myself for others so as to aid in Node 
proliferation.  Like many other platforms, embedding tends to become a more 
frequent topic as platform maturity increases.  

So what do you all think?  How badly did I screw it up, what can I do to 
make it better, and do you feel as I do, that it is important to provide 
easy access to Node embedding - a Node Embedders Guide, so to speak?  That 
little plnode project provides my first attempt at giving a useful guide 
for doing such things, but as mentioned I had to modify node.cc so before 
solidifying anything else I wanted to reach out to the community and get 
your collective thoughts, experience, expertise on the topic!

Other questions also - implications of turning on C++ exceptions - I've 
referenced a few threads on the topic, but would love it if someone would 
educate me as to whether or not this is a good idea or something that will 
blow up on me down the road.  

Thanks!
Matt

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to