{"id":17887519,"url":"https://github.com/stellarwitch7/moth-lang","last_synced_at":"2025-04-03T02:41:00.384Z","repository":{"id":176429851,"uuid":"657400711","full_name":"StellarWitch7/moth-lang","owner":"StellarWitch7","description":"Moth's official compiler written in C#","archived":false,"fork":false,"pushed_at":"2024-04-12T14:23:28.000Z","size":1128,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-14T00:22:21.972Z","etag":null,"topics":["compiler","console-application","csharp","llvm","llvm-frontend","llvm-sharp","moth","parser","programming-language"],"latest_commit_sha":null,"homepage":"https://stellarwitch7.github.io/moth","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StellarWitch7.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}},"created_at":"2023-06-23T01:36:37.000Z","updated_at":"2024-04-16T02:38:12.485Z","dependencies_parsed_at":"2024-04-16T02:48:20.665Z","dependency_job_id":null,"html_url":"https://github.com/StellarWitch7/moth-lang","commit_stats":null,"previous_names":["stellarwitch7/language-parser","stellarwitch7/moth","stellarwitch7/moth-lang"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StellarWitch7%2Fmoth-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StellarWitch7%2Fmoth-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StellarWitch7%2Fmoth-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StellarWitch7%2Fmoth-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StellarWitch7","download_url":"https://codeload.github.com/StellarWitch7/moth-lang/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246927811,"owners_count":20856193,"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","console-application","csharp","llvm","llvm-frontend","llvm-sharp","moth","parser","programming-language"],"created_at":"2024-10-28T13:28:49.907Z","updated_at":"2025-04-03T02:41:00.331Z","avatar_url":"https://github.com/StellarWitch7.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Moth\n\n[Home Page](https://stellarwitch7.github.io)\n\n### About [![Build](https://github.com/StellarWitch7/moth-lang/actions/workflows/build.yml/badge.svg)](https://github.com/StellarWitch7/moth-lang/actions/workflows/build.yml) [![Test](https://github.com/StellarWitch7/moth-lang/actions/workflows/test.yml/badge.svg)](https://github.com/StellarWitch7/moth-lang/actions/workflows/test.yml)\n\nMoth's official compiler, written in C#. It takes Moth code and converts it to LLVM IR, which is then passed to the Clang C compiler. Currently only compatible with the Clang compiler. Read the [wiki](https://github.com/StellarWitch7/Moth/wiki) for Moth's documentation. Please report any bugs to the [issue tracker](https://github.com/StellarWitch7/Moth/issues), as it helps to improve Moth's compiler. \n\n### Dependencies\n1. [.NET 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)\n2. [Clang 16](https://clang.llvm.org/get_started.html)\n3. [Git](https://git-scm.com/downloads)\n4. [Git Extras](https://github.com/tj/git-extras)\n\n### Arguments\n\n#### luna\n```\nUsage:\nluna build [-v] [-n] [-c] [--no-advanced-ir-opt] [-p \u003cpath\u003e] =\u003e Builds the project at the path provided or in the current directory if no project file is passed. \nluna run [-v] [-n] [-c] [--no-advanced-ir-opt] [-p \u003cpath\u003e] [--run-args \u003cargs\u003e] [--run-dir \u003cpath\u003e] =\u003e Builds and runs the project at the path provided or in the current directory if no project file is passed. \nluna init [--lib] [--name \u003cproject-name\u003e] =\u003e Initialises a new project in the current directory. \n\n-v, --verbose =\u003e Logs extra info to console. \n-d, --do-not-compress =\u003e Tell mothc to not compress embedded metadata. \n-n, --no-meta =\u003e Strips metadata from the output file. WARNING: disables reflection! \n-c, --clear-cache =\u003e Whether to clear dependency cache prior to build. \n--no-advanced-ir-opt =\u003e Whether to skip IR optimization passes. \n-p, --project =\u003e The project file to use. \n--name =\u003e When initializing a new project, pass this option with the name to use. \n--lib =\u003e When initializing a new project, pass this option to create a static library instead of an executable project. \n--run-args =\u003e When running a project, pass this option with the arguments to use. \n--run-dir =\u003e When running a project, pass this option with the working directory to use. \n```\n\n#### mothc\n```\nUsage:\nmothc [-v] [-n] [--no-advanced-ir-opt] [--moth-libs \u003cpaths\u003e] [--c-libs \u003cpaths\u003e] -t exe|lib -o \u003coutput-name\u003e -i \u003cpaths\u003e\n-v, --verbose =\u003e Logs extra info to console. \n-n, --no-meta =\u003e Strips metadata from the output file. WARNING: disables reflection! \n--no-advanced-ir-opt =\u003e Whether to skip IR optimization passes. \n-t, --output-type =\u003e The type of file to output. Options are \"exe\" and \"lib\". \n-o, --output =\u003e The name of the output file. Please forego the extension. \n-V, --module-version =\u003e The version of the compiled module. \n-i, --input =\u003e The files to compile. \n-m, --moth-libs =\u003e External Moth library files to include in the compiled program. \n-c, --c-libs =\u003e External C library files to include in the compiled program. \n-e, --export-for =\u003e Languages to @Export functions for. Use the file extension for the language. \n-g, --compression-level =\u003e The type of compression to use for mothlib embedded metadata. Only really matters for huge projects. Options are: \"none\", \"low\", \"mid\", and \"high\". \n```\n\n### Hello World\nThe following is a minimal example that prints \"Hello World!\" to the terminal. \n```\n// main.moth\nnamespace hello; // all files must belong to a namespace\n\nwith core; // we are using the core namespace in this file, so we declare our usage here\n\n// the main function is the entrypoint of an executable program\n// it must return a value of type i32\nfn main() #i32 {\n    WriteLine(\"Hello World!\"); // we use the core namespace here to call the WriteLine(#u8*) function\n    // we end the program by returning from the main function with an exit code of zero\n    ret 0 // note that unlike other lines, return lines do not have semicolons\n}\n```\nTo learn how to run this code, [continue reading](https://github.com/StellarWitch7/moth-lang/wiki/Hello-World). \n\n### Tools\nCurrently the only aid for coding in Moth is the official [VS Code extension](https://github.com/StellarWitch7/moth-dev). It serves only to provide syntax highlighting. \n\n# !!WARNING!!\nMoth is currently **unfinished**. Many things are unlikely to function well. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstellarwitch7%2Fmoth-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstellarwitch7%2Fmoth-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstellarwitch7%2Fmoth-lang/lists"}