Front Page All Articles Recent Changes Random Article

Contents

Concatenative language

  • ACL
  • Ait
  • Aocla
  • Breeze
  • Callisto
  • Cat
  • Cognate
  • colorForth
  • Concata
  • CoSy
  • Deque
  • DSSP
  • dt
  • Elymas
  • Enchilada
  • ETAC
  • F
  • Factor
  • Fiveth
  • Forth
  • Fourth
  • Freelang
  • Gershwin
  • hex
  • iNet
  • Joy
  • Joy of Postfix App
  • kcats
  • Kitten
  • lang5
  • Listack
  • LSE64
  • Lviv
  • Meow5
  • min
  • Mirth
  • mjoy
  • Mlatu
  • Ode
  • OForth
  • Om
  • Onyx
  • Plorth
  • Popr
  • Porth
  • PostScript
  • Prowl
  • Quest32
  • Quackery
  • r3
  • Raven
  • Retro
  • RPL
  • SPL
  • Staapl
  • Stabel
  • Tal
  • Titan
  • Trith
  • Uiua
  • Worst
  • xs
  • XY
  • 5th
  • 8th

Concatenative topics

  • Compilers
  • Interpreters
  • Type systems
  • Object systems
  • Quotations
  • Variables
  • Garbage collection
  • Example programs

Concatenative meta

  • People
  • Communities

Other languages

  • APL
  • C++
  • Erlang
  • FP trivia
  • Haskell
  • Io
  • Java
  • JavaScript
  • Lisp
  • ML
  • Oberon
  • RPL
  • Self
  • Slate
  • Smalltalk

Meta

  • Search
  • Farkup wiki format
  • Etiquette
  • Sandbox

Staapl

Staapl (http://zwizwa.be/staapl) is a 2-stage dynamically typed metaprogramming system for the PLT Scheme family of programming languages. It consists of a concatenative transformer language Coma that operates on a stack machine language.

It is based on two main observations.

  • An imperative stack machine model (abstracting a processor as a Forth machine) works particularly well for small embedded microcontrollers.
  • Staging and partial evaluation are simple to express for functional concatenative programming languages due to absence of problems related to identifier hygiene.

Staapl's Scheme bridge consists of the dynamically typed functional concatenative Scat language, implemented as a hygienic Scheme macro. In its basic form, Scat is Joy with extensional compositions: code quotations are not lists, but abstract entities represented by Scheme closures. Scat compositions support quasiquotation for lexically scoped template programming from Scheme, and use a hygienic hierarchical name management system based on PLT Scheme's declarative module system.

Staapl's code transformers are written in a derivative of Scat called Coma, a functional concatenative language operating on stacks of stack machine code instructions. Staapl contains a pattern matching mechanism for implementing Coma primitives in Scheme, which is used to implement partial evaluation and writing architecture backends. Currently there is an optimizing backend for Microchip PIC18.

Staapl contains a simplified Forth frontend that hides most of the metaprogramming system. This Forth dialect has the standard Forth-style metaprogramming removed and replaced with a mechanism based on partial evaluation and template macros. It is possible to use the Forth language as a stand-alone programming system.

This revision created on Tue, 23 Sep 2008 07:53:24 by doelie

Latest Revisions Edit

All content is © 2008-2024 by its respective authors. By adding content to this wiki, you agree to release it under the BSD license.