Install

The Anchor language

tare-lang is a second implementation of the Anchor language: the same macros and types, generating leaner code around your handlers.

Entrypoint

The entrypoint borrows the loader’s input buffer. A cursor walks the account records to find the instruction data and the program ID, and materializes an account only when a handler uses it. No vector of account infos is allocated and no reference-counted graph is built. Duplicate accounts resolve to the same backing record.

Dispatch

#[program] emits direct dispatch on the 8-byte discriminator to a wrapper per handler. Instruction-name logs are constant byte strings. The legacy IDL instructions keep their own dispatcher, apart from ordinary instruction bodies.

Accounts and constraints

#[derive(Accounts)] follows stock extraction and constraint order. It covers typed and unchecked accounts, signers, programs, interfaces, sysvars, account loaders, optional and boxed accounts and composite groups, with constraints for initialization, payer and signature, seeds and bumps, ownership, addresses, relations, custom predicates, zero, close and reallocation.

Fixed primitive layouts are read and written as views over the account’s own bytes, with field offsets verified against the Borsh layout. Other layouts use snapshots that are serialized back only when a handler changed them.

No validation check is dropped. What is removed is the work around the checks.

CPI and SPL

CpiContext, generated cpi:: clients, declare_program! bindings, return values, events and event CPI use the same instruction bytes and account order as stock. The anchor-spl surface is implemented for token, token-2022, token-interface, associated-token, token extensions, metadata and memo, calling the real SPL programs.

Errors

Error codes, messages, account names and compared values stay observable, formatted on the stack. Error order under several simultaneous faults is part of what tare prove compares.