docs.std
This the documentation of smoλ's standard library. It is automatically kept up to date by periodically running the following command. That pulls from code annotations and overloaded implementations.
./smol docs/std.s --task doc
You may notice that lot of dependencies are marked as unsafe; this is not worrying but only indicates that extra trust should be placed on both the person writing the implementations because some of the language's safety features are turned off to bring to you low-level functionaltiy.
The following functionality that is ready to use without -or with minimal- external dependencies. It is organized into top-level files residing directly under std/
and files under its subfolders. Do not import the latter by themselves to safe development speed. As a final remark, overloaded implementations are split per the file declaring them; foreign imports are not shown. Numbers in brackets indicate the number of structural primitive values.
std.builtins
std/builtins.s
std.builtins.convert unsafe
Standard library wrapping and simplification of C console commands.
This file is marked with the unsafe keyword. This means that its internal implementation (only) could be subject to bugs that the language's design otherwise eliminates. By using this file as a direct or indirect dependency you are trusting its implementation. Given this trust, consider other non-unsafe files using it as safe.
read
Reads several string and primitive types from console text input given by the user; they need to press enter after entering the input. String reading is restricted to 1024 bytes allocated on the heap. You can have more control of string reading on alternatives. Non-string variations of this method are restricted to local variables. Invalid inputs create service failures.
read(i64) → i64
read(u64) → u64
read(f64) → f64
convert
convert(i64,cstr _s) → i64
convert(i64,str[5] _s) → i64
convert(i64,nstr[5] _s) → i64
convert(u64,cstr _s) → u64
convert(u64,str[5] _s) → u64
convert(u64,nstr[5] _s) → u64
convert(f64,cstr _s) → f64
convert(f64,str[5] _s) → f64
convert(f64,nstr[5] _s) → f64
std.builtins.err unsafe
Standard library implementations of error utilities.
This file is marked with the unsafe keyword. This means that its internal implementation (only) could be subject to bugs that the language's design otherwise eliminates. By using this file as a direct or indirect dependency you are trusting its implementation. Given this trust, consider other non-unsafe files using it as safe.
ok
Checks if an error code corresponds to no error. If it does not, the service fails while printing the type of error. Error codes can be user errors, buffer errors, unknown errors, or no errors.
ok(errcode error) → ()
assert
assert(bool condition,cstr error) → ()
print
Prints an interpretation of the error code. Error codes can be user errors, buffer errors, unknown errors, or no errors.
print(errcode error) → ()
fail
Causes the current service to fail given a String message. This creates a user error code.
fail(cstr error) → ()
fail(str[5] error) → ()
std.builtins.num unsafe
Standard library wrapping of C basic arithmetics and printing.
This file is marked with the unsafe keyword. This means that its internal implementation (only) could be subject to bugs that the language's design otherwise eliminates. By using this file as a direct or indirect dependency you are trusting its implementation. Given this trust, consider other non-unsafe files using it as safe.
not
Negation of a boolean. In general, for unary operations, there is NO equivalent operator to overload. This promotes a currying-based notation for manipulating single values.
Here is a simple example, though this is often used in conditional statements:
print(true:not)
not(bool x) → bool
exists
Checks if a pointer is non-null. Pointer access and manipulation is inherently unsafe and you should not encounter that in normal code writing. For those aiming to extend the standard library or who dabble with inherently unsafe use cases, this can be used to check for memory allocation failures and trigger a service failure to safely collapse the current execution state.
exists(ptr x) → bool
print
Prints a primitive number, character, or boolean to the console.
print(f64 message) → ()
print(i64 message) → ()
print(u64 message) → ()
print(bool message) → ()
print(char message) → ()
printin
Prints a primitive number, character, or boolean to the console without changing line.
printin(f64 message) → ()
printin(i64 message) → ()
printin(u64 message) → ()
printin(bool message) → ()
printin(char message) → ()
le
Checks if the first number is less than or equal to the second and overloads the corresponding operator. Only the same number types can be compared, and explicit casts are required otherwise.
Here is an example demonstrating the need to use an f64 zero (0.0 and not 0) to compare with another read value of the same type:
x=f64:read
if x<0.0 -> print("negative")
else -> print("non-negative")
le(u64 x,u64 y) → bool
le(f64 x,f64 y) → bool
le(i64 x,i64 y) → bool
ge
Checks if the first number is greater than or equal to the second and overloads the corresponding operator. Only the same number types can be compared, and explicit casts are required otherwise.
Here is an example demonstrating the need to use an f64 zero (0.0 and not 0) to compare with another read value of the same type:
x=f64:read
if x>0.0 -> print("positive")
else -> print("non-positive")
ge(u64 x,u64 y) → bool
ge(f64 x,f64 y) → bool
ge(i64 x,i64 y) → bool
lt
Checks if the first number is less than the second and overloads the corresponding operator.
Here is an example:
print(1>=2)
lt(u64 x,u64 y) → bool
lt(f64 x,f64 y) → bool
lt(i64 x,i64 y) → bool
gt
Checks if the first number is greater than the second and overloads the corresponding operator.
Here is an example:
print(1>=2)
gt(u64 x,u64 y) → bool
gt(f64 x,f64 y) → bool
gt(i64 x,i64 y) → bool
leq
Checks if the first number is less than or equal to the second.
leq(u64 x,u64 y) → bool
leq(f64 x,f64 y) → bool
leq(i64 x,i64 y) → bool
geq
Checks if the first number is greater than or equal to the second.
geq(u64 x,u64 y) → bool
geq(f64 x,f64 y) → bool
geq(i64 x,i64 y) → bool
eq
Checks if two primitives are equal and overloads the corresponding operator. Equality can be checked for all primitives, and is defined for other runtypes too in the standard library, such as strings.
Here is an example:
print(1==2)
eq(u64 x,u64 y) → bool
eq(f64 x,f64 y) → bool
eq(i64 x,i64 y) → bool
eq(ptr x,ptr y) → bool
eq(bool x,bool y) → bool
neq
Checks if two primitives are not equal and overloads the corresponding operator. Non-equality can be checked for all primitives, and is defined for other runtypes too in the standard library, such as strings.
Here is an example:
print(1!=2)
neq(u64 x,u64 y) → bool
neq(f64 x,f64 y) → bool
neq(i64 x,i64 y) → bool
neq(ptr x,ptr y) → bool
neq(bool x,bool y) → bool
add
Addition of two numbers of the same type and overloads the corresponding operator.
Here is an example:
print(1+2)
add(u64 x,u64 y) → u64
add(i64 x,i64 y) → i64
add(f64 x,f64 y) → f64
mod
Modulo operation for signed or unsigned integers. For i64, only positive divisors are allowed. Fails on zero divisor. Overloads the corresponding operator. Here is an example:
print(1%2)
mod(u64 x,u64 y) → u64
mod(i64 x,i64 y) → i64
sub
Subtraction of two numbers of the same type. Doing so for u64 will create a service failure if the result would be negative. Overloads the corresponding operator for numbers.
Here is an example that FAILS because the default integer type is u64:
print(1-2)
sub(u64 x,u64 y) → u64
sub(i64 x,i64 y) → i64
sub(f64 x,f64 y) → f64
mul
Multiplication of two numbers of the same type and overloads the corresponding operator.
Here is an example:
print(3*2)
mul(u64 x,u64 y) → u64
mul(i64 x,i64 y) → i64
mul(f64 x,f64 y) → f64
div
Division of two numbers of the same type. Division by zero for i64 or u64 creates a service failure, but for f64 it yields NaN. Overloads the corresponding operator. Here is an example that yields zero by performing integer division:
print(1/2)
div(u64 x,u64 y) → u64
div(i64 x,i64 y) → i64
div(f64 x,f64 y) → f64
negative
Returns the additive inverse (negation) of an i64 or f64. Does NOT overload any operation. Having u64 as the default type helps avoid many spurious negation errors, especially when memory handling is concerned.
Both examples below print -1:
print(0:i64-1:i64)
print(1:i64:negative)
negative(i64 x) → i64
negative(f64 x) → f64
std.builtins.range
Standard library implementation of u64 ranges.
next
Obtains the next element in the range. Using a combination of a range and next element traversal is safer than manually checking bounds.
Below is the main usage pattern. Notice that next's argument is an in-place constructed u64 number that is mutable to obtain the next value. The function progress the range's state and set that value.
range(10)
:while next(u64 &i)
print(i)
--
next(u64& self.start,u64& self.end,u64& self.step,u64& self.pos,u64& value) → bool
range
Defines a u64 range as a structural type (instead of nominal type). When directly using variables as ranges, the position should be mutable. A couple of calling conventions are provided for default values of 0 for start and 1 for step.
range(u64 start,u64 end,u64 step) → (u64 start,u64 end,u64 step,u64 pos)
range(u64 start,u64 end) → range(u64 start,u64 end,u64 step)
range(u64 end) → range(u64 start,u64 end,u64 step)
std.builtins.str unsafe
Standard library implementation of the extensible string model based on C pointers and an implementation for const char arrays.
This file is marked with the unsafe keyword. This means that its internal implementation (only) could be subject to bugs that the language's design otherwise eliminates. By using this file as a direct or indirect dependency you are trusting its implementation. Given this trust, consider other non-unsafe files using it as safe.
next
Retrieves the next element over a Split string iteration. Example: Split('I like bananas', ' '):while next(str& word) print(word) --
next(Split&[12] self,str&[5] value) → bool
String
A union between str
, nstr
, and constant strings cstr
. Constant strings are those that generated by default when enclosing some text in quotients and are stored in the program memory.
Main usage is to abstract an argument's type by converting it to str. The conversion is a zero cost abstraction in that needless operations will be removed. But it still augments constant strings with length and first element inform if these are needed. Here is an example:
smo foo(String _s)
s = _s:str
...
--
str(nom,ptr contents,u64 length,char first,ptr memory) → (nom,ptr contents,u64 length,char first,ptr memory)
nstr(nom,ptr contents,u64 length,char first,ptr memory) → (nom,ptr contents,u64 length,char first,ptr memory)
IndependentString
A copy of the String union that can be used when a second argument is needed for a string of a potentially different variation.
str(nom,ptr contents,u64 length,char first,ptr memory) → (nom,ptr contents,u64 length,char first,ptr memory)
nstr(nom,ptr contents,u64 length,char first,ptr memory) → (nom,ptr contents,u64 length,char first,ptr memory)
CString
A union between nstr
and constant strings cstr
.
Main usage is to abstract an argument's type by converting it to nstr. The conversion is a zero cost abstraction in that needless operations will be removed. But it still augments constant strings with length and first element inform if these are needed. Here is an example:
smo foo(CString _s)
s = _s:nstr
...
--
nstr(nom,ptr contents,u64 length,char first,ptr memory) → (nom,ptr contents,u64 length,char first,ptr memory)
is
Compile-time check of a String exact type matching compared to an arbitrary type.
Example usage: smo foo(String s) with s:is(str) ... -- else ...----
is(cstr self,cstr) → cstr
is(str[5] self,str[5]) → str[5]
is(nstr[5] self,nstr[5]) → nstr[5]
print
Prints strings or bools to the console.
print(cstr message) → ()
print(nstr[5] message) → ()
print(str[5] message) → ()
str
A memory allocated string and converters from constant strings and booleans to the type. Other standard library implementations provide more converters.
str(nom,ptr contents,u64 length,char first,ptr memory) → (nom,ptr contents,u64 length,char first,ptr memory)
str(nstr[5] other) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(cstr raw) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(bool value) → str(nom,ptr contents,u64 length,char first,ptr memory)
nstr
A null-terminated variation of str. Many operation produce this string version, as it can be readily converted to str at no cost (for the inverse, you need to copy the string)
nstr(nom,ptr contents,u64 length,char first,ptr memory) → (nom,ptr contents,u64 length,char first,ptr memory)
nstr(cstr raw) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(bool value) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
printin
Prints strings or bools to the console without evoking a new line at the end.
printin(cstr message) → ()
printin(nstr[5] message) → ()
printin(str[5] message) → ()
eq
eq(char x,char y) → bool
eq(cstr _x,cstr _y) → bool
eq(str[5] _x,cstr _y) → bool
eq(nstr[5] _x,cstr _y) → bool
eq(cstr _x,str[5] _y) → bool
eq(str[5] _x,str[5] _y) → bool
eq(nstr[5] _x,str[5] _y) → bool
eq(cstr _x,nstr[5] _y) → bool
eq(str[5] _x,nstr[5] _y) → bool
eq(nstr[5] _x,nstr[5] _y) → bool
neq
neq(char x,char y) → bool
neq(cstr _x,cstr _y) → bool
neq(str[5] _x,cstr _y) → bool
neq(nstr[5] _x,cstr _y) → bool
neq(cstr _x,str[5] _y) → bool
neq(str[5] _x,str[5] _y) → bool
neq(nstr[5] _x,str[5] _y) → bool
neq(cstr _x,nstr[5] _y) → bool
neq(str[5] _x,nstr[5] _y) → bool
neq(nstr[5] _x,nstr[5] _y) → bool
slice
slice(cstr self,u64 from,u64 to) → str[5]
slice(str[5] self,u64 from,u64 to) → str[5]
slice(nstr[5] self,u64 from,u64 to) → str[5]
slice(cstr self,u64 from) → str[5]
slice(str[5] self,u64 from) → str[5]
slice(nstr[5] self,u64 from) → str[5]
strip
strip(cstr _s) → str[5]
strip(str[5] _s) → str[5]
strip(nstr[5] _s) → str[5]
len
len(str[5] x) → u64
len(nstr[5] x) → u64
len(cstr x) → u64
at
at(str[5] x,u64 pos) → char
at(nstr[5] x,u64 pos) → char
Split
Splits a String given a query String. Optionally, you may also provide a starting position, where the default is 0. The result of the split can be iterated through with next
. This does not allocate memory in that a substring is retrieved, so you might consider copying the splits - or store them on data structures like maps that automatically copy data if needed.
Split(nom,str[5] query,str[5] sep,u64& pos) → (nom,str[5] query,str[5] sep,u64 pos)
Split(cstr _query,cstr _sep) → Split(nom,str[5] query,str[5] sep,u64& pos)
Split(str[5] _query,cstr _sep) → Split(nom,str[5] query,str[5] sep,u64& pos)
Split(nstr[5] _query,cstr _sep) → Split(nom,str[5] query,str[5] sep,u64& pos)
Split(cstr _query,str[5] _sep) → Split(nom,str[5] query,str[5] sep,u64& pos)
Split(str[5] _query,str[5] _sep) → Split(nom,str[5] query,str[5] sep,u64& pos)
Split(nstr[5] _query,str[5] _sep) → Split(nom,str[5] query,str[5] sep,u64& pos)
Split(cstr _query,nstr[5] _sep) → Split(nom,str[5] query,str[5] sep,u64& pos)
Split(str[5] _query,nstr[5] _sep) → Split(nom,str[5] query,str[5] sep,u64& pos)
Split(nstr[5] _query,nstr[5] _sep) → Split(nom,str[5] query,str[5] sep,u64& pos)
std.file unsafe
Standard library implementation of file management that uses the C filesystem.
This file is marked with the unsafe keyword. This means that its internal implementation (only) could be subject to bugs that the language's design otherwise eliminates. By using this file as a direct or indirect dependency you are trusting its implementation. Given this trust, consider other non-unsafe files using it as safe.
to_end
Go to the end of a WriteFile. This is not implemented for ReadFile, as it makes more sense to just close the latter. Returns a boolean indicating a successful operation.
to_end(WriteFile&[2] f) → bool
ReadFile
An opened file that is meant to be read only.
ReadFile(nom,ptr contents) → (nom,ptr contents)
WriteFile
An opened file that is meant to be read or write.
WriteFile(nom,ptr contents) → (nom,ptr contents)
console
console(WriteFile&[2]) → (WriteFile[2])
open
Opens a File given a String path, in which case you might get service failure due to external factors. Opening a WriteFile, may also cause service failure if the file already exists - in that case remove it first. On the other hand, a ReadFile must already exist to be opened.
open(ReadFile&[2],cstr _path) → ReadFile[2]
open(ReadFile&[2],str[5] _path) → ReadFile[2]
open(ReadFile&[2],nstr[5] _path) → ReadFile[2]
open(Stack&[1] memory,u64 size) → WriteFile[2]
open(Heap&[1] memory,u64 size) → WriteFile[2]
open(Arena&[9] memory,u64 size) → WriteFile[2]
open(Arena&[9] memory,u64 size) → WriteFile[2]
open(Volatile&[9] memory,u64 size) → WriteFile[2]
open(Volatile&[9] memory,u64 size) → WriteFile[2]
open(Dynamic&[5] memory,u64 size) → WriteFile[2]
open(WriteFile&[2],cstr _path) → WriteFile[2]
open(WriteFile&[2],str[5] _path) → WriteFile[2]
open(WriteFile&[2],nstr[5] _path) → WriteFile[2]
next_line
Reads the next line of a file while using it as an iterator. It accomodates Arena and Volatile memories.
Here is an example where volatile memory is used to avoid repeated or large allocations:
endl="n":str.first // optimized to just setting the new line character
on Heap:volatile(1024)
ReadFile("README.md")
:open("README.md")
:while next_line(str& line)
if line[line:len-1]==endl
line = line[0 to line:len-1]
--
print(line)
----
next_line(Volatile&[9] reader,ReadFile&[2] f,nstr&[5] value) → bool
next_line(Volatile&[9] reader,ReadFile&[2] f,nstr&[5] value) → bool
next_line(Volatile&[9] reader,WriteFile&[2] f,nstr&[5] value) → bool
next_line(Volatile&[9] reader,WriteFile&[2] f,nstr&[5] value) → bool
next_line(Arena&[9] reader,ReadFile&[2] f,nstr&[5] value) → bool
next_line(Arena&[9] reader,ReadFile&[2] f,nstr&[5] value) → bool
next_line(Arena&[9] reader,WriteFile&[2] f,nstr&[5] value) → bool
next_line(Arena&[9] reader,WriteFile&[2] f,nstr&[5] value) → bool
next_line(Arena&[9] reader,ReadFile&[2] f,str&[5] value) → bool
next_line(Arena&[9] reader,ReadFile&[2] f,str&[5] value) → bool
next_line(Volatile&[9] reader,ReadFile&[2] f,str&[5] value) → bool
next_line(Volatile&[9] reader,ReadFile&[2] f,str&[5] value) → bool
next_line(Arena&[9] reader,WriteFile&[2] f,str&[5] value) → bool
next_line(Arena&[9] reader,WriteFile&[2] f,str&[5] value) → bool
next_line(Volatile&[9] reader,WriteFile&[2] f,str&[5] value) → bool
next_line(Volatile&[9] reader,WriteFile&[2] f,str&[5] value) → bool
next_chunk
Reads the next chunk of a file while using it as an iterator. It accomodates Arena and Volatile memories.
Here is an example where volatile memory is used to avoid repeated or large allocations:
on Heap:volatile(1024)
ReadFile
:open("README.md")
:while next_chunk(str& chunk)
print(chunk)
----
next_chunk(Volatile&[9] reader,ReadFile&[2] f,nstr&[5] value) → bool
next_chunk(Volatile&[9] reader,ReadFile&[2] f,nstr&[5] value) → bool
next_chunk(Volatile&[9] reader,WriteFile&[2] f,nstr&[5] value) → bool
next_chunk(Volatile&[9] reader,WriteFile&[2] f,nstr&[5] value) → bool
next_chunk(Arena&[9] reader,ReadFile&[2] f,nstr&[5] value) → bool
next_chunk(Arena&[9] reader,ReadFile&[2] f,nstr&[5] value) → bool
next_chunk(Arena&[9] reader,WriteFile&[2] f,nstr&[5] value) → bool
next_chunk(Arena&[9] reader,WriteFile&[2] f,nstr&[5] value) → bool
next_chunk(Arena&[9] reader,ReadFile&[2] f,str&[5] value) → bool
next_chunk(Arena&[9] reader,ReadFile&[2] f,str&[5] value) → bool
next_chunk(Volatile&[9] reader,ReadFile&[2] f,str&[5] value) → bool
next_chunk(Volatile&[9] reader,ReadFile&[2] f,str&[5] value) → bool
next_chunk(Arena&[9] reader,WriteFile&[2] f,str&[5] value) → bool
next_chunk(Arena&[9] reader,WriteFile&[2] f,str&[5] value) → bool
next_chunk(Volatile&[9] reader,WriteFile&[2] f,str&[5] value) → bool
next_chunk(Volatile&[9] reader,WriteFile&[2] f,str&[5] value) → bool
File
A union between file types that allows common reading and positioning operations.
ReadFile(nom,ptr contents) → (nom,ptr contents)
WriteFile(nom,ptr contents) → (nom,ptr contents)
to_start
Go to the beginning of a File. You can continue read or writing from there. May cause service failure due to external factors.
to_start(ReadFile&[2] f) → ()
to_start(WriteFile&[2] f) → ()
write
Writes a string on a WriteFile.
write(WriteFile&[2] f,cstr _s) → ()
write(WriteFile&[2] f,str[5] _s) → ()
write(WriteFile&[2] f,nstr[5] _s) → ()
len
Computes the size of a File in bytes.
len(ReadFile&[2] f) → u64
len(WriteFile&[2] f) → u64
ended
Checks if the ending of the file has been reached. This is normal to be true for WriteFile.
ended(ReadFile&[2] f) → bool
ended(WriteFile&[2] f) → bool
is_file
Checks if a String path is a file system file.
is_file(cstr _path) → bool
is_file(str[5] _path) → bool
is_file(nstr[5] _path) → bool
is_dir
Checks if a String path is a file system directory.
is_dir(cstr _path) → bool
is_dir(str[5] _path) → bool
is_dir(nstr[5] _path) → bool
remove_file
Deletes a file from the system. May cause service failure due to external factors or if the file is already open.
remove_file(cstr _path) → ()
remove_file(str[5] _path) → ()
remove_file(nstr[5] _path) → ()
create_dir
Creates a directory given a String path. May cause service failure due to external factors or if the directory already exists.
create_dir(cstr _path) → ()
create_dir(str[5] _path) → ()
create_dir(nstr[5] _path) → ()
std.map
std/map.s
std.math unsafe
Standard library wrapping of C math operations.
This file is marked with the unsafe keyword. This means that its internal implementation (only) could be subject to bugs that the language's design otherwise eliminates. By using this file as a direct or indirect dependency you are trusting its implementation. Given this trust, consider other non-unsafe files using it as safe.
cos
cos(f64 x) → f64
acos
acos(f64 x) → f64
sin
sin(f64 x) → f64
asin
asin(f64 x) → f64
exp
exp(f64 x) → f64
pi
pi(f64 x) → f64
tan
tan(f64 x) → f64
atan
atan(f64 x) → f64
atan2
atan2(f64 y,f64 x) → f64
is_nan
is_nan(f64 x) → bool
is_inf
is_inf(f64 x) → bool
sqrt
sqrt(f64 x) → f64
pow
pow(f64 base,f64 exponent) → f64
log
log(f64 x) → f64
std.mem
std/mem.s
std.mem.arena unsafe
Standard library implementation of arena allocation, marked as @noborrow but unsafely returned from constructors. Pointer arithmetics yield offsets within arenas.
This file is marked with the unsafe keyword. This means that its internal implementation (only) could be subject to bugs that the language's design otherwise eliminates. By using this file as a direct or indirect dependency you are trusting its implementation. Given this trust, consider other non-unsafe files using it as safe.
Dynamic
Dynamic(nom) → (nom,ptr acquired,u64 size,u64 allocated,u64)
Arena
Arena(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 size)
Arena(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 size)
read
read(Arena&[9] self) → str[5]
read(Arena&[9] self) → str[5]
Volatile
Volatile(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 cycles)
Volatile(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 cycles)
controlled_corrupt
controlled_corrupt(Volatile&[9] self) → ()
controlled_corrupt(Volatile&[9] self) → ()
allocate
allocate(Dynamic&[5] self,u64 size,char) → ContiguousMemory[6]
allocate(Dynamic&[5] self,u64 size,u64) → ContiguousMemory[6]
allocate(Dynamic&[5] self,u64 size,f64) → ContiguousMemory[6]
allocate(Dynamic&[5] self,u64 size,i64) → ContiguousMemory[6]
allocate(Dynamic&[5] self,u64 size) → ContiguousMemory[6]
allocate(Arena&[9] self,u64 size) → ContiguousMemory[6]
allocate(Arena&[9] self,u64 size) → ContiguousMemory[6]
allocate(Arena&[9] self,u64 _size,char) → ContiguousMemory[6]
allocate(Arena&[9] self,u64 _size,char) → ContiguousMemory[6]
allocate(Arena&[9] self,u64 _size,u64) → ContiguousMemory[6]
allocate(Arena&[9] self,u64 _size,u64) → ContiguousMemory[6]
allocate(Arena&[9] self,u64 _size,f64) → ContiguousMemory[6]
allocate(Arena&[9] self,u64 _size,f64) → ContiguousMemory[6]
allocate(Arena&[9] self,u64 _size,i64) → ContiguousMemory[6]
allocate(Arena&[9] self,u64 _size,i64) → ContiguousMemory[6]
allocate(Volatile&[9] self,u64 size) → ContiguousMemory[6]
allocate(Volatile&[9] self,u64 size) → ContiguousMemory[6]
allocate(Volatile&[9] self,u64 _size,char) → ContiguousMemory[6]
allocate(Volatile&[9] self,u64 _size,char) → ContiguousMemory[6]
allocate(Volatile&[9] self,u64 _size,u64) → ContiguousMemory[6]
allocate(Volatile&[9] self,u64 _size,u64) → ContiguousMemory[6]
allocate(Volatile&[9] self,u64 _size,f64) → ContiguousMemory[6]
allocate(Volatile&[9] self,u64 _size,f64) → ContiguousMemory[6]
allocate(Volatile&[9] self,u64 _size,i64) → ContiguousMemory[6]
allocate(Volatile&[9] self,u64 _size,i64) → ContiguousMemory[6]
is
is(Stack&[1] self,Stack&[1]) → Stack[1]
is(Heap&[1] self,Heap&[1]) → Heap[1]
is(Arena&[9] self,Arena&[9]) → Arena[7]
is(Arena&[9] self,Arena&[9]) → Arena[7]
is(Volatile&[9] self,Volatile&[9]) → Volatile[7]
is(Volatile&[9] self,Volatile&[9]) → Volatile[7]
is(Dynamic&[5] self,Dynamic&[5]) → Dynamic[1]
DerivedMemory
Arena(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 size)
Arena(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 size)
Volatile(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 cycles)
Volatile(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 cycles)
dynamic
dynamic(Heap[1]) → Dynamic[1]
dynamic(Stack[1]) → nom
used
used(Arena&[9] self) → u64
used(Arena&[9] self) → u64
used(Volatile&[9] self) → u64
used(Volatile&[9] self) → u64
len
len(Arena&[9] self) → u64
len(Arena&[9] self) → u64
len(Volatile&[9] self) → u64
len(Volatile&[9] self) → u64
Memory
Arena(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 size)
Arena(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 size)
Volatile(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 cycles)
Volatile(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 cycles)
Dynamic(nom) → (nom,ptr acquired,u64 size,u64 allocated,u64)
BoundedMemory
Arena(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 size)
Arena(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 size)
Volatile(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 cycles)
Volatile(nom,ContiguousMemory[6] contents) → (nom,ContiguousMemory[6] contents,u64 length,u64 cycles)
arena
arena(Stack&[1] self,u64 size) → Arena[7]
arena(Heap&[1] self,u64 size) → Arena[7]
arena(Arena&[9] self,u64 size) → Arena[7]
arena(Arena&[9] self,u64 size) → Arena[7]
arena(Volatile&[9] self,u64 size) → Arena[7]
arena(Volatile&[9] self,u64 size) → Arena[7]
arena(Dynamic&[5] self,u64 size) → Arena[7]
volatile
volatile(Stack&[1] self,u64 size) → (Volatile[9])
volatile(Heap&[1] self,u64 size) → (Volatile[9])
volatile(Arena&[9] self,u64 size) → (Volatile[9])
volatile(Arena&[9] self,u64 size) → (Volatile[9])
volatile(Volatile&[9] self,u64 size) → (Volatile[9])
volatile(Volatile&[9] self,u64 size) → (Volatile[9])
volatile(Dynamic&[5] self,u64 size) → (Volatile[9])
std.mem.device unsafe
Standard library implementation of memory management that accounts for the stack and heap and depends on the runtime.h implementation of heap memory, and GCC implementation of alloca. Stack alloactions cannot be returned from services, as the stack is pruned when programming function calls end. Smo runtypes are not implemented as functions, so it is fine to return stack allocations from them.
This file is marked with the unsafe keyword. This means that its internal implementation (only) could be subject to bugs that the language's design otherwise eliminates. By using this file as a direct or indirect dependency you are trusting its implementation. Given this trust, consider other non-unsafe files using it as safe.
Stack
Represents call stack memory. Allocating on this is near-zero cost by being just an arithmetic addition but its total size is limited - typically up to a few megabytes. Prefer this for small localized data that need to be processed exceedingly fast.
Stack(nom) → nom
Heap
Random access memory (RAM) that can be allocated with __runtime_alloc. Writing to it and reading from it can be slow for programs that keep. Modern processors optimize heap usage by prefetching and caching nearby areas as the ones you access. For this reason, prefer creating Arena regions when you have a sense of the exact amount of data you will need. Allocating on the heap can leak memory under certain conditions, but the lnaguage's safety mechanism prevents this. Use other allocators in those cases. The standard library provides a Dynamic type that also accesses several heap allocations, though with an additional level of indirection.
Heap(nom) → nom
MemoryDevice
Refers to either stack or heap memory.
Stack(nom) → nom
Heap(nom) → nom
ContiguousMemory
Represents allocated memory management. It keeps track of both currently used pointer addresses, for example if these are offsets of allocated base pointers with finally segments calling __runtime_free on those, and the underlying pointer addresses. Importantly, not all this information is retained after compilation, as most of it -perhaps all- is optimized away. But this structure still helps the compiler organize where to place memory releases, if needed. Users of the standard library will not generally work with this type, as it is highly unsafe to get its pointer fields and requires annotation for the language to allow that.
ContiguousMemory(nom,Stack[1],u64 size,char,ptr mem,ptr underlying) → (nom,Stack[1],u64 size,char,ptr mem,ptr underlying)
ContiguousMemory(nom,Heap[1],u64 size,char,ptr mem,ptr underlying) → (nom,Heap[1],u64 size,char,ptr mem,ptr underlying)
ContiguousMemory(nom,Stack[1],u64 size,u64,ptr mem,ptr underlying) → (nom,Stack[1],u64 size,u64,ptr mem,ptr underlying)
ContiguousMemory(nom,Heap[1],u64 size,u64,ptr mem,ptr underlying) → (nom,Heap[1],u64 size,u64,ptr mem,ptr underlying)
ContiguousMemory(nom,Stack[1],u64 size,f64,ptr mem,ptr underlying) → (nom,Stack[1],u64 size,f64,ptr mem,ptr underlying)
ContiguousMemory(nom,Heap[1],u64 size,f64,ptr mem,ptr underlying) → (nom,Heap[1],u64 size,f64,ptr mem,ptr underlying)
ContiguousMemory(nom,Stack[1],u64 size,i64,ptr mem,ptr underlying) → (nom,Stack[1],u64 size,i64,ptr mem,ptr underlying)
ContiguousMemory(nom,Heap[1],u64 size,i64,ptr mem,ptr underlying) → (nom,Heap[1],u64 size,i64,ptr mem,ptr underlying)
allocate
Allocates memory on a predetermined device given a number of entries and an optional primitive data type. If the data type is not provided, char is assumed so that the number of entries becomes equal to the number of allocated bytes. Other standard library overloads implement allocation for more memory types, derived from the devices. Allocations throughout the standard library track the raw allocated memory so that usage is finally released only when the last dependent variable (e.g., the last string allocated on a heap arena) is no longer used. See ContiguousMemory.
allocate(Stack[1],u64 size,char) → ContiguousMemory[6]
allocate(Stack[1],u64 size,u64) → ContiguousMemory[6]
allocate(Stack[1],u64 size,f64) → ContiguousMemory[6]
allocate(Stack[1],u64 size,i64) → ContiguousMemory[6]
allocate(Heap[1],u64 size,char) → ContiguousMemory[6]
allocate(Heap[1],u64 size,u64) → ContiguousMemory[6]
allocate(Heap[1],u64 size,f64) → ContiguousMemory[6]
allocate(Heap[1],u64 size,i64) → ContiguousMemory[6]
allocate(Stack[1],u64 size) → ContiguousMemory[6]
allocate(Heap[1],u64 size) → ContiguousMemory[6]
is
is(char self,char) → char
is(u64 self,u64) → u64
is(f64 self,f64) → f64
is(i64 self,i64) → i64
__unsafe_put
Can modify an allocated memory. This operation cannot be callsed in safe files.
__unsafe_put(ContiguousMemory[6] v,u64 pos,char value) → (ContiguousMemory[6] v)
__unsafe_put(ContiguousMemory[6] v,u64 pos,char value) → (ContiguousMemory[6] v)
__unsafe_put(ContiguousMemory[6] v,u64 pos,u64 value) → (ContiguousMemory[6] v)
__unsafe_put(ContiguousMemory[6] v,u64 pos,u64 value) → (ContiguousMemory[6] v)
__unsafe_put(ContiguousMemory[6] v,u64 pos,f64 value) → (ContiguousMemory[6] v)
__unsafe_put(ContiguousMemory[6] v,u64 pos,f64 value) → (ContiguousMemory[6] v)
__unsafe_put(ContiguousMemory[6] v,u64 pos,i64 value) → (ContiguousMemory[6] v)
__unsafe_put(ContiguousMemory[6] v,u64 pos,i64 value) → (ContiguousMemory[6] v)
at
Accesses a specific memory position of the corresponding base type. This operation includes bound checks.
at(ContiguousMemory[6] v,u64 pos) → char
at(ContiguousMemory[6] v,u64 pos) → char
at(ContiguousMemory[6] v,u64 pos) → u64
at(ContiguousMemory[6] v,u64 pos) → u64
at(ContiguousMemory[6] v,u64 pos) → f64
at(ContiguousMemory[6] v,u64 pos) → f64
at(ContiguousMemory[6] v,u64 pos) → i64
at(ContiguousMemory[6] v,u64 pos) → i64
std.mem.grid
std/mem/grid.s
MemoryGrid
MemoryGrid(nom,Stack&[1] memory,char,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Heap&[1] memory,char,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Arena&[9] memory,char,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Arena&[9] memory,char,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Volatile&[9] memory,char,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Volatile&[9] memory,char,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Dynamic&[5] memory,char,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Stack&[1] memory,u64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Heap&[1] memory,u64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Arena&[9] memory,u64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Arena&[9] memory,u64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Volatile&[9] memory,u64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Volatile&[9] memory,u64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Dynamic&[5] memory,u64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Stack&[1] memory,f64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Heap&[1] memory,f64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Arena&[9] memory,f64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Arena&[9] memory,f64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Volatile&[9] memory,f64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Volatile&[9] memory,f64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Dynamic&[5] memory,f64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Stack&[1] memory,i64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Heap&[1] memory,i64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Arena&[9] memory,i64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Arena&[9] memory,i64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Volatile&[9] memory,i64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Volatile&[9] memory,i64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
MemoryGrid(nom,Dynamic&[5] memory,i64,u64 size,u64 squares) → (nom,ContiguousMemory[6] surface,u64 size,u64 squares)
GridEntry
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
GridEntry(nom,MemoryGrid&[9] grid,u64 id) → (nom,MemoryGrid[9] grid,u64 id)
put
put(GridEntry&[11] self,u64 pos,char value) → ()
put(GridEntry&[11] self,u64 pos,char value) → ()
put(GridEntry&[11] self,u64 pos,char value) → ()
put(GridEntry&[11] self,u64 pos,char value) → ()
put(GridEntry&[11] self,u64 pos,char value) → ()
put(GridEntry&[11] self,u64 pos,char value) → ()
put(GridEntry&[11] self,u64 pos,char value) → ()
put(GridEntry&[11] self,u64 pos,u64 value) → ()
put(GridEntry&[11] self,u64 pos,u64 value) → ()
put(GridEntry&[11] self,u64 pos,u64 value) → ()
put(GridEntry&[11] self,u64 pos,u64 value) → ()
put(GridEntry&[11] self,u64 pos,u64 value) → ()
put(GridEntry&[11] self,u64 pos,u64 value) → ()
put(GridEntry&[11] self,u64 pos,u64 value) → ()
put(GridEntry&[11] self,u64 pos,f64 value) → ()
put(GridEntry&[11] self,u64 pos,f64 value) → ()
put(GridEntry&[11] self,u64 pos,f64 value) → ()
put(GridEntry&[11] self,u64 pos,f64 value) → ()
put(GridEntry&[11] self,u64 pos,f64 value) → ()
put(GridEntry&[11] self,u64 pos,f64 value) → ()
put(GridEntry&[11] self,u64 pos,f64 value) → ()
put(GridEntry&[11] self,u64 pos,i64 value) → ()
put(GridEntry&[11] self,u64 pos,i64 value) → ()
put(GridEntry&[11] self,u64 pos,i64 value) → ()
put(GridEntry&[11] self,u64 pos,i64 value) → ()
put(GridEntry&[11] self,u64 pos,i64 value) → ()
put(GridEntry&[11] self,u64 pos,i64 value) → ()
put(GridEntry&[11] self,u64 pos,i64 value) → ()
grid
grid(Stack&[1] memory,u64 size,u64 squares,char) → (MemoryGrid[9])
grid(Heap&[1] memory,u64 size,u64 squares,char) → (MemoryGrid[9])
grid(Arena&[9] memory,u64 size,u64 squares,char) → (MemoryGrid[9])
grid(Arena&[9] memory,u64 size,u64 squares,char) → (MemoryGrid[9])
grid(Volatile&[9] memory,u64 size,u64 squares,char) → (MemoryGrid[9])
grid(Volatile&[9] memory,u64 size,u64 squares,char) → (MemoryGrid[9])
grid(Dynamic&[5] memory,u64 size,u64 squares,char) → (MemoryGrid[9])
grid(Stack&[1] memory,u64 size,u64 squares,u64) → (MemoryGrid[9])
grid(Heap&[1] memory,u64 size,u64 squares,u64) → (MemoryGrid[9])
grid(Arena&[9] memory,u64 size,u64 squares,u64) → (MemoryGrid[9])
grid(Arena&[9] memory,u64 size,u64 squares,u64) → (MemoryGrid[9])
grid(Volatile&[9] memory,u64 size,u64 squares,u64) → (MemoryGrid[9])
grid(Volatile&[9] memory,u64 size,u64 squares,u64) → (MemoryGrid[9])
grid(Dynamic&[5] memory,u64 size,u64 squares,u64) → (MemoryGrid[9])
grid(Stack&[1] memory,u64 size,u64 squares,f64) → (MemoryGrid[9])
grid(Heap&[1] memory,u64 size,u64 squares,f64) → (MemoryGrid[9])
grid(Arena&[9] memory,u64 size,u64 squares,f64) → (MemoryGrid[9])
grid(Arena&[9] memory,u64 size,u64 squares,f64) → (MemoryGrid[9])
grid(Volatile&[9] memory,u64 size,u64 squares,f64) → (MemoryGrid[9])
grid(Volatile&[9] memory,u64 size,u64 squares,f64) → (MemoryGrid[9])
grid(Dynamic&[5] memory,u64 size,u64 squares,f64) → (MemoryGrid[9])
grid(Stack&[1] memory,u64 size,u64 squares,i64) → (MemoryGrid[9])
grid(Heap&[1] memory,u64 size,u64 squares,i64) → (MemoryGrid[9])
grid(Arena&[9] memory,u64 size,u64 squares,i64) → (MemoryGrid[9])
grid(Arena&[9] memory,u64 size,u64 squares,i64) → (MemoryGrid[9])
grid(Volatile&[9] memory,u64 size,u64 squares,i64) → (MemoryGrid[9])
grid(Volatile&[9] memory,u64 size,u64 squares,i64) → (MemoryGrid[9])
grid(Dynamic&[5] memory,u64 size,u64 squares,i64) → (MemoryGrid[9])
len
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
len(GridEntry[11] self) → u64
at
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(MemoryGrid&[9] self,u64 id) → GridEntry[11]
at(GridEntry[11] self,u64 pos) → char
at(GridEntry[11] self,u64 pos) → char
at(GridEntry[11] self,u64 pos) → char
at(GridEntry[11] self,u64 pos) → char
at(GridEntry[11] self,u64 pos) → char
at(GridEntry[11] self,u64 pos) → char
at(GridEntry[11] self,u64 pos) → char
at(GridEntry[11] self,u64 pos) → u64
at(GridEntry[11] self,u64 pos) → u64
at(GridEntry[11] self,u64 pos) → u64
at(GridEntry[11] self,u64 pos) → u64
at(GridEntry[11] self,u64 pos) → u64
at(GridEntry[11] self,u64 pos) → u64
at(GridEntry[11] self,u64 pos) → u64
at(GridEntry[11] self,u64 pos) → f64
at(GridEntry[11] self,u64 pos) → f64
at(GridEntry[11] self,u64 pos) → f64
at(GridEntry[11] self,u64 pos) → f64
at(GridEntry[11] self,u64 pos) → f64
at(GridEntry[11] self,u64 pos) → f64
at(GridEntry[11] self,u64 pos) → f64
at(GridEntry[11] self,u64 pos) → i64
at(GridEntry[11] self,u64 pos) → i64
at(GridEntry[11] self,u64 pos) → i64
at(GridEntry[11] self,u64 pos) → i64
at(GridEntry[11] self,u64 pos) → i64
at(GridEntry[11] self,u64 pos) → i64
at(GridEntry[11] self,u64 pos) → i64
std.mem.str unsafe
Standard library implementation of string operations using its own allocators and C memory operations.
This file is marked with the unsafe keyword. This means that its internal implementation (only) could be subject to bugs that the language's design otherwise eliminates. By using this file as a direct or indirect dependency you are trusting its implementation. Given this trust, consider other non-unsafe files using it as safe.
copy
Copies a string while. The result is nstr, that is, str-like that can be directly converted to a null-terminated version.
copy(Stack&[1] allocator,cstr _s) → nstr[5]
copy(Heap&[1] allocator,cstr _s) → nstr[5]
copy(Arena&[9] allocator,cstr _s) → nstr[5]
copy(Arena&[9] allocator,cstr _s) → nstr[5]
copy(Volatile&[9] allocator,cstr _s) → nstr[5]
copy(Volatile&[9] allocator,cstr _s) → nstr[5]
copy(Dynamic&[5] allocator,cstr _s) → nstr[5]
copy(Stack&[1] allocator,str[5] _s) → nstr[5]
copy(Heap&[1] allocator,str[5] _s) → nstr[5]
copy(Arena&[9] allocator,str[5] _s) → nstr[5]
copy(Arena&[9] allocator,str[5] _s) → nstr[5]
copy(Volatile&[9] allocator,str[5] _s) → nstr[5]
copy(Volatile&[9] allocator,str[5] _s) → nstr[5]
copy(Dynamic&[5] allocator,str[5] _s) → nstr[5]
copy(Stack&[1] allocator,nstr[5] _s) → nstr[5]
copy(Heap&[1] allocator,nstr[5] _s) → nstr[5]
copy(Arena&[9] allocator,nstr[5] _s) → nstr[5]
copy(Arena&[9] allocator,nstr[5] _s) → nstr[5]
copy(Volatile&[9] allocator,nstr[5] _s) → nstr[5]
copy(Volatile&[9] allocator,nstr[5] _s) → nstr[5]
copy(Dynamic&[5] allocator,nstr[5] _s) → nstr[5]
str
str(Stack&[1] allocator,u64 number) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(Heap&[1] allocator,u64 number) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(Arena&[9] allocator,u64 number) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(Arena&[9] allocator,u64 number) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(Volatile&[9] allocator,u64 number) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(Volatile&[9] allocator,u64 number) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(Dynamic&[5] allocator,u64 number) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(Stack&[1] allocator,i64 number) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(Heap&[1] allocator,i64 number) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(Arena&[9] allocator,i64 number) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(Arena&[9] allocator,i64 number) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(Volatile&[9] allocator,i64 number) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(Volatile&[9] allocator,i64 number) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(Dynamic&[5] allocator,i64 number) → str(nom,ptr contents,u64 length,char first,ptr memory)
str(Stack&[1] allocator,f64 number) → (str[5])
str(Heap&[1] allocator,f64 number) → (str[5])
str(Arena&[9] allocator,f64 number) → (str[5])
str(Arena&[9] allocator,f64 number) → (str[5])
str(Volatile&[9] allocator,f64 number) → (str[5])
str(Volatile&[9] allocator,f64 number) → (str[5])
str(Dynamic&[5] allocator,f64 number) → (str[5])
nstr
nstr(Stack&[1] allocator,i64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Heap&[1] allocator,i64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Arena&[9] allocator,i64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Arena&[9] allocator,i64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Volatile&[9] allocator,i64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Volatile&[9] allocator,i64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Dynamic&[5] allocator,i64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Stack&[1] allocator,u64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Heap&[1] allocator,u64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Arena&[9] allocator,u64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Arena&[9] allocator,u64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Volatile&[9] allocator,u64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Volatile&[9] allocator,u64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Dynamic&[5] allocator,u64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Stack&[1] allocator,f64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Heap&[1] allocator,f64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Arena&[9] allocator,f64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Arena&[9] allocator,f64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Volatile&[9] allocator,f64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Volatile&[9] allocator,f64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
nstr(Dynamic&[5] allocator,f64 number) → nstr(nom,ptr contents,u64 length,char first,ptr memory)
add
Overloads the + operator to concatenate two strings. The result is nstr, that is, str-like that can be directly converted to a null-terminated version.
add(Stack&[1] allocator,cstr _x,cstr _y) → nstr[5]
add(Heap&[1] allocator,cstr _x,cstr _y) → nstr[5]
add(Arena&[9] allocator,cstr _x,cstr _y) → nstr[5]
add(Arena&[9] allocator,cstr _x,cstr _y) → nstr[5]
add(Volatile&[9] allocator,cstr _x,cstr _y) → nstr[5]
add(Volatile&[9] allocator,cstr _x,cstr _y) → nstr[5]
add(Dynamic&[5] allocator,cstr _x,cstr _y) → nstr[5]
add(Stack&[1] allocator,str[5] _x,cstr _y) → nstr[5]
add(Heap&[1] allocator,str[5] _x,cstr _y) → nstr[5]
add(Arena&[9] allocator,str[5] _x,cstr _y) → nstr[5]
add(Arena&[9] allocator,str[5] _x,cstr _y) → nstr[5]
add(Volatile&[9] allocator,str[5] _x,cstr _y) → nstr[5]
add(Volatile&[9] allocator,str[5] _x,cstr _y) → nstr[5]
add(Dynamic&[5] allocator,str[5] _x,cstr _y) → nstr[5]
add(Stack&[1] allocator,nstr[5] _x,cstr _y) → nstr[5]
add(Heap&[1] allocator,nstr[5] _x,cstr _y) → nstr[5]
add(Arena&[9] allocator,nstr[5] _x,cstr _y) → nstr[5]
add(Arena&[9] allocator,nstr[5] _x,cstr _y) → nstr[5]
add(Volatile&[9] allocator,nstr[5] _x,cstr _y) → nstr[5]
add(Volatile&[9] allocator,nstr[5] _x,cstr _y) → nstr[5]
add(Dynamic&[5] allocator,nstr[5] _x,cstr _y) → nstr[5]
add(Stack&[1] allocator,cstr _x,str[5] _y) → nstr[5]
add(Heap&[1] allocator,cstr _x,str[5] _y) → nstr[5]
add(Arena&[9] allocator,cstr _x,str[5] _y) → nstr[5]
add(Arena&[9] allocator,cstr _x,str[5] _y) → nstr[5]
add(Volatile&[9] allocator,cstr _x,str[5] _y) → nstr[5]
add(Volatile&[9] allocator,cstr _x,str[5] _y) → nstr[5]
add(Dynamic&[5] allocator,cstr _x,str[5] _y) → nstr[5]
add(Stack&[1] allocator,str[5] _x,str[5] _y) → nstr[5]
add(Heap&[1] allocator,str[5] _x,str[5] _y) → nstr[5]
add(Arena&[9] allocator,str[5] _x,str[5] _y) → nstr[5]
add(Arena&[9] allocator,str[5] _x,str[5] _y) → nstr[5]
add(Volatile&[9] allocator,str[5] _x,str[5] _y) → nstr[5]
add(Volatile&[9] allocator,str[5] _x,str[5] _y) → nstr[5]
add(Dynamic&[5] allocator,str[5] _x,str[5] _y) → nstr[5]
add(Stack&[1] allocator,nstr[5] _x,str[5] _y) → nstr[5]
add(Heap&[1] allocator,nstr[5] _x,str[5] _y) → nstr[5]
add(Arena&[9] allocator,nstr[5] _x,str[5] _y) → nstr[5]
add(Arena&[9] allocator,nstr[5] _x,str[5] _y) → nstr[5]
add(Volatile&[9] allocator,nstr[5] _x,str[5] _y) → nstr[5]
add(Volatile&[9] allocator,nstr[5] _x,str[5] _y) → nstr[5]
add(Dynamic&[5] allocator,nstr[5] _x,str[5] _y) → nstr[5]
add(Stack&[1] allocator,cstr _x,nstr[5] _y) → nstr[5]
add(Heap&[1] allocator,cstr _x,nstr[5] _y) → nstr[5]
add(Arena&[9] allocator,cstr _x,nstr[5] _y) → nstr[5]
add(Arena&[9] allocator,cstr _x,nstr[5] _y) → nstr[5]
add(Volatile&[9] allocator,cstr _x,nstr[5] _y) → nstr[5]
add(Volatile&[9] allocator,cstr _x,nstr[5] _y) → nstr[5]
add(Dynamic&[5] allocator,cstr _x,nstr[5] _y) → nstr[5]
add(Stack&[1] allocator,str[5] _x,nstr[5] _y) → nstr[5]
add(Heap&[1] allocator,str[5] _x,nstr[5] _y) → nstr[5]
add(Arena&[9] allocator,str[5] _x,nstr[5] _y) → nstr[5]
add(Arena&[9] allocator,str[5] _x,nstr[5] _y) → nstr[5]
add(Volatile&[9] allocator,str[5] _x,nstr[5] _y) → nstr[5]
add(Volatile&[9] allocator,str[5] _x,nstr[5] _y) → nstr[5]
add(Dynamic&[5] allocator,str[5] _x,nstr[5] _y) → nstr[5]
add(Stack&[1] allocator,nstr[5] _x,nstr[5] _y) → nstr[5]
add(Heap&[1] allocator,nstr[5] _x,nstr[5] _y) → nstr[5]
add(Arena&[9] allocator,nstr[5] _x,nstr[5] _y) → nstr[5]
add(Arena&[9] allocator,nstr[5] _x,nstr[5] _y) → nstr[5]
add(Volatile&[9] allocator,nstr[5] _x,nstr[5] _y) → nstr[5]
add(Volatile&[9] allocator,nstr[5] _x,nstr[5] _y) → nstr[5]
add(Dynamic&[5] allocator,nstr[5] _x,nstr[5] _y) → nstr[5]
std.os unsafe
Standard library wrapping of C system calls and of process management using C popen.
This file is marked with the unsafe keyword. This means that its internal implementation (only) could be subject to bugs that the language's design otherwise eliminates. By using this file as a direct or indirect dependency you are trusting its implementation. Given this trust, consider other non-unsafe files using it as safe.
Process
A running process whose stdout can be read as a file-like object.
Process(nom,ptr contents) → (nom,ptr contents)
to_end
Reads all remaining output from the process without returning it, moving to EOF. Returns a boolean indicating whether "Error:" is part of the output.
to_end(Process&[2] p) → bool
open
Opens a Process given a command string. This starts the process and lets you read its output.
open(Process&[2],cstr _command) → Process[2]
open(Process&[2],nstr[5] _command) → Process[2]
open(Process&[2],str[5] command) → (Process[2])
next_chunk
Reads the next chunk of process output into a provided buffer.
next_chunk(Arena&[9] reader,Process&[2] p,nstr&[5] value) → bool
next_chunk(Arena&[9] reader,Process&[2] p,nstr&[5] value) → bool
next_chunk(Volatile&[9] reader,Process&[2] p,nstr&[5] value) → bool
next_chunk(Volatile&[9] reader,Process&[2] p,nstr&[5] value) → bool
next_chunk(Arena&[9] memory,Process&[2] p,str&[5] value) → bool
next_chunk(Arena&[9] memory,Process&[2] p,str&[5] value) → bool
next_chunk(Volatile&[9] memory,Process&[2] p,str&[5] value) → bool
next_chunk(Volatile&[9] memory,Process&[2] p,str&[5] value) → bool
next_line
Reads the next line of process output into a provided buffer.
next_line(Arena&[9] reader,Process&[2] p,nstr&[5] value) → bool
next_line(Arena&[9] reader,Process&[2] p,nstr&[5] value) → bool
next_line(Volatile&[9] reader,Process&[2] p,nstr&[5] value) → bool
next_line(Volatile&[9] reader,Process&[2] p,nstr&[5] value) → bool
next_line(Arena&[9] memory,Process&[2] p,str&[5] value) → bool
next_line(Arena&[9] memory,Process&[2] p,str&[5] value) → bool
next_line(Volatile&[9] memory,Process&[2] p,str&[5] value) → bool
next_line(Volatile&[9] memory,Process&[2] p,str&[5] value) → bool
system
system(cstr command) → ()
system(str[5] command) → ()
system(str[5] command) → ()
system(str[5] command) → ()
system(str[5] command) → ()
system(str[5] command) → ()
system(str[5] command) → ()
system(str[5] command) → ()
system(str[5] command) → ()
std.rand unsafe
Standard library porting Xoshiro256plus random numbers from https://prng.di.unimi.it/. These and are NOT cryptographically secure.
This file is marked with the unsafe keyword. This means that its internal implementation (only) could be subject to bugs that the language's design otherwise eliminates. By using this file as a direct or indirect dependency you are trusting its implementation. Given this trust, consider other non-unsafe files using it as safe.
__rotl
__rotl(u64 x,u64 k) → u64
splitmix64
Computes the next random number of a splitmix64 sequence using the mutable unsigned int argument as state to be updated.This is not cryptographically secure and also has small period of 2^64 so usage is not recommended for long-running sequences.It is, however, much faster than using a Rand state with next.
splitmix64(u64& x) → u64
next
Computes the next random number of a Rand sequence.
next(u64& self.s0,u64& self.s1,u64& self.s2,u64& self.s3) → f64
Rand
This a structural type for storing the progress of random number generators on four u64 state fields. It can be initialized with an optional seed, which defaults to a time-based initialization if not provided. For safety against sharing random implementations between services or repeatedly initializating them, state variables are marked as a leaking resource. The whole data type as a whole is marked as @noborrow. These safety mechanisms are not mandatory but help safeguard speed by preventing common mistakes, such as directly re-initializing Rand in each loop to get a next number. Its period is 2^256-1
Rand(u64 seed) → (u64 s0,u64 s1,u64 s2,u64 s3)
Rand() → Rand(u64 seed)
std.time unsafe
Standard library wrapping of C time (provided by posix time.h or windows.h).
This file is marked with the unsafe keyword. This means that its internal implementation (only) could be subject to bugs that the language's design otherwise eliminates. By using this file as a direct or indirect dependency you are trusting its implementation. Given this trust, consider other non-unsafe files using it as safe.
sleep
Make the current service wait for AT LEAST a number of f64 seconds.While yielding, other services may be called asynchronously to fill inthe missing time. There is no guarantee for this, though.Sleeping for 0.0 duration does not incur delays, but may still runother services. Negative durations skip over this. Use exact_sleppto sleep without yielding and thus get a guarantee on the sleepduration. This method's exact implementation is ported from the runtime.
sleep(f64 duration) → ()
exact_sleep
Make the current service wait for exactly a specified numberof f64 seconds. Control flow is not transferred to other services,so use sparingly (e.g., in main game loops).
exact_sleep(f64 duration) → ()
time
Retrieve time elapsed from the start of the program in f64 seconds.
time() → f64
std.vec unsafe
Standard library implementation of vectors that are allocated with safe memory management but use C pointers for element access.
This file is marked with the unsafe keyword. This means that its internal implementation (only) could be subject to bugs that the language's design otherwise eliminates. By using this file as a direct or indirect dependency you are trusting its implementation. Given this trust, consider other non-unsafe files using it as safe.
Vec
Vec(nom,ptr contents,u64 size,ptr surface) → (nom,ptr contents,u64 size,ptr surface)
dot
dot(Vec[4] x1,Vec[4] x2) → f64
vector
vector(Stack&[1] memory,u64 size) → Vec[4]
vector(Heap&[1] memory,u64 size) → Vec[4]
vector(Arena&[9] memory,u64 size) → Vec[4]
vector(Arena&[9] memory,u64 size) → Vec[4]
vector(Volatile&[9] memory,u64 size) → Vec[4]
vector(Volatile&[9] memory,u64 size) → Vec[4]
vector(Dynamic&[5] memory,u64 size) → Vec[4]
vector(Stack&[1] memory,u64& rand.s0,u64& rand.s1,u64& rand.s2,u64& rand.s3,u64 size) → Vec[4]
vector(Heap&[1] memory,u64& rand.s0,u64& rand.s1,u64& rand.s2,u64& rand.s3,u64 size) → Vec[4]
vector(Arena&[9] memory,u64& rand.s0,u64& rand.s1,u64& rand.s2,u64& rand.s3,u64 size) → Vec[4]
vector(Arena&[9] memory,u64& rand.s0,u64& rand.s1,u64& rand.s2,u64& rand.s3,u64 size) → Vec[4]
vector(Volatile&[9] memory,u64& rand.s0,u64& rand.s1,u64& rand.s2,u64& rand.s3,u64 size) → Vec[4]
vector(Volatile&[9] memory,u64& rand.s0,u64& rand.s1,u64& rand.s2,u64& rand.s3,u64 size) → Vec[4]
vector(Dynamic&[5] memory,u64& rand.s0,u64& rand.s1,u64& rand.s2,u64& rand.s3,u64 size) → Vec[4]
vector(u64& rand.s0,u64& rand.s1,u64& rand.s2,u64& rand.s3,Stack&[1] memory,u64 size) → Vec[4]
vector(u64& rand.s0,u64& rand.s1,u64& rand.s2,u64& rand.s3,Heap&[1] memory,u64 size) → Vec[4]
vector(u64& rand.s0,u64& rand.s1,u64& rand.s2,u64& rand.s3,Arena&[9] memory,u64 size) → Vec[4]
vector(u64& rand.s0,u64& rand.s1,u64& rand.s2,u64& rand.s3,Arena&[9] memory,u64 size) → Vec[4]
vector(u64& rand.s0,u64& rand.s1,u64& rand.s2,u64& rand.s3,Volatile&[9] memory,u64 size) → Vec[4]
vector(u64& rand.s0,u64& rand.s1,u64& rand.s2,u64& rand.s3,Volatile&[9] memory,u64 size) → Vec[4]
vector(u64& rand.s0,u64& rand.s1,u64& rand.s2,u64& rand.s3,Dynamic&[5] memory,u64 size) → Vec[4]
put
put(Vec&[4] v,u64 pos,f64 value) → Vec[4]
put(Vec&[4] x1,Vec[4] x2) → ()
print
Prints a vector to the console.
print(Vec[4] v) → ()
slice
Slices a vector from a given to an ending position. This is a transparent view of vector data.
slice(Vec[4] v,u64 from,u64 to) → Vec[4]
add
add(Stack&[1] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
add(Heap&[1] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
add(Arena&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
add(Arena&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
add(Volatile&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
add(Volatile&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
add(Dynamic&[5] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
add(Vec&[4] result,Vec[4] x1,Vec[4] x2) → Vec[4]
sub
sub(Stack&[1] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
sub(Heap&[1] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
sub(Arena&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
sub(Arena&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
sub(Volatile&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
sub(Volatile&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
sub(Dynamic&[5] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
sub(Vec&[4] result,Vec[4] x1,Vec[4] x2) → Vec[4]
mul
mul(Stack&[1] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
mul(Heap&[1] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
mul(Arena&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
mul(Arena&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
mul(Volatile&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
mul(Volatile&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
mul(Dynamic&[5] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
mul(Vec&[4] result,Vec[4] x1,Vec[4] x2) → Vec[4]
div
div(Stack&[1] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
div(Heap&[1] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
div(Arena&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
div(Arena&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
div(Volatile&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
div(Volatile&[9] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
div(Dynamic&[5] memory,Vec[4] x1,Vec[4] x2) → Vec[4]
div(Vec&[4] result,Vec[4] x1,Vec[4] x2) → Vec[4]
len
len(Vec[4] v) → u64
at
at(Vec[4] v,u64 pos) → f64