The nice thing about macros is that there’s no particular reason they need to live in Julia itself–you can always just make your own package to define the macro and then anyone who wants it can use it.
That said, I’m not sure what you’re asking for is possible. Even in the example you gave, how would the macro know that a and b are fields of conf, but exp is not? The macro just sees them all as symbols. You’d have to also pass the set of symbols to be extracted, something like: @instruct(conf, (a, b, c), a * exp(-b^2/c))
The macro sees only the :conf symbol. It doesn’t know it is referencing a Configuration{T} type. fieldnames would be called on a symbol not on the instance of a Configuration type.
An @generated function would have access to the type, so you could conceivably operate on its fieldnames(), yes. But which function should be generated? You’d have to make every function that wants to use this feature an @generated one.
Someone may have mentioned this, but it may be worth checking out Parameters.jl. It doesn’t do exactly what you want, but it does similar things that save quite a bit of coding time.