Hi everyone and happy new year!
I’ve been using a small ECS module for my own projects lately and decided to share it. It’s called MiniECS.
It’s not a fancy framework or a complex library. It’s just a single-file, minimalist module designed for those who prefer simple tools over heavy abstractions. There are no macros or custom DSLs to learn; if you have basic Nim knowledge, you can easily use it, read it, or even modify it to your needs.
Repository: https://github.com/erayzesen/miniecs
It uses a Sparse-Set architecture (similar to EnTT), which makes adding or removing components very fast while keeping the data compact for cache-friendly iteration.
Beginner example:
Nim
type
Pos = object # Data-only component
x, y: float
Vel = object
vx, vy: float
let ecs = newMiniECS()
# Create and compose
var player = ecs.newEntity()
player.addComponent(Pos(x: 0, y: 0))
player.addComponent(Vel(vx: 1.2, vy: 0.5))
# Elegant, pointer-based iteration
for id, p, v in ecs.allWith(Pos, Vel):
p.x += v.vx
p.y += v.vy
It’s stable enough for my daily work, so if you need a "just works" ECS that stays out of your way, feel free to give it a try.