runtime

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const KDebug = false

Variables

This section is empty.

Functions

func ToBool

func ToBool(rt *Runtime, o Object) (bool, error)

func ToFunc

func ToFunc(rt *Runtime, o Object) (unsafe.Pointer, uint8, error)

func ToNative

func ToNative(rt *Runtime, o Object) (unsafe.Pointer, unsafe.Pointer, error)

func ToOption

func ToOption(rt *Runtime, o Object) (Object, []Object, error)

func ToRecordFields

func ToRecordFields(rt *Runtime, o Object) ([]struct {
	K TString
	V Object
}, error)

func ToUnit

func ToUnit(rt *Runtime, o Object) (struct{}, error)

Types

type DefName

type DefName string

type Id added in v1.0.2

type Id uint32

type InstanceKind

type InstanceKind uint8
const (
	InstanceKindUnknown InstanceKind = iota
	InstanceKindUnit
	InstanceKindInt
	InstanceKindFloat
	InstanceKindString
	InstanceKindChar
	InstanceKindRecord
	InstanceKindTuple
	InstanceKindList
	InstanceKindOption
	InstanceKindFunction
	InstanceKindClosure
	InstanceKindNative
)

type ModuleName

type ModuleName string

type Object

type Object uint64

func FindRecordField

func FindRecordField(rt *Runtime, o Object, name TString) (Object, bool, error)

func ToList

func ToList(rt *Runtime, o Object) ([]Object, error)

func ToTuple

func ToTuple(rt *Runtime, o Object) ([]Object, error)

func UpdateRecordField

func UpdateRecordField(rt *Runtime, o Object, key Object, value Object) (Object, error)

func (Object) Kind

func (o Object) Kind() InstanceKind

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

func GetById added in v1.0.2

func GetById(id Id) *Runtime

func NewRuntime

func NewRuntime(program *bytecode.Binary, libsPath string) (*Runtime, error)

func (*Runtime) AppendFrameMemory added in v1.0.2

func (rt *Runtime) AppendFrameMemory(mem unsafe.Pointer)

func (*Runtime) Apply

func (rt *Runtime) Apply(defName bytecode.FullIdentifier, args ...Object) (Object, error)

func (*Runtime) ApplyFunc

func (rt *Runtime) ApplyFunc(fn Object, args ...Object) (Object, error)

func (*Runtime) Clean

func (rt *Runtime) Clean(keepCapacity bool)

func (*Runtime) Destroy added in v1.0.2

func (rt *Runtime) Destroy()

func (*Runtime) FreeFrameMemory added in v1.0.2

func (rt *Runtime) FreeFrameMemory(free func(unsafe.Pointer))

func (*Runtime) Id added in v1.0.2

func (rt *Runtime) Id() Id

func (*Runtime) NewBool

func (rt *Runtime) NewBool(b bool) Object

func (*Runtime) NewChar

func (rt *Runtime) NewChar(r TChar) Object

func (*Runtime) NewFloat

func (rt *Runtime) NewFloat(f TFloat) Object

func (*Runtime) NewFunc added in v1.0.2

func (rt *Runtime) NewFunc(ptr unsafe.Pointer, arity uint8) Object

func (*Runtime) NewFunc0

func (rt *Runtime) NewFunc0(f func() Object) Object

func (*Runtime) NewFunc1

func (rt *Runtime) NewFunc1(f func(Object) Object) Object

func (*Runtime) NewFunc2

func (rt *Runtime) NewFunc2(f func(Object, Object) Object) Object

func (*Runtime) NewFunc3

func (rt *Runtime) NewFunc3(f func(Object, Object, Object) Object) Object

func (*Runtime) NewFunc4

func (rt *Runtime) NewFunc4(f func(Object, Object, Object, Object) Object) Object

func (*Runtime) NewFunc5

func (rt *Runtime) NewFunc5(f func(Object, Object, Object, Object, Object) Object) Object

func (*Runtime) NewFunc6

func (rt *Runtime) NewFunc6(f func(Object, Object, Object, Object, Object, Object) Object) Object

func (*Runtime) NewFunc7

func (rt *Runtime) NewFunc7(f func(Object, Object, Object, Object, Object, Object, Object) Object) Object

func (*Runtime) NewFunc8

func (rt *Runtime) NewFunc8(f func(Object, Object, Object, Object, Object, Object, Object, Object) Object) Object

func (*Runtime) NewInt

func (rt *Runtime) NewInt(i TInt) Object

func (*Runtime) NewList

func (rt *Runtime) NewList(elems ...Object) Object

func (*Runtime) NewListItem added in v1.0.2

func (rt *Runtime) NewListItem(value Object, next Object) Object

func (*Runtime) NewNative

func (rt *Runtime) NewNative(ptr unsafe.Pointer, cmp unsafe.Pointer) Object

func (*Runtime) NewOption

func (rt *Runtime) NewOption(optionName TString, values ...Object) Object

func (*Runtime) NewOptionWithTypeName

func (rt *Runtime) NewOptionWithTypeName(dataTypeName TString, optionName TString, values ...Object) Object

func (*Runtime) NewRecord

func (rt *Runtime) NewRecord(keys []TString, values []Object) Object

func (*Runtime) NewString

func (rt *Runtime) NewString(s TString) Object

func (*Runtime) NewTuple

func (rt *Runtime) NewTuple(items ...Object) Object

func (*Runtime) NewUnit

func (rt *Runtime) NewUnit() Object

func (*Runtime) RegisterDef

func (rt *Runtime) RegisterDef(moduleName bytecode.QualifiedIdentifier, name ast.Identifier, def Object)

func (*Runtime) Stack

func (rt *Runtime) Stack() []string

type TChar

type TChar rune

func ToChar

func ToChar(rt *Runtime, o Object) (TChar, error)

type TFloat

type TFloat float64

func ToFloat

func ToFloat(rt *Runtime, o Object) (TFloat, error)

type TInt

type TInt int64

func ToInt

func ToInt(rt *Runtime, o Object) (TInt, error)

type TSize

type TSize uint64

type TString

type TString string

func ToString

func ToString(rt *Runtime, o Object) (TString, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL