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

Support for range-limited integer arithmetic #22

Open
pliniker opened this issue Jul 7, 2020 · 0 comments
Open

Support for range-limited integer arithmetic #22

pliniker opened this issue Jul 7, 2020 · 0 comments
Labels
book-section Describes a part or chapter of the book that needs to be written compiler Area: compiling medium Some experience and/or subject matter knowledge required needs documentation Code documentation needs improvement needs tests Testing needs improvement parser Area: lexing and parsing vm Area: virtual machine

Comments

@pliniker
Copy link
Member

pliniker commented Jul 7, 2020

The TaggedPtr type allows for size_of::<isize>() * 8 - 2 bits of integer to be stored in a pointer.

Support for numbers needs to be implemented:

  1. in the parser
  2. in the compiler (+, -, integer div, *) opcodes
  3. in the VM

This initial implementation should return RuntimeError for values and results that fall outside of the supported TaggedPtr range.

A short chapter of the book might be written to describe this.

Consider splitting this issue into multiple issues to break it up, perhaps an issue for each area of the code and one for documentation.

@pliniker pliniker added book-section Describes a part or chapter of the book that needs to be written compiler Area: compiling medium Some experience and/or subject matter knowledge required needs documentation Code documentation needs improvement needs tests Testing needs improvement parser Area: lexing and parsing vm Area: virtual machine labels Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
book-section Describes a part or chapter of the book that needs to be written compiler Area: compiling medium Some experience and/or subject matter knowledge required needs documentation Code documentation needs improvement needs tests Testing needs improvement parser Area: lexing and parsing vm Area: virtual machine
Projects
None yet
Development

No branches or pull requests

1 participant