SYNX – AI 파이프라인용으로 구축된 YAML보다 67배 빠르게 구문 분석하는 구성 형식
hackernews
|
|
🔬 연구
#ai 파이프라인
#json
#review
#synx
#yaml
#설정 형식
#ai
#파이프라인
원문 출처: hackernews · Genesis Park에서 요약 및 분석
요약
SYNX v3.5는 AI 파이프라인과 인간의 사용 모두에 최적화된 새로운 구성 형식으로, 따옴표나 쉼표 없이 간결한 키-값 구조를 제공합니다. 특히 이 형식은 순수 타입스크립트로 작성된 VS Code 확장 프로그램을 통해 실시간 문법 검사, 자동 완성, 실시간 JSON 미리보기 등의 강력한 기능을 지원합니다. 성능 면에서는 110개의 키(2.5KB)를 약 39µs 만에 파싱하는 놀라운 속도를 자랑하며, Python 환경에서는 YAML보다 67배 더 빠르게 구문을 분석합니다. 아울러 다양한 레이어와 스칼라 타입 등을 포함하는 250개의 테스트 케이스를 통해 여러 LLM 모델이 해당 형식을 얼마나 정확하게 파싱하고 생성하는지 벤치마킹을 진행했습니다.
본문
Better than JSON. Cheaper than YAML. Built for AI and humans. Just key, space, value. No quotes, no commas, no braces: Add !active on the first line and your config comes alive — with logic built right into the format: This extension provides complete SYNX v3.5 language support for Visual Studio Code: | Feature | Description | |---|---| | Syntax Highlighting | Keys, values, markers, constraints, comments, types, template placeholders, colors | | IntelliSense | Autocomplete for 12 markers, 7 constraints, type casts, template keys, alias keys | | Hover Info | Documentation on markers, constraints, !active , key types and values | | Diagnostics | Real-time validation: tabs, indentation, duplicate keys, unknown markers, broken refs | | Go to Definition | Ctrl+Click on :alias , :template {ref} , :calc variable names, :include file paths | | Find References | Find all usages of any key across :alias , :template , :calc | | Document Outline | Full symbol tree in the Outline panel and breadcrumbs | | Formatting | Normalize indentation (2 spaces), trim whitespace, fix tabs | | Color Preview | Inline color swatches for #hex values (3/4/6/8-digit) | | Inlay Hints | Computed :calc results shown inline as = 500 | | Live Preview | Side panel with real-time parsed JSON output | | Convert | SYNX → JSON and JSON → SYNX conversion commands | | Freeze | Resolve all !active markers into a static .synx | | Context Menus | Right-click on .synx / .json files in Explorer or Editor | | Command | Shortcut | Description | |---|---|---| | SYNX: Convert to JSON | Ctrl+Shift+P → type | Parse .synx → save .json alongside it | | SYNX: Convert JSON → SYNX | Ctrl+Shift+P → type | Parse .json → save .synx alongside it | | SYNX: Freeze | Ctrl+Shift+P → type | Resolve all markers → save .static.synx | | SYNX: Preview | Ctrl+Shift+P → type | Open live side panel with parsed JSON | All commands also available via right-click context menu on .synx and .json files. The extension is zero-dependency — no external runtime, no native modules. Everything runs as pure TypeScript inside VS Code: src/ ├── extension.ts # Entry point — registers all providers ├── parser.ts # AST-like parser with position info (SynxNode, ParsedDoc) ├── diagnostics.ts # 15 diagnostic checks with severity levels ├── completion.ts # IntelliSense (12 markers, 7 constraints, types, hover) ├── navigation.ts # Document symbols, Go to Definition, Find References ├── formatter.ts # Formatting provider (2-space indent, trim) ├── commands.ts # Convert, Freeze, Preview commands ├── colors.ts # Color provider (#hex inline swatches) └── inlay-hints.ts # Inlay hints for :calc results The extension validates your .synx files in real time: | Check | Severity | Description | |---|---|---| | Tab characters | Error | SYNX uses spaces, not tabs | | Odd indentation | Warning | Indentation should be a multiple of 2 | | Invalid key start | Error | Keys cannot start with - , # , / , ! | | Duplicate keys | Warning | Same key at the same indent level | | Unknown type cast | Error | Only int , float , bool , string allowed | | Unknown marker | Warning | Not one of the 12 known markers | Markers without !active | Info | Markers only work in active mode | :alias broken ref | Error | Referenced key doesn't exist | :calc unknown var | Warning | Variable in expression not defined | :include file missing | Error | Included file not found | :template missing key | Warning | {placeholder} key not found | Constraints without !active | Info | Constraints only work in active mode | | Unknown constraint | Warning | Not one of the 7 known constraints | min /max non-numeric | Error | Min/max values must be numbers | enum invalid value | Error | Value not in allowed list | SYNX v3.5 uses a unified Rust core with native bindings. Real benchmark results on a 110-key config (2.5 KB): | Benchmark | Time | |---|---| Synx::parse (110 keys) | ~39 µs | parse_to_json (110 keys) | ~42 µs | Synx::parse (4 keys) | ~1.2 µs | | Parser | µs/parse | |---|---| JSON.parse (3.3 KB) | 6.08 µs | synx-js pure TS | 39.20 µs | js-yaml (2.5 KB) | 82.85 µs | synx-native parseToJson | 86.29 µs | synx-native parse | 186.84 µs | | Parser | µs/parse | |---|---| json.loads (3.3 KB) | 13.04 µs | synx_native.parse (2.5 KB) | 55.44 µs | yaml.safe_load (2.5 KB) | 3,698 µs | SYNX parses 67× faster than YAML in Python. In Node.js, the pure TS parser matches Rust direct speed at ~39 µs. How well different LLM models understand and work with SYNX format: We benchmark how well LLMs can: - Parse: Read SYNX format and convert to JSON - Generate: Create SYNX from English descriptions Test corpus now has 250 total cases: - 125 parsing tests ( SYNX -> JSON ) - 125 generation tests ( Description -> SYNX ) What is inside the test texts: - Parsing texts include simple key-value pairs, nested blocks (2-4 levels), arrays, mixed scalar types, null values, comments ( // ,/* */ ), strings with spaces, and configuration-like documents (service/database/deployment shapes
Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.
공유