Blazingly fast Entity-Component-System microframework.

Upstream URL


Andrew Kravchuk <>



1cl-fast-ecs ⚡὎6

NOTE: this software is of alpha quiality, and the API is subject to change.

cl-fast-ecs is a Common Lisp library providing an implementation of the Entity-Component-System pattern, primarily focused on speed and interactive development.

ECS is an architectural data-oriented design pattern that allows for the effective processing of a large number of in-game objects while keeping the code and data separated. This provides flexibility in the way that game objects are built at runtime.

See the documentation page for more details.


  • Ability to interactively redefine components and systems on the fly.
  • Ability to interactively add new components and systems on the fly.
  • Native Lisp, no C/C++ code.
  • Mininal external dependencies (alexandria and trivial-garbage).


Just clone this repository to your Quicklisp's local-projects directory and execute (ql:quickload :cl-fast-ecs) in your Lisp.

Currently tested to work on following Lisp compilers:


  (ql:quickload :cl-fast-ecs)
  (use-package :cl-fast-ecs)

  (defcomponent position
    "Location information"
    (x 0.0 :type single-float :documentation "X coordinate")
    (y 0.0 :type single-float :documentation "Y coordinate"))

  (defcomponent velocity
    (x 0.0 :type single-float)
    (y 0.0 :type single-float))

  (defsystem move
    (:components-ro (velocity)
     :components-rw (position))
    "Moves objects according to their velocity."
    (incf position-x velocity-x)
    (incf position-y velocity-y))

  (defsystem print
    (:components-ro (position))
    (format t "entity ~a: (~a, ~a)~%" entity position-x position-y))

  (let* ((storage (make-storage))
         (entity0 (make-entity storage)))
    (make-position storage entity0 :x 0.0 :y 0.0)
    (make-velocity storage entity0 :x 0.5 :y 0.5)
    (make-object storage '((:position :x 1.0 :y 1.0)
                             (:velocity :x 0.1 :y 0.1)))
    (dotimes (i 3)
      (run-systems storage)))

1.4Related projects

  • cl-ecs offers defcomponent / defsys macros, similar to the ones found in this project, and uses hash tables for component storage.
  • lisp butts game engine (sic) rolls its own CLOS-based ECS implementation.


Merge requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


Copyright (C) 2023 Andrew Kravchuk (



Dependencies (5)

  • alexandria
  • chlorophyll
  • cl-mock
  • parachute
  • trivial-garbage

Dependents (0)

    • GitHub
    • Quicklisp