This is BROOD 4 INTRODUCTION BROOD is a collection of compositional languages, and the tools to make them. These languages are also referred to as "stack languages", "concatenative languages" or "combinatorial languages". Existing examples of such systems are Forth (and it's zillion dialects), Postscript, Joy, Factor, ... The distinctive feature of a stack language is its use of a stack to pass data from one functional unit to the next. This as opposed to using a formal list of named parameters. The result is that parameters are accessed based on position on this stack. This leads to the term "combinator language". The term "concatenative" refers to a syntactic property. Source code of such a language is a concatenation of "words". These words can be grouped in one unit to give a new word. The term "compositional" refers to a semantic property: in a functional compositional language like Joy, a word defined in terms of the concatenation of other words, is actually a function composition in the mathematical sense: a composition of unary function which take a stack and produce a stack. My interest in these languages is from a "scripting" and "rapid prototyping" approach, based on these properties. * Absence of formal parameters makes the languages extremely terse. This a good thing when doing interactive development: typing commands at a computer terminal. * Ease of editing. The concatenative syntactic property makes it very easy to split a long definition in a couple of smaller ones. * Metaprogramming. A notorious example is Postscript. Due to the extremely simple structure, it is easy to perform higher order programming operations. For more information see these Wikipedia links: http://en.wikipedia.org/wiki/Forth_%28programming_language%29 http://en.wikipedia.org/wiki/PostScript http://en.wikipedia.org/wiki/Factor_programming_language http://en.wikipedia.org/wiki/Joy_programming_language ELEMENTS The two main players in BROOD are CAT and PURRR. They are respectively a functional compositional language, and a (series of) Forth dialect(s). CAT is loosely based on Joy, with the exception of some impure features and a distinction between quoted lists (data) and quoted programs, which are abstract. CAT is implemented as an extension to Scheme (MzScheme from the PLT Scheme suite). PURRR comprises a series of Forth dialects. PURRR/18 is a compiled 8 bit Forth for the Microchip PIC18 microcontroller architecture. PURRR/DT is a more abstract direct threaded forth on top of PURRR/18. The compiler is called BADNOP, and is the main thread through the 3 BROOD versions. It is a Forth compiler specificly aimed at small (8-bit) microcontrollers with a Harvard architecture. BADNOP is written in Scheme, CAT, and a special purpose (nameless) pattern matching language (written in Scheme) used to implement a peephole optimizing code generator. The future player is Packet Forth (PF). A Forth dialect currently written in C but planned to be generated from within the BROOD system. Its main features are: linear data structures for predictable real-time memory management, and a simple CLOS like OO type system. PF contains another minilanguage called Simple Cellular Automata Forth (SCAF), which is a 1-bit parallel Forth dialect. HISTORY BROOD 4.x (summer 2007) - host language implemented as mzscheme macros (without interpreter) - made most macros hygienic, including pattern + forth preprocessor. - purification: eliminated some side effects - added better state (monad) syntax + state combinators BROOD 3.x (early 2007, code named LAMB) - switched to host language CAT with static binding - moved from implicit state monad to pure language + explicit lifting - introduced pattern matching language for peephole optimizer - port of sheepsint 2.0 to slightly modified PURRR/18 BROOD 2.x (early 2006) - switched from forth to functional host language CAT with dynamic binding - state represented by implicit monad - sheepsint 2.0 on 18f1220 written in PURRR/18 BROOD 1.x (early 2004, original BADNOP) - imperative forth host language with special quoting syntax - simple PIC specific compiler - sheepsint 1.0 on 12f675