compiler

package
v2.3.13 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModePlay     = mode.ModePlay
	ModeWatch    = mode.ModeWatch
	ModePreview  = mode.ModePreview
	ModeTutorial = mode.ModeTutorial
)
View Source
const (
	OptimizationMinimal  = optimize.LevelMinimal
	OptimizationFast     = optimize.LevelFast
	OptimizationStandard = optimize.LevelStandard
)
View Source
const (
	RuntimeChecksNone      = frontend.RuntimeChecksNone
	RuntimeChecksTerminate = frontend.RuntimeChecksTerminate
	RuntimeChecksNotify    = frontend.RuntimeChecksNotify
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchetypeSchema

type ArchetypeSchema = compilerschema.Archetype

type Artifacts

type Artifacts = backend.Artifacts

type CompileStats

type CompileStats struct {
	Load, Frontend, Optimize, Backend, Total time.Duration
	Modes                                    map[mode.Mode]ModeStats
	Cached                                   bool
}

type Compiler

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

func NewCompiler

func NewCompiler(options Options, patterns ...string) *Compiler

func (*Compiler) Compile

func (c *Compiler) Compile(requested ...mode.Mode) (*Artifacts, error)

func (*Compiler) CompileAll

func (c *Compiler) CompileAll() (*Artifacts, error)

func (*Compiler) Schema

func (c *Compiler) Schema() (*ProjectSchema, error)

Schema returns the Play, Watch, and Preview level archetype schema without lowering callbacks or running optimization and backend compilation.

func (*Compiler) SourceFiles

func (c *Compiler) SourceFiles() []string

func (*Compiler) Stats

func (c *Compiler) Stats() CompileStats

type Mode

type Mode = mode.Mode

Mode identifies a Sonolus engine compilation mode.

type ModeStats

type ModeStats struct {
	Load     time.Duration
	Frontend time.Duration
}

type OptimizationLevel

type OptimizationLevel = optimize.Level

OptimizationLevel selects the compiler optimization pipeline.

type Options

type Options struct {
	Optimization  optimize.Level
	FallbackROM   []byte
	RuntimeChecks RuntimeChecks
}

type ProjectSchema

type ProjectSchema = compilerschema.Project

type RuntimeChecks

type RuntimeChecks = frontend.RuntimeChecks

type Target

type Target struct {
	PackagePath string
	ModulePath  string
}

Target identifies one engine main package matched by package patterns.

func DiscoverTargets

func DiscoverTargets(m mode.Mode, patterns ...string) ([]Target, error)

DiscoverTargets expands package patterns into engine main packages for a mode.

Directories

Path Synopsis
Package backend lowers source-independent frontend IR into Sonolus engine data.
Package backend lowers source-independent frontend IR into Sonolus engine data.
Package catalog is the single semantic index for the public Sonolus Go DSL.
Package catalog is the single semantic index for the public Sonolus Go DSL.
cmd/gencatalog command
Package intrinsic defines the limited standard-library surface understood by the compiler.
Package intrinsic defines the limited standard-library surface understood by the compiler.
Package ir defines the source-independent, typed control-flow IR emitted by the compiler frontend.
Package ir defines the source-independent, typed control-flow IR emitted by the compiler frontend.
Package optimize provides source-independent optimization passes for the strongly typed compiler IR.
Package optimize provides source-independent optimization passes for the strongly typed compiler IR.
Package schema builds the level archetype field contract shared by the CLI schema output and development-level validation.
Package schema builds the level archetype field contract shared by the CLI schema output and development-level validation.
Package sim compiles and executes final Sonolus EngineData callbacks.
Package sim compiles and executes final Sonolus EngineData callbacks.
Package tag parses namespaced Go struct tags used by the compiler.
Package tag parses namespaced Go struct tags used by the compiler.

Jump to

Keyboard shortcuts

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