proj-oot-ootMainStdlib

Part of Oot Details.

Read Oot first.

Details of the Oot Standard Library

Overview of the Oot standard library

The Oot standard library is a set of library modules which are maintained by the Oot project, distributed with Oot, and released in lockstep with new Oot versions. The Oot standard library follows the set of official conventions.

comparison

bit shifts

low-level arithmetic

div (%):

idiv (integer divison), mod:

inc, dec: increment (a = a + 1) and decrement (a = a - 1) (todo should these somehow be 'in-place'?)

mac: multiply-and-accumulate: a = a + b*c (todo should this somehow be 'in-place'?)

xor

floating-point arithmetic

floating point arithmetic: Although floating point literals are in Oot Core syntax, the arithmetic operations in Oot Core are only supported on fixed point.

higher-level arithmetic

gdot: Generalized dot product (generalized matrix multiplication); like matrix multiplication, except with multiplication replaced by any binary operation, and addition replaced by any binary associative operation.

dot: Dot product (matrix multiplication); equivalent to 'gdot multiply add'

exp, log

various trigonometric functions

control

if

ifs: by using 'TRUE' as the value being tested, 'cond' can be made to function like a chain of if..elif..elif..else in other languages. For convenience, 'ifs' is 'cond TRUE'

dispatch: identical to something like

while(true) {cond (!{next_instr, args = get_next_instr()}) {...}}

where next_instr is an enum; SHOULD be compiled in a time-efficient way to omit range checks in the cond, and to repeat the code inside the cond condition at the end of every cond-case, so as to (a) assist branch prediction, and (b) minimize branching (see https://news.ycombinator.com/item?id=9827749 )

intended to handle one of the 3 common usecases of goto in otherwise structured programming (where the other two common usecases are provided by break-to-enclosing-label and continue-to-enclosing-label, and try/catch/finally)

repeat until

gcond: 'cond' is like C's 'switch'. 'cond' is equivalent to 'gcond is'.

Overview of the canonical Oot packaging repository

(todo: this is superceded by the stuff in proj-oot-ootLibraries

Some Oot packages may be officially designated 'canonical' by the Oot project. These are packages which the Oot project recommends as 'standard' for their domain, even though they may not be maintained by the Oot project, distributed with Oot, or released in lockstep with new Oot versions.

To assist other packages in rising to the notice of the Oot team for possible designation as canonical, and to make it easy for developers to identify which other packages are popular and widely recommended, the repo includes a rating and reputation system which computes a score for packages in the repo based on developer ratings, weighted by developer influence.

In order to encourage the development of a library ecosystem that providing strong typing guarantees, Oot packages are not eligible for inclusion in the repo unless they use the (otherwise optional) static typing system. There may be some exceptions on a case-by-case basis for packages whose function necessitates dynamic or metaprogrammy black-magic; these packages will be segregated into a special section of the repo. Similarly, in order to encourage uniform conventions used across the library ecosystem, Oot packages which have been reported and verified as not following one or more official Oot conventions will be assigned a flag in the repo.