「‍」 Lingenic

README

(⤓.md ◇.md); γ ≜ [2026-01-27T113137.906, 2026-01-27T113137.906] ∧ |γ| = 1

HSV - Hierarchical Separated Values

HSV is both a text-based file format and a streaming protocol, using ASCII control characters. Unlimited nesting (like JSON). No escaping required. Binary data supported via DLE transparency.

Spec: hsvfile.com

Features

  • No escaping - Quotes, backslashes, newlines are literal data
  • Streaming - STX/ETX framing with clear block boundaries
  • Unlimited nesting - SO/SI for nested structures
  • Binary mode - DLE transparency for raw bytes
  • Parallel parsing - Records are independent, trivially parallelizable

Quick Start

use hsv::{parse, HsvValue};

// Parse a simple record
let data = "\x02name\x1fAlice\x1eage\x1f30\x03";
let doc = hsv::parse(data);

println!("{:?}", doc.records[0].get("name"));
// Some(String("Alice"))

Control Characters

CodeHexSymbolPurpose
US0x1FKey-value separator
RS0x1EProperty separator
GS0x1DArray element separator
FS0x1CRecord separator
STX0x02Start data block
ETX0x03End data block
SOH0x01Start header
SO0x0EStart nested structure
SI0x0FEnd nested structure
DLE0x10Binary mode escape

Examples

Basic key-value

␂name␟Alice␞age␟30␃
let doc = hsv::parse("\x02name\x1fAlice\x1eage\x1f30\x03");
// records: [{"name": "Alice", "age": "30"}]

Arrays

␂tags␟admin␝user␝guest␃
let doc = hsv::parse("\x02tags\x1fadmin\x1duser\x1dguest\x03");
// records: [{"tags": ["admin", "user", "guest"]}]

Nested structures

␂user␟␎name␟Alice␞email␟a@b.com␏␃
let doc = hsv::parse("\x02user\x1f\x0ename\x1fAlice\x1eemail\x1fa@b.com\x0f\x03");
// records: [{"user": {"name": "Alice", "email": "a@b.com"}}]

Headers

␁hsv␟1.0␞type␟users␂name␟Alice␃
let doc = hsv::parse("\x01hsv\x1f1.0\x1etype\x1fusers\x02name\x1fAlice\x03");
// header: {"hsv": "1.0", "type": "users"}
// records: [{"name": "Alice"}]

Parallel vs Sequential

The default parse() function uses Rayon for parallel processing of blocks:

// Parallel (default) - faster for large inputs
let doc = hsv::parse(large_data);

// Sequential - deterministic ordering, better for small inputs
let doc = hsv::parse_sequential(small_data);

Parallel HTML Parsing

HSV enables parallel parsing of HTML-like structured documents—something research has struggled with for 30 years. See go-html-parallel/ for a proof-of-concept.

Prior research (HPar 2013, ZOOMM 2013, Servo 2017) achieved limited results due to HTML's stateful parsing model. HSV changes the question: instead of "how do we parallelize HTML parsing?" it asks "why use a format that requires sequential parsing?"

cd go-html-parallel && go test -v

Language Implementations

LanguageDirectoryTests
Rustrust/15 passing
C++cpp/31 passing
Cc/10 passing
Gogo/12 passing
Javajava/10 passing
Pythonpython/14 passing
JavaScript/TypeScriptjs/12 passing
PHPphp/13 passing
Perlperl/11 passing
Common Lisplisp/28 passing
Fortranfortran/16 passing
COBOLcobol/6 passing

Python Example

import hsv

doc = hsv.parse("\x02name\x1fAlice\x1eage\x1f30\x03")
print(doc['records'])
# [{'name': 'Alice', 'age': '30'}]

Go Example

import "hsv"

doc := hsv.Parse("\x02name\x1fAlice\x1eage\x1f30\x03")
fmt.Println(doc.Records[0]["name"])
// Alice

JavaScript Example

const hsv = require('./hsv');

const doc = hsv.parse("\x02name\x1fAlice\x1eage\x1f30\x03");
console.log(doc.records[0].name);
// Alice

License

CC0 1.0 - Public Domain

HSV was formalized as an open standard by Danslav Slavenskoj, Lingenic LLC, on 2026-01-27, based on traditional ASCII control character semantics (ANSI X3.4-1963).