#dang modules

1 messages ยท Page 1 of 1 (latest)

orchid venture
#

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?

silver goblet
#

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

orchid venture
#

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

silver goblet
#

Yeah, I figured that out.

orchid venture
#

i'd definitely entertain a proposal or feature request if the dagger approach proves too painful

#

i just haven't run into it yet

silver goblet
#

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.

orchid venture
#

definitely fair

#

maybe the import PR could be expanded to also support import Foo which loads ./Foo/*.dang if present

silver goblet
#

In may case ot would be more like import ../../../../foo/bar/baz ๐Ÿ˜„

orchid venture
#

haha was about to ask

silver goblet
#

don't ask why ๐Ÿ˜„

#

๐Ÿ˜„

orchid venture
#

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

silver goblet
#

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

orchid venture
#

right right

silver goblet
#

anyway, I'll give the dagger path a try and let you know

silver goblet
#

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.