#ecs #entity #component

no-std shipyard

Entity Component System

19 releases

0.6.2 Aug 11, 2022
0.6.0-alpha.4 Jul 13, 2022
0.6.0-alpha.1 Mar 15, 2022
0.5.0 Mar 20, 2021
0.2.0 Aug 18, 2019

#48 in Game dev

Download history 422/week @ 2023-08-20 625/week @ 2023-08-27 593/week @ 2023-09-03 572/week @ 2023-09-10 397/week @ 2023-09-17 863/week @ 2023-09-24 297/week @ 2023-10-01 317/week @ 2023-10-08 477/week @ 2023-10-15 400/week @ 2023-10-22 404/week @ 2023-10-29 419/week @ 2023-11-05 374/week @ 2023-11-12 336/week @ 2023-11-19 559/week @ 2023-11-26 467/week @ 2023-12-03

1,792 downloads per month
Used in 20 crates (7 directly)


18K SLoC

Shipyard ⚓

Shipyard is an Entity Component System focused on usability and speed.

If you have any question or want to follow the development more closely Chat.

Crates.io Documentation LICENSE

Guide Master | Guide 0.6 | Demo | Visualizer

Basic Example

use shipyard::{Component, IntoIter, View, ViewMut, World};

struct Health(u32);
struct Position {
    x: f32,
    y: f32,

fn in_acid(positions: View<Position>, mut healths: ViewMut<Health>) {
    for (_, mut health) in (&positions, &mut healths)
        .filter(|(pos, _)| is_in_acid(pos))
        health.0 -= 1;

fn is_in_acid(_: &Position) -> bool {
    // it's wet season

fn main() {
    let mut world = World::new();

    world.add_entity((Position { x: 0.0, y: 0.0 }, Health(1000)));


Small Game Example

Inspired by Erik Hazzard's Rectangle Eater.

Play Source

Table of Contents

Origin of the name

Assembly lines take input, process it at each step, and output a result. You can have multiple lines working in parallel as long as they don't bother each other.

Shipyards such as the Venetian Arsenal are some of the oldest examples of successful, large-scale, industrial assembly lines. So successful that it could output a fully-finished ship every day.

Shipyard is a project you can use to build your own highly-parallel software processes.


I initially wanted to make an ECS to learn how it works. After a failed attempt and some research, I started working on Shipyard.

Specs was already well established as the go-to Rust ECS but I thought I could do better and went with EnTT's core data-structure (SparseSet) and grouping model. A very flexible combo.

Cargo Features

  • parallel (default) — enables workload threading and add parallel iterators
  • proc (default) — re-exports macros from shipyard_proc, mainly to derive Component
  • serde1 — adds (de)serialization support with serde
  • std (default) — lets Shipyard use the standard library
  • thread_local — adds methods and types required to work with !Send and !Sync components
  • tracing — reports workload and system execution


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~27K SLoC