Katahdin is a programming language where the syntax and semantics are mutable at runtime. The Katahdin interpreter parses and executes programs according to a language definition that can be modified by the running program. Commands to modify the language definition are similar to those that define new types and functions in other languages, and can be collected into language definition modules.
Katahdin can execute programs written in any language which it has a definition module for. The definition of more than one language can be composed allowing more than one language to be used in the same program, the same file, and even the same function. Data and code is shared between all languages, with a function defined in one language callable from another with no binding layer.
Traditional language development involves using a parser generator tool to generate a static parser from the language grammar. Katahdin’s approach is to just-in-time compile a parser from the grammar as the program runs. The grammar can be modified as the program runs because the parser can be recompiled to match it.
Recent research into grammar theory with parsing expression grammars and parser theory with packrat parsers provided the basis for the techniques used in Katahdin and will be referenced in this thesis along with an introduction to my additions.
Katahdin is intended as a language independent interpreter and a development platform that can replace traditional static parser generators for language development. With further development Katahdin should be useable as a drop in replacement for interpreters and compilers for a wide range of languages, and as a platform for development of new languages.
Using a single runtime to execute any programming language will reduce development costs to businesses. For any combination of languages used in a system, only a single runtime has to be maintained, ported between platforms and supported. The ability to use multiple languages in the same program will allow businesses to use the most appropriate language for any part of the system. For example, an engineer could write the core of a program in FOR- TRAN and then add a user interface written in Python, without worrying about interfacing between two runtimes.