>    On Tue, Jan 18, 2011 at 4:40 PM, Jak Sprats <[1][email protected]>
>    wrote:
> 
>      does vu8 fulfill all the requirements I wrote in my last reply to
>      Stephan?
>      Can you (briefly) compare and contrast vu8's strengths and
>      weaknesses
>      compared to v8-juice (e.g. lightweight is GOOD for my use-case).

vu8 is header only with nothing to link against, and should be
equivalent to hand-writing the code yourself as it uses template
meta-programming heavily to optimise (the same as v8-juice). The code
size of vu8 is much smaller than v8-juice in spite of it performing
the same tasks as it re-uses components from boost. Particularly boost
fusion, boost mpl and boost preprocessor were very helpful. v8-juice
replicates many features from boost.mpl and boost.fusion, which removes
the dependency on boost but increases the size of the source code.

Additionally vu8 will take advantage of C++0x variadic template
arguments, r-value references and perfect forwarding. These improve
compile times amongst other things.

>    i have no experience with vu8. i only found out about it via the above
>    post. From a brief glance, it seems provide more or less the same
>    features as v8-juice, but vu8 uses of function-pointer-style template
>    args to make the API more readable (if i had only known how to do that
>    two years ago...).

I could commit the code to v8-juice to show you if you want. Function
pointer templates can be passed easily using any type-based template
parameters, but converting this function pointer into a template
argument that accepts a member-function pointer requires either C++0x or
some pre-processor programming. The only tricky bit really is:

template <class T, [dependant on T] Q>

[dependant on T] can be worked out using a meta-program on T to
determine the type of template parameter Q is (i.e. what kind of
member function pointer it is). The trouble is without C++0x variadic
template parameters you need one copy of the meta-function to
determine [dependant] for each N where N is the number of arguments
in the member function prototype. You'd need to use preprocessor
programming to do this without C++0x variadic template arguments, and 
with them the problem is trivial.

If you look at detail/Proto.hpp and Class.hpp in vu8 you'll probably
get it right away.

-- 
+44 (0) 7974 159 643 | [email protected] | http://chilon.net

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to