FunC standard library
This section discusses the stdlib.fc library with standard functions used in FunC.
Currently, the library is just a wrapper for the most common assembler of the TVM commands which are not built-in. Each TVM command description used in the library can be found in the TVM documentation section. Some descriptions were borrowed for this document.
Some functions are commented out in the file. It means that they have already become built-ins for optimization purposes. However, the type signature and semantics remain the same.
Note that some less common commands are not presented in the stdlib. Someday they will also be added.
Tuple manipulation primitives
The names and the types are mostly self-explaining. See polymorhism with forall for more info on the polymorphic functions.
Note that currently values of atomic type tuple
cannot be cast into composite tuple types (e.g. [int, cell]
) and vise versa.
Lisp-style lists
Lists can be represented as nested 2-element tuples. Empty list is conventionally represented as TVM null
value (it can be obtained by calling null()
). For example, the tuple (1, (2, (3, null)))
represents the list [1, 2, 3]
. Elements of a list can be of different types.