4 ms·
I guess what I'm getting at is that in any non-trivial program with many external dependencies and cross-cutting concerns, almost all of your code is the "shell
by lackbeard 8y ago
I guess what I'm getting at is that in any non-trivial program with many external dependencies and cross-cutting concerns, almost all of your code is the "shell", so either I'm missing something, or this is stating the obvious (write pure functions where you can) in a very roundabout way. I've never seen a program written explicitly in this style that wasn't a trivial example.
- ramchip 8y agoThe functional core can return a symbolic description of actions to take, which the shell executes, a bit like a simple interpreter. This is a good example: https://www.theerlangelist.com/article/spawn_or_not https://www.theerlangelist.com/article/spawn_or_not (Note the context is Elixir, so it’s talking about lightweight processes, not OS processes. It explains how to keep that stateful / effectful code very simple, and have all the real logic be pure functional code.)
- yen223 8y agoI think it's more that a lot of programs aren't actually doing anything terribly complex, logic-wise. A lot of apps out there do nothing more than fetching data from one service, and dumping it out to another.
- pwm 8y agoThe system I've been working on in the past 6 months is non-trivial and written in this style. Roughly 2/3 of the code is in core and 1/3 is in shell.