donomii / throff-combined

The THROFF programming languge

Home Page:http://www.praeceptamachinae.com/projects/throff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GoDoc

throff

A programming language that started as an improved Forth, and got out of control. Has lexical scoping, continuations, effective tail calls and macros. throff runs on a custom 3-stack engine.

throff was an experiment in creating a small core and building the language up to a fully featured programming language. This was successful, but there are already many fully featured programming languages and this one doesn't add anything particularily new.

View the manual.

Get it

the Throff programming language

go get -v github.com/donomii/throff
go build github.com/donomii/throff

Or download a precompiled binary

Use it

Run from Command Line

> throff ADD 1 1
2

Interactive shell

> throff
Welcome to the THROFF command shell v0.1. Type HELP for help.
Throff »ADD 1 1
2

Run a program from a file

throff -f sierpinski.thr

Scripting interface for golang

	result, _ := t.CallArgs1("ADD", 4, "5")
	fmt.Println("Calculation result: ", result)

Throff is

Throff is a dynamically typed, late binding, homoiconic, concatenative programming language, taking inspiration from Forth, Joy and Scheme. It has all the features of a modern language - closures, lexical scopes, tail call optimisations, currying, and continuations.

Everything is a function, even language constructs like IF and FOR, which can be replaced and extended with your own versions. It uses immutable semantics wherever possible to provide safe threading and continuations. There is almost no lexer/tokeniser, and no parser in the traditional sense. Commands are fed directly into the engine to be executed. The programs are written backwards.

There are many examples in the examples and rosetta directories.

About

The THROFF programming languge

http://www.praeceptamachinae.com/projects/throff


Languages

Language:Jupyter Notebook 75.4%Language:Go 18.8%Language:C 2.6%Language:Java 1.4%Language:JavaScript 1.0%Language:HTML 0.4%Language:Dockerfile 0.2%Language:TeX 0.2%Language:Batchfile 0.0%Language:Shell 0.0%