Programming Language Design
Programming languages are at the heart of everything that we do with computers. They are also interesting and fun to design an implement even though it takes a lot of work and there's usually no reward or glory involved. On the surface, one may doubt the value of building new programming languages since it's unlikely that a new programming language will become a new standard and change the world. However, new domain specific languages can be successful and result in a huge gains in productivity. Also, if there is to be hope of progress in technology, someone has to dream.
Skills
My work with building several programming languages has given me experience in the following aspects of programming language design and implementation.
Language Design
- Syntax of declarations, statements, and expressions
- Type system design
- Class and inheritence systems
- Expression operators
- Parameter passing mechanisms
- Array semantics / slicing / operators
- Looping and iterators
Compiler Construction
- Formulation of BNF grammers
- Lexical analysis (scanners and tokenizers)
- Syntax analysis (recursive descent parsers)
- Symbol table management and scoping
- Static type checking systems
- Intermediate representations (parse trees)
- Intermediate code generation
- Tree traversal for static code analysis
- Code tracing for dead code detection and removal
Interpreter Implementation
- Abstract syntax tree design
- Evaluation from intermediate representations
- Stack based memory management
- Heap based memory management
- Reference counting and tracing for automatic garbage collection
- Error handling / stack tracing
Portfolio
OMAR
The OMAR language was designed for "Object-Oriented Modeling, Animation, and Rendering". The OMAR language takes many of the graphical ideas fist explored in the SMPL language and advances them into the object-oriented paradigm. Along the way, it also brings in more advanced tools for creating data structures and various other utilities. The OMAR language contains all of the power of languages such as Java and C# and, in my opinion, signficantly improves upon them by making the functionality easier to use and understand.
Characteristics
- Modern and object-oriented - uses the same paradigms from Java and C# but in a friendlier and easier to understand way.
- Very structured and powerful - create complex collections of reusable and related classes just and you would in Java or C++.
- Type safe - no need to worry about weird memory bugs or crashes like in C / C++.
- Very expressive - by properly using the languge, you can often write code that reads almost like pseudo-code.
Features
The OMAR language has all of the features of the SMPL language described below plus the following additions:
- Object-oriented - classes ("subjects") and interfaces ("adjectives") allow the definition of objects with complex sets of behaviors.
- Encapsulation - each class and function has a clearly defined interface and implementation with separate public and private parts.
- Garbage collection - objects and array memory management is handled automatically.
- Iterators for lists and arrays - built-in iterators make it possible to sweep through arrays and lists safely and efficiently.
- Array slicing - assign subarrays or slices of arrays easily and efficiently.
- English like syntax - the language includes the notion of subjects, verbs, objects, adjectives, and even pronouns making it easy to learn.
Implementation
The OMAR language was implemented for the Hypercosm Player and Hypercosm Studio set of tools. If you would like to use OMAR for your own projects, you can so so by downloading the Hypercosm Studio software from here.
Documentation
To learn more about the OMAR language, download the full OMAR Language reference manual from here.
SMPL
The SMPL language was designed as a "Simulation and Modeling Programming Language". The goal of the SMPL language was to provide an easy to use and learn procedural langauge that could be used to create 3D simulations and renderings. It succeeded magnificently well at simple tasks. For more complex tasks such as creating sophisticated computer simulations, it is usually necessary to store complex state information in elaborate sets of data structures which the SMPL language does not provide support for. This is why the OMAR language was later developed.
Characteristics
- Easy to learn and use - basic procedural structure and similarity to english (no cryptic symbolic operators) makes it easier to learn.
- Type safe - no need to worry about weird memory bugs or crashes like in C / C++.
- Contains built-in support for 3D graphics - vectors, transformations, shaders, etc. are supported in the language.
- Expressive - tools like optional and keyword parameters allow you to write code that is easy to understand.
Features
- Vector data type and operators - vector data types, +, -, *, /, dot, and cross product operators
- Smart arrays - arrays know their own bounds so you don't need to worry about accessing elements outside of the array.
- Multi-dimensional arrays - true multidimensional arrays (unlike Java) allow complex scientific applications.
- Optional parameters - functions may include optional parameters, which eliminates the need to pass long lists of unneccessary parameters.
- Keyword parameters - parameters may have keywords which allow function calls to read almost like English.
- Reference variables and parameters - there is no need for cumbersome "wrappers" to change parameters as in Java.
- Support for 3D graphics - contains built-in support for things like vectors, scene graph management, transformations, and even shaders!
Implementation
The SMPL language was implemented for the Microcosm and Megahedron software packages. These software packages are no longer supported and have been replaced by the OMAR language used in the Hypercosm Studio software described above.