Skip to content

knight-lang/go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Knight v2.1: Go Edition

This is a Knight 2.0.1 implementation in Go. More details about Knight, its license, and specifications can be found in the knight-lang repo.

Compiling

Simply run go build . to build it. You can then execute it via ./go (-e 'expr' | -f filename).

Exemplar

This implementation is an "exemplar" implementation, so that people can get an idea of how Knight implementations might look. It has no fancy tricks or optimizations, and is thoroughly documented. If you don't know how to get started writing a Knight program, take a look at this one!

It does, however, provide some extensions that aren't required by the knight spec, as a convenience for people using it to execute Knight programs:

  • Integers are 64 bit, instead of the required 32.
  • UTF-8 is fully supported throughout, instead of just the required ASCII-subset that Knight requires
  • Some forms of undefined behaviour are handled by returning errors (such as syntax errors, or type errors like + TRUE 1). Not all forms are handled, and things like integer wraparound are just ignored.

About

A Go Implementation of Knight

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages