Skip to content

Spec: Higher Level Expressions

HazardJ edited this page Jan 13, 2015 · 3 revisions

Following up on a call today with a software and systems developer of wide reputation, a note on an important design decision, an area for progress, conversation, thought:

Conditionality and other functions beyond inheritance:

Question posed: Will inheritance be an adequate model for all that one wants to do. Don't we need if/then, while, etc.? And, while on the subject, what about math, spreadsheet functions and the like?

My sense is that a great deal can be done (I have done a great deal) with a pure inheritance model, and there is virtue in (i) simplicity and (ii) log-like traceability of the pure substitution model.

But there are obvious situations where one wants more.

The biggest gap is spreadsheet-like functions - adding up a column of numbers, etc. Inheritance doesn't do that (though I once implemented the multiplication tables up to 12 x 12).

My sense is that the right way to handle this is to let {expressions} pass to a programming environment. Cmacc "keys" can contain nearly any character string (except the close "}" and so one could treat {a variable as a statement}. E.g. {* ~Product.1.Price ~Product.1.Quantity }, where ~ indicates a key name. Of course, the parser would seek to match this with keys, but if there was no matching key/value, the parser could treat this as a missing field and pass it to a programming language. Indeed, a number of environments or other resources could be used simultaneously by treating the environments as included lists (with prefixing? "Python.+ ~Product.1.Price ~Product.1.Quantity }, {OurDatabase.Some SQL Query}. Doing this has the disadvantage of creating a relatively high barrier for the casual user, but allows full expressiveness for a sophisticated user. And we avoid having to invent or choose for the community. That seems a good tradeoff. The casual user can of course still "program" by overriding the expression with a key.

This emphasizes the need to find more learning about Cmacc-like expansion - to see if we can situate the expansion model as a function, since it is likely that there is deep learning out there somewhere.