{"id":16226157,"url":"https://github.com/ghostdevv/tst","last_synced_at":"2025-08-20T12:03:22.761Z","repository":{"id":38441139,"uuid":"497034799","full_name":"ghostdevv/tst","owner":"ghostdevv","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-03T05:06:03.000Z","size":216,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T11:40:53.877Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/ghostdevv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-05-27T14:49:10.000Z","updated_at":"2023-08-17T19:17:05.000Z","dependencies_parsed_at":"2024-10-25T01:50:22.242Z","dependency_job_id":"6f702657-d9ee-407e-a4c9-ab66cdd2dc11","html_url":"https://github.com/ghostdevv/tst","commit_stats":{"total_commits":50,"total_committers":2,"mean_commits":25.0,"dds":"0.040000000000000036","last_synced_commit":"b13acd35bde3bcad9401ca659e5248867ee0287d"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2Ftst","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2Ftst/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2Ftst/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2Ftst/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghostdevv","download_url":"https://codeload.github.com/ghostdevv/tst/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243989576,"owners_count":20379647,"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":[],"created_at":"2024-10-10T12:48:17.631Z","updated_at":"2025-03-19T13:30:29.981Z","avatar_url":"https://github.com/ghostdevv.png","language":"TypeScript","readme":"# TST\n\nIt's like `.txt` but with scripting! Making this for myself because I wanted a easier way to compute maths and text together whilst playing Satisfactory, and of course it quickly got out of hand 😅. It's a side project but feel free to poke around\n\n# The Language\n\nText is the main primitive, so this means that unless it's not text it's text. For example a basic tst file might look like this:\n\n```\nHello World\nThis is just some text\nno way of knowing it's a tst file\nunless you do\n```\n\nThere are special ways of defining non-text elements which you can see:\n\n## Variables\n\nVariables are defined with the $ modifier, they have a name and a value.\n\n```\n$ variableName = some value\n```\n\nYou can consume a variable by using mustache tags anywhere\n\n```\n{variableName}\n```\n\n## Functions\n\nFunctions are similar to variables in their definition, you can have as many space seperated arguments as you want.\n\n```\n$ functionName = |arg1 arg2 etc| the expression comes after\n```\n\nTo call a function you put it in a mustache tag and use square brackets\n\n```\n$ concat = |wordOne wordTwo| {wordOne} {wordTwo}\n\n{concat[hello world]}\n```\n\n## Maths\n\nMaths is done by wrapping the statement in brackets, this can be any statement accepted by [maths-expression-evaluator](https://github.com/bugwheels94/math-expression-evaluator) and it can accept mustache tags like everything else.\n\n```\nSomething something 6 * 8 = (6 * 8)\n```\n\n## Macros\n\nMacros are used with a # followed by it's name, for example:\n\n```\n# clear\n```\n\nBelow is a list of global macros, and there are also some compiler specific ones.\n\n- ### Global Macros\n\n    | Macro Name | Description             |\n    |------------|-------------------------|\n    | clear      | Clears the console      |\n    | exit       | Exits the process early |\n\n- ### JavaScript Compiler Macros\n\n    | Macro Name | Description                                  |\n    |------------|----------------------------------------------|\n    | export     | Marks the variable/function for export (esm) |\n\n# Compilers\n\nThere main part of the language is just a parser and validater, there are many compilers that read from the generated AST-like list of instructions.\n\n- ### Console\n\n    The main compiler just prints to console as it reads from the tree.\n\n- ### JavaScript\n\n    This is a more advanced compiler that will conver tst to javascript which can then be executed in any javascript runtime as it's self contained. Below is an example of what that looks like:\n\n    test.tst\n    ```\n    $ add = |a b| ({a} + {b})\n    $ echo = |word| {word}\n\n    10 + 8 = {add[10 8]}\n    6 * 9 = (6 * 9)\n\n    # export\n    $ tst = neat\n\n    {echo[test]}\n    ```\n\n    test.js\n    ```js\n    import { _tst_math_ } from './test.lib.js';\n\n    // [function] \"$ add = |a b| ({a} + {b})\"\n    var add = (a, b) =\u003e `${_tst_math_(`${a} + ${b}`)}`;\n\n    // [function] \"$ echo = |word| {word}\"\n    var echo = (word) =\u003e `${word}`;\n\n    // [blank] \"\"\n    console.log();\n\n    // [line] \"10 + 8 = {add[10 8]}\"\n    console.log(`10 + 8 = ${add(10, 8)}`);\n\n    // [line] \"6 * 9 = (6 * 9)\"\n    console.log(`6 * 9 = ${_tst_math_(`6 * 9`)}`);\n\n    // [blank] \"\"\n    console.log();\n\n    // [macro] \"# export\"\n    export\n\n    // [variable] \"$ tst = neat\"\n    var tst = `neat`;\n\n    // [blank] \"\"\n    console.log();\n\n    // [line] \"{echo[test]}\"\n    console.log(`${echo(test)}`);\n    ```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostdevv%2Ftst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghostdevv%2Ftst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostdevv%2Ftst/lists"}