{"id":15394824,"url":"https://github.com/mhmd-azeez/loxsharp","last_synced_at":"2025-04-15T23:53:33.415Z","repository":{"id":111221155,"uuid":"150407882","full_name":"mhmd-azeez/LoxSharp","owner":"mhmd-azeez","description":"A C# interpreter for the Lox programming language","archived":false,"fork":false,"pushed_at":"2021-05-26T19:14:54.000Z","size":3132,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T22:43:50.472Z","etag":null,"topics":["crafting-interpreters","csharp","interpreter","lox","lox-language"],"latest_commit_sha":null,"homepage":"https://mhmd-azeez.github.io/LoxSharp/","language":"C#","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/mhmd-azeez.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":"2018-09-26T10:15:48.000Z","updated_at":"2023-12-23T05:47:24.000Z","dependencies_parsed_at":"2023-04-25T14:09:03.951Z","dependency_job_id":null,"html_url":"https://github.com/mhmd-azeez/LoxSharp","commit_stats":{"total_commits":43,"total_committers":1,"mean_commits":43.0,"dds":0.0,"last_synced_commit":"22c6e00fcfd1ba278a72fa2de4e0d3162403304a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmd-azeez%2FLoxSharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmd-azeez%2FLoxSharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmd-azeez%2FLoxSharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmd-azeez%2FLoxSharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhmd-azeez","download_url":"https://codeload.github.com/mhmd-azeez/LoxSharp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173061,"owners_count":21224481,"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":["crafting-interpreters","csharp","interpreter","lox","lox-language"],"created_at":"2024-10-01T15:24:37.884Z","updated_at":"2025-04-15T23:53:33.396Z","avatar_url":"https://github.com/mhmd-azeez.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LoxSharp\nLox is a little programming language created by [Bob Nystrom](https://twitter.com/intent/user?screen_name=munificentbob) in his book [Crafting Interpreters](http://www.craftinginterpreters.com/). This is my attempt at recreating it in C#. I've published a web based version of the interpreter [here](https://mhmd-azeez.github.io/LoxSharp/).\n\n## What's implemented\nThe interprer is still a work in progress as I've not finished the book yet.\n\n### Operators\n\n| Name           | Operators | Associates |\n|----------------|-----------|------------|\n| Unary          | ! -       | Right      |\n| Multiplication | / * %     | Left       |\n| Addition       | - +       | Left       |\n| Comparison     | \u003e \u003e= \u003c \u003c= | Left       |\n| Equality       | == !=     | Left       |\n\n### Variables\nLox is a dynamically typed language, variables can have values of four types: `nil`, `number` (64-bit floating point numbers), `boolean` and `string`.\n\n```kotlin\nvar x = 5.8;\nvar y;\ny = 10;\nvar z = x * y;\nvar i = true;\nprint(i);\nprint(z);\n```\n\n### If conditional\n```kotlin\nvar x = 250;\nif (x % 2 == 0)\n{\n    print(\"Even\");\n}\nelse\n{\n    print(\"Odd\");\n}\n```\n### Loops\n\n#### While loop\n```kotlin\nvar x = 0;\nwhile(x \u003c 10)\n{\n    if (x \u003e 5)\n        break;\n        \n    print(x);\n    x = x + 1;\n}\n```\n#### For loop\n```kotlin\nfor (var i = 0; i \u003c 10; i = i + 1)\n{\n    print(\"i is: \" + i);\n}\n```\n### Functions\nFunctions can return something:\n```kotlin\nfun coolify(thing)\n{\n    return \"cool \" + thing;\n}\n\nprint(coolify(\"app\"));\n```\n\nOr return nothing:\n\n```kotlin\nfun doSomething() {\n    print(\"Doing something...\");\n}\n\ndoSomething();\n```\n\n### Standard Library\nThere are only two functions in the standard library:\n#### Print\npPrints the value to stdout:\n```kotlin\nprint(\"Hello World!\");\nprint(42);\nprint(true);\n```\n\n#### Clock\nReturns the number of seconds since 0001-01-01:\n```kotlin\nprint(clock());\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmd-azeez%2Floxsharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhmd-azeez%2Floxsharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmd-azeez%2Floxsharp/lists"}