Re:OOSMOS, the Object Oriented State Machine Operating Syste...
by eru on Thursday November 05, 2015 @01:10AM
(#10511899)
> Recursion and non-strict evaluation, however, are clearly problematic viz. stack consumption, system load, and execution time; ditto for purely functional data structures and associated functions.
What you'd want is not a Turing complete language by default, but one that's guaranteed to halt. (And only have Turing complete bits as a fallback, just like unsafePerformIO today.)
Primitive Recursion might be a good limited but useful model of computation. Or something along the lines of Agda.
With such a more restricted notion, recursion doesn't necessarily have to be compiled to a stack.
Re:OOSMOS, the Object Oriented State Machine Operating Syste...
by lectrick on Thursday November 05, 2015 @12:03PM
(#10514485)
> problematic viz. stack consumption
Not if one codes towards TCO (Tail Call Optimization): http://stackoverflow.com/questions/310974/what-is-tail-call-...
Re:OOSMOS, the Object Oriented State Machine Operating Syste...
by OopsCriticality on Thursday November 05, 2015 @01:59PM
(#10515399)
TCO doesn't address unpredictable system load or execution time. Recursion doesn't lead to predictable systems.
Aspects of functional paradigms are good for safety critical systems, e.g., using pure functions when possible, when it leads to more predictable and testable systems. Recursion and non-strict evaluation, however, are clearly problematic viz. stack consumption, system load, and execution time; ditto for purely functional data structures and associated functions.
[0] I'm hedging here with frequently, but I'm having trouble thinking of safety critical systems that aren't hard real-time off the cuff… perhaps supervised expert systems, say an automated pathology platform, might count?