add: interpreter task - #49
shrehanrajsingh wants to merge 2 commits into
Conversation
|
|
||
| ## Example: Bytecode Generation (Optional) | ||
|
|
||
| Here's a sample bytecode representation for the QBasic program above. Each instruction is a simple operation that the interpreter's virtual machine would execute: |
There was a problem hiding this comment.
Since this is a teaching task, and this part is optional, all of the following explanations are unnecessary imo. Give them links to resources and explain what bytecode is at a high level and let them explore the rest.
There was a problem hiding this comment.
Replaced this with a small paragraph on bytecode generation, with some resources to learn about them
| ## Some Resources | ||
| - https://ruslanspivak.com/lsbasi-part1/ | ||
| - https://github.com/codecrafters-io/build-your-own-x?tab=readme-ov-file#build-your-own-programming-language | ||
| - https://www.craftinginterpreters.com/contents.html |
There was a problem hiding this comment.
It would be best to highlight this one, and even ask them to go through it as the primary resource/guide to complete the task.
There was a problem hiding this comment.
highlighted this section further
|
|
||
| Each node represents a statement or expression in the code, capturing its structure and relationships. | ||
| In the execution phase, the interpreter can be tuned as follows. | ||
| ```cpp |
There was a problem hiding this comment.
This code block seems too technical. I feel it should be removed.
There was a problem hiding this comment.
removed this code block
|
|
||
| ## Example: AST Breakdown | ||
|
|
||
| Here's a simple Abstract Syntax Tree (AST) representation for the QBasic code above: |
There was a problem hiding this comment.
If the reader has no idea what an AST is, the following would be hard to understand. It would be good to add a one-line description of what an AST is and how it helps.
There was a problem hiding this comment.
removed the breakdown with basic definition of AST and a small example
This pull request adds a coding + teaching task for developing a simple toy interpreter which would help the person unfold the concepts of interpreter design. Emphasis is more on teaching, thus the task is kept in the
Teaching/directory