GARA Design Goals
From Mavaball
This page contains the design goals and choices for the GARA programming language.
Design Goals and Requirements
This list contains the goals and requirements that guide the development of GARA.
- GARA is a compiled programming language, with emphasis on performance, maintainability, and security.
- GARA provides a complete replacement for C on modern processors. In particular:
- There exists a subset of GARA that compiles to code that executes at least as fast as does an equivalent implementation in C.
- There exists a subset of GARA suitable for use in embedded systems with limited memory and processing power.
- GARA can produce C as a target, allowing a C compiler to generate the final binary executable.
- GARA is platform and processor independent, but requires a 32-bit or larger processor (8 and 16 bit processors are better supported by C and assembly)
- GARA natively supports functionality that is not efficiently (if at all) supported by C (i.e., requires assembly language), and that is supported on the popular processors.
- The syntax and grammar of GARA follows these guidelines:
- Readability and maintainability over brevity
- Completely non-ambiguous grammar and syntax
- Easily parsed by editors that provide syntax highlighting and contextual help -- all information required to annotate syntax is present in the current file.
- Do not allow a visual layout that can obfuscate the true meaning of the program (e.g., false indentation)
- Enforce coding standard that makes merging easier.
- Facilitate provable computing
- Allow embedding of other languages (or mini-languages) into GARA, and validate the grammar and syntax of the embedded language.
- Warnings become errors -- require annotation in code to inhibit (and explain) warnings
- GARA intends to be well-suited for the following tasks (among others):
- Numerical analysis (e.g., MATLAB)
- Web design (e.g., PHP)
- Database access (e.g., PHP), interfacing popular DB back-ends (e.g., MySQL)
- GARA makes it easy to write algorithms that run on multiple threads or cores (i.e., parallel processing, distributed computing)
- GARA provides native constructs for securely protecting and erasing memory, and for secure execution.
- GARA facilitates certification efforts for Common Criteria and NIST FIPS 140.
- GARA by default requires writing re-entrant code, suitable for preemptive operating systems.
- GARA comes with a micro-kernel suitable for embedded systems
- GARA allows creation of efficient parsers or even mini-languages.
- GARA allows creation of binary structures with elements that are bit sizes that are non-multiples of bytes
- GARA natively handles Big-Endian vs. Little Endian vs. Native ordering of data structures.
- GARA requires a function to annotate a Big-O estimate for the algorithm run time if larger than constant time
- GARA imposes requirements on documentation of the source code within comments.
Design Choices
This list contains several design choices based on the goals above.
- GARA will support these features that are not natively available in C:
- Enabling/Disabling Interrupts
- Large number arithmetic
- Finite field arithmetic (Galois Field) - Used in Cryptography and Error Correction Codes
- Matrix Multiplication (e.g., MMX extensions)
- Stack Traces
- Multiple return values from functions (possibly passed through registers)
- Exception processing
- Secure memory
- Semaphores
- Automatic garbage collection
- Require annotation on functions that have side-effects
- Assume all variables are immutable
- Assume all operations in a particular block can execute concurrently -- require additional annotation to show a sequential operation.
- Do not use the '=' operator, because it is confused with assignment vs. equality testing.
