Feature request: specifying the target language parent namespace when compiling #4322
Labels
kind: enhancement
Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny
part: code-generation
Support for transpiling Dafny to another language. If relevant, add a `lang:` tag
Milestone
Projects that want to embed compiled Dafny code inside libraries will frequently want to isolate the compiled code under a specific namespace. For example:
The challenge with using
:extern
for this is that it's not realistic to expect a single symbol to make sense for all target languages. Several suggestions have been made to allow specifying extern names per language somehow:For the specific case of just relocating the compiled code, however, it would be a lot simpler to just provide a prefix namespace when building the code on a per-language basis. This would be adequate for
smithy-dafny
, since the user-facing target language symbols are generated from Smithy models instead anyway, so there is actually no need for precise control over extern attributes.As a strawperson proposal, this could just be an option like
--compile-prefix "software.amazon.cryptography.materialproviders.internaldafny"
, although it may be poor UX to have a single term across all languages, even if the build or configuration of a project can provide different values for each target language.The text was updated successfully, but these errors were encountered: