「‍」 Lingenic

HSV v1.0

Hierarchical Separated Values

HSV is both a file format (like CSV) and a streaming protocol. HSV is a carefully curated set of primary control codes standardized for modern use. In 1963, ASCII defined these characters for structured data (like JSON)—then we forgot about them and spent 60 years escaping quotes instead. No escaping. No quotes. All of Unicode is valid data, and binary mode handles raw bytes. It streams, and parsing parallelizes trivially.

CSV  →  1 level    (comma, quoting required)
JSON →  unlimited  (escaping required)
HSV  →  unlimited  + framing + protocol (no escaping)

Where It Fits

Save .hsv files and grep them, or stream records over a socket with acknowledgments. Binary formats like MessagePack and Protobuf are serialization-only.

HSV CSV JSON MsgPack Protobuf
File format
Hierarchy Unlimited 1 level Unlimited Unlimited Unlimited
Text tools work
No escaping Quoting
Streaming Lines
Framing (STX/ETX)
Protocol (ACK/NAK)

HSV is CSV with hierarchy, JSON without escaping, and unlike binary-only formats, you can debug with cat and grep.

Structure

key ␟ value                       key-value pair
pair ␞ pair ␞ pair                object
item ␝ item ␝ item                array
key ␟ ␎ nested ␏                  unlimited nesting (SO/SI)
␂ record ␜ record ␃               stream

Comparison with JSON

JSON (46 bytes)

{"name": "Alice", "age": "30", "city": "NYC"}

HSV (27 bytes)

name␟Alice␞age␟30␞city␟NYC

40% smaller. No quotes, braces, colons, or commas.

Escaping

JSON (escaping required)

{"msg": "He said \"hello\""}

HSV (no escaping)

msg␟He said "hello"

Newlines

JSON (must escape)

{"text": "line 1\nline 2"}

HSV (literal)

text␟line 1
line 2

Streaming

STX/ETX framing solves the streaming problem:

␂name␟Alice␞role␟admin␜name␟Bob␞role␟user␃

Unlike NDJSON, newlines in data don't break parsing. Unlike length-prefix, it's human-inspectable.

Headers

SOH (Start of Header) adds metadata before the data block:

␁hsv␟1.0␞content-type␟users␂name␟Alice␞role␟admin␃

Structure: ␁ header ␂ data ␃ — header properties use the same format as data. When present, hsv␟1.0 is the recommended first property for version identification.

Mixed Content

Everything outside STX…ETX is ignored—no special comment syntax needed:

This text is ignored
␂name␟Alice␞age␟30␃
So is this

Binary Mode

DLE (Data Link Escape) enables raw binary in values:

␐␂ [any bytes] ␐␃     binary section
␐␐                     literal DLE byte

Inside binary mode, only DLE needs escaping. All other bytes—including the 7 structure separators—are literal data. ~0.4% overhead for random binary.

type␟image␞data␟␐␂<raw PNG>␐␃␞width␟800

This is BISYNC-style transparency from 1967, finally applied to data serialization.

Implementations

Reference implementations in Rust and Python:

github.com/LingenicLLC/HSV

The Eighteen Control Codes

Eighteen invisible bytes reserved. Everything else is data.

CodeHexNamePurpose
Framing
10x01SOHStart header
20x02STXStart data block
30x03ETXEnd data block
40x04EOTEnd stream
Protocol
50x05ENQEnquiry (request ACK)
60x06ACKAcknowledge (success)
210x15NAKNegative acknowledge (error)
240x18CANCancel operation
Flow Control
170x11XONResume transmission
190x13XOFFPause transmission
220x16SYNSync/keepalive
Nesting
140x0ESOStart nested structure
150x0FSIEnd nested structure
160x10DLEBinary mode escape
Structure
280x1CFSRecord separator
290x1DGSArray element separator
300x1ERSProperty separator
310x1FUSKey-value separator

Tools may display control codes as: ␁ ␂ ␃ ␄ ␅ ␆ ␎ ␏ ␐ ␑ ␓ ␕ ␖ ␘ ␜ ␝ ␞ ␟

Quick Reference

Reserved:  0x01-0x06 0x0E-0x11 0x13 0x15-0x16 0x18 0x1C-0x1F  (18 bytes)
Data:      Everything else (all of Unicode)

Structure:
  ␟ (US)   key:value
  ␞ (RS)   properties
  ␝ (GS)   array items
  ␜ (FS)   records

Framing:   ␁...␂...␃  (SOH header, STX data, ETX end)
Nesting:   ␎...␏  (SO/SI, unlimited depth)
Binary:    ␐␂...␐␃  (DLE transparency)
Protocol:  ␅/␆/␕  (ENQ/ACK/NAK)
Flow:      ␑/␓/␖  (XON/XOFF/SYN)
Stream:    ␄  (EOT end of stream)

Extension: .hsv
MIME type: application/hsv