Open MartinNowak opened 10 years ago
This should also work for the online REPL.
I made something related to this https://github.com/ShigekiKarita/grain/blob/master/example/repl.d
I'd think of dub integration as some form of :dub mir
command that will fetch and compile mir as shared library that will be linked against in D module for that command.
Afterwards modules from that package can be imported.
So it'd would be an interactive addition of dub modules.
You're appproach looks interesting, but it has a flaw. It statically links packages into every subsequent D module, i.e. you'll end up with dozens of copies of the package. That will break the One Definition Rule. You really need to compile packages as shared libraries to avoid this. Atm. dub's support to compile packages as shared libs is still not fully there, e.g. dependencies need to be shared libs as well to avoid ODR issues.
ODR
Thanks for pointing out. I have not thought about it. Maybe also compiling separate static library like tmp/_dubdeps.a
only with DUB packages and tmp/_mods%s.so
without DUB packages can avoid ODR?
Allow to fetch and use dub packages.