#codegen q

1 messages · Page 1 of 1 (latest)

stone mica
#

For a given environment there is codegen for its own functions, and for its dependencies’ functions. Does it always get mashed together? What if I want codegen only for eg. an external caller, can I get codegen for only the exposed functions without exposing the dependencies?

jade grotto
#

Both of those can be changed if desired. Codegen for transitive dependencies would be simple (I just question if that would be the expectation or not). Bindings for yourself is possible but extremely thorny to get right in terms of not creating catch-22 situations that become incredible frustrating in terms of DX (we did that back in cloak days and immediately ran into those frustrations 🙂 )

#

What if I want codegen only for eg. an external caller, can I get codegen for only the exposed functions without exposing the dependencies?
Let me know if that answers this question, I'm not 100% sure I am following the question

stone mica
#

yeah I think it does 🙂 I’m thinking of a dagger script command that would invoke a python/node/go repl ready to go with the target environment/module’s codegen loaded

#

I think under the hood it would be an ephemeral env with the target as only dependency?

jade grotto
#

Yeah that sounds right, slight impediment is that we currently do codegen in the CLI, for that we'd want to do codegen server-side.

We actually originally did codegen server-side in cloak but undid it. We can just redo it now 🙂

#

It would avoid the catch-22 situations since it doesn't involve writing the env code; if you env doesn't compile then you just can't open a shell to it

#

go repl
Not sure that exists, but we can create the equivalent of it

#

Also I wouldn't forget the other ideas buried in some discord thread somewhere around making every entrypoint of the env invokable from a shell. So if there's a function named Foo in my env and I run dagger shell on the env, I get dropped into a shell where I can literally run foo (with flags if needed)

#

Not contradictory with a language specific repl at all, just complementory. Particularly for languages that don't have a repl like go

stone mica
jade grotto
stone mica
stone mica
jade grotto
jade grotto
stone mica
#

really our own api playground (with native language support courtesy of @deep mulch and @pseudo totem ) is a web version of the same thing