Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Fix outdated value types in environment-concepts #560

Merged
merged 3 commits into from
Sep 19, 2023

Conversation

jayz22
Copy link
Contributor

@jayz22 jayz22 commented Sep 7, 2023

No description provided.

@stellar-jenkins
Copy link

@stellar-jenkins
Copy link

docs/fundamentals-and-concepts/environment-concepts.mdx Outdated Show resolved Hide resolved
@@ -66,7 +66,7 @@ Host objects can be passed (by handle) directly to storage routines or between c

All host functions can accept as arguments and return values from, at most, the limited Wasm VM repertoire of machine-level types. To simplify matters, Soroban further limits all host functions to passing and returning values from within a single specialized form of 64-bit integers called "value" or "the value type". Through careful bit-packing, the value type can encode any of several separate types more meaningful to users than just "integers".

Specifically, the value type can directly encode 63-bit unsigned integers (equivalent to positive signed 64-bit numbers), but also boolean true and false, signed or unsigned 32-bit integers, typed host object handles, typed error codes, small symbols (up to 10 latin-alphanumeric characters), small bitsets (up to 60 bits), or a unique void value. Individual bits in a value are allocated to tagging and switching between these cases dynamically, and host functions or objects that require specific cases may reject values of other cases.
Specifically, the value type can directly encode small integers (up to 56 bits), but also boolean true and false, signed or unsigned 32-bit integers, typed host object handles, typed error codes, small symbols (up to 9 latin-alphanumeric characters), or a unique void value. Individual bits in a value are allocated to tagging and switching between these cases dynamically, and host functions or objects that require specific cases may reject values of other cases.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @graydon to check, I lost track of how the small encodings actually work now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this is all fine

@graydon graydon merged commit 91dfe3d into stellar-deprecated:main Sep 19, 2023
@stellar-jenkins
Copy link

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants