diff --git a/docs.json b/docs.json index efe98fa1a..a264cc1e4 100644 --- a/docs.json +++ b/docs.json @@ -469,6 +469,7 @@ "group": "Fift", "pages": [ "languages/fift/overview", + "languages/fift/types", "languages/fift/fift-and-tvm-assembly", "languages/fift/deep-dive", "languages/fift/multisig", diff --git a/languages/fift/types.mdx b/languages/fift/types.mdx new file mode 100644 index 000000000..d015e9678 --- /dev/null +++ b/languages/fift/types.mdx @@ -0,0 +1,52 @@ +--- +title: "Types" +sidebarTitle: "Types" +noindex: "true" +--- + +import { Aside } from '/snippets/aside.jsx'; + +The Fift stack can contain values of the following types: + +| Type | Description | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Integer` | A TVM signed 257-bit integer. | +| `Cell` | A [TVM cell](/foundations/serialization/cells) for persistent data storage on TON Blockchain. A cell consists of up to `1023` data bits and up to `4` references to other cells. | +| `Slice` | A TVM slice is a read-only view of a TVM cell that allows sequential access to the cell's data and references. A cell can be converted into a slice, extracting stored bits and references without modifying the original cell. | +| `Builder` | A TVM builder is used to construct a cell by adding data and cell references. | +| `Null` | The TVM Null type has exactly one value `null`. In Fift, `null` is mostly used to initialize `Box`'es, hashmaps and lists. Usually denoted by `⊥`. | +| `Tuple` | A tuple is an ordered collection of values of any of the Fift types in this list, where each value is not necessarily of the same type. | +| `Continuation` | A [TVM continuation](/tvm/continuations) employed for execution of [TVM code](/tvm/instructions). | +| `String` | A UTF-8 string. | +| `Bytes` | An arbitrary sequence of 8-bit bytes, typically used to represent binary data. | +| `Box` | A container occupying one stack slot, that can be used to store one value of any type. Usually used to represent variables and mutable data structures. | +| `Atom` | A simple entity uniquely identified by its name. Can be used to represent identifiers, labels, operation names, tags, and stack markers. | +| `Object` | An arbitrary C++ object. Entities like word lists, execution tokens and Fift hashmaps are represented as having the type `Object`. This type may also be used by Fift extensions to manipulate other data types and interface with other C++ libraries. | + +The first seven types listed above are shared with TVM; the remainder are Fift-specific. + + + + + +