3 ms·
Is it cleaner to view program executing as a function between domains? I don't know. I agree it gives rise to very convoluted explanations where you have to 'im
by sago 11y ago
Is it cleaner to view program executing as a function between domains? I don't know. I agree it gives rise to very convoluted explanations where you have to 'imagine' that various things that aren't happening are happening for the sake of a model that is only used in one style of programming language (and isn't actually happening there, either, under the skin).
The advantage of the operational view is that it is true.
I wasn't sure what you are saying in your PS. That you think the functional description is obfuscatory? Or that you were taught the operational view in college and didn't understand why it would be useful?
I think it is unlikely to be you being dumb. Either way your lecturer should have worked through the 'possibilities' to demonstrate why it is useful (exceptions, multitasking, asynchronous code).
- agumonkey 11y agoMaybe I'm too used to the functional meal and think that the convolutions have more worth than harm. I think it's a simple and solid view, pushing away side effects, and types to have a little sanity when combining the pieces. None is more true than the other. CPU didn't have "stack" before people wanted nice recursion I believe, and there are runtimes that don't use them. With time I started to go away from low level and stay in logic land thinking it can be represented in many ways on the metal. But in school I was still thinking with hardware first. I don't think I could ever have envisioned coroutines or backtracking this way.
- sago 11y agoContinuations work the same way without a stack, incidentally. You are still saving the FP, either way. I'm not aware of languages that don't have a FP of some kind. Interesting on the last point, that you'd find coroutines harder to explain with 'save the current place you're executing, go do something else, return to that place when you need to do more'.