#Howdy! I'm trying to create a zenith

1 messages ยท Page 1 of 1 (latest)

supple sparrow
#

cc @hazy mountain

#

@broken rampart thanks for those examples. It's a great way to advance the discussion! ๐Ÿ™

supple sparrow
#

Are you leaning a certain way given your use cases?

broken rampart
#

I'm not sure. I have under a dozen optional flags (!) . The "With" style feels pretty verbose when running dagger call; however, the Optional[] style feels pretty verbose as an imported module.

#

The "With" style feels good as an imported module and the Optional[] style feels good as dagger call cli arguments.

#

Is dagger call to be the common way to use modules?

supple sparrow
#

That might be a useful distinction @broken rampart. If you plan for your module to mostly be a "component" or "utility" module that is dagger mod installed by other modules, then perhaps the With style is best. For a top-level or "main" module that is likely to be invoked by the CLI with dagger call, then perhaps you could use the Optional[] style. We're still figuring out the best DX for various situations, but what do you think of that idea?

cc @upbeat cypress

broken rampart
#

@supple sparrow right on. Yeah, that feels right. Iโ€™m playing around with supporting both at the moment; I was thinking Iโ€™d write examples in the readme for each style.

hazy mountain
#

Hey @broken rampart! Good to see you here ๐Ÿ˜„

Yeah this DX wart has become more and more apparent, ends up touching on quite a bit.

I just opened this issue to discuss more: https://github.com/dagger/dagger/issues/6115

Apologies all for the vague thoughts at parts; it ties into so many other things we're working on + thinking about that it's difficult to quickly put together 100% coherent thoughts ๐Ÿ˜…

Hopefully it's enough to at least seed more discussion amongst everyone

GitHub

The pattern of writing modules that use With* functions to enable updates of object state in a builder-pattern/"fluent" style works pretty well for codegen clients, but looks clunky in th...

upbeat cypress
#

@hazy mountain should we bring back the topic of language-native one-liners? The CLI invocation wasnโ€™t meant to be the final form for end users, or at least not the only form

hazy mountain
#

Right good point! I had forgotten about that, also a viable route

#

added a comment about that too, glad you remembered, such a great feature to have in general and surprisingly easy to implement given how complicated it sounds at first glance ๐Ÿ˜„

supple sparrow
#

Was discussing with @tame glacier yesterday evening too. Hot topic.

#

An idea came up of taking WithFoo(foo string)
which would look like with-foo --foo in the CLI
and making that callable as just --foo or something, IIRC