Skip to content

Conversation

@RyanGlScott
Copy link
Collaborator

The non-public Copilot.Compiler.Bluespec.External module lives under a
shared/ directory so that it be imported by both the library code and the
test suite code. This is a questionable design, as if the test suite needs to
use the code, then it should be exposed by the library.

This commit moves Copilot.Compiler.Bluespec.External from shared/ to
src/, exposes the module as part of the public API, and removes the shared/
directory. As a result, the test suite can now import
Copilot.Compiler.Bluespec.External like it does other parts of the
copilot-bluespec API.

Fixes #36.

The non-public `Copilot.Compiler.Bluespec.External` module lives under a
`shared/` directory so that it be imported by both the library code and the
test suite code. This is a questionable design, as if the test suite needs to
use the code, then it should be exposed by the library.

The comments in `Copilot.Compiler.Bluespec.External` mistakenly reference the
C99 backend instead of the Bluespec backend, which will make it confusing for
users when this module is exposed as part of the public interface. This commit
fixes the comments to reference the Bluespec backend instead.
The non-public `Copilot.Compiler.Bluespec.External` module lives under a
`shared/` directory so that it be imported by both the library code and the
test suite code. This is a questionable design, as if the test suite needs to
use the code, then it should be exposed by the library.

This commit moves `Copilot.Compiler.Bluespec.External` from `shared/` to
`src/`, exposes the module as part of the public API, and removes the `shared/`
directory. As a result, the test suite can now import
`Copilot.Compiler.Bluespec.External` like it does other parts of the
`copilot-bluespec` API.
@RyanGlScott RyanGlScott force-pushed the T36-remove-shared-directory branch from 21a9435 to 091a7db Compare March 20, 2025 12:52
@ivanperez-keera
Copy link
Member

If it wasn't for the tests, would this new module be exposed by the library?

@RyanGlScott
Copy link
Collaborator Author

No, it wouldn't be. (This is the same reason why it's not exposed in copilot-c99.)

@ivanperez-keera
Copy link
Member

The please just duplicate the code for now. As much as it sucks and I hate the code duplication, at least it leaves a cleaner design for the library itself (nothing is exposed that shouldn't).

I agree that longer term there may be a better place for this that can be shared between copilot-c99, copilot-bluespec, tests, etc.

@RyanGlScott
Copy link
Collaborator Author

Sounds good to me. I'll open a separate PR for this.

@RyanGlScott RyanGlScott deleted the T36-remove-shared-directory branch March 20, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Remove shared/ directory

3 participants