{"id":13995409,"url":"https://github.com/torkleyy/nitric","last_synced_at":"2025-08-20T20:32:06.256Z","repository":{"id":57645148,"uuid":"158427969","full_name":"torkleyy/nitric","owner":"torkleyy","description":"[ABANDONED] General-purpose data processing library. Mirror of https://gitlab.com/nitric/nitric","archived":false,"fork":false,"pushed_at":"2020-09-17T14:41:17.000Z","size":108,"stargazers_count":84,"open_issues_count":0,"forks_count":2,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-12-09T04:45:29.590Z","etag":null,"topics":["data","ecs","entity-component","processing"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/torkleyy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-20T17:34:36.000Z","updated_at":"2022-10-09T06:17:07.000Z","dependencies_parsed_at":"2022-09-08T16:41:10.246Z","dependency_job_id":null,"html_url":"https://github.com/torkleyy/nitric","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torkleyy%2Fnitric","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torkleyy%2Fnitric/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torkleyy%2Fnitric/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torkleyy%2Fnitric/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/torkleyy","download_url":"https://codeload.github.com/torkleyy/nitric/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230052226,"owners_count":18165367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data","ecs","entity-component","processing"],"created_at":"2024-08-09T14:03:23.405Z","updated_at":"2024-12-19T15:08:05.430Z","avatar_url":"https://github.com/torkleyy.png","language":"Rust","readme":"# `nitric`(ABANDONED)\n\n[![Build Status](https://img.shields.io/travis-ci/torkleyy/nitric.svg?style=flat-square)](https://travis-ci.org/torkleyy/nitric)\n[![Code coverage](https://img.shields.io/codecov/c/gitlab/nitric/nitric/master.svg?style=flat-square)](https://codecov.io/gl/nitric/nitric/branch/master)\n[![Crates.io](https://img.shields.io/crates/v/nitric.svg?style=flat-square)](https://crates.io/crates/nitric)\n[![API Docs](https://img.shields.io/badge/API-on%20docs.rs-blue.svg?style=flat-square)](https://docs.rs/nitric)\n\nGeneral-purpose data processing library.\n\n\u003e Status notes: highly experimental, unfinished, work in progress, not recommended for use\n\nThis library is meant as a successor for [Specs], a parallel ECS library. However, `nitric` aims to be more general\nand composable than Specs. In fact, Specs can be implemented as a frontend for `nitric` once this library is complete.\n\n[Specs]: https://github.com/slide-rs/specs\n\n* [nitric on GitLab](https://gitlab.com/nitric/nitric)\n* [nitric on GitHub (mirror)](https://github.com/torkleyy/nitric)\n\n## Motivation\n\nSpecs has many problems, both big and small. The library grew big without much planning and as it is now this will\ncontinue and make it very hard to maintain. That's what made me think about what I want to create. This is what I\nended up with:\n\n### Vision\n\nThe vision for `nitric` is to provide a set of crates that evolve as the standard way to solve data processing\nproblems. There were already very interesting use cases for Specs, including using it for a compiler and performing\nlarger simulations, both outside of Specs' original scope (ECS for game development). This is what I intend to make\n`nitric` suitable for. So to list a few examples of what `nitric` could be used for in the future:\n\n* game development\n* game physics\n* simulations\n* compilers\n* data validation\n* Graphical User Interfaces\n\nThe question of how to structure your library/application is a very common one, everywhere in programming. The\nplan for `nitric` is not to force any of them, but to provide useful and modular facilities that allow for specific\npatterns (e.g. [Entity Component System] (1)), and to provide \"recipes\", similar to the [Rust cookbook] that show how\ncommon tasks can be solved. Nice side effects of that are that we can work on one implementation, that is efficient\nand can allow for neat extra functionality (debugging facilities, profiling, easy multi-threading, etc.).\n\n(1) for ECS, also see [this great presentation by Catherine West][gpcw]\n\n[gpcw]: https://kyren.github.io/rustconf_2018_slides/index.html\n[Entity Component System]: https://en.wikipedia.org/wiki/Entity%E2%80%93component%E2%80%93system\n[Rust cookbook]: https://rust-lang-nursery.github.io/rust-cookbook/\n\n### Philosophy\n\n`nitric` will be a collection of crates all about processing data. All of its crates follow this philosophy:\n\n* Only solve a single problem, in a reasonably composable way\n* Expose a general, composable and robust API (also refer to the [API design document](docs/API.md))\n    * APIs should either be designed to not produce any error cases or return a `Result` with only the possible error\n      conditions\n    * Do not assume how the API is being used (-\u003e composability)\n    * Expose internals in a `*-internals` crate for stability by default, with the option to opt into more unstable\n      facilities\n* Impose minimal friction to use `nitric`\n    * The goal is for `nitric` to be cheap and easy to use in one place of your project for solving a particular problem\n    * `nitric` is meant to be compatible with other data structure / ECS / [CGS] libraries, e.g. [Specs], [froggy], etc.\n      instead of competing with them\n\n[froggy]: https://github.com/kvark/froggy\n[CGS]: https://github.com/kvark/froggy/wiki/Component-Graph-System\n\n### Using `nitric` as ECS\n\nHow will this allow you to use `nitric` instead of Specs? Here's the tentative design for ECS:\n\n* `nitric-entity`: Provides entity allocators, storages, and with that mappings between entities and components\n\nThis would already be enough to have an ECS. Systems can simply be functions that accept references to the storages\nand eventually the allocator. In fact, that is the recommended way for libraries to expose their API; libraries should\nnot assume how the code is executed. For example:\n\n(pseudo code for now)\n\n```rust\npub fn process_local_transforms(\n    local: \u0026Storage\u003cLocalTransform\u003e,\n    global: \u0026mut Storage\u003cGlobalTransform\u003e,\n    parents: \u0026Storage\u003cParent\u003e)\n{\n    // compute global transforms    \n}\n```\n\nIf those component storages come from a dynamically typed, string mapped `HashMap`, fine. If they are stored in a \n`struct` - works, too. How systems are run also doesn't matter.\n\nNow, there surely are other things Specs users would miss, so the next crate will be...\n\n* `nitric-world`\n\nAs you might have guessed, this provides a map that can store arbitrary component storages. In contrast to Specs,\nI also plan to include support for multiple values of the same type by allowing an additional key (e.g. a string).\n\n* `nitric-graph`\n\nThis will be a re-worked version of `shred`'s `Dispatcher`, allowing to parallelize data processing (execution of\nsystems). A \"system\" will simply be a `FnMut(T) -\u003e R`, which means it's up to the user how the data is fetched\n(`nitric` will provide solutions for this, but it doesn't force you to use any of them).\n\n## Structure\n\nThe main crate, `nitric` will simply serve as a top-level crate for re-exporting all `nitric-*` crates.\nHowever, since everything is optional, `nitric` is controlled with Cargo features, only exporting the crates for which\nyou enable the flag.\n\nCurrent crates:\n\n* [`nitric-component`] - Component storages with custom id spaces\n* [`nitric-lock`] - Locks with deadlock prevention \u0026 lock ordering\n\n[`nitric-component`]: crates/nitric-component/\n[`nitric-lock`]: crates/nitric-lock/\n\n## FAQ\n\n### What does this mean for Specs?\n\nFor the immediate future, this has no effect on Specs. It will not be deprecated. The biggest change for now is that\nI won't spend much time on it (just merge PRs and fix critical bugs).\n\nAs for when nitric is in a usable state, that has yet to be seen. In any case, it should be possible to make Specs a\nthin wrapper over `nitric` crates (if that's necessary). All that depends on how well `nitric` will be adopted.\n\n### What does this mean for Amethyst?\n\n[Amethyst] (a game engine that makes heavy use of Specs) will continue to use Specs. Whether it will use `nitric` in\nthe future will be decided by all members, through the usual RFC process. \n\n[Amethyst]: https://github.com/amethyst/amethyst\n\n## Contribution\n\n`nitric` can only exist with lively contributions and every help is very much appreciated!\n\nPlease note that in its current state, however, the project might not be very friendly for contributions. If you're\nstill interested in helping out, please contact me (@torkleyy) so we can make sure there's no duplicated effort.\n\n## License\n\nAll `nitric` projects are, except stated otherwise, dual-licensed under Apache-2.0 / MIT. You're free to choose one of\nboth licenses.\n\nEvery contribution made to this project is assumed to be licensed according to these terms.\n\nSee [LICENSE](LICENSE), [docs/LICENSE-MIT](docs/LICENSE-MIT) and [docs/LICENSE-APACHE](docs/LICENSE-APACHE) for more\ninformation.\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorkleyy%2Fnitric","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorkleyy%2Fnitric","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorkleyy%2Fnitric/lists"}