Jai Modules
Modules for the language being developed by Thekla, Inc.
Source: https://source.gudinoff.com/dam/jai-modules
Contact: https://www.gudinoff.com/dam/contact.html
Saturation
This module provides basic integer saturation arithmetic procedures: add, sub, mul, and div.
These procedures accept any of the built-in integer types and adjust the output accordingly, e.g., adding an u8 with an s16 results in an s16.
All procedures return a flag signaling if the result is saturated and, additionally, the division procedure returns the remainder.
Branch-free procedures are included for the x64 architecture. These may be used by setting the PREFER_BRANCH_FREE_CODE module argument, or by setting prefer_branch_free_code on each function call. These should speed things up, specially when using signed values. Some benchmarks are included on the tests file.
TUI
A simple terminal user interface module that provides basic functionalities similar to the ncurses library.
Usefull for creating simple terminal-based apps that require user input.
View snake.jai for an example.
It has been tested on the following terminal emulators:
UTF8
Basic operations over UTF8 encoded strings.
License
Licensed under MIT or ISC.
SPDX-License-Identifier: MIT OR ISC.
