GitXplorerGitXplorer
w

Staple

public
5 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
1fa2a13c14cb5b76722c601c2fa5997103ce66d3

Add newlines in documentation

wwandernauta committed 10 years ago
Unverified
9e10ce60cfe13993feec5c4965dda8a7836101ce

Don't use M_PI

wwandernauta committed 10 years ago
Unverified
941438afbef503a7e958efeda1d70e3efa8807a0

Added unit tests and small fixes

wwandernauta committed 12 years ago
Unverified
16e457634ef493260161a22f505708a1a54b6667

Fixed abs op

wwandernauta committed 12 years ago
Unverified
d63eb6612e41bad81f272653d8d831a50ab528db

Added assert operator

wwandernauta committed 12 years ago
Unverified
ddee0569709e7b52a90ff898bc2d730506f59fad

Improved docs and Makefiles

wwandernauta committed 12 years ago

README

The README file for this repository.

Staple logo

Staple

Staple is a minimalistic ('esoteric'), interpreted language based around stack manipulation. It resembles languages like Forth and Factor, but also takes ideas from the likes of Lisp (code is data in Staple) and Smalltalk (it has symbols). Everything (everything) in Staple is in postfix notation.

What does Staple code look like?

Here's a program that calculates the circumference of a circle:

[
  /* Ask the user about their circle's radius, convert the input */
  " What's the radius of your circle? " prompt float

  /* Multiply that with two pi */
  3.14 2 * *

  /* Print the result as a string */
  " Your circle's circumference is about " print
  string println

  " " println
] loop

What's different?

Staple doesn't care about whether you use spaces, newlines or tabs, but whitespace is important in Staple. In other languages, ((4+2)==6) may be perfectly valid - in Staple, it's 4 2 + 6 eq. Even the spaces around double quotes are non-optional (although that may change in the near future).

Staple will never automagically cast values from one type to another (not even integers to floating point values or booleans to integers).

Everything in Staple is in postfix notation. 'if' is a no-op that exists for readability reasons, and carries no meaning at all for Staple.

Building and contributing

To build the interpreter, just run make in the Interpreter directory. There is no ./configure.

The Staple interpreter is released under the MIT license. Contributions are more than welcome, as are bug reports. Fork away!