Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the compiler less tightly coupled to the CLI #3

Closed
MatthewKosloski opened this issue Jul 9, 2021 · 4 comments
Closed

Make the compiler less tightly coupled to the CLI #3

MatthewKosloski opened this issue Jul 9, 2021 · 4 comments
Labels
refactor Change implementation without affecting behavior

Comments

@MatthewKosloski
Copy link
Owner

The CLI should simply be a wrapper around the compiler. That is, the compiler code should be loosely coupled from the command-line arguments. For instance, instead of keeping a reference to a TorreyConfig object, the TorreyCompiler constructor should have arguments (see here).

@MatthewKosloski MatthewKosloski added the refactor Change implementation without affecting behavior label Jul 9, 2021
@MatthewKosloski
Copy link
Owner Author

At torrey/src/main/java/me/mtk/torrey/, make a new package compiler to hold packages frontend and backend. Then, create a sibling interface package to contain all the command-line interface code.

@MatthewKosloski
Copy link
Owner Author

Maybe even try to implement our own command-line parser (similar to how they do it in TypeScript) instead of relying on jcommander

@MatthewKosloski
Copy link
Owner Author

MatthewKosloski commented Sep 15, 2021

By less tightly coupled, I mean the core compiler should expose an API to the CLI, which would be the interface between the user of the compiler and the compiler itself.

@MatthewKosloski
Copy link
Owner Author

Closing this as issue #15 takes care of this and more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Change implementation without affecting behavior
Projects
None yet
Development

No branches or pull requests

1 participant