{"id":50541776,"url":"https://github.com/notakeith/itmoscript","last_synced_at":"2026-06-03T20:30:54.676Z","repository":{"id":361598809,"uuid":"1255006629","full_name":"notakeith/itmoscript","owner":"notakeith","description":"Interpreter for ITMOScript, a dynamically-typed scripting language. Hand-written lexer, recursive descent parser, AST, and tree-walking interpreter","archived":false,"fork":false,"pushed_at":"2026-05-31T11:23:15.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-31T13:12:07.443Z","etag":null,"topics":["ast","cpp","interpreter","lexer","parser","programming-language","scripting-language"],"latest_commit_sha":null,"homepage":"","language":"C++","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/notakeith.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":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-31T09:25:45.000Z","updated_at":"2026-05-31T11:23:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/notakeith/itmoscript","commit_stats":null,"previous_names":["notakeith/itmoscript"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/notakeith/itmoscript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notakeith%2Fitmoscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notakeith%2Fitmoscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notakeith%2Fitmoscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notakeith%2Fitmoscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notakeith","download_url":"https://codeload.github.com/notakeith/itmoscript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notakeith%2Fitmoscript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33878990,"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-06-03T02:00:06.370Z","response_time":59,"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":["ast","cpp","interpreter","lexer","parser","programming-language","scripting-language"],"created_at":"2026-06-03T20:30:54.612Z","updated_at":"2026-06-03T20:30:54.669Z","avatar_url":"https://github.com/notakeith.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"banner-dark.svg\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"banner-light.svg\"\u003e\n    \u003cimg alt=\"ITMOScript preview\" src=\"banner-light.svg\"\u003e\n    \u003c/picture\u003e\n\u003c/div\u003e\n\n\u003e [Русская версия](README_RU.md)\n\n[![C++17](https://img.shields.io/badge/C%2B%2B-17-blue?logo=cplusplus\u0026logoColor=white)](https://en.cppreference.com/w/cpp/17)\n[![CMake](https://img.shields.io/badge/CMake-3.14%2B-064F8C?logo=cmake\u0026logoColor=white)](https://cmake.org/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nA dynamically-typed scripting language with a hand-written interpreter in C++17. Implements the full compilation pipeline: **Lexer → Parser → AST → Interpreter**, with lexical scoping, first-class functions, list slicing, and automatic memory management.\n\n## Language\n\n### Types\n\n`number` · `string` · `bool` · `nil` · `list` · `function`\n\n### Syntax\n\n```python\n# Variables \u0026 arithmetic\nx = 10\ny = x ^ 2 + 3 * x - 1     # ^ is exponentiation\n\n# Strings\ngreeting = \"Hello, \" + \"world!\"\nrepeated = \"ha\" * 3        # \"hahaha\"\n\n# Lists \u0026 slicing\nnums = [1, 2, 3, 4, 5]\nprint(nums[1:4])           # [2, 3, 4]\nprint(nums[:2])            # [1, 2]\n\n# Control flow\nif x \u003e 5 then\n    print(\"big\")\nelse if x == 5 then\n    print(\"five\")\nelse\n    print(\"small\")\nend if\n\n# Loops\nwhile x \u003e 0\n    x -= 1\nend while\n\nfor i in range(0, 10, 2)\n    print(i)               # 0 2 4 6 8\nend for\n\n# Functions (first-class, closures)\nfib = function(n)\n    if n == 0 then return 0 end if\n    a = 0\n    b = 1\n    for i in range(1, n, 1)\n        c = a + b\n        a = b\n        b = c\n    end for\n    return b\nend function\n\nprint(fib(10))             # 55\n\n# FizzBuzz — string * bool trick\nfizzBuzz = function(n)\n    for i in range(1, n)\n        s = \"Fizz\" * (i % 3 == 0) + \"Buzz\" * (i % 5 == 0)\n        if s == \"\" then print(i) else print(s) end if\n    end for\nend function\nfizzBuzz(20)\n```\n\n### Built-ins\n\n| Function | Description |\n|----------|-------------|\n| `print(x)` | Print value with newline |\n| `len(x)` | Length of list or string |\n| `range(start, end[, step])` | Generate a numeric range |\n| `type(x)` | Return type name as string |\n\n### Operators\n\n| Category | Operators |\n|----------|-----------|\n| Arithmetic | `+` `-` `*` `/` `%` `^` |\n| Comparison | `==` `!=` `\u003c` `\u003e` `\u003c=` `\u003e=` |\n| Logical | `and` `or` `not` |\n| Assignment | `=` `+=` `-=` `*=` `/=` `%=` `^=` |\n\n## Architecture\n\n```\nSource text\n    │\n    ▼\n┌─────────┐    tokens    ┌──────────┐    AST    ┌─────────────┐\n│  Lexer  │ ──────────► │  Parser  │ ─────────►│ Interpreter │\n└─────────┘              └──────────┘           └─────────────┘\n                                                       │\n                                                  Environment\n                                                  (scope chain)\n```\n\n| Module | File | Responsibility |\n|--------|------|----------------|\n| Lexer | `lib/Lexer.h / .cpp` | Tokenization, keyword recognition, string/number literals |\n| Parser | `lib/Parser.h / .cpp` | Recursive descent, operator precedence, block parsing |\n| AST | `lib/AST.h` | Node hierarchy: `NumberExpr`, `BinaryExpr`, `CallExpr`, `FunctionExpr`, … |\n| Value | `lib/Value.h / .cpp` | Dynamic type wrapper for all runtime values |\n| Environment | `lib/Environment.h / .cpp` | Symbol table, lexical scope chain |\n| Interpreter | `lib/Interpreter.h / .cpp` | AST traversal, expression evaluation, statement execution |\n| Builtins | `lib/Builtins.h / .cpp` | Standard library functions |\n\nControl flow (`return`, `break`, `continue`) is implemented via C++ exceptions caught at the appropriate scope boundary.\n\n## Build\n\n```bash\ngit clone https://github.com/notakeith/itmoscript.git\ncd itmoscript\nmkdir build \u0026\u0026 cd build\ncmake ..\ncmake --build .\n```\n\n## Usage\n\n```bash\n./bin/main path/to/script.is\n\n# Bundled examples\n./bin/main ../examples/fibonacci.is\n./bin/main ../examples/fizzBuzz.is\n./bin/main ../examples/slices.is\n```\n\n## Tests\n\n```bash\nctest --output-on-failure\n```\n\nTests cover: lexer tokenization, parser grammar, operator precedence, control flow, built-in functions, illegal operations, and type coercion.\n\n## VSCode Extension\n\nSyntax highlighting for `.is` files: [itmoscript-syntax](https://github.com/notakeith/itmoscript-syntax).\n\n## Requirements\n\n- C++17\n- CMake 3.14+\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotakeith%2Fitmoscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotakeith%2Fitmoscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotakeith%2Fitmoscript/lists"}