Skip to content
Open
76 changes: 76 additions & 0 deletions foundations/whitepapers/comments.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: "Whitepapers comments"
---

Clarifications and status notes for the whitepapers.

## TON Virtual Machine (tvm.pdf)

Check warning on line 7 in foundations/whitepapers/comments.mdx

View workflow job for this annotation

GitHub Actions / Spelling

Unknown word (tvm) Suggestions: (TVM, TVMs, tam, tem, tom)

### 1.3.2. List of control registers

The zero element of the `c7` tuple is an environment information (which itself is also a tuple). The remaining 255 slots are used for global variables. [`[i] SETGLOB`](/tvm/instructions#f87_-setglob) modifies `c7`, inserting an element with index `i`, [`[i] GETGLOB`](/tvm/instructions#f85_-getglob) reads `i`-th element from `c7`. See [TVM > Registers](/tvm/registers#c7-%E2%80%94-environment-information-and-global-variables) for details.

### 4.4. Continuations as objects

It is possible to construct such objects, however, no high-level language implemented it yet.

### 4.5.7. List of predefined exceptions

Exit code `11` is thrown by [standard function selector](/tvm/registers#c3-—-function-selector) if there is no function with given id. Also it is thrown by [`SENDMSG`](/tvm/instructions#fb08-sendmsg) in case of invalid message.

### 5.1. Codepages and interoperability of different TVM versions

Currently only codepage `0` implemented.

### A. Instructions and opcodes

Basic gas price is `10 + b`, not `10 + b + 5r`. See [TVM > Gas](/tvm/gas) for details.

Provided instruction list is obsolete. Consider use [TVM > Instructions](/tvm/instructions).

### B.2. Step function of TVM

"Reference implementation of TVM" and codepages `-1` and `-2` are not implemented yet.

## Fift, `fiftbase.pdf`

### 1 Overview

> The dictionary is supposed to be split into several vocabularies, or namespaces; however, namespaces are not implemented yet, so all words are currently defined in the same global namespace.

Namespaces and context switching are now implemented — Fift words are defined in the default dictionary and accessible through the global namespace called `Fift`.

It is now possible to add new namespaces with the `namespace` word or switch dictionary contexts on the fly. It is also possible to define words or named constants directly under those namespaces and reference words from different namespaces:

```fift
namespace My

"a" constant a
"b" constant b
"c" constant c

a b c .s { drop } 3 times // "a" "b" "c"

My definitions
"b-my" constant b
"c-my" constant c
"d-my" constant d

a b c d .s { drop } 4 times // "a" "b-my" "c-my" "d-my"

Fift definitions
a b c .s { drop } 3 times // "a" "b-my" "c-my" "d-my"

My b My c My d .s { drop } 3 times // "b-my" "c-my" "d-my"
a b c .s { drop } 3 times // "a" "b" "c" "d"

My definitions
a b c d .s { drop } 4 times // "a" "b-my" "c-my" "d-my"
Fift a Fift b Fift c d .s { drop } 4 times // "a" "b" "c" "d-my"

Fift definitions
cr
My-wordlist @
{ drop type -1 } hmapforeach drop cr // "b " "d " "c "
```

Loading