GitXplorerGitXplorer
w

Staple

public
5 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
b910f16cf5f96e5817605e222f727e9468f71de4

Improved README.

wwandernauta committed 13 years ago
Unverified
43ee8bb5740046b96c5f8c8373d9bdcaa7649cca

Added concat test

wwandernauta committed 13 years ago
Unverified
91a08d095febee5f150ca7d212966e1f35133820

Miscellaneous fixes and additions

wwandernauta committed 13 years ago
Unverified
4a3934206610e1597e3bff30e9f137e4b6cf3d46

Implemented libc math function wrappers

wwandernauta committed 13 years ago
Unverified
edfa3b6ac162a99eb7d06db013ae43578887b9d9

Leak less memory

wwandernauta committed 13 years ago
Unverified
580355bc86ed0299a289b9abb980899a4e5c0241

Improved tests

wwandernauta committed 13 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!