-
Notifications
You must be signed in to change notification settings - Fork 115
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
[Tracking issue] Improve Tact CLI #136
Comments
Got one idea just now: a sub-command It may:
{
"$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/grammar/configSchema.json",
"projects": []
}
The ability to generate the config based on existing UPD: I'm also thinking about making a standalone repo + npm package for CLI. Additionally, the current version ( Blueprint, for one, uses API of the compiler directly, rather than the CLI, see: https://github.com/ton-org/blueprint/blob/41d57ed9a7f3a39069efb7f31c0eb0fb4f32174b/src/compile/compile.ts#L12 |
Another sub-command options:
All of the above should have one or the other (may have both):
Having all those sub-commands will make general Tact CLI installation nearly self-sufficient, so that people could do But before we do that, there should be a clear separation (IMHO) between the Tact compiler's CLI and the general Tact CLI (separate repo?), where the former would have |
Although it's just a rough idea, I think that compiler's CLI and/or API can be extended to allow switching between compiler versions or controlling available compiler versions per project. This would simplify working with multiple compiler versions #250. However, this is not a pressing issue until breaking changes are introduced, such as per planned Tact 2.0 #249 |
These are some really nice suggestions: #136 (comment). Moving |
Perhaps, it would be reasonable to keep the compiler's CLI and simply rename Although I'm in full support on having a somewhat stable API of the compiler. It would be especially nice to have the AST or CST exposed right after the parsing phase, so that it can be re-used in tools |
We should definitely expose AST, preferably a typed one, unless someone has a use case for an untyped AST. Unfortunately, we don't have typed AST right now. |
Having |
That might be useful, indeed. However, let's have a use-case first, before adding those |
For instance, add the following command line options:
--version
/-v
: output Tact's version (done in feat[cli]: --version flag #137)tact --version
output #504--help
/-h
: output CLI help (done in Improved CLI #287)--check
: stop the compilation pipeline right after typechecking Tact code (done in Improved CLI #287)--func
: stop the compilation pipeline right after generating FunC code (done in Improved CLI #287)tact.config.json
file (done in Improved CLI #287)--expr
/-e
: evaluate a Tact expression:tact -e '-1 / (2 << 1 + 1)'
(done in feat(cli): constant expression evaluation #462)--check-expr
: typecheck a Tact expression #656--ast-parsed
: output parsed AST (perhaps using JSON format here is preferable, related issue: Export typed AST in JSON/S-expressions format to use in third-party tools #572)--ast-typed
: output typechecked AST when we have itbin/tact
intobin/tactc
or introduce a name binding inpackage.json
to allow re-writing it as an ESM modulefile.tact
, output directory should be same asfile.tact
's #457Your suggestions are welcome!
Some docs, talks and guidelines on how to design CLI interfaces:
The text was updated successfully, but these errors were encountered: