DeukPack
agent
Basarisiz
Health Gecti
- License — License: Apache-2.0
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 19 GitHub stars
Code Basarisiz
- rimraf — Recursive directory removal in package-lock.json
- rimraf — Recursive directory removal in package.json
- fs module — File system access in scripts/audit-projector-ownership.js
- fs.rmSync — Destructive file system operation in scripts/bench/serializer-bench.ts
- fs module — File system access in scripts/checks/audit-generated-objects.js
- child_process — Shell command execution capability in scripts/checks/compare-syntax-canonical.js
- spawnSync — Synchronous process spawning in scripts/checks/compare-syntax-canonical.js
- fs module — File system access in scripts/checks/compare-syntax-canonical.js
- fs module — File system access in scripts/checks/docs-boundary.js
- spawnSync — Synchronous process spawning in scripts/compile-gate/agent-exec.mjs
- process.env — Environment variable access in scripts/compile-gate/agent-exec.mjs
- network request — Outbound network request in scripts/compile-gate/agent-exec.mjs
- child_process — Shell command execution capability in scripts/compile-gate/dotnet.js
- exec() — Shell command execution in scripts/compile-gate/dotnet.js
- spawnSync — Synchronous process spawning in scripts/compile-gate/dotnet.js
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
DeukPack: one IDL (.deuk, .proto, .thrift) to typed objects and serializers for C#, Python, TypeScript, JavaScript, C++ and Rust
README.md
DeukPack
A code generator that turns one IDL into typed objects and serializers.
Made by deuklab. Homepage and manual: deuklab.com/deukpack. npm: deukpack.
Scope
- Input IDL:
.deuk·.proto·.thrift - Output languages: C# · Python · JavaScript · TypeScript · C++
- Output language: Rust
- Formats: DeukPack native (
dppack) · protobuf-compatible (xpb) · Thrift-compatible (xtbinaryxtcompact) · JSON (dpjson) · CSV (dpcsv) - I/O: bytes · stream · file
- Source of truth: docs/public/architecture/TARGET_SCOPE.md
Support matrix
Only cells whose gate (npm run verify) passes are listed. An empty cell means unsupported.
| Format | TypeScript | JavaScript | Python | C++ | C# | Rust |
|---|---|---|---|---|---|---|
dppack |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
xpb |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
xtbinary |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
xtcompact |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
dpjson |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
dpcsv |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
- Every cell covers bytes, streams and files.
xpbalone carries one record per input and applies to records proto3 can express - Check 1, against official implementations in both directions: Apache Thrift, protobufjs,
JSON.parse,csv-parse, and a dppack decoder written separately from the spec - Check 2, across languages: one language packs, the other five unpack and compare (30 directions × 6 formats)
- Input schemas: fixtures, their proto and thrift conversions, and seed-generated schemas
- Platforms observed: Windows x64 (C++ on MSVC), Linux x64 (C++ on GCC). Clang and macOS are not observed
- Rust: observed on Windows x64 and Linux x64 (cargo 1.75 on the linux build agent)
- Measured performance: docs/public/BENCHMARK.md
IDL example
namespace Dto
struct Hero {
1> required int32 id
2> required string name
3> optional float hp
}
- Full grammar: docs/public/IDL.md
Install
npm i -g deukpack # CLI on PATH: deukpack
npx deukpack --version # or run without installing
- Needs Node.js 18 or later
- The generated code needs no DeukPack package: each output carries its own runtime
Usage
deukpack gen hero.deuk --lang csharp,python --out generated
- PowerShell: quote the list,
--lang "csharp,python"
Using the generated code
One codec per record. format = dppack xpb xtbinary xtcompact dpjson dpcsv.
| Language | Pack | Unpack |
|---|---|---|
| TypeScript, JavaScript | HeroCodec.pack(hero, 'dppack') |
HeroCodec.unpack(bytes, 'dppack') |
| Python | HeroCodec.pack(hero, 'dppack') |
HeroCodec.unpack(data, 'dppack') |
| C# | HeroCodec.Pack(hero, "dppack") |
HeroCodec.Unpack(bytes, "dppack") |
| C++ | Dto::DpPack(hero, "dppack") |
Dto::DpUnpack(hero, bytes, "dppack") |
| Rust | hero.dp_pack("dppack")? |
Hero::dp_unpack(bytes, "dppack")? |
- Files:
<idl>.codec.*holds the codecs,<idl>.*the objects - Python:
<idl>_codec.py,<idl>.py - C#: the namespace is PascalCase (
namespace Dto→Dto) - C++: build
dp_serializer.cppand<idl>.codec.cppwith your sources - Rust:
mod dp_serializer; mod dp_model; mod dp_codec;in your crate root
With a project config
deukpack init --idl schema/hero.deuk --lang typescript=gen/ts --lang python=gen/py --lang rust=gen/rs
deukpack gen # every language deukpack.json names
deukpack gen --config <file> # another config file
initwritesdeukpack.jsonin the current directory: the IDL, an output directory per language,--cpp-allocator,--no-serializer- An existing file is an error;
--forcereplaces it - Paths are relative to
deukpack.json. An unknown key, an unknown language or emptylanguagesis an error - Each language's output carries its own format runtime: no per-language DeukPack package to install
Common
- Input: one
.deuk,.protoor.thriftfile --lang:typescriptjavascriptpythoncppcsharprust; several go to<out>/<language>/- Output: objects, codecs and the format runtime;
--no-serializeremits objects only - C++ arena:
--cpp-allocator pmrmakes generated objects usestd::pmrcontainers and propagates the memory resource you pass through every nested level. The default stays plain standard containers. Keep one arena per thread or per message - C# output builds for both netstandard2.1 and the installed .NET runtime, in C# 9 syntax
- Python objects are pydantic v2 models (
pip install "pydantic>=2"): strict, validated on assignment, integer widths range-checked python.modelsindeukpack.json: codecs read and write your own pydantic models, no object modulepython.scalarChoice: abool | int | float | strfield carried as one recordpython.native: true: adds a pyo3 crate (native/) anddp_native.py, the Rust codec over your modelspython.nativebuild: cargo, on the machine that runs Python
Development
mise install
npm ci
npm run verify # every gate
npm run build # dist/
npm run dev:install # this checkout: build, pack, install globally
npm run bench -- --idl <file> # pack / unpack timings per format, all six languages
npx tsx scripts/compile-gate/serializer-cross.ts # cross-language data integrity
npx tsx scripts/compile-gate/serializer-gate.ts <language> [--idl <file>] [--fuzz <seed>]
- Tool versions:
.tool-versions - Gate inputs are fixture schemas, their proto and thrift conversions, and seed-generated ones;
--idlchecks any schema
Documents
| Kind | Location |
|---|---|
| IDL grammar | docs/public/IDL.md |
| Scope | docs/public/architecture/TARGET_SCOPE.md |
| Serializer contract | docs/public/architecture/SERIALIZER_CONTRACT.md |
| Generated object contract | docs/public/architecture/GENERATED_OBJECT_CONTRACT.md |
| Format specs | docs/public/protocol/specs/ |
| Releases | releases |
| Releasing | RELEASING.md |
| Document layout | docs/README.md |
| Measured performance | docs/public/BENCHMARK.md |
| Naming | docs/public/IDENTITY.md |
| Support | SUPPORT.md |
Deferred
- Excel integration · Unity (UPM) · VS Code extension · DB · MCP
- Languages: Java, Elixir
License
Apache License 2.0 — LICENSE · NOTICE. Not an Apache Thrift subproject.
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi