Make the Plan a Value

17 points by jackdk


mayonnaise

Even in strict languages, the decoupling benefits are great enough that the extra memory use is often worth it.

If I got it right, Gary Bernhardt made this famous for the Ruby world some 10+ years ago through Functional Core Imperative Shell in his Destroy All Software series and his Boundaries talk.

One challenge I have found sometimes when trying to apply this is performance optimizations requiring IO to decide whether a plan goes one way or another. You can front load the IO, but then you make every plan pay a high fixed cost.

The answer might be breaking out into multiple smaller plans, which is awkward, or making your plan interpreter smarter, but a big point of FCIS was making the imperative shell dumb and exercisable with simple happy path testing.

It might be certain domains lend themselves better to FCIS than others.