Crate cairo_lang_sierra

Source
Expand description

Sierra is an intermediate representation between high level Cairo and compilation targets, such as CASM. Sierra code is guaranteed to be “safe”* by construction. Sierra has a primitive, yet rich typing system to express all high level code while guaranteeing safety and allowing for efficient compilation down to the target.

Safety - this means a few things:

  1. There are no “panics” / “runtime errors”. Every function is guaranteed to return.
  2. There are no infinite loops. Moreover, every program “counts” its own steps, and returns when the limit is reached.
  3. Builtin library functions are always used correctly.

Modules§

algorithm
debug_info
edit_state
extensions
fmt
ids
program
program_registry
simulation

Macros§

define_concrete_libfunc_hierarchy
Forms a concrete library function type from an enum of library calls. The new enum implements ConcreteLibfunc. All the variant types must also implement ConcreteLibfunc. Usage example:
define_libfunc_hierarchy
Forms a libfunc type from an enum of libfuncs. The new enum implements GenericLibfunc. All the variant types must also implement GenericLibfunc. Usage example:
define_type_hierarchy
Forms a Sierra type used by extensions type from an enum of such types. The new enum implements GenericType. All the variant types must also implement GenericType. Usage example:

Type Aliases§

ConcreteLibfuncLongIdParser
ConcreteTypeLongIdParser
ProgramParser