{"id":49705349,"url":"https://github.com/komagata/tya","last_synced_at":"2026-05-28T06:11:40.169Z","repository":{"id":356374054,"uuid":"1226824145","full_name":"komagata/tya","owner":"komagata","description":"A programing language without hesitation.","archived":false,"fork":false,"pushed_at":"2026-05-27T10:45:13.000Z","size":6555,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-27T12:21:46.778Z","etag":null,"topics":["programing-language"],"latest_commit_sha":null,"homepage":"https://tya-lang.org","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/komagata.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-01T21:52:12.000Z","updated_at":"2026-05-27T10:45:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"7ecc68fc-31a1-40ac-aa62-82767242041d","html_url":"https://github.com/komagata/tya","commit_stats":null,"previous_names":["komagata/tya"],"tags_count":87,"template":false,"template_full_name":null,"purl":"pkg:github/komagata/tya","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komagata%2Ftya","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komagata%2Ftya/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komagata%2Ftya/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komagata%2Ftya/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/komagata","download_url":"https://codeload.github.com/komagata/tya/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komagata%2Ftya/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33596395,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["programing-language"],"created_at":"2026-05-08T10:02:11.668Z","updated_at":"2026-05-28T06:11:40.158Z","avatar_url":"https://github.com/komagata.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://tya-lang.org/\"\u003e\n    \u003cimg src=\"docs/assets/tya-logo.png\" alt=\"Tya logo\" width=\"220\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# Tya\n\n**A language without hesitation.**\n\nTya removes the small decisions that interrupt your work — how to format,\nwhich tool to install, what an error means.\n\n## At a glance\n\n- **Accepted Syntax + Formatted Syntax** — Tya accepts editing-friendly source,\n  while `tya format` emits one deterministic representation.\n- **Dynamically typed**, indentation-based, with strict semantics\n  (no implicit conversions, no `nil` arithmetic).\n- **Compiles to C** for a small, portable runtime.\n- **All-in-one toolchain** (Gleam-style) — the `tya` binary holds the\n  compiler, formatter, language server, test runner, doc generator, and\n  package manager.\n- **Kind diagnostics** (Elm-grade) — every error has a stable code, an\n  expected/found block, an actionable hint, and a linked explanation.\n\nThe reference implementation is a hand-written Go compiler (lexer, parser,\nAST, checker, C emitter) with a small C runtime and a self-hosted Tya\ncompiler that compiles itself.\n\nWebsite: \u003chttps://tya-lang.org/\u003e\n\n## Requirements\n\n- A C compiler available as `cc`\n\n## Install\n\nOn macOS, install Tya with Homebrew:\n\n```sh\nbrew tap komagata/tap\nbrew install tya\n```\n\nFor local formula development from this repository:\n\n```sh\nbrew install --HEAD ./Formula/tya.rb\n```\n\nFor v0.71.2, download the release source and build the `tya` command locally.\nThis currently requires Go because the reference implementation is written\nin Go.\n\n```sh\ncurl -L https://github.com/komagata/tya/archive/refs/tags/v0.71.2.tar.gz | tar xz\ncd tya-0.71.2\ngo build -o tya ./cmd/tya\n./tya version\n```\n\n## Run\n\nCreate `hello.tya`.\n\n```tya\nprint(\"Hello, Tya\")\n```\n\n```sh\ntya run hello.tya\n```\n\n`tya run` builds a temporary executable, runs it, and removes the temporary\nfile after execution.\n\nTo keep the executable:\n\n```sh\ntya build hello.tya -o hello\n./hello\n```\n\nTo print the installed version:\n\n```sh\ntya version\n```\n\nTo check, format, or inspect generated C:\n\n```sh\ntya check hello.tya\ntya format hello.tya\ntya format -w hello.tya\ntya format --check hello.tya\ntya emit-c hello.tya\ntya test\ntya test tests\n```\n\n### Project workflow\n\n```sh\ntya new app           # scaffold tya.toml + src/main.tya + .gitignore\ncd app\ntya task              # list tasks defined under [tasks] in tya.toml\ntya task run          # run the named task\ntya lint src                  # report unused locals (TYAL0001) under a path\ntya lint --fix src            # rewrite TYAL0001 line-deletes and TYAL0003 `if true` unwraps in place\ntya lint --format=json src    # machine-readable findings for CI consumers\ntya doc               # print source-comment API documentation\ntya doc --json lib # emit generated stdlib API documentation\ntya doc --html ./out  # write a multi-page HTML site\n```\n\n`tya task \u003cname\u003e [args...]` POSIX-quotes the trailing args and\nappends them to the task command (mirrors `$@`). Array-form tasks\nrun each entry under `/bin/sh -c` in order and stop on the first\nfailure. Table-form tasks support `cmds = [...]`, `parallel = true`,\n`depends_on = [...]`, per-task `env = { KEY = \"value\" }`, and\n`tya task \u003cname\u003e --watch` for reruns on project file changes.\n\n### Editor integration\n\n`tya lsp` runs the Language Server (LSP JSON-RPC 2.0 over stdio)\nfrom the same binary as the compiler. It supports the full IDE feature set:\n\n- Diagnostics on save / on change\n- Formatting (full + range, backed by `tya format`)\n- Hover signatures + doc comments\n- Goto-definition (cross-file via `import`)\n- References, rename (top-level + local + param scope-aware)\n- Code actions (TYAL0001 / TYAL0003 quick fixes)\n- Document outline + workspace symbols\n- Semantic tokens, incremental document sync\n\nSetup recipes ship in [`editors/`](./editors):\n\n- [`editors/vscode/`](./editors/vscode) — TextMate grammar + TypeScript extension\n- [`editors/vim/`](./editors/vim) — Vim / Neovim syntax, filetype, and indent files\n- [`editors/neovim/`](./editors/neovim) — nvim-lspconfig\n- [`editors/zed/`](./editors/zed) — Zed `settings.json`\n- [`editors/emacs/`](./editors/emacs) — syntax coloring plus eglot / lsp-mode\n- [`editors/github-linguist/`](./editors/github-linguist) — GitHub Linguist registration notes\n- [`editors/TOKENS.md`](./editors/TOKENS.md) — shared syntax-color token taxonomy\n\nVS Code extension:\n\nInstall Tya from the Visual Studio Marketplace or Open VSX.\nFor a local package build:\n\n```sh\ncd editors/vscode\nnpm install\nnpm run compile\nnpx vsce package\ncode --install-extension tya-0.65.2.vsix\n```\n\n## Example\n\n```tya\nuser = { name: \"komagata\", age: 20 }\n\ngreet = user -\u003e \"Hello, {user[\"name\"]}!\"\n\nif user[\"age\"] \u003e= 20\n  print(greet(user))\n```\n\nImports expose public top-level bindings from separate files.\n\n```tya\n# greeting.tya\nhello = name -\u003e \"Hello, {name}\"\n```\n\n```tya\n# main.tya\nimport greeting\n\nprint(greeting.hello(\"komagata\"))\n```\n\nPrimitive values expose their standard operations as methods.\n\n```tya\nprint(\"  \".blank?())\nprint([\"tya\"].first())\n```\n\n## Documentation\n\n- [Guide](https://tya-lang.org/guide/): read this first to learn Tya.\n- [Spec](https://tya-lang.org/spec/): latest Tya language specification.\n- [Versions](https://tya-lang.org/versions/): frozen historical release docs.\n\nThe public website is built from the Jekyll source files under `docs/`.\n\n## Language Scope\n\nThe current implementation on `main` includes:\n\n- `.tya` files\n- indentation-based blocks\n- comments, assignments, multiple assignment, and constants\n- `nil`, booleans, numbers, strings, arrays, dictionaries, functions, and\n  errors\n- string interpolation\n- dictionary index access with `dictionary[\"name\"]`\n- function literals and function calls\n- `if` / `elseif` / `else`\n- `while`, `for`, `break`, and `continue`\n- implicit final-expression returns, explicit `return`, and multiple return\n  values\n- `try` error propagation\n- same-directory, package dependency, `TYA_PATH`, and standard library import\n  lookup\n- git and path package dependencies through `tya.toml`, `tya.lock`, and\n  `tya install`\n- native package metadata through `[native]`, `tya doctor native`, and\n  `tya new --template lib --native`\n- package-provided tools through `[tools]` and `tya tool`\n- standard library packages and APIs loaded from `lib/`\n- standard builtins listed in the specification\n- compile-to-C execution through `tya run`, `tya build`, and `tya emit-c`\n- source checking through `tya check`\n- test discovery and assertions through `tya test`\n- conservative source formatting through `tya format`\n- WebAssembly build targets with unsupported native packages rejected for\n  WebAssembly builds\n- minimal classes, constructor calls, `init`, public instance fields,\n  instance methods, instance field defaults, class variables, class methods,\n  single inheritance, class-level inheritance, class introspection, private\n  members, private constructors, abstract classes, abstract methods, final\n  classes, explicit interfaces, interface inheritance, stackable interface\n  defaults, interface fields, interface initializer hooks, method overrides,\n  class-method `self`, and `super(args...)`\n\nExternal packages and tools such as SQLite, SDL2, GTK4, raylib, Slim,\nFlakewatch, and Magvideo live in separate `komagata/*` repositories and are\nconsumed by git URL plus tag.\n\nCurrent Tya does not include multiple inheritance, protected members, async,\nmacros, a central package registry, `tya publish`, mocking, benchmark, watch\nmode, parallel test execution, or set literals.\n\n## Test\n\n```sh\ngo test ./... -count=1\n```\n\n## Development\n\nClone the repository and verify the local toolchain first.\n\n```sh\ngit clone https://github.com/komagata/tya.git\ncd tya\ngo run ./cmd/tya version\ngo test ./... -count=1\n```\n\nThe compiler is intentionally hand-written Go. The main implementation areas\nare:\n\n- `internal/lexer/`: source text to tokens.\n- `internal/parser/`: tokens to AST.\n- `internal/ast/`: AST node definitions.\n- `internal/checker/`: language and import validation.\n- `internal/codegen/`: C emitter.\n- `internal/runner/`: source loading, import loading, and run helpers.\n- `runtime/`: C runtime used by generated programs.\n- `cmd/tya/`: user-facing CLI.\n- `tests/`: CLI, example, and specification-level tests.\n\nUseful local commands:\n\n```sh\ngo run ./cmd/tya run examples/hello.tya\ngo run ./cmd/tya build examples/hello.tya -o hello\ngo run ./cmd/tya check examples/hello.tya\ngo run ./cmd/tya format examples/hello.tya\ngo run ./cmd/tya emit-c examples/hello.tya\ngo run ./cmd/tya version\n```\n\nDeveloper inspection commands are intentionally not part of the public CLI\nsurface, but they are useful when working on the compiler:\n\n```sh\ngo run ./cmd/tya --tokens examples/hello.tya\ngo run ./cmd/tya --check-unused examples/hello.tya\n```\n\nRun focused compile-to-C checks when changing examples, argument handling, C\nemission, imports, runtime execution, or stdlib loading.\n\n```sh\nsh scripts/go_emit_examples_check.sh\nsh scripts/go_emit_args_check.sh\n```\n\nThe website is served by GitHub Pages from the Jekyll source files under\n`docs/`.\n\n```sh\nbundle install\nbundle exec jekyll build --source docs --destination _site\n```\n\nBefore committing Go changes, format touched Go files and run the default test\nsuite. The default suite includes the maintained self-host fixed-point check.\n\n```sh\ngofmt -w path/to/changed.go\ngo test ./... -count=1\n```\n\nThe current `selfhost/v01/compiler.tya` fixed point is maintained and must not\nregress.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomagata%2Ftya","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkomagata%2Ftya","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomagata%2Ftya/lists"}