Formalization of the interpreter
The interpreter needs to be formalized once the operational semantics is finished. This is a necessary step towards writing TransLucid in TransLucid. The key missing parts for writing TL in TL are:
1. Besfitting
2. Parsing (a form of bestfitting)
3. Printing (a form of bestfitting)
4, Libraries
We are close on all of these. But nothing is finalized.
jarro2783 10:05 on 2010/09/14 Permalink |
1. We need a good algorithm to determine the bestfit equation. The best I can think of would be n^2 because it has to determine for every equation whether it is more specific than every other.
2. Not sure about how to tackle this still. Some sort of recursive descent thing which mimics spirit could be feasible. I can see that in the future we could even beat spirit, possibly blowing it out of the water. We quite possibly need functions in TL to do this.
3. String operations are probably required, apart from that it seems trivial.
4. It seems that we just need some proper semantics. At the moment a library adds equations when it’s loaded. Libraries are currently written in c++, we could allow these to be translucid files too.
cartesianprogramming 10:12 on 2010/09/14 Permalink |
If you store information separately for each variable, then testing applicability is linear in the number of entries for that variable. Among the applicable entries, finding bestfit ones is quadratic in the number of applicable entries.
This can be improved by using just-in-time ideas. After each modification of the set of equations for a variable, the first time that a demand is made for that variable would force the creation of a finite-state automaton that would be run upon any request for that variable (until, of course, the next modification to the set of equations).
cartesianprogramming 10:14 on 2010/09/14 Permalink
The initial implementation can be done using the linear-quadratic solution. Just-in-time ideas can be kept for future optimization.
jarro2783 00:18 on 2010/09/16 Permalink
what about including priority in that?