{"id":16306160,"url":"https://github.com/gfx/tiscript","last_synced_at":"2026-03-10T19:32:22.473Z","repository":{"id":247609646,"uuid":"824569954","full_name":"gfx/tiscript","owner":"gfx","description":"Turing-Incomplete TypeScript as a Configuration Language","archived":false,"fork":false,"pushed_at":"2024-09-16T12:59:40.000Z","size":321,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-19T16:50:10.406Z","etag":null,"topics":["configuration-language","json","rust","rust-crate","typescript"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gfx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-07-05T12:15:36.000Z","updated_at":"2025-10-06T09:28:31.000Z","dependencies_parsed_at":"2024-09-16T14:59:04.579Z","dependency_job_id":null,"html_url":"https://github.com/gfx/tiscript","commit_stats":null,"previous_names":["gfx/titys","gfx/tiscript"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/gfx/tiscript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfx%2Ftiscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfx%2Ftiscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfx%2Ftiscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfx%2Ftiscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gfx","download_url":"https://codeload.github.com/gfx/tiscript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfx%2Ftiscript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30350071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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-language","json","rust","rust-crate","typescript"],"created_at":"2024-10-10T21:09:49.967Z","updated_at":"2026-03-10T19:32:22.451Z","avatar_url":"https://github.com/gfx.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TiScript - Turing-Incomplete TypeScript as a Configuration Language [![crates.io](https://img.shields.io/crates/v/tiscript.svg)](https://crates.io/crates/tiscript) [![CI](https://github.com/gfx/tiscript/actions/workflows/ci.yml/badge.svg)](https://github.com/gfx/tiscript/actions/workflows/ci.yml)\n\nTiScript is a configuration language designed to be intuitive and easy for humans and machines. It draws inspiration from TypeScript and JSON, offering the benefits of both:\n\n* **Readability and maintainability** for humans, similar to JSON.\n* **Type safety and structure** for machines inspired by TypeScript.\n\nTiScript is intentionally designed to be **Turing incomplete**. This means it focuses on defining configurations and is not intended for general programming tasks. However, since it's a subset of TypeScript, you can still leverage the TypeScript development toolkit for features like language services.\n\n## Project Status\n\nThis is a work in progress. **The current implementation is MVP** and not intended to be used in production.\n\n## Example\n\nTiScript definition (it's strict subset of TypeScript):\n\n```ts\n// editor_config.ts\nconst LF = \"\\x0A\";\n\nexport const tabSize = 4;\nexport const trimTrailingWhitespace = true;\nexport const endOfLine = LF;\nexport const encoding = \"utf-8\";\n```\n\nCurrently, the only interface is a command called tiscript(1) (or `cargo run` on development).\n\n```sh\n$ cargo run ./editor_config.ts\n```\n\nthe output is:\n\n```json\n{\n    \"tabSize\": 4,\n    \"trimTrailingWhitespace\": true,\n    \"endOfLine\": \"\\n\",\n    \"encoding\": \"utf-8\"\n}\n```\n\n## Rust API\n\nThis library implements [serde](https://serde.rs/)'s Deserializer.\n\n### Synopsis\n\nFrom a file:\n\n```rust\nuse serde::{Deserialize, Serialize};\n\nuse tiscript::from_file;\n\n// integrated to Serde\n#[derive(Serialize, Deserialize, Debug, PartialEq)]\nstruct EditorConfig {\n    tabSize: i32,\n    trimTrailingWhitespace: bool,\n    endOfLine: String,\n    encoding: String,\n}\n\nfn main() {\n    let editorConfig: EditorConfig = from_file(\"./editor_config.ts\").unwrap();\n    // or from_file_with_timeout(f, d) for untrusted code\n\n    println!(\"{:?}\", editorConfig);\n}\n```\n\nFrom an inline code:\n\n```rust\nuse serde::{Deserialize, Serialize};\n\nuse tiscript::from_str;\n\n// integrated to Serde\n#[derive(Serialize, Deserialize, Debug, PartialEq)]\nstruct EditorConfig {\n    tabSize: i32,\n    trimTrailingWhitespace: bool,\n    endOfLine: String,\n    encoding: String,\n}\n\nfn main() {\n    let editorConfig: EditorConfig = from_str(r#\"\n        const LF = \"\\x0A\";\n\n        export const tabSize = 4;\n        export const trimTrailingWhitespace = true;\n        export const endOfLine = LF;\n        export const encoding = \"utf-8\";\n    \"#).unwrap();\n    // or from_str_with_timeout(f, d) for untrusted code\n\nprintln!(\"{:?}\", editorConfig);\n}\n```\n\n### Description\n\nTBD\n\n## Features\n\nThis is a list of features in ECMA-262 that are planned or implemented (\"[x]\" does not necessarily mean it's 100% compatible with TypeScript and ECMA-262):\n\n* [x] shebang\n* [x] line and block comments\n* [x] `export`\n* [x] `export default`\n* [x] `let`\n* [x] `const`\n* [x] `if` and `else`\n* [x] `undefined` literals\n* [x] `null` literals\n* [x] `boolean` literals\n* [x] `number` literals\n* [x] `string` literals\n* [x] template `string` literals\n* [ ] tagged template `string` literals\n* [x] `bigint` literals (actually 64-bit int)\n* [x] array literals\n* [x] object literals\n* [ ] index access (`[0]` and `.[\"foo\"]`)\n* [ ] property access (`.foo`)\n* [ ] `typeof` operator\n* [x] arithmetic operators (`+`, `-`, `*`, `/`, `%`, `**`)\n* [x] bitwise operators (`~`, `\u0026`, `|`, `^`, `\u003c\u003c`, `\u003e\u003e`, `\u003e\u003e\u003e`)\n* [ ] assignment operators (`=`, `+=`, `-=`, `*=`, `/=`, `%=`, `**=`, `\u003c\u003c=`, `\u003e\u003e=`, `\u003e\u003e\u003e=`, `\u0026=`, `|=`, `^=`)\n* [x] comparison operators (`==`, `!=`, `===`, `!==`, `\u003c`, `\u003e`, `\u003c=`, `\u003e=`)\n* [ ] increment and decrement operators (`++`, `--`)\n* [x] ternary operator (`cond ? t : f`)\n* [ ] logical operators (`\u0026\u0026`, `||`, `!`)\n* [ ] nullish coalescing operator (`??`)\n* [ ] null-conditional operator (`?.`)\n* [x] object spread syntax\n* [x] array spread syntax\n* [ ] `class` statement\n* [ ] `for-of` loop\n* [ ] C-style `for` (with restrictions)\n* [ ] `while` loop (with restrictions)\n* [ ] `do-while` loop (with restrictions)\n* [ ] exceptions (`Error`, `try-catch-finally`, `throw` and so on)\n* [ ] temporal module\n* [x] function declaration\n* [ ] arrow function\n* [x] function call\n* [ ] method call\n* [x] function declaration with `function` keyword\n* [ ] function as a first-class object\n* [ ] generator function (`function*`)\n* [ ] limited recursive calls of functions\n* [ ] optional semicolons (ASI)\n* [ ] static `import`\n* [ ] dynamic `import`\n* [x] `Math` class methods\n* [ ] `Math` class properties\n* [ ] `String` class methods\n* [ ] `String` instance methods\n* [ ] `Number` class methods\n* [ ] `Number` instance methods\n* [ ] `TextEncoder`\n* [ ] `Intl` / ECMA-402\n* [ ] `atob` and `btoa`\n\nThis is a list of features in TypeScript that are planned or implemented:\n\n* [x] `import type` statement (but it does nothing so far)\n* [ ] `any`\n* [ ] `unknown`\n* [ ] `never`\n* [ ] `as` type assertion\n* [x] `satisfies` type operator\n* [x] primitive type annotations\n* [ ] literal type annotations\n* [x] union type annotations\n* [ ] intersection type annotations\n* [ ] tuple type annotations\n* [ ] array type annotations\n* [x] object type annotations\n* [ ] type guards\n* [ ] `interface` type statement\n* [x] `type` type statement\n* [ ] `typeof` operator in type expressions\n* [ ] generics\n* [ ] null-assertion operator (trailing `!`)\n\nThis is a list of features that won't be implemented:\n\n* `var` declaration\n* `eval` function\n* `new Function()`\n* `RegExp` and regular expression operators\n* Most of runtime (e.g. typed arrays)\n* `for-in` loop\n* `async` and `await`\n* `symbol`\n* true bigint\n* decorators (just because the spec is too large)\n* `enum`\n* `const enum`\n* `namespace`\n* commonjs features\n* no strict features\n* unlimited recursion / loop\n* anything that meets Turing completeness\n\nNote that **any features TiScript recognizes, but TypeScript compiler does not** are invalid, but not vice versa. This is because TiScript is a strict subset of TypeScript.\n\n## Development\n\nIf you'd like to develop this project, run `UPDATE=1 cargo test` to automatically generates `*.stdout` or `*.stderr` files in `spec/`.\n\n## WebAssembly\n\nThis project is ensured to be built with `--target=wasm32-wasi` in CI. There's no test for WebAssembly though.\n\n## Similar Works\n\n* JSON https://www.json.org/\n* Jsonnet https://jsonnet.org/\n* TySON https://github.com/jetify-com/tyson\n\n## Authors\n\nFUJI, Goro (gfx).\n\nThis project a fork of https://github.com/msakuta/ruscal, and thus much of the code comes from it.\n\n## License\n\nThis project is licensed under the ISC License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfx%2Ftiscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgfx%2Ftiscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfx%2Ftiscript/lists"}