-
-
Notifications
You must be signed in to change notification settings - Fork 0
Prime
For any specific architecture, there is only one prime language: the language that expresses and maps the physical limitations of the hardware onto the optimal lexical architecture (not regarding a few cosmetic, syntactical differences).
It's entirely possible that such a language might start with assembly or machine-code mneumonics, and then continue to add structures, like macros, parameterized macros (functions), self-contained encapsulations of functions with data (a "nucleus": essentially "objects" in assembly)], and so forth, to add more structure to your language.
One might ask, then, is there one idealized operating system for a given architecture? Sorta. It goes deeper into metaphysics and transcends the machine: data. You're building machines to either simulate the universe or to manipulate data and build knowledge. This project focusses on the latter. So one might say there are two equal systems: singularity to self-actualize knowledge and ??.
XXX What follows is out-of-date.
A prime aims for a minimal syntax, without losing any expressivity, that is fully object-oriented. It is the language used for PositionOS. It is provably optimal within a small constant difference (provided no one implements a sub-byte programming language).
Basic objects all follow a simple, universal, API. If an object tries to go beyond this limitation, a syntax error of sorts is raised: you've violated the uniform architecture.
A graph could hold the current state of executions. Each object or process is a node in the graph. Nodes can connect to hardware inputs or outputs. If an action value at a node is positive, it is in a RUN state. If the value is high, it is a priority. If it is 0 (idle), it is still capable of queuing up a small amount of data from other processes or hardware. STUB If we store our objects in a hashable object "space", then this data can just hover around the object.
XXXconsider: So rather than deal with a buffer in hardware, each object could have a buffer of, say, 4 words. Objects that are higher up the change have access to theirs plus all other lower down to stash data.
FUTURE: If the action value of a node is negative, it is in a pull state and will query a hardware element for state data.
Most keywords are replaced with symbols to make the user code the object of understanding. In fact, there is only one keyword: while. This, too, could be replaced in the future with curly braces to identify a looping block.
Prime syntax
function_name:
statement1, related_statement2, [...],
statement3
asynchronous_statement // statements separated by commas are assumed to be executed sequentially, the prior line has no comma, ergo this statement is independent in execution of the others.
&"one-line object docstring description" object_name:
([[init_parameter1=default]][[, ...]]): //init method
@.attribute= ; could have anonymous 4-word attributes here?
>>: ;
<<: ;
?: return_value_upon_success/ ; // leaving no space between the exclusive operator means: we don't expect any other result
//empty line enforces object separation, though not strictly necessary.
["this",] {"This", "not", "is", "container", "ordered"}
Inherited objects append parameters of subobjects to superobject in order of inclusion.
Must think about function objects (verbs) vs. storage objects (nouns?)
Format for accessing hardware. Hardware devices in all-caps.
- AudioFile << HDD1
- AudioFile >> SPEAKER0
Note, that this concept applies equally to human languages: that eventually all languages, for a given species of Man (like the architecture of a machine), will gravitate towards one language.
Singularity