ddc-core-salt-0.4.1.3: Disciplined Disciple Compiler C code generator.

Safe HaskellNone

DDC.Core.Salt.Runtime

Contents

Description

Bindings to functions exported by the runtime system, and wrappers for related primops.

Synopsis

Runtime Config

data Config Source

Runtime system configuration

Constructors

Config 

Fields

configHeapSize :: Integer

Used a fixed-size heap of this many bytes.

runtimeImportKinds :: Map Name (ImportSource Name)Source

Kind signatures for runtime types that we use when converting to Salt.

runtimeImportTypes :: Map Name (ImportSource Name)Source

Type signatures for runtime funtions that we use when converting to Salt.

Types defined in the runtime system.

rTop :: Type NameSource

The top-level region. This region lives for the whole program, and is used to store objects whose types don't have region annotations (like function closures and Unit values).

Functions defined in the runtime system.

xGetTag :: a -> Type Name -> Exp a Name -> Exp a NameSource

Get the constructor tag of an object.

xAllocBoxed :: a -> Type Name -> Integer -> Exp a Name -> Exp a NameSource

Allocate a Boxed object.

xGetFieldOfBoxedSource

Arguments

:: a 
-> Type Name

Prime region var of object.

-> Type Name

Type of field object

-> Exp a Name

Object to update.

-> Integer

Field index.

-> Exp a Name 

Get a field of a Boxed object.

xSetFieldOfBoxedSource

Arguments

:: a 
-> Type Name

Prime region var of object.

-> Type Name

Region of field object.

-> Exp a Name

Object to update.

-> Integer

Field index.

-> Exp a Name

New field value.

-> Exp a Name 

Set a field in a Boxed Object.

xAllocRawSmall :: a -> Type Name -> Integer -> Exp a Name -> Exp a NameSource

Allocate a RawSmall object.

xPayloadOfRawSmall :: a -> Type Name -> Exp a Name -> Exp a NameSource

Get the payload of a RawSmall object.

Calls to primops.

xCreate :: a -> Integer -> Exp a NameSource

Create the heap.

xRead :: a -> Type Name -> Exp a Name -> Integer -> Exp a NameSource

Read a value from an address plus offset.

xWrite :: a -> Type Name -> Exp a Name -> Integer -> Exp a Name -> Exp a NameSource

Write a value to an address plus offset.

xPeekBuffer :: a -> Type Name -> Type Name -> Exp a Name -> Integer -> Exp a NameSource

Peek a value from a buffer pointer plus offset

xPokeBuffer :: a -> Type Name -> Type Name -> Exp a Name -> Integer -> Exp a Name -> Exp a NameSource

Poke a value from a buffer pointer plus offset

xFail :: a -> Type Name -> Exp a NameSource

Fail with an internal error.

xReturn :: a -> Type Name -> Exp a Name -> Exp a NameSource

Return a value. like (return] x)