{
  "id": 17642809,
  "title": "Fast simulation code is slow to write, so generators write it",
  "url": "https://urgent.news/2026/11/01/fast-simulation-code-is-slow-to-write-so-generators-write-it",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-01T17:14:48.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/mfc_keibisoft/fast-simulation-code-is-slow-to-write-so-generators-write-it-30oe"
  },
  "original_language": "en",
  "account": "Fast simulation code can be time-consuming to write, leading some developers to create generators that automatically generate the code. Games like Dwarf Fortress, Age of Empires and Might and Magic, as well as Role Playing Games, share a common structure of having a state, actors, and rules governing their interactions. The author of the story experimented with cache optimized Go data structures, encoding them as annotations to generate code. This approach led to the development of Ecclesia, an isometric pilgrimage through a world of countries drawn as Orthodox icons. Ecclesia is written as annotations on Go structs, with seven code generators working together to produce cache-friendly memory pools, behavior, the world, drawings, network frames, screens, and rules. The simulation runs on one thread at 0.21 ms per tick on an Intel i7-9750H, achieving around 8,192 classic Reynolds boids in 1 CPU at 60 FPS without using any goroutines. The author's goal was to encode optimal cache data structures into metaprogramming generators, enabling Claude to write a high-level DSL and generate code down to the level of simulations. To achieve this, the author stacked three levels of generators on top of each other, starting from a basic generator that converts raw structs to SoA, wire codecs, and bitfields, followed by a generator for relations between entities, and finally a generator for game design and schema behavior. Each generator reads its own annotations and writes Go code that the level above calls. The final output is a running world that can be visualized from various perspectives, including an isometric view and first-person view. The simulation runs on one core, with networking, disk I/O, and screen painting handled by separate cores. The author sees potential in using this approach for MMORPGs, allowing players to create their own fantasy games by interacting with shared gamestate and rules.",
  "summary": "I want to talk about code generators, domain specific languages (DSL), and simulating interactions. Me personally, I am a fan of games like Dwarf Fortress, Age of Empires and Might and Magic, and Role Playing Games in the broader sense. Now, no matter how you look at them, they all boil down to having a \"state\" (like a chess board), some \"actors\" (the little ants you interact with), and \"the…",
  "key_points": [
    "Developers create generators to speed up simulation code writing",
    "Ecclesia is an isometric pilgrimage written as annotations on Go structs",
    "Three levels of generators produce cache-friendly code for simulations"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}