Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Human brain is two separate organs, Stanford Medicine-led research finds(stanford.edu ↗)
    73comments
  2. If math is more than proof, we need to better celebrate the rest of it(terrytao.wordpress.com ↗)
    39comments
  3. GPT-6 Astra Solves a WWI German Radio Cipher(prinzai.com ↗)
    42comments
  4. San Francisco Onion Futures Company(onionfutures.com ↗)
    62comments
  5. Android 17 is the first since 3.x to add new APIs without releasing to the AOSP(grapheneos.social ↗)
    403comments
  6. Apple M6 Pro Achieves the Highest Single-Core CPU Score in Geekbench 7(geekbench.com ↗)
    14comments
  7. Typesafe-computer-use drives a Mac toward a goal for 1/50th of a cent per step(github.com/awlevin ↗)
    43comments
  8. Cloudflare Quick Tunnels(cloudflare.com ↗)
    278comments
  9. SDCC – Small Device C Compiler(sourceforge.net ↗)
    17comments
  10. Science Is Open Software(jepedersen.dk ↗)
    35comments
  11. You can run Git on object storage if you re-make packfiles(tigrisdata.com ↗)
    12comments
  12. How to Write with an LLM(sockpuppet.org ↗)
    324comments
  13. Saving another 100TB of RAM(cloudflare.com ↗)
    70comments
  14. Why building a Rust LSP is hard(rust-glancer.github.io ↗)
    31comments
  15. Ctenophores: Wonders of Biology(quantamagazine.org ↗)
    5comments
  16. NASA-IBM Lunar Foundation open-Source Geospatial AI Model(usra.edu ↗)
    2comments
  17. How OpenAI Used Its Own LLMs to Design Its Jalapeño Chip(ieee.org ↗)
    85comments
  18. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    104comments
  19. Goroutine Leak Profiles(go.dev ↗)
    2comments
  20. OpenJev(openjev.com ↗)
    262comments
  21. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    88comments
  22. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    69comments
  23. Minimal Phone 2(minimalcompany.com ↗)
    220comments
  24. Cache-to-Cache: Direct Semantic Communication Between LLMs (2025)(arxiv.org ↗)
    12comments
  25. Veronese's Dogs(publicdomainreview.org ↗)
    discuss
  26. Suppress vulnerabilities applying Kubernetes context to scans(github.com/alegrey91 ↗)
    1comments
  27. Warez: The Infrastructure and Aesthetics of Piracy (2021)(archive.org ↗)
    61comments
  28. Inside ZCode: Silently uploading your Git history to the cloud(ferstar.org ↗)
    98comments
  29. Cyclomatic Complexity in C#(ndepend.com ↗)
    19comments
  30. Stepfun Step 5 Preview (LLM): On AA Pareto frontier(artificialanalysis.ai ↗)
    2comments

Entity Component Systems and Data Oriented Design [pdf]

82 pointsby 8y agoaras-p.info
20 comments
8y agoHN ↗

It isn't appropriate for all games. Which is important to keep in mind. Sometimes people get crazy and do these really complex high performance ECS systems for a 2d game with 10 entities. Or a game with only 2 kinds of entities. Just unnecessary complexity in those cases.

8y agoHN ↗

I am not a game dev, but from watching some of his stuff, I have a feeling he would invert that claim, and say ECS is fine for smaller games but for really involved systems with time-to-market pressures the framework is too limiting.

8y agoHN ↗

but for really involved systems with time-to-market pressures the framework is too limiting

It was specifically designed and developed for involved systems.

8y agoHN ↗

Jon is also known for being hugely opinionated with only his direct personal experience backing him up.

His basic thought on ECS is that it's "obvious". And if you have worked on an involved game a few times and tried to examine the performance bottlenecks of the architecture, it really is. There are different flavors of "how to ECS" that make tradeoffs between static compile-time composition(theoretical fastest ECS: an entire scene is fed into a compiler and it emits a custom bespoke memory layout and an API for it) and runtime dynamism(most flexible ECS: dynamic types, reflection, some code to automatically maintain indexes). But the basic principles of working directly with compositions of plain old data are ingrained throughout, and emerge naturally from trying to extend a simple game with simple data structures and an imperative code style, without resorting to OO inheritance(which was tried and discarded because properties inevitably crept upwards into the parent class leading to a memory-hungry "God Object").

8y agoHN ↗

I don't think I'm claiming that Jon would advocate for OO inheritance. I also think he thinks that SoA instead of AoS is a good thing - no qualms there. I guess he would probably have the most comments on how to deal/access/manipulate that SoA at a higher level

8y agoHN ↗

Jonathan Blow's commentary isn't anti-ECS. It's more skeptical of Rust's borrow checker, more specifically he's pointing out how the original talk ends with bypassing the borrow checker and copying a pattern that would have equal safety in C or C++.

8y agoHN ↗

That is true + there is an offhand quote he makes about ECS in general, but 99% is about the issue you mention

8y agoHN ↗

In ECS I don't understand where you put the collections (scene graphs, quad trees, etc) or what manages them. Does anyone have insight in this?

8y agoHN ↗

The collections with any connections between elements are not exactly fitting the ECS model, which works best for independent components. When I was thinking about it back in the day, I came up with a Component Graph concept (implemented in [1]), which has the data locality similar to ECS but doesn't have a notion of systems.

[1] https://github.com/kvark/froggy

8y agoHN ↗

Like kvark said, they don't really fit the ECS model well. The standard answer would be to encapsulate them into a system (i.e. go outside the ECS).

The way I see ECSs is that they are in-memory relational databases that only support equijoins (look up component matching entity ID) and optimize for table scans. The typical choice of an index structure is a contiguous ordered array, making for very fast lookups and scans. If insertion/deletion performance becomes an issue you can add one level of indirection and only keep a list of pointers to components ordered. However, like you indicated, games also need other kinds of queries, so scene graphs and quad trees should be supported as indices on the same level as the arrays and hash tables that are traditional for ECSs.

I would love to see an in-memory database with all the features required by games. There are some very different tradeoffs to be made than in typical in-memory databases:

- The most important queries are known up-front, since the simulation/rendering loop is fairly defined.

- Transactions don't need to be durable. Just need to be able to checkpoint once in a while.

- Lots of bulk updates from the simulation.

- Query language needs to be well integrated into the application language to avoid overheads.

8y agoHN ↗

The main thing to realise is that not everything has to go into the ECS. This is a bit more clear with middleware like physics engines where you’re forced to integrate two views of the world. The game view and the physics view and need to translate and update between the two. Similarly with data in an ECS you can separately process spatial relationships either reusing the required data or keeping local copies as an optimisation.

8y agoHN ↗

I really wish there was a video of this talk, I like this deck but I'm missing the color commentary.

8y agoHN ↗

There was a video, but since I talked in Lithuanian, I doubt if it would be useful to many people :)

8y agoHN ↗

For the past few days I've been messing with an ECS module for Elixir! My fork is here: https://github.com/lytedev/ecs

Really simple with Elixir, but the naive implementation has some potential performance issues methinks.

8y agoHN ↗

I agree that ECS is at its most fundamental a relational scheme. Not sure why that is controversial though..

8y agoHN ↗

There are some parallels here with data engineering/science I think, at least on the surface of "array of structs" => "struct of arrays" is another view on "row oriented" vs "column oriented" data. Killing the object hierarchy and moving to a more relational style (indexed dataframes). OO -> Systems, Systems seem like seperated functional programming.

8y agoHN ↗

I wonder why ECS is completely absent in non-game systems. It seems like a natural way for non-invasive extension.