Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including with all npm packages installed. Try it out:

var gp = require("")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors. v0.1.25

Genetic programming helpers & strategies (tree based & multi-expression programming)


npm version npm downloads Twitter Follow

This project is part of the monorepo.


Genetic programming helpers & strategies (tree based & multi-expression programming).

This package does not (yet) provide a complete GP framework and is largely focused on the following operations:

  • General GP setup configuration
  • Genotype / chromosome / AST generation
  • Phenotype / chromosome translation
  • Offspring generation
    • Crossover (single-point, uniform)
    • Mutation

Does not specifically deal with:

  • Population management
  • AST evaluation
  • Fitness computation



ALPHA - bleeding edge / work-in-progress

Related packages

  • - Dynamic, extensible multiple dispatch via user supplied dispatch function.
  • - Pointfree functional composition / Forth style stack execution engine
  • - Extensible S-Expression parser & runtime infrastructure
  • - DSL to define shader code in TypeScript and cross-compile to GLSL, JS and other targets
  • - Functional tree editing, manipulation & navigation

Blog posts


yarn add
// ES module
<script type="module" src="" crossorigin></script>

// UMD
<script src="" crossorigin></script>

Package sizes (gzipped, pre-treeshake): ESM: 1.25 KB / CJS: 1.29 KB / UMD: 1.40 KB


Usage examples

Several demos in this repo's /examples directory are using this package.

A selection:

ScreenshotDescriptionLive demoSource
Evolutionary shader generation using genetic programmingDemoSource


Generated API docs



Karsten Schmidt


© 2019 - 2020 Karsten Schmidt // Apache Software License 2.0

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free