{"id":23711325,"url":"https://github.com/kirillsemyonkin/lsd","last_synced_at":"2026-02-27T19:15:29.411Z","repository":{"id":209462076,"uuid":"724147412","full_name":"kirillsemyonkin/lsd","owner":"kirillsemyonkin","description":"LSD (Less Syntax Data) configuration/data transfer format.","archived":false,"fork":false,"pushed_at":"2025-05-28T14:38:28.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-20T02:24:44.234Z","etag":null,"topics":["configuration","data","java","parsing","rust"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kirillsemyonkin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE-2.0","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-11-27T13:48:58.000Z","updated_at":"2025-05-28T14:38:33.000Z","dependencies_parsed_at":"2025-05-23T07:15:54.059Z","dependency_job_id":"d567ca53-8a94-45c7-9734-7f321c3a199b","html_url":"https://github.com/kirillsemyonkin/lsd","commit_stats":null,"previous_names":["kirillsemyonkin/lsd"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kirillsemyonkin/lsd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillsemyonkin%2Flsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillsemyonkin%2Flsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillsemyonkin%2Flsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillsemyonkin%2Flsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kirillsemyonkin","download_url":"https://codeload.github.com/kirillsemyonkin/lsd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillsemyonkin%2Flsd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29909433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T17:28:36.873Z","status":"ssl_error","status_checked_at":"2026-02-27T17:28:20.970Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configuration","data","java","parsing","rust"],"created_at":"2024-12-30T19:38:08.003Z","updated_at":"2026-02-27T19:15:29.400Z","avatar_url":"https://github.com/kirillsemyonkin.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LSD\r\n\r\nLSD (Less Syntax Data, also LSData, `.lsd`) is a human-readable configuration / data transfer format\r\nintended to have a very simple syntax (less characters) without complex rules or limitations\r\n(necessary indents of same type, necessary quotes, closing things with repeating same things, etc).\r\n\r\n## Implementations / Usage\r\n\r\nLSD libraries are available in following implementations:\r\n\r\n- [Rust](rust)\r\n- [Java](java)\r\n\r\nMore implementations may be added here (if you are an author - give us a PR to add a link to this\r\nlist or to add a whole implementation).\r\n\r\nEach folder has own `README.md` file that describes installation.\r\n\r\n### Paths\r\n\r\nImplementations provide a way for reading values from LSD files with deeply nested values. The keys\r\nare represented by one-dimensional arrays, containing either only strings or dynamically typed\r\narrays with optimization for numerical indices (lists may be accessed with non-negative integers).\r\nHere are examples with [Rust](rust) and [Java](java):\r\n\r\n\u003c!-- Note for editors: adding more languages to this example is not necessary.\r\n     Use individual README.md files. --\u003e\r\n\r\n```rust\r\nlet inner_lsd = lsd.inner(key![\"users\" 0 \"name of the user\"]);\r\n```\r\n\r\n```java\r\nvar inner_lsd = lsd.inner(\"users\", 0, \"name of the user\");\r\n```\r\n\r\n## Syntax\r\n\r\nLSD files have only 3 types of inner LSDs (also may be called *elements*): *values*, *levels* and\r\n*lists*. Line-comments are also supported with the `#` character.\r\n\r\n```grammar\r\nIWS ::= (' ' | '\\t')*\r\nNWS ::= IWS (('#' (_ - '\\r' - '\\n')*)? ('\\r' | '\\n') IWS)*\r\n\r\n# Value can read [ and { so do not go to it first\r\nLSD ::= List | Level | Value\r\n\r\nmain ::= NWS (Level NWS | List NWS | LevelInner)\r\n```\r\n\r\n### Values\r\n\r\nValue is a simple piece of data. It has no inner LSDs. Numbers are not distinguished from strings\r\n(you will have to distinguish them in your code instead).\r\n\r\nYou may optionally wrap a value in quotes (single `'...'` or double `\"...\"`), which enables you to\r\nuse string formatting using escape sequences (starting with a backslash `\\`):\r\n\r\n| Escape sequence    | Result                                                                    |\r\n|--------------------|---------------------------------------------------------------------------|\r\n| `\\\"`, `\\'`, `\\\\`   | character, as-is (`\\x22`, `\\x27`, `\\x5C`)                                 |\r\n| `\\0`               | null (`\\x00`)                                                             |\r\n| `\\a`, `\\A`         | alert / bell (`\\x07`)                                                     |\r\n| `\\b`, `\\B`         | backspace (`\\x08`)                                                        |\r\n| `\\t`, `\\T`         | (horizontal) tab (`\\x09`)                                                 |\r\n| `\\n`, `\\N`         | newline / line feed (`\\x0A`)                                              |\r\n| `\\v`, `\\V`         | vertical tab (`\\x0B`)                                                     |\r\n| `\\f`, `\\F`         | form feed (`\\x0C`)                                                        |\r\n| `\\r`, `\\R`         | carriage return (`\\x0D`)                                                  |\r\n| `\\x##`, `\\X##`     | any utf-8 character (with sequences support!), `#` is a hex digit         |\r\n| `\\u####`, `\\U####` | any utf-16 character (with surrogate pair support!), `#` is a hex digit   |\r\n\r\nValues end on a newline. Strings that follow values (and vice-versa) get concatenated with the\r\nwhitespace between them. Values appear as always trimmed (stripped of whitespace on both sides),\r\nbut there are cases when it is not the case. Lists and levels that may appear in a value get\r\ninterpreted as plain characters.\r\n\r\n```lsd\r\n10                                         # \"10\"\r\nHello world!                               # \"Hello world!\"\r\n\"# Test\\n\\nTesting strings with newlines\"  # \"# Test\\n\\nTesting strings with newlines\"\r\n10 \"px\"                                    # \"10 px\"\r\na  b                                       # \"a  b\"\r\n  a  b                                     # \"a  b\"\r\n```\r\n\r\n```grammar\r\nValue ::= ValuePart (IWS ValuePart)*\r\n\r\nValueWordChar ::= _ - ' ' - '\\t' - '\\r' - '\\n' - '\"' - '\\'' - '#'\r\nValueWord ::= ValueWordChar+\r\nValuePart ::= ValueWord | String\r\nString ::= '\"' (Escape | StringChar | '\\'')* '\"'\r\n         | '\\'' (Escape | StringChar | '\\\"')* '\\''\r\nStringChar ::= _ - '\\'' - '\\\"' - '\\\\' - '\\r' - '\\n'\r\nEscape ::= '\\\\\\\"' | '\\\\\\'' | '\\\\\\\\'\r\n         | '\\\\0'\r\n         | '\\\\a' | '\\\\A'\r\n         | '\\\\b' | '\\\\B'\r\n         | '\\\\t' | '\\\\T'\r\n         | '\\\\n' | '\\\\N'\r\n         | '\\\\v' | '\\\\V'\r\n         | '\\\\f' | '\\\\F'\r\n         | '\\\\r' | '\\\\R'\r\n         # utf-8 logic omitted\r\n         | '\\\\x' Hex Hex | '\\\\X' Hex Hex\r\n         # utf-16 logic omitted\r\n         | '\\\\u' Hex Hex Hex Hex | '\\\\U' Hex Hex Hex Hex\r\nHex ::= 'a' . 'f' | 'A' . 'F' | '0' . '9'\r\n```\r\n\r\n### Levels\r\n\r\nLevel (map, dictionaries) is an ordered set of key-LSD pairs, where key is a unique word or string.\r\nThe syntax for levels uses curly braces `{...}`, and inside contains keys/paths followed by some\r\nwhitespace, LSDs, and then newlines. An LSD file is immediately put into a level, if it is not\r\na list (`[...]`) and not a level (`{...}`), and thus, empty file is considered an empty level.\r\nLevels with matching paths are merged. Levels may be omitted altogether and replaced by a dot `.` in\r\na key/path (level itself does not have to exist beforehand).\r\n\r\n```lsd\r\nkey value\r\nlevel {\r\n    a b\r\n}\r\n# {\"key\": \"value\", \"level\": {\"a\": \"b\"}}\r\n\r\n\"empty level\" {}\r\n# {\"empty level\": {}}\r\n\r\nouter{ # no space before `{` and `[` or after a string - also accepted\r\n    \"example level\" {\r\n        value 10\r\n    }\r\n}\r\nouter.\"example level\".value2 20\r\na.b.c 30\r\n# {\"outer\": {\"example level\": {\"value\": \"10\", \"value2\": \"20\"}}, \"a\": {\"b\": {\"c\": \"30\"}}}\r\n```\r\n\r\n```grammar\r\nLevel ::= '{' NWS LevelInner '}'\r\n\r\nLevelInner ::= (KeyPath NWS LevelLSD NWS)*\r\n\r\nKeyPath ::= KeyPart ('.' KeyPart)*\r\nKeyPart ::= (KeyWord | String)+\r\nKeyWord ::= (ValueWordChar - '{' - '}' - '[' - ']' - '.')+\r\n\r\nLevelLSD ::= LevelValue | List | Level\r\nLevelValue ::= LevelValuePart (IWS LevelValuePart)*\r\nLevelValueWordChar ::= ValueWordChar - '}'\r\nLevelValueWord ::= LevelValueWordChar+\r\nLevelValuePart ::= LevelValueWord | String\r\n```\r\n\r\n### Lists\r\n\r\nList (vector) is an ordered collection of non-necessarily-unique LSDs. Lists use square brackets\r\n`[...]` syntax.\r\n\r\n```lsd\r\n[\r\n    test\r\n    of things\r\n    \"and such\"\r\n    {\r\n        a b\r\n    }\r\n]\r\n# [\"test\", \"of things\", \"and such\", {\"a\": \"b\"}]\r\n\r\n[{} as {}]  # [{}, \"as\", {}]\r\n```\r\n\r\n```grammar\r\nList ::= '[' NWS (ListLSD NWS)* ']'\r\n\r\nListLSD ::= ListValue | List | Level\r\nListPart ::= (ListWord | String)+\r\nListWord ::= (ValueWordChar - '{' - '}' - '[' - ']')+\r\nListValue ::= ListPart (IWS ListPart)*\r\n```\r\n\r\n### Example\r\n\r\nHere is an example file that describes how an LSD file may look (taken from\r\n[buildpp](https://github.com/kirillsemyonkin/buildpp/blob/master/example.buildpp.lsd)):\r\n\r\n```lsd\r\nname project-name\r\nversion 0.1.0\r\n\r\ndependency {\r\n    msmpi {\r\n        is local pair\r\n        include C:\\Program Files (x86)\\Microsoft SDKs\\MPI\\Include\r\n        library C:\\Program Files (x86)\\Microsoft SDKs\\MPI\\Lib\\x64\r\n    }\r\n}\r\n\r\nprofile {\r\n    default {\r\n        is msvc\r\n        standard c++20 \r\n    }\r\n}\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirillsemyonkin%2Flsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkirillsemyonkin%2Flsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirillsemyonkin%2Flsd/lists"}