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

import... from... in REPL does not work #1180

Open
konnov opened this issue Sep 25, 2023 · 3 comments
Open

import... from... in REPL does not work #1180

konnov opened this issue Sep 25, 2023 · 3 comments
Assignees
Labels
simulator Quint simulator tech-debt Technical debt usability Usability issues

Comments

@konnov
Copy link
Contributor

konnov commented Sep 25, 2023

It looks like we have dismantled support for imports from files in REPL, when we made it incremental.

Consider a simple spec:

module foo {                                                                                       
  pure def x = 3
}

Suppose that the following command works for foo.qnt:

$ quint -r foo.qnt::foo
>>> x
3

The following command, which should be equivalent, does not work:

$ quint
>>> import foo.* from "./foo"
syntax error: error: [QNT405] Module 'foo' not found
import foo.* from "./foo"
^^^^^^^^^^^^^^^^^^^^^^^^^
@konnov konnov self-assigned this Sep 25, 2023
@konnov konnov added the usability Usability issues label Sep 25, 2023
@konnov konnov added this to the T4.2: Simulator Q1 (after MVP) milestone Sep 25, 2023
@konnov konnov added the W3 label Sep 25, 2023
@konnov
Copy link
Contributor Author

konnov commented Sep 25, 2023

The deeper I got into this issue, the more I understood how hard it would be to support import... from in REPL. I have a semi-working solution in https://github.com/informalsystems/quint/tree/igor/import1180

But it seems that it would take me 2-3 more days to fully implement it, which I do not have atm. This issue would require a very careful refactoring of incremental compilation.

@bugarela, do you think it would make sense to add an error message in REPL that import... from... is not supported? That should be relatively easy to do.

@konnov
Copy link
Contributor Author

konnov commented Sep 25, 2023

We have quint -r foo.qnt::qnt and .load in REPL. So supporting import... from... is not critical, though it would definitely make REPL more delightful :)

@konnov konnov changed the title import in REPL does not work import... from... in REPL does not work Sep 25, 2023
@bugarela
Copy link
Collaborator

Alternatively, we could disable incremental compilation for import ... from ..., that is, whenever that sort of declaration is evaluated by the REPL, we re-evaluate the whole thing (non-incrementally). I'm not sure, but that should be relatively easy to do.

@shonfeder shonfeder added the simulator Quint simulator label Jan 9, 2024
@shonfeder shonfeder removed this from the T4.2: Simulator Q1 (after MVP) milestone Jan 9, 2024
@shonfeder shonfeder added tech-debt Technical debt and removed tech debt labels Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
simulator Quint simulator tech-debt Technical debt usability Usability issues
Projects
None yet
Development

No branches or pull requests

3 participants