Skip to content

TwilicCompact binary format for structured data

MessagePack-like usability. Decisively smaller on repeated structure, keys, strings, and homogeneous arrays.

import { encode, decode } from '@twilic/core'

// same-shape objects → keys sent once
const records = [
  { id: 1001n, name: 'alice', score: 98.6 },
  { id: 1002n, name: 'bob',   score: 74.1 },
  { id: 1003n, name: 'carol', score: 88.0 },
]

const bytes   = encode(records)
// keys written once · values only per row

const decoded = decode(bytes)

Woven from repetition

Named after Old English twilic — the root of twill. Repeated keys, shapes, and strings are woven together, not sent again and again.

Schema-less or schema-aware

Dynamic profile works like MessagePack with no schema required. Bound profile uses a shared schema to eliminate field names and type tags entirely.

Deferred optimization

First transmission may be self-describing. Compact forms activate automatically as repetition is observed — no manual tuning needed.

Batch & columnar encoding

Row-wise and columnar batch profiles with per-column codecs — delta, FOR, RLE, XOR float, dictionary — for decisive wins on tabular data.

Stateful session compression

Optional stateful mode supports base snapshots, state patches, template batches, and trained dictionaries over long-lived streams.

Eighteen language SDKs

Official implementations in Rust, Go, Python, JavaScript/TypeScript, Java, Scala, Ruby, R, Zig, PHP, Kotlin, Dart, Elixir, Lua, C, C++, C#, and Swift.

Released under the CC-BY-4.0 License.