What options are you considering for how to do it? I for one would be willing to trade a little performance for modularity if it means I can save a lot of load time by not loading unneeded code.
On Sunday, March 2, 2014 4:23:09 PM UTC-8, Alon Zakai wrote: > > We don't support dynamic linking in fastcomp. As mentioned on the wiki, we > need to reconsider how we do it. Until then, the old compiler is an option > for use cases absolutely requiring linking. However even there the feature > does not fully work, and does not result in code as fast as everything > linked together statically. > > Regarding EXPORTED_FUNCTIONS, the EMSCRIPTEN_KEEPALIVE macro will also > export it for you. I see this is missing in the docs, adding that now. See > test_llvm_used for an example. > > - Alon > > > > On Sun, Mar 2, 2014 at 4:02 PM, Joel Croteau <[email protected]<javascript:> > > wrote: > >> What is the state of dynamic linking with fastcomp? Is it still not yet >> implemented? I have some code which potentially calls one of many JS >> modules, and I'd like to be able to only load those which it actually >> needs. Another issue I have is having to specify EXPORTED_FUNCTIONS on the >> command line for all functions I want to be available to side modules. This >> is very difficult to do with C++ functions, and very impractical for a >> large library with thousands of potential functions to be called. A better >> approach would be if this could be specified from within the code. Ideally, >> I would like to have a modifier in a class declaration that tells the >> compiler that all of that class's public methods and members should be >> accessible to external code. It seems like this is possible to do with >> embind, but requires a good deal of manual setup. Is there a way to have >> embind automatically export the members of a class in some human readable >> format, and have dynamically loaded modules use those function members? It >> seems like if functions in C++ correspond to functions in JS, class >> instances in C++ correspond to class instances in JS, and the names of >> those JS functions are predictable from their C++ names/arguments/etc., >> then it should not be difficult to intermingle code from different files >> just as you would with dynamic libraries in C/C++, just having the compiled >> code call functions defined in different JS modules. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "emscripten-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
