{"id":13760585,"url":"https://github.com/til-lang/til","last_synced_at":"2025-05-10T11:30:23.602Z","repository":{"id":96029193,"uuid":"365650022","full_name":"til-lang/til","owner":"til-lang","description":"An easy to extend command language","archived":false,"fork":false,"pushed_at":"2023-03-12T13:44:17.000Z","size":626,"stargazers_count":56,"open_issues_count":11,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-16T17:41:14.583Z","etag":null,"topics":["dlang","programming-language","tcl"],"latest_commit_sha":null,"homepage":"","language":"D","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/til-lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE-OF-CONDUCT.md","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":"2021-05-09T02:19:53.000Z","updated_at":"2024-10-24T11:53:12.000Z","dependencies_parsed_at":"2023-03-26T01:49:18.717Z","dependency_job_id":null,"html_url":"https://github.com/til-lang/til","commit_stats":null,"previous_names":[],"tags_count":74,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/til-lang%2Ftil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/til-lang%2Ftil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/til-lang%2Ftil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/til-lang%2Ftil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/til-lang","download_url":"https://codeload.github.com/til-lang/til/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253409897,"owners_count":21903986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["dlang","programming-language","tcl"],"created_at":"2024-08-03T13:01:13.476Z","updated_at":"2025-05-10T11:30:23.359Z","avatar_url":"https://github.com/til-lang.png","language":"D","funding_links":[],"categories":["D"],"sub_categories":[],"readme":"# Til\n\nA command language. \n\nhttps://til-lang.github.io/til/\n\n\n## Some examples\n\n```tcl\n# Most of the syntax is the same as Tcl:\nset a 1\nset b 2\nprint \"$a $b\"\n# 1 2\n\n# But with some new features\nset (a b) (1 2)\nprint \"$a $b\"\n# 1 2 \n\n# Til has \"simple lists\", using \"()\":\nset lista (1 2 3 4)\n\n# And can work with infix notation:\nset x $(1 + 2 + 3 + 4)\nprint $x\n# 10\n\n# Infix notation is a syntatic sugar:\n# $(1 + 2 + 3 + 4) -\u003e [+ 1 2 3 4]\n# $(1 + 2 * 3 - 4) -\u003e [- [* [+ 1 2] 3] 4]\n# (And, no, there's no \"precedence\" besides\n# simple left-to-right order of appearance.)\n\n# Infix notation is also implemented as a command:\nset operation (1 + 1)\ninfix $operation | as result\n# (It's handy to send operations as arguments, for example.)\n\n# Til also values *comfort*, and offer\n# some ways to avoid nesting braces:\n# Instead of `set y [list $a $b]`,\nlist $a $b | as y\nprint $y\n# (1 2)\n# Instead of `range [length [list 1 2 3]] | foreach`,\nlist 1 2 3 | length | range | foreach x { print $x }\n# (1 2 3)       3    range 3  ...\n\n# Unlike Tcl, \"{}\" enclosed things are NOT strings,\n# but simply \"SubPrograms\".\n# They are parsed as any other part of the language,\n# just not immediately run.\nif ($x \u003e 7) {\n    print \"Great! $x is greater than 7.\"\n}\n\n# (Oh, and comments are **real** comments!)\n\n# Til implements the concept of \"streams\", almost\n# like stdin/stdout in shell script.\nrange 1 5 | foreach x { print $x }\n# 1\n# 2\n# 3\n# 4\n# 5\n\n# You can \"transform\" values from the stream before consuming them:\nrange 1 5 | transform value {\n        return [math ($value * 2)] \n    } | foreach x {\n        print $x\n    }\n# 2\n# 4\n# 6\n# 8\n# 10\n\n# Til values your comfort, so there's syntatic sugar for both\n# transform and foreach:\nrange 97 99 | { to.ascii } | { print }\n# a\n# b\n# c\n# This is the same as:\nrange 97 99\n    | transform x { return [to.ascii $x]}\n    | foreach x { print $x}\n# Or, using \".inline\" commands:\nrange 97 99\n    | transform.inline { to.ascii }\n    | foreach.inline { print }\n# (The sugar consists in calling both commands above, actually.\n# For all intents and purposes, both options are the same thing.)\n\n# We also have dictionaries!\ndict (a 1) (b 2) (c 3) | as d\n\n# Values can be extracted using Til's **extraction** syntax:\nprint \u003c$d a\u003e\n# 1\n# It makes it easier to write conditions, for instance:\nif (\u003c$d a\u003e == 1) { print \"yes, it's 1!\" }\n\n# Extraction syntax is used to get values from lists, too:\nset lista (a b c d e)\n# by index:\nprint \u003c$lista 0\u003e\n# a\n\n# by range:\nprint \u003c$lista 1 4\u003e\n# (b c d)\n\n# And the extraction itself is implemented as a command:\nextract $lista 1 4 | range | foreach item { print $item }\n# b\n# c\n# d\n```\n\nSee more in the `examples/` directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftil-lang%2Ftil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftil-lang%2Ftil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftil-lang%2Ftil/lists"}