Mutant Language
Mutant Language
Holding name for the new programming language that will be needed for Mutant OS.
Base it on Erlang.[1]
Contents
What to name it?
Names taken
Algae
Amoeboid
Crucible
Ioco
Monads
Names not taken
Bacteria
Elugnorn
Harec
Lichen
Phykos
Pondscum
Ruvator
Features
- Think beyond the Querty keyboard and Latin-1 set for reserved words and symbols. Exploit the UNICODE set to represent more complex mathematical ideas. See "Sir, Please Step Away from the ASR-33!" by Poul-Henning Kamp ACM 2010 11 p. 56.
- Able to re-write it's own code from main() to end(). (LISP can re-write a line, but not a whole program.)
- Event driven
- Encapsulation. View this as a cell or skin wall. Separating the atoms.
- Not object oriented.
- No primitives are accessable to the programmer.
- Inherent message passing between programs.
- String has a pointer+length representation. Add \0 at the end for compatibility. See "The Most Expensive One-Byte Mistake" by Poul-Henning Kamep ACM 2011 09 p 42
- No ";" ending a line as in c/c++. CR will do fine.
- Loops:
- Identifier for each loop in a method.
- Auto-number the loops by default.
- Loops end with a comment line containing the loop's number or name using the form. // <name> :
- Methods with a comment line containing the method's number or name using the form. // <name> :
- Classes end with a comment line containing the class's number or name using the form. // <name> :
- Each class name is unique within the program.
- Each loop name is unique within the method.
- Memory protection to the method level.
- No global variables.
- No GOTO.
- Global constants are allowed.
- PERL: Steal all the string handling commands.
- Nibble: A four bit datatype useful for representing numbers as strings to solve the Big Number Problem.
- Every method is in a generic try{}catch() block invisible to the programmer. This requires a default returned error atom, logfile and dialog box.
- No interfaces
- Typing varies from Weak <-> Strong as the programmer and mutation needs.
- Libraries
- System - information about the OS and hardware
- System.OS -
- Program - information about the Program, PID, Name, Memory used, system memory and disk space, Origin, who spawned me? Where am I?
- Life Points
- Needed for existence
- Needed for carrying out functions. How many Life Points does a while-loop cost?
- How do I write a language that has objects, encapsulation, inheritance, but isn't object oriented?
Mutant OS and Language must be Event Driven, not Object Oriented. In the real world an event happens, starting an event chain, then the chain ends, waiting for the next event.
Data Types
Main Article Datatypes
Discusses Datatypes.
Issues
- Concurancy in parallelism. Erlang solved this so apply it.
- Joe Armstrong - Erlang, "Bringing the Gorilla and Jungle along when you just want a banana." Many objects and classes are needed to do simple things. Bury the complexity under the hood. You don't have to know how a car works to drive one. One banana brings along billions of cells aswell. Call this the Banana Problem.
- How do you bounds check a recursive function? Iterator limit does not work because it can be added to.
- Typing. When reproducing the code can select a type level on the Weak <-> Strong range. ACM Oct 2014 p.17
- Dynamic vs. Static. I'm thinking massively dynamic.
- Iterative - Allow. Though I don't use it myself much every option must be offered.
- Recursive - Of course.
Problems
- DNA - How to represent code in such a way that it can be randomly modified, spawned into a new process, and mostly work.
What would the code look like?
tiki - visual programming language
Open vs. Closed Universe Model
"An open-universe probability model (OUPM) defines a probability distribution over possible worlds that vary in the objects they contain and in the mapping from symbols to objects. Thus, OUPMs can handle data from sources (text, video, radar, intelligence reports, among others) that violate the closed-universe assumption. Given evidence, OUPMs learn about the objects the world contains." From Communications of the ACM July 2105 p. 92.
Since we do not know what may enter the environment, the Mutant Language must be open-universe.
Languages
Other Languages to reference.
- Erlang[2] For Spawning and inter-process communications and process mail-box.
Calculus and Object Oriented Languages
The idea came to me as I reviewed Object Oriented Programming (OOP). That OOP was like pre-calculus geometry in that it took a single object, here the Object Class vs. the Point, and attempted to create the world from it. This creates a sequential and hierarchical world. In Newton's time this was used to justify a hierarchical society with all the wealth and privilege at the top. It assumes that all reality is based on one fundamental object and that we poor humans can imagine all the higher-level structures.
Newton and his Calculus reversed this to decomposing existing objects into infinitely small and infinitely numerous rectangles. Study reality as it is. Not how it fits an ideology.
How to apply this to software development?
Newton could cut a wood block and immerse it in water to find the volume before applying calculus to it. But there are no concrete programming objects to test against. Hmmm...