nguh

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: CC0-1.0, 0BSD Imports: 5 Imported by: 0

Documentation

Overview

Package nguh is the Next Generation Universal Hlang compiler. nguh gives u hlang.

nguh outputs WebAssembly directly instead of shelling out to wat2wasm. It is not known to have any bugs that are not features.

Index

Constants

View Source
const (
	SectionTypeType   = 0x01
	SectionTypeImport = 0x02
	SectionTypeFunc   = 0x03
	SectionTypeExport = 0x07
	SectionTypeCode   = 0x0a
)

WebAssembly section types

View Source
const (
	ExportFunc  = 0x60
	WASMi32Type = 0x7f
)

Variables

This section is empty.

Functions

func Compile

func Compile(tree *peg.Node) ([]byte, error)

Types

type Section

type Section struct {
	Kind uint32
	Len  uint32
	Data bytes.Buffer
}

Section is a WebAssembly binary section.

func (*Section) Commit

func (s *Section) Commit(out io.Writer) error

Commit turns a section into WebAssembly bytecode

Jump to

Keyboard shortcuts

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