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 a G-Machine interpreter for debugging #107

Open
Ailrun opened this issue Sep 7, 2019 · 7 comments
Open

Add a G-Machine interpreter for debugging #107

Ailrun opened this issue Sep 7, 2019 · 7 comments
Assignees
Labels
discussion This issue or pull request is under a discussion documentation This issue or pull request is related with documents enhancement New feature or request

Comments

@Ailrun
Copy link
Member

Ailrun commented Sep 7, 2019

Is your feature request related to a problem? Please describe.
It is really hard to debug G-Machine transpiler with the current setting.

Describe the solution you'd like
Implement a G-Machine interpreter.

Additional context
See https://github.com/Ailrun/core-lang-haskell for a reference.

@Ailrun Ailrun added enhancement New feature or request documentation This issue or pull request is related with documents discussion This issue or pull request is under a discussion labels Sep 7, 2019
@Ailrun Ailrun self-assigned this Sep 7, 2019
@Ailrun Ailrun mentioned this issue Sep 7, 2019
27 tasks
@Ailrun

This comment has been minimized.

@Ailrun

This comment has been minimized.

@Ailrun
Copy link
Member Author

Ailrun commented Sep 30, 2019

Dev note
Possible commands for CUI

  • help
  • run
  • step
  • undo (I believe that last two command should have the names related with each other in some manner. It's not the case for the listed names, so I wonder what are better name for them.)
  • break (both adding and removing break commands are included)
  • show (a command to display current state)
  • etc.

@Ailrun

This comment has been minimized.

@Ailrun

This comment has been minimized.

@Ailrun

This comment has been minimized.

@Ailrun Ailrun mentioned this issue Oct 7, 2019
@Ailrun
Copy link
Member Author

Ailrun commented Oct 7, 2019

Dev note
If possible, make the interpreter lazy so that it can print intermediate results before a program finishes.
(Be careful with the implementability of undo command. It might not able to implement if the interpreter becomes lazy)
I think by using two or more data structure simultaneously, it is possible to implement the interpreter in a lazy and undo-able way.
The previous solution is not possible. Think the next example.

lazyEvalResult = st0 : st1 : ...
undoResult = st0 : ...
modifyResult = st0 : st1' : ...
{- but st1 is already considered as a part of the result in 'lazyEvalResult' -}

Maybe it is possible by changing state structure entirely, like the next description.

lazyEvalResult = State st0 : State st1 : ...
undoResult = State st0 : State st1 : Undo : ...
modifyResult = State st0 : State st1 : Undo : State s1' : ...

I'm not totally sure this works well or not though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion This issue or pull request is under a discussion documentation This issue or pull request is related with documents enhancement New feature or request
Development

No branches or pull requests

1 participant