Help us shape the future of Go! Take the 2026 Go Developer Survey

compiler

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2017 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package compiler is the entrypoint to Joy's compiler It follows the steps outlined in: https://mat.tm/joy/#how

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assemble

func Assemble(idx *index.Index, g *graph.Graph) (scripts []*script.Script, err error)

Assemble the code

func Compile

func Compile(cfg *Config) (scripts []*script.Script, err error)

Compile our Go application into a Javascript application

func Parse

func Parse(cfg *Config) (idx *index.Index, g *graph.Graph, err error)

Parse loads, indexes and graphs the program

This is breaking down our program into all the pieces we need to build it back up as a Javascript program.

Eventually, we'll be able use this stage separately from assembling to incrementally compile packages

func Setup

func Setup(cfg *Config) (err error)

Setup the compiler's stdlib, runtime and macro source code we're going to keep this stupid simple right now, and just overwrite everytime. Overhead right now is ~3ms on the compiler.

TODO: optimize

func Watch

func Watch(packages ...string)

Watch a set of packages

Types

type Config

type Config struct {
	// build a development or production bundle
	Development bool

	// joy's root path
	JoyPath string `valid:"required"`

	// packages to compile
	Packages []string
}

Config for the compiler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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