{"id":34521831,"url":"https://github.com/secondlife/tailslide","last_synced_at":"2026-03-13T09:31:59.888Z","repository":{"id":326309980,"uuid":"821589248","full_name":"secondlife/tailslide","owner":"secondlife","description":"Embeddable parser, AST, tree walker and compiler for the Linden Scripting Language based on LSLint ","archived":false,"fork":false,"pushed_at":"2025-12-13T03:28:53.000Z","size":2313,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-12-14T17:29:48.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"LSL","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/secondlife.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":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE.txt","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-28T22:38:00.000Z","updated_at":"2025-12-13T03:25:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/secondlife/tailslide","commit_stats":null,"previous_names":["secondlife/tailslide"],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/secondlife/tailslide","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondlife%2Ftailslide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondlife%2Ftailslide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondlife%2Ftailslide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondlife%2Ftailslide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secondlife","download_url":"https://codeload.github.com/secondlife/tailslide/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondlife%2Ftailslide/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30464650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T06:34:02.089Z","status":"ssl_error","status_checked_at":"2026-03-13T06:33:49.182Z","response_time":60,"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":[],"created_at":"2025-12-24T04:59:01.717Z","updated_at":"2026-03-13T09:31:59.871Z","avatar_url":"https://github.com/secondlife.png","language":"LSL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Intro\n\n![Build Status](https://github.com/secondlife/tailslide/workflows/build/badge.svg) [![codecov](https://codecov.io/gh/secondlife/tailslide/branch/master/graph/badge.svg?token=5BQCSA63F1)](https://codecov.io/gh/secondlife/tailslide)\n\n\nTailslide provides an embeddable parser, AST representation, and tree walker library for\nSecond Life's Linden Scripting Language. These can be used as the foundation for an\nLSL compiler or developing a superset of LSL.\n\nA reference [byte-perfect LSO compiler](libtailslide/passes/lso)\nand semantically equivalent [CIL compiler](libtailslide/passes/mono) are provided. Semantic\nconformity with the output of LL's compilers is proven through\n[extensive testcases](https://github.com/secondlife/tailslide/tree/master/tests/scripts) and a\n[fuzzer](https://github.com/SaladDais/lscript-tailslide#lscript_fuzzer).\n\nAlso provided is a CLI utility to quickly lint or optimize LSL scripts,\nas well as visualize the AST of the supplied script.\n\nIf you're mainly interested in a command-line linting or optimization utility,\nplease see [lslint](https://github.com/Makopo/lslint) or\n[LSL-PyOptimizer](https://github.com/Sei-Lisa/LSL-PyOptimizer), respectively.\n\n# Credits\nTailslide is heavily based on the [lslint](https://github.com/pclewis/lslint)\nLSL linter written by pclewis, see the [NOTICE.txt](NOTICE.txt) file for the\noriginal README and credits.\n\n# Build\n\n## Linux \u0026 OSX\n\n`cmake`, `flex` and `bison` must be installed through your system's package manager.\nOn OS X you _must_ install the Homebrew versions of `flex` and `bison` because the\nversions provided with XCode are extremely old.\n\n```bash\ngit clone https://github.com/secondlife/tailslide.git\ncd tailslide\nmkdir build\ncd build\ncmake ..\nmake\n```\n\n# Windows\n\nNot well-supported, but possible:\n\n* Install [CMake](https://cmake.org/download/)\n* Install [Flex and Bison](https://github.com/lexxmark/winflexbison/releases) somewhere in your `PATH`\n* Install [MSVC for C++ 2022](https://visualstudio.microsoft.com/downloads/)\n\ninside the cloned repo:\n\n```batch\nmkdir build\ncd build\ncmake -G\"Visual Studio 17 2022\" ..\ncmake --build .\n```\n\n# Tech Overview\n\n## Parsing\n\nThe parser behaves more or less like the one on SL's servers, quirks and all.\n\nFor example:\n```\ndefault { $$$$\n    '' state_entry() {\n        llOwnerSay(L\"Hello\nworld!\");\n    }\"\n}/*{\n```\n\nis completely handled:\n\n```\n$ tailslide --show-tree tests/scripts/parser_abuse.lsl\ndefault\n{\n    state_entry()\n    {\n        llOwnerSay(\"\\\"Hello\\nworld!\");\n    }\n}\n\nTOTAL:: Errors: 0  Warnings: 0\nscript [none] (cv=) (1,1)\n  ast node list [none] (cv=) (1,1)\n  ast node list [none] (cv=) (1,1)\n    state [none] (cv=) (1,1)\n      identifier \"default\" [none] (cv=) (1,1)\n      event handler [none] (cv=) (2,8)\n        identifier \"state_entry\" [none] (cv=) (2,8)\n        null [none] (cv=) (2,8)\n        compound statement [none] (cv=) (2,22)\n          statement [none] (cv=) (3,9)\n            function call [none] (cv=) (3,9)\n              identifier \"llOwnerSay\" [none] (cv=) (3,9)\n              constant expression [string] (cv=string constant: \"\\\"Hello\\nworld!\") (3,20)\n                string constant: \"\\\"Hello\\nworld!\" [string] (cv=string constant: \"\\\"Hello\\nworld!\") (3,20)\n```\n\nSpecial attention has been paid to weird, undocumented corner cases.\n\n## Optimizations\n\n### Constant Folding\n\nThe constant folding implementation is currently very simple. Tailslide makes multiple\nwalks down the tree checking if an expression is constant, and replaces it with its value.\n\n```\ninteger foo = 2;\nfoo = foo + 2 + 4 + 3 + 5;\n```\n\nwon't currently be simplified at all due to how expressions are represented and will\nrequire term rewriting to move non-constant parts of expressions as far to the right (left) as possible.\n\nThere are still some cases where constants may be folded but currently aren't, and some differences\nin how floating point operations are folded.\n\n### Unused Variable / Function Pruning\n\nAny variable or function that is unused after constant folding may be pruned to save bytecode space.\n\n### Symbol Mangling\n\nNames of user defined functions, their parameters and globals contribute to bytecode size.\nTo reduce bytecode size, Tailslide can mangle user-defined symbols into more compact ones like\n`_a`, `_b`, etc. This may also help with disambiguation when converting the AST to another\nlanguage with different scoping / variable shadowing rules.\n\nThis isn't the most efficient naming scheme if targeting SL in particular,\nsince it's better to take advantage of strings already in the constant pool.\n\n# License\nMIT, scripts used for test data (barring those added by me and those in `bugs/`) are\nproperty of their respective owners\n\nSerialization code based on Kai Mast's [BitStream library](https://github.com/kaimast/BitStream/blob/master/include/BitStream.h)\nis included in BitStream.hh, and is licensed under the BSD 3-clause license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecondlife%2Ftailslide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecondlife%2Ftailslide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecondlife%2Ftailslide/lists"}