Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Compile-time "Animation" creation #161

Open
sofianedjerbi opened this issue Dec 29, 2023 · 2 comments
Open

feat: Compile-time "Animation" creation #161

sofianedjerbi opened this issue Dec 29, 2023 · 2 comments
Labels
up-for-grabs The maintener is unlikely to work on this anytime soon. If you want it, build it!

Comments

@sofianedjerbi
Copy link

Current Behavior

Currently, the Animation structures are constructed at runtime, which works well for dynamic and interactive applications.

Desired Feature

I propose adding the capability to build Animation structures at compile time. This feature would allow developers to define animations that are static and unchanging throughout the application's life, ensuring these animations are constructed and optimized during compilation, reducing runtime overhead and potentially improving the application's overall performance. (The main reason is for design purposes)

Possible Implementation

I believe this feature could be implemented by providing a macro or a set of const functions that allow for the construction of Animation structures with fixed parameters. This way, developers can opt-in to compile time construction where it makes sense for their application.

@jcornaz
Copy link
Owner

jcornaz commented Feb 20, 2024

Thanks for the suggestion, and sorry for the delayed response.

It's an interesting Idea. However, it is unclear to me if the value would be worth the added complexity. Even animations that never need to change can be created at startup without noticeable performance cost.

If someone proposes a concrete implementation (via a pull request), I may consider merging it. But even in that case, I may reject the PR if I feel it's adding too much complexity.

If you would like to try creating a PR, make sure to:

  • gate that functionality behind a new feature flag named unstable-comptime
  • write automated tests

@jcornaz jcornaz added the up-for-grabs The maintener is unlikely to work on this anytime soon. If you want it, build it! label Feb 20, 2024
@jcornaz
Copy link
Owner

jcornaz commented Feb 20, 2024

That being said, if it can be done without much more complexity than a handful of simple const functions, then I am up for it 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
up-for-grabs The maintener is unlikely to work on this anytime soon. If you want it, build it!
Projects
None yet
Development

No branches or pull requests

2 participants