https://github.com/heydocode/packed_dsl
https://github.com/heydocode/packed_dsl
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/heydocode/packed_dsl
- Owner: heydocode
- License: mit
- Created: 2026-05-16T11:30:46.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-06-14T11:58:59.000Z (about 1 month ago)
- Last Synced: 2026-06-14T13:24:24.878Z (about 1 month ago)
- Language: Rust
- Size: 83 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# packed_dsl
This project is in its planning stage and the information you can see below is
speculative, but it shows my thoughts about the design and goals of `packed_dsl`.

## About
This crate is made with a purpose to facilitate the creation of extremely compact and efficient mods / plugins / network protocols
through custom bytecode DSLs, generated from Rust enums.
The crate's goals are:
- minimizing disk and memory usage
- reducing runtime overhead
- providing deterministic and portable deserialization
- depending only on `core`, allowing use in `no_std`, embedded, and allocator-free environments
In contrast to Lua and Wasm, `packed_dsl` is not intended for creating another general-purpose scripting language:
it is intended for creating bytecode from high-level instructions defined by the programmer, that, once deserialized,
are executed directly by Rust code, therefore minimizing runtime overhead even more.
The library handles:
- DSL serialization & deserialization with a compact bytecode generation
- automatic discriminant sizing
- padding removal on serialization
- compatibility check through compile-time hashes
The user remains responsible for handling the deserialized instructions. During compilation,
the crate computes hashes of all types used in the instruction set, then the instruction set itself.
The hash result is embedded into the binary, and a mod / plugin / network protocol can simply use
the public associated constant of the instruction enum to embed the hash into the DSL contents too.
At runtime, there's a negligible overhead: u64 == u64 (may be changed to u128).