Tins · Primitives
thrift
Apache Thrift serialization in pure Mojo — compact and binary protocols — plus every struct, union and enum of the Parquet metadata schema, generated ahead of time.
Install
plain pixi:
pixi init app -c https://conda.modular.com/max -c conda-forge && cd app
sed -i.bak 's/^\[workspace\]/[workspace]\npreview = ["pixi-build"]/' pixi.toml
pixi add "mojo-compiler==1.2.0"
# Without mojoshelf: the tin as a git dependency at its published commit.
# Transitive dependencies may be wrong: pixi takes the tin's own git deps as
# pinned in its pixi.toml, which may not match what other tins pin, and then
# fails with "duplicate records". mojoshelf picks revisions that agree.
pixi add thrift-mojo --git https://github.com/magmalake/thrift.mojo --rev 21cdbce67d22d72e88e88a60e2f168b05b4ef9fa No mojoshelf needed. If pixi reports duplicate records, the mojoshelf tab picks revisions that agree.
Version
0.1.3 on mojoshelf
Source
What it does
Works today
- TCompactProtocol and TBinaryProtocol behind one trait
- All of parquet.thrift, pre-generated
- Footer, page-header and page-index decode helpers
- No RPC, no runtime IDL, no dependencies
Correctness
Checked against Apache Thrift itself — 13 generated wire vectors, byte-identical
Byte-identical to Apache Thrift on generated wire vectors, in both the compact and the binary protocol.