zephyrfalcon / stapel

Yet another stack-based toy language ^_~

This URL has Read+Write access

stapel /
name age message
file IDEAS Mon Sep 21 17:33:25 -0700 2009 copy files from svn [zephyrfalcon]
file LANG.txt Mon Sep 21 17:33:25 -0700 2009 copy files from svn [zephyrfalcon]
file README Mon Sep 21 18:14:23 -0700 2009 more info [zephyrfalcon]
file builtins.py Mon Sep 21 17:33:25 -0700 2009 copy files from svn [zephyrfalcon]
file commands.py Mon Sep 21 17:33:25 -0700 2009 copy files from svn [zephyrfalcon]
file interactive.py Mon Sep 21 17:33:25 -0700 2009 copy files from svn [zephyrfalcon]
file stapel.py Mon Sep 21 17:33:25 -0700 2009 copy files from svn [zephyrfalcon]
file stapel_types.py Mon Sep 21 17:33:25 -0700 2009 copy files from svn [zephyrfalcon]
file stdlib.s Fri Sep 25 13:43:32 -0700 2009 add filter [zephyrfalcon]
file test_all Mon Sep 21 17:33:25 -0700 2009 copy files from svn [zephyrfalcon]
file test_stapel.py Fri Sep 25 13:43:32 -0700 2009 add filter [zephyrfalcon]
README
# Quick overview

[in progress...]

Stapel is a stack-oriented language, written in Python. Mostly for experiments and learning.

General philosophy:

- It's closely related to Python; Python types are used where possible. (So numbers, strings, lists, etc, are Python 
builtins. Special classes are only used if there is no direct equivalent in Python, e.g. for symbols.)

- Unlike other stack-based languages like Forth, Cat, etc, there should be as little 'lookahead' as possible. Things 
like word definition and 'if' are not special; you put items on the stack and call 'define' or 'if', rather than having 
a special construct.

- Unlike my earlier attempts at stack-based languages, this one uses an explicit "command stack" (inspired by Dollop 
(also here on github) which has an explicit call stack). Executing a user-defined word simply means, that the words 
making up the first word's definition, are put on the command stack, to be executed in the next evaluation step. This 
way we achieve the stack-oriented equivalent of "tail recursion" (sort of).

- The above implies that built-in words cannot just evaluate subexpressions willy-nilly; rather, they need to manipulate 
the command stack accordingly.