read


read
or learn more

The Vodka Programming Language

Jan 15, 2007

For the past few years I have made it my habit to design programming languages and develop interpreters for them. I have thus far created (to varying levels of completeness) 4 different language interpreters including:
LOB: A simple language skin on top of OpenGL used to create shapes, lights, materials, and apply transformation matrices (as well as performing generic linear algebra tasks) to objects in real time.

Lisp: I have created a simple Lisp interpreter as an exercise in Python programming.

Scheme: Likewise, I was able to develop a fairly solid Scheme interpreter using Java.

WFD: For my job I wrote a mini-language interpreter for constructing and executing workflows.

As I have a modest amount of experience developing languages, I felt that I should attempt instead a compiled language for my next project; thus the genesis of the Vodka Programming Language.


What is Vodka?
Vodka is a object-oriented, statically typed, type-inferenced, compiled, pseudo-functional, memory-safe (via array bounds checking and reference handling), with weak typing. The Vodka distribution will consist of a number of tools, and will be developed as an educational experience for myself, and its (eventual) users.

Scanner Generator
The Vodka toolset first will consist of a basic scanner generator along the lines of Flex or Lex. However, the grammar to describe the scanner generation rules will be far less robust than that found in Flex and Lex, but will suffice for illustrative purposes. The scanner (lexer) that is generated will consist of a table-driven deterministic finite automaton.

Lexer
The DFA generated by the scanner generator will be used by the lexer to recognize tokens and attach type information for constants. The lexer will provide a single entry point for the parser; namely get_token().

Parser
The parser will be tasked with building an abstract syntax tree, grammar checking, and also generating the target independent quadruples. Initially the parser will be recursive descent, but eventually will be rewritten as a shift-reduce parser.

Code Optimizer
Prior to being translated into a target binary format, the code optimization will be performed. Little beyond basic loop transformation will be performed initially, but more complex techniques will be added in the future.

Code Translator
The code translator will be responsible for translating the implementation independent quadruples into a specific target language. Initially, I hope to implement translators for Java bytecode, x86 assembly, and CIL. The generated quadruples will be targeted toward a generic register-based machine instead of a stack-based vm in hopes of easing the translation from the former to the latter and also maintaining a closer analogue to the more popular flavor of machine architecture.

As each of the above pieces are being developed I hope to provide write-ups of their functionality, architecture, and lessons learned. Stay tuned; however, in the meantime check out the Vodka project page on Sourceforge.
-m

No Comments, Comment or Ping

Reply to “The Vodka Programming Language”