3 ms·
> the reason why coding is so difficult is that interfaces are often too darn complicated to keep track of? Haven't brought this up in a while. Ya. I feel codi
by ericHosick 3y ago
> the reason why coding is so difficult is that interfaces are often too darn complicated to keep track of?
Haven't brought this up in a while. Ya. I feel coding is hard due to complex interfaces. I once worked on a programming abstraction, mechanisms, aiming for a consistent interface for easy composition.
Key features of mechanisms were:
1) All data types were mechanisms
2) A Mechanism needed no context (parameters) when invoked.
3) Composition of a mechanism could take any number of mechanisms (primitives at this point are treated as mechanisms) and return a mechanism.
4) Upon invocation, a mechanism functions in one or more modes, returning either a primitive data type or another mechanism.
Think of it as currying or Lisp's S-expressions, but supercharged, envisioned as a base for Visual Programming Languages.
An example of composition using mechansisms:
// Compose
addTwo =
print(
map(
add(
2,
emitFromRange(0, 20, 4)
)
)
);
Which is saying "Print a mapping of adding 2 to an emitted range from 0 to 20 by 4."
// Invoke
addTwo()