-
-
Notifications
You must be signed in to change notification settings - Fork 748
Adopting a flat crate hierarchy #121
Comments
Hey, First let me say nice project! PS. Amethyst has some of the nicest looking code I've seen. It's been easy for me as a newbie to dig though and understand exactly what is happening under the hood, and i very much appreciate that! |
Hi, new to this project and rust. I'm using some rust projects to learn the language and yours got my attention, not sure if my opinion can be useful for you, but I would like to suggest you, to split the code in separated project, as the code base and contributors grow, splitting projects helps out. |
@ByteBuddha @Julianobsg Welcome to the project! We appreciate the feedback. If you guys need any help feel free to join us on gitter. @ebkalderon I think we should keep it as the nested structure because of the ability to easily compile the project. Maybe we can create a WIKI page to describe the structure of the project. I think adding a ton of folders to the root of the project just makes it harder to understand whats going on. |
I recently moved one of my personal projects to a monorepo layout and I like it a lot. Not a fan of splitting into separate projects since coordinating changes between projects becomes increasingly painful. Unreal Engine is a single repo for example. |
While we are talking about this, I've been thinking that maybe making each portion of the engine to be separate crates instead of modules might not be the best idea. You can see the problems it causes with
Which means that any bit of modularity it might have is diminished (since it now depends on getting another crate locally). The only current benefit I see of splitting into separate crates is shorter compile times (which will eventually be swapped when incremental compilation comes along). |
I am working on my own game engine with similar design. I switched to multiple crates from modules. Compile time was much faster. It made it inconvenient to change dependencies such as gfx versions. It was also more hierarchical and less interconnected so it was easier to switch out parts of the engine. |
I personally would prefer a flat hierarchy as it's easier to distinguish the different components or layers of the engine. The top-level README could contain a quick overview, which directory contains the actual engine/entrypoint. |
I'm not sure the current set up is too obvious with the dependencies (since some crates may depend on other sub-crates). So I think moving them to the top-level might make it easier to read anyways.
Wouldn't it be easy to do this by doing
from the top-level? |
Having modules and crates mixed in When #152 is merged, amethyst_renderer is going to be the only "feature" that is implemented as seperate crate (at that moment). I would encourage for a flat hierarchy that would currently look like
For new features that are integrated, it should be individually determined if it makes sense to mantain these as seperate crates. |
Actually, looking at the workspace section of the Cargo Manifest Format and the linked RFC 1525, it appears that this is the idiomatic way:
I like that the |
Heads up, this will actually be landing as part of #233! |
Implemented, so I'm closing this. |
I was wondering whether restructuring the file hierarchy of our crates to be flat rather than nested might be of any benefit. That is, transitioning from our current setup of:
over to something like:
Nested Hierarchy
Pros:
cargo build
at the top level is enough to build the whole thing.Cons:
Flat Hierarchy
Pros:
Cons:
amethyst/
directory?The text was updated successfully, but these errors were encountered: