Stackd programming language

The Stackd programming language
———— Version 0.1.0 ————–

Stackd is a concatenative programming language, much like Factor and Forth.
It’s somewhat an attempt to write a Factor implementation in Ruby.
In contrast to Factor, Stackd is interpreted and not compiled.
It’s still in an early development phase, so many things aren’t yet supported.

Here’s a small list of features, that currently work already:

  • Word definitions
  • Most of Factors core words
    (still some missing, but shouldn’t be hard to implement)
  • Literals for
    • Booleans
    • Numbers (Integer & Float)
    • Strings
    • Arrays
    • Symbols (as in Ruby)
    • Quotations (e.g. first-class ‘functions’)
    • Regular Expressions (as in Ruby)
    • Hashtables (as in Ruby)
  • Two stacks to work with:
    • Data stack
      (used implicitly and most of the time)
    • Retain stack
      (used for temporarily storing values with predefined words
      e.g.: dip, keep etc.)
  • Very lean and simple syntax (as in Factor)
  • A simple REPL (see bin/repl)
  • Support for debug output via: bin/stackd filename.stackd —debug
    –> Outputs the parsed AST

What’s partially implemented:

  • A generic object system (as in Factor)
  • Support for:
    • Generic Words & Methods
    • Inheritance

What’s still missing (and never might be implemented):

  • Private / read-only slots on objects / classes (and probably more)
  • Nice development tools, as Factor has them
  • Real debugger or walker
  • Many more features, you’ll find in Factor

Some basic syntax rules:

  • All expressions / statements need to end with a semicolon (‘;’)
  • Word definitions start with a colon (‘:’)
  • Words can be named almost anything (as in Factor)
    e.g.: <>, <a,b>, empty?, >!< etc.
  • For more information, have a look at:
    http://concatenative.org/

Example code:
* You can find some example code within the examples/ directory.

————– Dependencies ————–

—————– License ——————
Stackd is licensed under the GNU GPL v3.
It is heavily influenced by the Factor programming language.
Factor is © Slava Pestov. Some parts of Stackd’s core library
is taken from Factor’s.
See http://www.factorcode.org for more information about Factor.

For more information on copying & distribution take a look at the
LICENSE file.

© 2009 Christopher Bertels
http://www.adztec-independent.de

Activities Feed