Back to BASICs

Recap and Feedback


In this part, you learned of the BASIC programming language, which was introduced in the 1960s. BASIC has a line-based execution model, where each line has a specific statement or command. Each line is assigned a number that serves both as a reference and a means for controlling the flow of execution. These line numbers allow for the use of branching commands like GOTO, which is used to jump to a specific line, and IF ... THEN ..., which is used to jump to a specific line in based on a condition.

At the same time, you learned about lexing, parsing, and interpreting, which are essential for creating a programming language in a sensible manner. You learned how to create a lexer that converts a string of characters into a sequence of tokens that represent sequences of characters such as keywords, identifiers, and operators. You also learned how to create a parser that transforms the list of tokens into statements with expressions, and learned how to create an interpreter that executes the statements.

The interpreter that we worked on in this part is a rather simple one, but it’s a good starting point for understanding how interpreters work. In particular, as BASIC uses a line-based execution model, the interpreter also focuses on line-based execution. Newer programming languages typically have more complex execution models, which require more sophisticated interpreters — regardless, the principles of lexing, parsing, and interpreting remain the same.

Loading Exercise...