ddc-core-flow-0.3.2.1: Disciplined Disciple Compiler data flow compiler.

Safe HaskellNone

DDC.Core.Flow

Contents

Description

Disciple Core Flow is a Domain Specific Language (DSL) for writing first order data flow programs.

Synopsis

Language profile

profile :: Profile NameSource

Language profile for Disciple Core Flow.

Names

data Name Source

Names of things used in Disciple Core Flow.

Constructors

NameVar String

User defined variables.

NameVarMod Name String

A name generated by modifying some other name `name$mod`

NameCon String

A user defined constructor.

NameKiConFlow KiConFlow

Fragment specific kind constructors.

NameTyConFlow TyConFlow

Fragment specific type constructors.

NameDaConFlow DaConFlow

Fragment specific data constructors.

NameOpFlow OpFlow

Flow operators.

NameOpLoop OpLoop

Loop operators.

NameOpStore OpStore

Store operators.

NamePrimTyCon PrimTyCon

A primitive type constructor.

NamePrimArith PrimArith

Primitive arithmetic, logic, comparison and bit-wise operators.

NamePrimCast PrimCast

Primitive casting between numeric types.

NameLitBool Bool

A boolean literal.

NameLitNat Integer

A natural literal.

NameLitInt Integer

An integer literal.

NameLitWord Integer Int

A word literal.

data TyConFlow Source

Fragment specific type constructors.

Constructors

TyConFlowTuple Int

TupleN# constructor. Tuples.

TyConFlowVector

Vector# constructor. Vectors.

TyConFlowSeries

Series# constructor. Series types.

TyConFlowSegd

Segd# constructor. Segment Descriptors.

TyConFlowSel Int

SelN# constructor. Selectors.

TyConFlowRef

Ref# constructor. References.

TyConFlowWorld

World# constructor. State token used when converting to GHC core.

TyConFlowRateNat

RateNat# constructor. Naturals witnessing a type-level Rate.

data PrimTyCon

Primitive type constructors.

Constructors

PrimTyConVoid

Void# the Void type has no values.

PrimTyConBool

Bool# unboxed booleans.

PrimTyConNat

Nat# natural numbers. Big enough to count every addressable byte in the store.

PrimTyConInt

Int# signed integers.

PrimTyConWord Int

WordN# machine words of the given width.

PrimTyConFloat Int

FloatN# floating point numbers of the given width.

PrimTyConTag

Tag# data constructor tags.

PrimTyConAddr

Addr# raw machine addresses. Unlike pointers below, a raw Addr# need not to refer to memory owned by the current process.

PrimTyConPtr

Ptr# should point to a well-formed object owned by the current process.

PrimTyConString

String# of UTF8 characters.

These are primitive until we can define our own unboxed types.

data PrimArith

Primitive arithmetic, logic, and comparison opretors. We expect the backend/machine to be able to implement these directly.

For the Shift Right operator, the type that it is used at determines whether it is an arithmetic (with sign-extension) or logical (no sign-extension) shift.

Constructors

PrimArithNeg

Negation

PrimArithAdd

Addition

PrimArithSub

Subtraction

PrimArithMul

Multiplication

PrimArithDiv

Division

PrimArithMod

Modulus

PrimArithRem

Remainder

PrimArithEq

Equality

PrimArithNeq

Negated Equality

PrimArithGt

Greater Than

PrimArithGe

Greater Than or Equal

PrimArithLt

Less Than

PrimArithLe

Less Than or Equal

PrimArithAnd

Boolean And

PrimArithOr

Boolean Or

PrimArithShl

Shift Left

PrimArithShr

Shift Right

PrimArithBAnd

Bit-wise And

PrimArithBOr

Bit-wise Or

PrimArithBXOr

Bit-wise eXclusive Or

data PrimCast

Primitive cast between two types.

The exact set of available casts is determined by the target platform. For example, you can only promote a Nat# to a Word32# on a 32-bit system. On a 64-bit system the Nat# type is 64-bits wide, so casting it to a Word32# would be a truncation.

Constructors

PrimCastPromote

Promote a value to one of similar or larger width, without loss of precision.

PrimCastTruncate

Truncate a value to a new width, possibly losing precision.

Name Parsing

readName :: String -> Maybe NameSource

Read the name of a variable, constructor or literal.

Program Lexing

lexModuleString :: String -> Int -> String -> [Token (Tok Name)]Source

Lex a string to tokens, using primitive names.

The first argument gives the starting source line number.

lexExpString :: String -> Int -> String -> [Token (Tok Name)]Source

Lex a string to tokens, using primitive names.

The first argument gives the starting source line number.