{"id":19053210,"url":"https://github.com/greydevv/mango-compiler","last_synced_at":"2025-10-24T14:27:43.328Z","repository":{"id":40476344,"uuid":"421901074","full_name":"greydevv/mango-compiler","owner":"greydevv","description":"Mango: Compiled, statically-typed general purpose programming language.","archived":false,"fork":false,"pushed_at":"2022-10-12T18:44:16.000Z","size":507,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T02:48:29.234Z","etag":null,"topics":["compiler","compiler-construction","cpp","llvm","llvm-ir","programming-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/greydevv.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}},"created_at":"2021-10-27T16:52:59.000Z","updated_at":"2023-12-07T21:14:20.000Z","dependencies_parsed_at":"2023-01-19T21:45:47.554Z","dependency_job_id":null,"html_url":"https://github.com/greydevv/mango-compiler","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/greydevv%2Fmango-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greydevv%2Fmango-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greydevv%2Fmango-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greydevv%2Fmango-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greydevv","download_url":"https://codeload.github.com/greydevv/mango-compiler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250552035,"owners_count":21449161,"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","compiler-construction","cpp","llvm","llvm-ir","programming-language"],"created_at":"2024-11-08T23:29:32.794Z","updated_at":"2025-10-24T14:27:38.277Z","avatar_url":"https://github.com/greydevv.png","language":"C++","readme":"# 🥭 Mango Language\n\n📝 Mango is still under development\n\n### Introduction\nLet's address the elephant in the room: why *yet another programming language*?\nWell, I don't really know, I just wanted to make a compiler. The language itself is just a byproduct of it.\n\nThis repository houses the compiler for Mango, a statically-typed, general-purpose programming language inspired by [Python](https://www.python.org/), [Swift](https://developer.apple.com/swift/), [C](https://en.wikipedia.org/wiki/C_%28programming_language%29), [C++](https://en.wikipedia.org/wiki/C%2B%2B), and [Rust](https://www.rust-lang.org/).\n\n### Mango Language\n\n##### About\nMango is a compiled, statically-typed, general purpose programming language created as a byproduct of my passion project, the Mango compiler.\n\nIn creating Mango, I took inspiration from the syntax of Swift, C/C++, and Python type-hinting. The following example calculates the factorial of a 32-bit integer.\n```c\nfunc factorial(i32 n) -\u003e i32 {\n  if (n == 0) {\n    return 1;\n  }\n  return n * factorial(n-1);\n}\n```\n\n##### Typing\nAs mentioned above, Mango is both statically and strongly typed which is mainly inspired by the type system Rust implements.\n```c\ni8 x = 10;\ni16 y = 356;\n\nx + y;\n```\nCompiling this bit of code yields a `TypeError` because `i8` and `i16` are not the same type and therefore not compatible in a binary expression.\n```text\nsamples/types.mg -\u003e [4,3]\n  |\n4 | x + y;\n  | ^~~~~  \nTypeError: i8 and i16 are not compatible in binary expression\n```\n\n### Directory\n| Stage                | Module                                                                |\n| :--                  | :--                                                                   |\n| Lexical analysis     | [src/Lexer.cpp](src/Lexer.cpp)                                        |\n| Syntax analysis      | [src/Parser.cpp](src/Parser.cpp)                                      |\n| Semantic analysis    | [src/visitors/ASTValidator.cpp](src/visitors/ASTValidator.cpp)        |\n| IR generation        | [src/visitors/ASTCodegenner.cpp](src/visitors/ASTCodegenner.cpp)      |\n\n### Development Progress\n- [x] Front-end\n\t- [x] Lexer\n\t- [x] Parser -\u003e AST\n- [ ] AST Validation\n\t- [x] type-checking\n\t- [x] symbol/reference table\n\t- [ ] integer types (i8, i16, i32, i64, i128, u8, u16, u32, u64, u128)\n  - [ ] constant folding\n\t- [ ] function overloading\n\t- [ ] strings/arrays\n\t- [ ] pointers (?)\n- [ ] IR/Codegen\n\t- [x] binary expressions (arithmetic, boolean, etc.)\n\t- [x] conditional control flow (if/else if/else)\n\t- [x] control flow (while loop)\n\t- [x] unary expressions\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreydevv%2Fmango-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreydevv%2Fmango-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreydevv%2Fmango-compiler/lists"}