MIA Is Awesome
What MIA is
- OfflineOS's application programming language - It is designed for writing large scale applications without getting bogged down in low-level concerns like memory management.
- Integrated with OTIL - Libraries and Modules written in OTIL can be used with no more effort that writing a require line.
- Object-Functional - MIA aims to combine the best elements of the Object Orientated and Functional paradigms in the tradition of OCaml, Scala and F#
- Multi-threaded - Threads are first class objects and can safely communicate through the observer pattern
What MIA isn't
- Purely functional - Input/Output will be familiar to anyone coming from an imperative language and values can be reassigned when that actually is the best solution
Type System
As a member of the ML sub-family of functional languages, the type system is a corner stone of MIA's design.
Everything is an object
Aside from comments and variations of require all syntax in MIA is for defining objects and making them interact.
Key classes
The following is a list of object classes that are required to understand MIA.
- Object The abstract class at the root of MIA's class hierarchy. Provides methods such as eql, clone, and klass.
- Class All classes in MIA are objects belonging to this class
- Function In MIA functions are instances of this class.
- Tuple This class is used for containing arguments and return values of function calls. Programmers are free to find other uses for it.
- True All instances of this class equal each other and nothing else. A subclass of Boolean.
- False All instances of this class equal each other and nothing else. A subclass of Boolean.
- Nil Similar to False but used to represent the absence of an answer rather than a negative number. Not a subclass of Boolean.
Syntax
Expression orientation
Unlike Procedural language all functions in MIA are actual mathematical functions. That is to say an equation with inputs (arguments) and outputs (one or more return value).
Procedural style can be emulated by chaining together expressions with the ; operator. Rather than denoting the end of a statement ; in MIA is a function which returns it's second argument. It can be expressed as:
let ; x y = y
Bindings
The let and in keywords are used for breaking a complex expression into a chain of simple expressions that are dependant on the previous.
let name = expr-1 in expr-2
For example
let pi = 3.14 in
pi * r ^ 2;