I have implemented but not yet documented:
unsigned:shift unsigned:+ unsigned:- unsigned:* unsigned:/mod unsigned:eq? unsigned:-eq? unsigned:lt? unsigned:gt?
In Napia, this is baked into the instruction set. Under Nga, it makes use of an I/O device to enable this, but implements the overall logic in a similar manner to Napia.
I've never implemented unsigned operations in Retro up to this point, but there are cases where they can be useful.
I am now planning to add an I/O device to support some operations on them in the near future, and to allow for better precision on some operations.
Initial functions planned:
Extended precision (using 64-bits intermediate):
What other functions should this support?
Strings in Retro currently have a few issues.
- ASCII only (currently Retro allows for strings containing UTF8, but does not provide words for actually manipulating UTF8 characters)
- Null terminated
- There is a lot of overlap with the functionality provided by arrays
I will be making changes to resolve these, but it will not be a quick process. Changing the strings model will break (to various degrees) backwards compatibility, so this is not something that'll be rushed.
My current plan:
#Stage 1(a): New String Words
I will introduce
s:storeto update characters in a string. For the standard strings, this will be a thin layer over
store. For the new strings, these will be a little more involved.
#Stage 1(b): Introduce UTF8 strings.
- UTF8 strings will be arrays of character data.
- There will be a
us:(utf8 string) namespace for words operating on them.
- A sigil for creating them will be provided.
- Match functionality in existing string vocabulary.
- Reuse array words internally when possible.
#Stage 2: Consolidation
This will involve updating the array words.
- Indirection in access words (fetch, store, etc)
I will need to insert some indirection (to allow for things like
us:storeto be used when updating arrays that contain utf8 data). This will also aid in allowing for arrays of byte or halfword data.
To be continued as feedback is gathered and work progresses