Lightweight Features
Virgil is a language that has been designed from the beginning to be lightweight, rather than feature complete. This approach is driven primarily by the need for an efficient implementation on microcontroller platforms. Thus Virgil focuses on getting simple, core ideas correct and less on covering all possible usage scenarios. While primarily an object-oriented language, Virgil borrows and retains some features from procedural and functional languages, which allows the programmer to solve some problems more elegantly than in a single paradigm.
Virgil is also an evolving language. For example, there a number of new features that are being integrated into Virgil that increase its expressiveness. Such features, such as fully parametric types, require new implementation techniques in order to be efficient enough for this domain. Such techniques are the subject of ongoing research at UCLA.
Virgil Language Features, version I-01
Object-oriented Features
- Classes and single-inheritance
- Virtual methods
- Constructors
- Orphan classes
- Always pass by reference
Procedural Features
- Components
- Loops
- Switches
- Statements
Functional Features
- Delegates
- Aggressive inlining *
- Tail call optimization *
Other
- Arrays
- Bit-level types
- Compile-time Application Initialization
- Hardware register access
- Interrupt handlers
- Well-defined language semantics
- Heap optimization
- Exceptions *
* = the implementation of this feature is not yet complete in prototype compiler
Planned Language Features
Major additions are planned to Virgil to increase its expressiveness without unduly hampering its implementation efficiency. These features will allow programmers increased freedom and expressiveness, without sacrificing code size or performance.
Virgil II
- Parametric types
- Module system
- Tuples
- Generalized Algebraic Types
- Integration with non-Virgil code