Skip to content

semio-ai/arora-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arora Schemas

Common schemas used by the engine. These schemas are somewhat redundant with Semio Records, but it is quite a lot of work to switch to Semio Records.

High-level vs. low-level schemas

High-level schemas use names to reference other entities. Names are meant to be resolved using a registry, or local indexes associating UUIDs to names.

Low-level schemas are produced for contexts where UUIDs are sufficient, if not more efficient for looking them up.

Module

The "high-level" ModuleDefinition is used to describe completely a module to implement. It is usually saved as a module.yaml file (using serde-yaml). It can be used by the code generators of arora-module-cli to produce the proper bindings for a module.

The "low-level" format of a module is called a Header, and is produced by the code generators under the file name header.yaml. It is used to load the module in the engine, with arora-cli.

Modules may export symbols, so that they can be called by any client. Modules may also declare symbols to import from other modules, so that the right bindings are made available in the implementation. The only symbols supported so far are functions. Their declaration may involve references to existing types:

  • directly (TypeRef::Scalar)
  • as the element type of an array (TypeRef::Array)
  • as the key or value type of a map (TypeRef::Map). This kind of reference is not supported in this project, in practice.

Type (ty)

Structured types can be described in both high-level or low-level ways, so that they can be used in both high-level or low-level modules. This library can describe:

  • primitive types, equivalent in Rust to: bool, u8, u16, u32, u64, i8, i16, i32, i64, f32, f64, String.
  • enumerations, similar to Rust enums: each variant can hold a value of any other type, and do not necessarily translate into an integer.
  • structures, similar to Rust structs and C / C++ PODs: each field has a name and holds a value.

Value

A Value describes a value defined in the low-level type schema. It is generic and can also be serialized (using serde. For other kind of conversions a common error type is suggested: arora-schema::value::ConversionError.

Values are useful at runtime to pass arguments to functions, but also to describe default_values for function parameters.

Note: we call "parameter" the declaration of what function may accept as inputs (or outputs, if mutable). We call "argument" the actual value passed to the function.

About

Core types for Arora to describe values, types, functions and modules.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages