Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upMake crates more self-contained and introduce `amethyst_core` #396
Comments
torkleyy
added
diff: medium
pri: important
type: RFC
type: task
labels
Oct 8, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
The link is slightly broken |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Fixed now, sorry |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Yay! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
Oct 8, 2017
Member
@torkleyy I guess I'm not entirely certain how this proposal solves our orphan rules problem. The purpose of the renderer crate is to render assets on screen, while the purpose of the assets crate is to allow new asset types to be defined. So when @omni-viral wants to implement amethyst_assets::Asset for amethyst_renderer::Mesh I'm still not sure how he'd do that under this proposal. Does the proposal just accept such an implementation won't be possible? Because if so we have two choices:
- Wrap Mesh ourselves in
amethyst_coreand implement Asset for the wrapper (similar to what we've already done) - Ask downstream users to do the same for their own projects, which is essentially asking them to write the same piece of code for every project just to satisfy our need to separate concerns.
Basically I'm questioning the wisdom of trying to separate concerns too heavily, because these concerns might not be that separate after all.
|
@torkleyy I guess I'm not entirely certain how this proposal solves our orphan rules problem. The purpose of the renderer crate is to render assets on screen, while the purpose of the assets crate is to allow new asset types to be defined. So when @omni-viral wants to implement
Basically I'm questioning the wisdom of trying to separate concerns too heavily, because these concerns might not be that separate after all. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Why not make |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
Oct 8, 2017
Member
That works. That was a relatively straightforward fix haha :) Then sure I have no problem with this if we're allowing amethyst_* crates to depend on amethyst_* crates other than amethyst_core
|
That works. That was a relatively straightforward fix haha :) Then sure I have no problem with this if we're allowing |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 8, 2017
Member
Ofc, that would be a given, my coming amethyst_gltf would depend on both assets and renderer, as an example.
|
Ofc, that would be a given, my coming |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 8, 2017
Member
Btw, we will need to look into error-chain or something like it from the get-go when we do this (we should anyway).
And app.rs, where does that go, amethyst_core or its own crate ?
|
Btw, we will need to look into error-chain or something like it from the get-go when we do this (we should anyway). And |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
torkleyy
Oct 8, 2017
Member
That's a tough question:
- I wanted to add a similar thing to Specs, but have to wait for specialization
Applicationis incompatible withParSeq- The way it currently works conflicts with the plans to give more freedom wrt dispatchers and
World
|
That's a tough question:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 8, 2017
Member
Yeah, I kinda felt that would be the case, so my suggestion is to put it in it's own crate, so it's easy to swap out. Something like amethyst_app.
|
Yeah, I kinda felt that would be the case, so my suggestion is to put it in it's own crate, so it's easy to swap out. Something like |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Binero
Oct 10, 2017
Contributor
I think a main crate should definitely remain. When splitting up amethyst in modules, I think it's important to have the main crate to bring them all together, and to allow the user to quickly get started without too much puzzling.
|
I think a main crate should definitely remain. When splitting up amethyst in modules, I think it's important to have the main crate to bring them all together, and to allow the user to quickly get started without too much puzzling. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
torkleyy
Oct 10, 2017
Member
@Binero My point is that it's not harder and by making them modular, docs can be more focused.
I mean how is
extern crate amethyst_renderer;
extern crate amethyst_physics;harder than
extern crate amethyst;
use amethyst::renderer::...;
use amethyst::physics::...;? We just provide a nice example and explanation to get started. This isn't what I'd call puzzling. Additionally, these crates should require zero glue code.
|
@Binero My point is that it's not harder and by making them modular, docs can be more focused. I mean how is extern crate amethyst_renderer;
extern crate amethyst_physics;harder than extern crate amethyst;
use amethyst::renderer::...;
use amethyst::physics::...;? We just provide a nice example and explanation to get started. This isn't what I'd call puzzling. Additionally, these crates should require zero glue code. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
Oct 10, 2017
Member
these crates should require zero glue code.
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 10, 2017
Member
With the exception of a single function call or two to register things in world/dispatch, but that's user code anyway
|
With the exception of a single function call or two to register things in world/dispatch, but that's user code anyway |
amethyst
deleted a comment from
Rhuagh
Oct 10, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
Oct 10, 2017
Member
(he accidentally submitted his comment twice so I deleted one of them. I'm not trying to censor things I swear :P)
|
(he accidentally submitted his comment twice so I deleted one of them. I'm not trying to censor things I swear :P) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Binero
Oct 10, 2017
Contributor
@torkleyy It makes it incredibly hard to read documentation, it requires the user to manage all dependencies and is non-obvious.
|
@torkleyy It makes it incredibly hard to read documentation, it requires the user to manage all dependencies and is non-obvious. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
torkleyy
Oct 11, 2017
Member
@Binero How about that:
We keep the main crate for now, which makes sense anyways because it's easier to refactor. Then, after all the other changes are made, we revisit this again and make a decision.
|
@Binero How about that: We keep the main crate for now, which makes sense anyways because it's easier to refactor. Then, after all the other changes are made, we revisit this again and make a decision. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 11, 2017
Member
Yeah, I'm fine with that. If it just becomes a long list of "pub extern crate amethyst_$t as $t;" so be it :)
|
Yeah, I'm fine with that. If it just becomes a long list of "pub extern crate amethyst_$t as $t;" so be it :) |
bot
added a commit
that referenced
this issue
Oct 12, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
torkleyy
assigned
Rhuagh and
torkleyy
Oct 18, 2017
torkleyy
referenced this issue
Oct 21, 2017
Merged
[rs] 09: Flatten crate structure of amethyst_renderer #438
bot
added a commit
that referenced
this issue
Oct 22, 2017
bot
added a commit
that referenced
this issue
Oct 22, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I think we're done here. Re-open if you disagree with me. |
torkleyy commentedOct 8, 2017
•
edited
Edited 1 time
-
torkleyy
edited Oct 8, 2017 (most recent)
A few days ago I came up with an idea, hey why don't we split up Amethyst and make the creates just utility crates for Specs. While some liked the idea, @Xaeroxe was quite skeptical. And I share that skepticism. That's why I came up with a compromise:
Right now we have our crates
amethyst_assets,amethyst_renderer, both of which contain their own functionality but are then wrapped in the main crate. We should instead put everything related to assets in the assets crate and the same for the renderer. This would not only solve constant complications with the orphan rules, but also allow us to make those crates optional, while still allowing easy integration and a cohesive experience thanks to the concept of ECS. Now, there are however things many Amethyst crates will share, e.g.Transform. These things should go intoamethyst_core.What should happen to the main crate?
I'm not sure if a main crate should remain, I've experimented with making a more generic state machine lately and the
ecsmodule would essentially get dropped. Timer stuff probably goes into the core crate and fps counters and profiling tools could go into anamethyst_toolscrate.