Skip to content

rhu1/wg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wgi - Welterweight Go Interpreter

wgi is a minimal (and somewhat rough) prototype implementation of WG as a command-line interpreter.

Installation

Prerequisites

  • Go 1.20 or later.
  • ANTLR v4 runtime library for Go (on $GOPATH).
  • Output directory of go install on $PATH.

Build and Install

To generate parsers and install:

    make generate-parser
    make install

Or to use the pre-generated parser:

    make install-pregen-parser

Usage

    wgi [options] path/to/file.wg

Options

  • -v: Print verbose output.
  • -eval=N: Type check and attempt to evaluate WG program for N (≥ 0) steps, or -1 to evaluate to value.
  • -compile: Compile to LWG, type check and print LWG to stdout.
  • -eval-lwg=N: Compile to LWG, type check and attempt to evaluate for N (≥ 0) steps, or -1 to evaluate to value.
  • -lolli=-1: Type check, then attempt to run WG program and LWG compilation to termination and check their final values correspond.

Example

    wgi -v -eval=10 examples/wg/hello/hello.wg

Testing

Run all tests:

    make test

Cleaning

Remove generated files and binaries:

    make clean

About

A minimal prototype implementation of Welterweight Go as a command-line interpreter.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published