From c5c821cf7567bc1109713f54636541861b1c8a70 Mon Sep 17 00:00:00 2001 From: jeshecdom Date: Mon, 24 Nov 2025 17:36:12 +0100 Subject: [PATCH] feat: types pages. --- docs.json | 1 + languages/fift/types.mdx | 45 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 languages/fift/types.mdx diff --git a/docs.json b/docs.json index f641014a5..71c38302d 100644 --- a/docs.json +++ b/docs.json @@ -404,6 +404,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..2f04f5660 --- /dev/null +++ b/languages/fift/types.mdx @@ -0,0 +1,45 @@ +--- +title: "Types" +sidebarTitle: "Types" +noindex: "true" +--- + +import { Aside } from '/snippets/aside.jsx'; + +The Fift stack can contain values of the following types: + +| | | +| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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 a mutable structure used to construct a cell by adding data and references to other cells. | +| `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. Tuples can be used to represent values of arbitrary algebraic data types and Lisp-style lists. | +| `String` | An UTF-8 string. | +| `Bytes` | An arbitrary sequence of 8-bit bytes, typically used to represent binary data. | +| `WordList` | A partially created list of word references, used for creating a new `WordDef`. | +| `WordDef` | An execution token, usually representing the definition of an existing Fift word. | +| `Box` | A container occupying one stack slot, that can be used to store one value of any type. Usually used to represent variables. | +| `Atom` | A simple entity uniquely identified by its name, a string. Can be used to represent identifiers, labels, operation names, tags, and stack markers. | +| `Object` | An arbitrary C++ object of any class derived from base class `td::CntObject`. It may be used by Fift extensions to manipulate other data types and interface with other C++ libraries. | + +The first six types listed above are shared with TVM; the remainder are Fift-specific. + + + +