{"id":13661682,"url":"https://github.com/mrahhal/CSharpLox","last_synced_at":"2025-04-25T03:30:47.647Z","repository":{"id":83656426,"uuid":"116184748","full_name":"mrahhal/CSharpLox","owner":"mrahhal","description":"A cross-platform compiler/interpreter .NET Standard implementation of the Lox language.","archived":false,"fork":false,"pushed_at":"2021-11-27T11:06:58.000Z","size":55,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-10T16:45:55.257Z","etag":null,"topics":["compiler","csharp","interpreter","netstandard"],"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/mrahhal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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-01-03T21:43:37.000Z","updated_at":"2024-09-24T15:39:52.000Z","dependencies_parsed_at":"2023-03-12T19:06:32.065Z","dependency_job_id":null,"html_url":"https://github.com/mrahhal/CSharpLox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrahhal%2FCSharpLox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrahhal%2FCSharpLox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrahhal%2FCSharpLox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrahhal%2FCSharpLox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrahhal","download_url":"https://codeload.github.com/mrahhal/CSharpLox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250747676,"owners_count":21480691,"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":["compiler","csharp","interpreter","netstandard"],"created_at":"2024-08-02T05:01:39.444Z","updated_at":"2025-04-25T03:30:46.912Z","avatar_url":"https://github.com/mrahhal.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"﻿# CSharpLox\n\nA cross-platform compiler/interpreter .NET Standard implementation of the [Lox](https://github.com/munificent/craftinginterpreters) language.\n\n## Build\n\nRun the `build.ps1` script in the root of the project:\n```\n$ ./build\n```\n\nAn \"artifacts\" folder will be created, it contains the executables, one for each platform (windows, osx, linux).\n(i.e The windows interpreter is at \"artifacts/interpreter/win/cslox.exe\")\n\nAfter building, run `basic-run.ps1` to test drive the built interpreter (on windows).\n```\n$ ./basic-run\nHello, World!\n```\n\n## Usage\n\n```\n$ cslox [script]\n```\n\nYou can also enter prompt mode by not specifying a script path:\n```\n$ cslox\n\u003e print 41 + 1;\n42\n```\n\nTo print the ast and exit:\n```\n$ cslox [script] --print-ast\n```\n\n## Syntax\n\nLox is a simple dynamic programming language that supports object oriented aspects. It supports classes and inheritance.\n\nA simple lox program:\n\n```lox\nclass Greeter {\n\tinit(name) {\n\t\tthis.name = name;\n\t}\n\n\tgreet() {\n\t\tprint \"Hello, \" + this.name + \"!\";\n\t}\n}\n\nvar greeter = Greeter(\"mrahhal\");\n\ngreeter.greet();\n```\n\n## Grammar\n\nThe [context-free-grammar](context-free-grammar.md) file contains the grammar of the whole language, expressed using a similar metasyntax to [EBNF](https://en.wikipedia.org/wiki/Extended_Backus–Naur_form).\n\n## Project Structure\n\n- `Core`: The core project, a class lib, handles scanning and parsing and lower level operations.\n- `Interpreter`: The interpreter project, a cross platform executable that evaluates the program in C#.\n\n## Further Improvements\n\n- Modules, importing other files\n- More native functions. Right now, there's only a `clock` function.\n- A bytecode compiler\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrahhal%2FCSharpLox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrahhal%2FCSharpLox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrahhal%2FCSharpLox/lists"}