PropagationLang is a programming language written to explore a few curiosities gained by taking the programming language course at NTNU. I have always wanted to write my own language, and with the extra knowledge i now have, it was a lot easier to do.
Current status: Not running
Xor- Xor's together any number of variables
And- And's together any number of variables
Or- Or's together any number of variables
Not- Inverts a value
Future libraries TBD
Just like with observables, this language works by defining relationships between variables. In PropagationLang's case, the atomic operators are used to define the relations. In theory, if the atomic operators were made to be strictly reversable, this language could be relational. However, as the atomic operators are one-way, this is not the case.
The interpreter consists of a variable store, and a dirty queue. The variable store contains objects that map a variable name to its current value, as well as the Atomic operator that is used to evaluate potential new values. Some of the variables in the variable store are inputs or outputs. When execution starts, all inputs are checked for "new content", and are marked as dirty if they have new content of interest to evaluate. Once all inputs are iterated over, the interpreter works through the dirty queue, popping from the queue and re-evaluating variable values until the queue is empty.
A variable is dirty if one of its dependent variables have a new value, different than last time it was evaluated. When a variable is marked as dirty, it is pushed onto the dirty queue, unless it already is in said queue.
Modules are discrete, computable, black-boxed segments. Inputs and outputs are used to expose the interesting parts of them to the outside world. The language does not currently support using modules inside other modules, as it is exam period at the time of writing, and i'd like to study for my exams. The plan is to add this feature long-term
I can imagine simulation of logic being the most straight forward example of its useability. My goal is to write a simple processor for this language. Other possible use-cases is other situations where your program is acting like a factory floor, with few inputs and a lot of processing steps.