Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hadronized/semantics
Semantics mapping between strings and integers
https://github.com/hadronized/semantics
Last synced: about 2 months ago
JSON representation
Semantics mapping between strings and integers
- Host: GitHub
- URL: https://github.com/hadronized/semantics
- Owner: hadronized
- License: other
- Created: 2022-07-07T14:56:31.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-07-07T15:01:23.000Z (over 2 years ago)
- Last Synced: 2024-10-31T12:13:08.730Z (2 months ago)
- Language: Rust
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Semantics
The term _semantics_ here is used to describe a value / type that strongly _represents_ something else, tracking its
type in the type-system and carrying its representation as an integer value at runtime. Semantics allow to represent
something meaningful, like a _user_, a _field_, etc. by using integers underneath. The target audience is people writing
protocols between two systems that are using two different namespaces.The main motivation for this crate is [luminance], which needs to be able to _represent_ attributes (vertex attribute
like a position, normal, color; fragment outputs, etc.) in two different namespaces:- The Rust code, where those attributes are manipulated via regular Rust variables.
- GLSL code, which might use different names for those variables.Semantics allow an indirection for both systems to “speak the same language” and “represent the same data.”
[luminance]: https://crates.io/crates/luminance