Make the compiler less tightly coupled to the CLI
MatthewKosloski opened this issue · comments
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).
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.
Maybe even try to implement our own command-line parser (similar to how they do it in TypeScript) instead of relying on jcommander
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.
Closing this as issue #15 takes care of this and more