README.md
March 20, 2026 · View on GitHub
Ark.jl is an archetype-based Entity Component System (ECS) for Julia. It is a port of the Go ECS Ark.
——
Features • Why ECS? • Installation • Usage
Features
- Designed for performance and highly optimized.
- Well-documented, type-stable API.
- Entity relationships as a first-class feature.
- Storage mode per component for ergonomics and SIMD,
with support for user-defined storages. - Extensible event system with filtering and custom event types.
- Fast batch operations for mass manipulation.
- Built-in GPU integration for maximal performance.
- No systems. Just queries. Use your own structure.
- Minimal dependencies, 100% test coverage.
Why ECS?
Entity Component Systems (ECS) offer a clean, scalable way to build individual- and agent-based models by separating agent data from behavioral logic. Agents are simply collections of components, while systems define how those components interact, making simulations modular, extensible, and efficient even with millions of heterogeneous individuals.
Ark.jl brings this architecture to Julia with a lightweight, performance-focused implementation that empowers scientific modellers to design complex and performant simulations without the need for deep software engineering expertise.
Installation
Run this to add Ark.jl to a Julia project:
using Pkg
Pkg.add("Ark")
Usage
Here is the classical Position/Velocity example that every ECS shows in the docs.
See the Manual, API docs and demos for more details.
using Ark
"""Position component"""
struct Position
x::Float64
y::Float64
end
"""Velocity component"""
struct Velocity
dx::Float64
dy::Float64
end
# Create a world with the required components
world = World(Position, Velocity)
for i in 1:1000
# Create an entity with components
entity = new_entity!(world, (Position(i, i * 2), Velocity(1, 1)))
end
# Time loop
for i in 1:10
# Iterate a query (archetypes)
for (entities, positions, velocities) in Query(world, (Position, Velocity))
# Iterate entities in the current archetype
@inbounds for i in eachindex(entities)
# Get components of the current entity
pos = positions[i]
vel = velocities[i]
# Update an (immutable) component
positions[i] = Position(pos.x + vel.dx, pos.y + vel.dy)
end
end
end
Contributing
Contributions are welcome! If you encounter any issues, have suggestions for improvements, or would like to add new features, feel free to open an issue or submit a pull request.
Cite as
Lange, M. & Meligrana, A. (2025): Ark.jl – An archetype-based Entity Component System for Julia. DOI: 10.5281/zenodo.17512271, GitHub repository: https://github.com/ark-ecs/Ark.jl
License
Ark.jl and all its sources and documentation are distributed under the MIT license and the Apache 2.0 license, as your options.