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

Implement a Scheme REPL based on the Ribbit VM #39

Merged
merged 221 commits into from
Mar 30, 2024
Merged

Implement a Scheme REPL based on the Ribbit VM #39

merged 221 commits into from
Mar 30, 2024

Conversation

mossprescott
Copy link
Owner

This involved a lot of side projects, including:

  • Implement an enhanced CPU with a larger, flat memory space with RAM and ROM both containing both instructions and data. In the process, the hardware simulators were made significantly more general with little apparent performance impact.
  • Implement a separate UI harness simulating a character-mapped display to save some RAM (2K for 80x25 characters vs. 16K for 512x256 pixels) and simplify text interaction.
  • Improve the compiler in [alt/reg.py] to generate much more compact code, and to provide access to assembly-level addresses and invocations.

Handle presence or absence of ROM, RAM(s), etc. separately, and fail lazily.
This allows alternate implementations pick and choose which components to use.
BUILTIN_SYMBOLS can be overridden.

If min_statics is None, any use of an undeclared symbol is a ParseError.

Range-checking for constant values.

A ParseError type for slightly more clarity about where the errors are coming from.
According to System 7.5.3 in emulation.
Run rsc and decode the symbol table into ROM and (at runtime) RAM.

Not really dealing with instructions yet, but the path is becoming clear.
@mossprescott
Copy link
Owner Author

A few bugs have been sorted out, and the getchar/putchar opcodes are now more responsive and support simple line editing.

That's sufficient to make this "usable".

In the REPL, a couple of simple expressions will consume the available memory, so we'll need a garbage collector to make this any more real.

@mossprescott
Copy link
Owner Author

Calling this good enough to merge. Planning to add pointer tagging and garbage collection on another branch.

@mossprescott mossprescott merged commit e8b7147 into master Mar 30, 2024
4 checks passed
@mossprescott mossprescott deleted the scheme branch March 30, 2024 21:41
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 this pull request may close these issues.

1 participant