Many submissions this time around made use of some form of ECS. I think it would be great to discuss implementation strategies and libraries.
I will start: Components have a symbol as key and any other type as value, implemented as a scheme record. An entity is a list of components. All entities (e.g. list of components) are stored in a vector. They are represented by an integer (their index into the vector), however this is never exposed to the user. Instead a query macro is provided with which to access entities with particular component types (cannot query on component values). This is backed by a hashtable mapping the components to a bitset of entity ids (to answer the question which entity implement what component). A system then applies a query and acts on the components of the entities return by the query.
I took great care that there is no mutation to allow a functional programming style. Thus at each step of the game loop a system is applied to the game world and returns a new game world.
Brief example of defining a world with a single entity with 3 components and a system to render to the screen
(define world (create-world (list (component 'myentity) (component 'postition (cons 1 1)) (component 'sprite "path/to/sprite"))))
(define (render world)
(let-values (((_ pos sprite) (get-components world (query 'position 'sprite) 'position 'sprite))) (for-each (lambda(p s) (draw-sprite (at (car p) (cdr p) s))) pos sprite)))
Code for the library: https://github.com/sam-d/klecs
EDIT: code formatting