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

Add compile subcommand #1278

Closed
shonfeder opened this issue Nov 30, 2023 · 5 comments
Closed

Add compile subcommand #1278

shonfeder opened this issue Nov 30, 2023 · 5 comments
Assignees

Comments

@shonfeder
Copy link
Contributor

We currently offer the following subcommands in the CLI:

  quint parse <input>      parse a Quint specification
  quint typecheck <input>  check types and effects of a Quint specification
  quint repl               run an interactive Read-Evaluate-Print-Loop [default]
  quint run <input>        Simulate a Quint specification and check invariants
  quint test <input>       Run tests against a Quint specification
  quint verify <input>     Verify a Quint specification via Apalache
  quint docs <input>       produces documentation from docstrings in a Quint
                           specification

parse and typecheck can be used to check an input's validity for syntax and typechecking, respectively, and to produce the intermediate stage of IR resulting from those processes. However, run, test, verify do not operate on the result of typechecking: instead they all require post-processing that includes forms of flattening and inlining.

This stage of the process is not exposed through the CLI currently, even tho it would be helpful for debugging and is probably what other tooling would want to consume.

I propose exposing this stage of the process through a compile subcommand, which will also become the recommended way for users to perform all static analysis and processing to a spec before passing it off to other tools.

@shonfeder shonfeder self-assigned this Nov 30, 2023
shonfeder pushed a commit to apalache-mc/apalache that referenced this issue Nov 30, 2023
This reverts commit fc88f06.

We need to wait on updating this fixture until we have
informalsystems/quint#1278 in place, so we can
generate the correct, flattened fixtures.
shonfeder pushed a commit to apalache-mc/apalache that referenced this issue Nov 30, 2023
This reverts commit fc88f06.

We need to wait on updating this fixture until we have
informalsystems/quint#1278 in place, so we can
generate the correct, flattened fixtures.
@konnov
Copy link
Contributor

konnov commented Nov 30, 2023

I am so happy that we both came up with the same idea independently! #359

@shonfeder
Copy link
Contributor Author

Ah yeah, I remember that issue now! I was probably channeling subconscious recollection of it :)

I think I agree with the functionality I'm not sure if I agree on the preferred interface.

We can probably merge these issues. The main thing I need is output of the stage that includes flattening, and a compile sub command seems like the right place to put that.

As to whether we should merge the parse and typecheck commands into compile, I'm not so sure. I'm not opposed, I just don't see a problem with having distinct subcommands here or what the benefit is of moving it into flags under a single subcommand. I guess our current interface seems a bit more like cargo than go, in that cargo has both build and check?

@shonfeder
Copy link
Contributor Author

Closing as duplicate of #359

@konnov
Copy link
Contributor

konnov commented Dec 1, 2023

If you would like to introduce a third command along with parse and typecheck, I am afraid it would get just too complicated from the user perspective. Who would know all these nuances? I think people can still get the difference between parse and typecheck, but what would compile do in their understanding?

@bugarela
Copy link
Collaborator

bugarela commented Dec 1, 2023

I Believe @shonfeder meant to close this, so closing (GitHub UI is terrible for this IMO)

@bugarela bugarela closed this as not planned Won't fix, can't repro, duplicate, stale Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants