Concatenative Stack-Oriented Interpreting language
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
cmd
interp
repl
.gitignore
.travis.yml
Gopkg.lock
Gopkg.toml
Makefile
README.md
yon.go

README.md

πŸ•“ yon

Build Status

About

Summary

  • yon is the concatenative interpreting language built by Go.
  • Its idea and grammar is basically inspired by some concatnative languages, like forth and factor.
  • It will be intended to make multi-node tool easily.
  • yon treats whole significant literal as the word. (2 is word, "test" is word, true is also word.)
  • And yon is under development.

How to try

Clone

$ go get -u github.com/mk2/yon
$ cd $GOPATH/src/github.com/mk2/yon

Make

# automatically restore dependencies (require Godep)
$ make restore-deps
# build yon executable, this brings the `yon` binary in current directory
$ make release

Start REPL

# Lets enjoy yon!
$ yon repl

🎢 Code

"test" -- string literal
`test` -- string literal
2123   -- number literal
true   -- bool   literal
false  -- bool   literal
name   -- name   literal
{"test" 1 true} -- array literal
{"version":1 name:yon} -- dictionary literal
[1 dup] -- quoted function literal

πŸ“š Vocabularies

πŸ“— Prelude vocabulary

Prelude vocabulary contains all basic words (dup, over, rot, each, comparators, and arithmetic operators)

Prefix

prelude

Table

word fully qualified key stack effect misc
. prelude~. (x -- ) pop top word on stack
.s prelude~.s ( -- ) show stack contents
.v prelude~.v ( -- ) show vocabularies
dup prelude~dup (x -- x x) duplicate top word on stack
over prelude~over (x y -- y x y) copy second depth word to top
rot prelude~rot (x y z -- z y x) duplicate top word on stack
def prelude~def (n x -- ) register x with n name in user class
if prelude~if (x y b -- ) take bool word b, and execute x or y wheter b is true or false
each prelude~each (x c -- ) take chainable-word c, and exxecut x to each c element

πŸ“˜ PsUtil vocabulary

This vocabulary have not been implemented yet.

Prefix

psutil

Table

TBD

πŸ“” User vocabulary

The vocabulary contains all user defined words.

Prefix

user

Table

There are no initial words.

πŸ“ TODOs

  • dictionary literal
  • more stable and usable quoted function
  • comment support
  • explicit function declaration (now only quoted function declaration)
  • execute code from file
  • error handling support
  • better repl interface
  • history recording

🎨 Future TODOs

  • event handling
  • stack-effect annotation
  • serf integration (yon's most valuable feature, if realized)