reproto
reproto copied to clipboard
Support a bigint type
Support a arbitrary size, whole-number representation through a new core type called bigint
.
This would translate to the following in various programming languages:
- Python - natively supported.
- JavaScript - https://github.com/MikeMcl/bignumber.js/
- Java -
java.util.BigInteger
- C# -
System.Numerics.BigInteger
. - Rust -
https://github.com/rust-num/num-bigint
Mentoring Instructions
As a primer, it will help to read General instructions for how the compiler works.
This will mean adding a new keyword to the language, bigint
. This is done in lib/lexer
.
We will also need to have this new type in our AST, and RpIR.
Ast can be found in the lib/ast
module, and RpIR is hosted in lib/core
. Specifically the rp_type.rs
file.
Finally we'll have to add support for the new type in each distinct backend. You can find an example of this in the Java backend here: https://github.com/reproto/reproto/blob/master/lib/backend-java/src/utils.rs#L41
The dynamic backends will probably require different handling.