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

KCVM instructions should include comment #205

Open
adamchalmers opened this issue Mar 13, 2024 · 0 comments
Open

KCVM instructions should include comment #205

adamchalmers opened this issue Mar 13, 2024 · 0 comments

Comments

@adamchalmers
Copy link
Collaborator

Background

KCVM is a low-level language, its instructions are usually generated by a compiler.

Problem

When debugging KCVM it's unclear why the high-level KCL generated a particular KCVM instruction.

Solution

Each Instruction should (optionally) support a comment string. That way compilers could explain "why" a particular instruction was included in the final instruction set.

Two suggested implementation approaches:

  1. Adding a comment: Option<String> field to the Instruction type
  2. Adding a map from instruction IDs to comment strings.

The KCVM debugger should show these comments.

Grackle should then add comments to the KCVM instructions it emits.

adamchalmers added a commit that referenced this issue Mar 13, 2024
Closes #205

The input JSON has been modified. Previously it accepted a Vec<Instruction>, now that is just one field of a JSON object.

The other field is a map from instruction indices to string comments. These comments show up in the debugger as events at the start of that instruction.
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

Successfully merging a pull request may close this issue.

1 participant