logo

Simpatico

Literate markdown server for a local codepen-like experience

License MIT PRs Welcome GitHub commit activity GitHub closed issues

VPS deployable - Running Locally - Experiments


Use a text editor and browser you already know and a simple server process to create literate programs that execute immediately and without a build. Tiny, privacy respecting, readable and short JavaScript source. No front-end build!

Features

Experiments

These are sample experiments users have created that show how Simpatico works. Feel free to fork them and start experimenting yourself.

  1. core. Very generic, convenience functions that smooth over the JavaScript runtime. Of particular importance is the definition of a comprehensive set of predicates/assertions. Nothing in this module is specific to Simpatico, although it is a good example of my preferred style of ES6 programming -> functional and minimal.
  2. combine. The function used to produce a new state from a previous state plus an input. combine() is a generalization of Object.assign() and previously published as combine-keys. Defines handler invocation and the message cascade.
  3. stree. A data structure that organizes inputs into chains that result in different, related states. Unifies previous distinct concepts like instantiation vs inheritance. Provides natural "collections" support.
  4. friendly. A very simple runtime type system, accessed through validate(), that helps functions help their callers call them correctly.
  5. svg SVG and SVG animation using only very small primitives. Visually interesting!

More detail about each module is available in the test harness html file, and the module source code itself.

Running Locally

  1. Install a recent version of NodeJS (See nvm, the best way to install node with $ nvm install 20 && nvm use 20)
  2. Clone this repository: git clone https://github.com/javajosh/simpatico
  3. Install the dependencies: cd simpatico && npm install
  4. Generate self-signed certificate to run local TLS (see devops/deploy.sh)
  5. Run the reflector node reflector.js
  6. Navigate to https://localhost:8080

Copyright SimpatiCorp 2024