Libs

Prelude

The Prelude module contains commonly used functions and types that are imported implicitly into every module. Types Str A string type that owns its contents. Strings in Ante are null terminated and contain a length field. type Str = c8* cStr, usz len Examples let s1 = "Hello" let s2 = Str("Hello".cStr, 5usz) let s3 = Str(strdup "hi", 2usz) Maybe ’t Represents either the presence of a value with Some, or the absence of a value with None.

Continue reading

Vec

The Vec module contains the vector type, a container for a dynamically-allocated contiguous region of memory with constant time access and the ability to resize. Types Vec ’t The main vector type exported by the module. type Vec 't = 't* data, usz len cap Examples Creating a Vec and pushing to it: mut v = Vec.empty () v.push 2 v.push 4 Creating a Vec from an array:

Continue reading

Build

The Build module defines several useful functions for compiling and linking applications. It defines a DSL for building programs centered around the creation of targets. Each target represents a single output file and contains a list of dependencies and a build action. If any of its dependencies are changed the build action is executed. Although this build system is defined in Ante it can also be used to build programs for abitrary languages and has built-in support (automatic dependency management) for Ante, C, and C++.

Continue reading