#dang modules
1 messages ยท Page 1 of 1 (latest)
there's no way for dang code to load other dang code at the moment, no - i've been using Dagger as that layer
which is a bit like bringing a bazooka to a gun fight, but i wonder if it'd work in this case too?
hm
it could
but there would be a lot of modules
cross dependencies between modules
since a dagger module with dang is just a json file and a dang file, it might not be a big maintenance burden
yeah - plus the flexibility of being able to use another language on the other side is kinda nice (in the general case, not what you want here)
btw, you can split .dang files up - if you get to that point. it works like Go
Yeah, I figured that out.
i'd definitely entertain a proposal or feature request if the dagger approach proves too painful
i just haven't run into it yet
I'll give it a try and we will see how it works. One minor annoyance I already see is having to manage dependencies in a separate json file. It would be much easier if I could just import a package and use the code from there.
definitely fair
maybe the import PR could be expanded to also support import Foo which loads ./Foo/*.dang if present
In may case ot would be more like import ../../../../foo/bar/baz ๐
haha was about to ask
i figured that might be the case when you said you want to reuse common code across a bunch of different sub-directories. hmm
yeah try the dagger thing first ๐
i'm mainly trying to avoid re-litigating much of the same dependency management challenges
it might be better to treat this independently from the language.
for example: in template languages "import" usually means from a virtual filesystem or some other interface, not necessarily the filesystem
so the language could support some sort of import mechanism. but the implementation could be up to wherever you run the code. In case of dagger, it's dagger collecting files or whatever
just an idea
right right
I ended up wrapping dagger in just...which is meh
I needed a way to dynamically call dagger workflows based on the directory name (see the use case above).
Not sure if there is a better way, but this will do for now.