Federico Pereiro
02/17/2025, 7:45 PMguitarvydas
02/17/2025, 8:14 PMFederico Pereiro
02/17/2025, 9:22 PMTom Larkworthy
02/17/2025, 9:50 PMguitarvydas
02/17/2025, 10:28 PMMarek Rogalski
02/21/2025, 9:01 AMguitarvydas
02/21/2025, 2:04 PMMarek Rogalski
02/21/2025, 5:14 PMguitarvydas
02/21/2025, 5:53 PMTom Larkworthy
02/21/2025, 6:04 PMguitarvydas
02/21/2025, 6:49 PMyou never need to worry about concurrency inside function blocksAgreed,,, but I think that there is a high cost to doing this. Current hardware hides this cost. Can we gain back some chip real-estate if we eliminate all of these extra doo-dads that are scaffolding for no-worry function blocks? And, we really should be thinking about concurrency. Especially when faced with asynchronous, distributed things like internet, robotics, IoT. Concurrency has a bad name in function-based programming circles. I suggest that concurrency is easy, except when you try to express it in terms of functions. By not-thinking about concurrency, we end up with gotchas like callback hell, await, etc. Harel showed a syntax, in 1986, "StateCharts" for dealing with concurrency that eliminated the really-bad aspects of the approach, i.e. "state explosion". Before even that, EEs were successfully using concurrency on a grand scale. (I count at least 100 concurrent, parallel components in the Atari Pong 1972 circuit. The circuit did not contain a CPU nor any sequential code). In 1986, our hardware could not - easily - handle Statechart notation. Today's hardware can. I believe that PBP is an advancement over Statecharts. I haven't needed to use a Statechart for ages. And, I'm able to do things that I previously thought were very hard - like building "compilers". The quotes are there because I use some cheats that aren't directly related to PBP. Thinking in terms of PBP, though, helped me think up these cheats and not be afraid of implementing them. An observation about the main-loop thing. The big win is to isolate control-flow, as well as data. Functions look good on paper, but when implemented on a computer, you get hidden, low-level coupling which leads to hidden uses of context-switching and virtual memory (e.g. the callstack, which is a data structure constructed dynamically at runtime and causes unpredictable, unstructured blocking and calcifies routing decisions in a non-networky way). The main loop is a (potentially) big lump of code. What if you chopped it up into smaller lumps of code, each with their own "main loops"?
Tom Larkworthy
02/23/2025, 1:11 PMguitarvydas
02/23/2025, 1:42 PM