I was wondering if it would be possible to add a switch to flatc's Nim code generation to allow developers to choose which package name the generated code should import. Currently, flatc --nim hardcodes an import flatbuffers into generated files, referencing this project's Nim implementation, but this raises a number of issues:
this repository's flatbuffers.nimble is not referenced by nimble's public package list, and I'm not sure that it can be added without moving it to its own repository
searching for this repo's version of the package cannot be done through nimble search like other packages
installing it requires cloning the repository and installing it locally, rather than a simple nimble install <packagename> like other packages
it creates issues if managing it in .nimble package files using requires "flatbuffers"
there is already another package which uses the name flatbuffers, and it creates a naming conflict
I was working on a forked implementation of this project's Nim package to address the first four points, but found myself facing the issue of conflicting package names. Following a quick discussion with the author of the existing flatBuffers package, we agreed that it would be worth adding an option to make the package name adjustable in the flatc --nim generated code, rather than the hardcoded import flatbuffers that exists currently.
Perhaps something along the lines of flatc --nim --nim-package-name=flatbuffers-runtime, which would instead generate import flatbuffers-runtime in the generated files?
Hi all :)
I was wondering if it would be possible to add a switch to
flatc
's Nim code generation to allow developers to choose which package name the generated code should import. Currently,flatc --nim
hardcodes animport flatbuffers
into generated files, referencing this project's Nim implementation, but this raises a number of issues:flatbuffers.nimble
is not referenced by nimble's public package list, and I'm not sure that it can be added without moving it to its own repositorynimble search
like other packagesnimble install <packagename>
like other packages.nimble
package files usingrequires "flatbuffers"
flatbuffers
, and it creates a naming conflictI was working on a forked implementation of this project's Nim package to address the first four points, but found myself facing the issue of conflicting package names. Following a quick discussion with the author of the existing
flatBuffers
package, we agreed that it would be worth adding an option to make the package name adjustable in theflatc --nim
generated code, rather than the hardcodedimport flatbuffers
that exists currently.Perhaps something along the lines of
flatc --nim --nim-package-name=flatbuffers-runtime
, which would instead generateimport flatbuffers-runtime
in the generated files?