Skip to content

Instantly share code, notes, and snippets.

@dannas
Created September 16, 2023 18:30
Show Gist options
  • Save dannas/f5ee6727260c53c173741eb03327c99b to your computer and use it in GitHub Desktop.
Save dannas/f5ee6727260c53c173741eb03327c99b to your computer and use it in GitHub Desktop.
Snippet from my notes on Functional core, imperative shell

Gary Bernhart made the concept popular with his screencast Functional core, Imperative shell. The idea is to let the code that uses side effects call into purely functional code. It's an extension of [[Architecture software Sans IO]]. Andy Matuschak expands on Gary's ideas in the presentation Controlling complexity.

I think I've seen an article where Joe Armstrong used the same construct but I'm unable to find it now. In https://www.destroyallsoftware.com/talks/boundaries, Gary makes the claim that Erlang's actors are built around functional cores, but that sending messages is imperative.

The ports and adapters pattern is the same idea dressed in different wording and not taken to such extremes. https://embeddeduse.com/2023/08/24/ports-and-adapters-architecture-the-pattern/

Marin Haverbeke claims that he's used the functional core, imperative shell paradigm when designing Codemirror

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment