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

Enhance the REPL Interface #23

Open
1 of 3 tasks
maxsnew opened this issue Nov 18, 2022 · 4 comments
Open
1 of 3 tasks

Enhance the REPL Interface #23

maxsnew opened this issue Nov 18, 2022 · 4 comments
Labels
design Discussion of design issues enhancement New feature or request
Milestone

Comments

@maxsnew
Copy link
Contributor

maxsnew commented Nov 18, 2022

It would be nice to support some additional features in the repl. Let's use this issue as a tracker for what we should support and discuss relevant design/impl issues.

  1. Support running computations of both types Ret(A) and OS
  2. A way to query the type of a value/expression without running it
  3. A way to list all names currently in scope

Other suggestions welcome.

@maxsnew maxsnew added enhancement New feature or request design Discussion of design issues labels Nov 18, 2022
@LighghtEeloo
Copy link
Contributor

As for syntax, should we adopt Haskell's approach of :i and :t? Maybe we can have :vtype 1, :ctype ret 1 and :env. It would also be nice if we can have ways to

  1. clear env
  2. (after we have modules) import / open a module

@maxsnew maxsnew self-assigned this Nov 19, 2022
@maxsnew
Copy link
Contributor Author

maxsnew commented Nov 19, 2022

WIP on the repl branch

@maxsnew
Copy link
Contributor Author

maxsnew commented Nov 20, 2022

I merged in the current version. I think I'll leave it there for now. Now it supports writing values and computations of any type which will be parsed and type-checked, and if the computation is a returner or an OS it will run it.

It doesn't directly support a type-checking interface, but if you have a computation m you can just write { m } and it will display the type it infers. So that's a pretty simple workaround for now. Other features will wait until we add support for libraries etc.

@maxsnew maxsnew removed their assignment Nov 20, 2022
@LighghtEeloo LighghtEeloo added this to the 0.2 milestone Apr 15, 2023
@LighghtEeloo
Copy link
Contributor

Now with #env command shipped in and 7e560e3 introducing #type <term> command to print the type, I'd consider the basic interface done. Further efforts can be made after the basic module system checks in (soon) and with pretty printing implemented for the surface syntax (low-priority).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Discussion of design issues enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants