Functional Programming

Functional programming breaks down into two actions:

  1. pattern matching
  2. text replacement & manipulation

Pattern Matching

Pattern matching is parsing.

Currently, the easiest parsing method is PEG.

My favorite variant of PEG is Ohm-JS.

Ohm-JS claims to simplify PEG parsing, through various complicated means (upper-case vs. lower-case rules).

The real gems in Ohm-JS are:

  1. Separation of Concerns (grammar separated from semantics, unlike in other variants of PEG)

  2. the Ohm-editor.

The Ohm-editor simplifies the act of building parsers.

If I were to use any other PEG library, I would use the Ohm-editor first.

Text Manipulation

Functional programming, and mathematical notation, imposes the restriction that there can be no side-effects.

In fact, this is only a subset of the more important idea of isolation.

You can allow mutation, and, you can build components that are arbitrarily complex, as long as the components are isolated.


Isolation is more important than complexity.

Isolation is more important than immutability.


Isolation provides scalability.

Black Boxes

Isolation means that you can treat Components as black boxes - input & outputs, we can’t care about what is inside.

Everything Is A Fractal

Everything is a fractal.

Everything can be further sub-divided.

That includes everything I write. Nothing I write is absolute, it is relative, and, it can be broken down.

See Also

Table of Contents