[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [GsoC] GNU Poke Project Idea [Big Numbers Part]
From: |
Jose E. Marchesi |
Subject: |
Re: [GsoC] GNU Poke Project Idea [Big Numbers Part] |
Date: |
Tue, 25 Feb 2020 23:21:09 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Hello Konstantinos.
I am a Computer Science student at National and Kapodistrian University of
Athens, and I would like to be a part of GsoC. The main language I have
used during my academic career is C, both in high-level projects and in
low-level projects like Operating Systems and Systems Programming.
I am interested in the GNU Poke Project Idea and what I find especially
interesting is the support for big numbers project.
Nice, thanks :)
I believe that I have the necessary background to keep up with your
expectations. Therefore, I would like to learn more things about this
project and find out in which ways I can contribute.
Well, this is about adding support for big numbers to both Poke (the
language) and poke (the program).
Let's see first the language level.
At the moment, integer values in Poke are limited to any number of bits
between 1 and 64, inclusive. Signed integers have types like int<3> and
int<64>, whereas unsigned integers have types like uint<1> and uint<64>.
The idea is to remove this limit, and allow integers (both signed an
unsigned) of arbitrary length at the language level. So for example you
could write uint<128>, which would be intepreted as a 128-bit unsigned
integer.
This requires small changes in the compiler. Examples:
- To allow to specify bigger bit numbers in type specifiers.
- To use the GNU gmp library in order to constant-fold arithmetic
expressions involving integers of more than 64-bit.
- To generate "big number" instructions whenever appropriate (see
below.)
Work also has to be done in the poke virtual machine (PVM):
- To add a new class of boxed value, for big numbers (currently there
are "ints" and "longs", and we can add "bigs".)
- To add a new set of instructions to the PVM, to deal with big numbers.
- The new instructions will also make use of the GNU gmp library.
- Printers for big numbers.
The IOS subsystem will also need adjustments:
- At the moment the IOS supports the notion of "integers" that are
limited to 64-bit. This shall be expanded to cover integers of an
arbitrary number of bits.
Additional work:
- Expand "integral structs" to cover an arbitrary number of bits.
- Documentation.
- A _good_ set of tests, i.e. a helluva lot of them ;)
And that is the outline, more or less.
Questions? :)