{"id":26235857,"url":"https://github.com/cheeksthegeek/lang-design","last_synced_at":"2026-04-24T11:06:37.656Z","repository":{"id":272243877,"uuid":"871242587","full_name":"CheeksTheGeek/lang-design","owner":"CheeksTheGeek","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-13T07:04:08.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T03:18:11.808Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"OCaml","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/CheeksTheGeek.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":"2024-10-11T14:49:53.000Z","updated_at":"2025-01-13T07:04:11.000Z","dependencies_parsed_at":"2025-01-13T07:33:41.048Z","dependency_job_id":"3f306005-ce30-4ece-b132-049d03868a38","html_url":"https://github.com/CheeksTheGeek/lang-design","commit_stats":null,"previous_names":["cheeksthegeek/lang-design"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CheeksTheGeek/lang-design","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CheeksTheGeek%2Flang-design","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CheeksTheGeek%2Flang-design/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CheeksTheGeek%2Flang-design/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CheeksTheGeek%2Flang-design/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CheeksTheGeek","download_url":"https://codeload.github.com/CheeksTheGeek/lang-design/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CheeksTheGeek%2Flang-design/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28099620,"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","status":"online","status_checked_at":"2025-12-28T02:00:05.685Z","response_time":62,"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":[],"created_at":"2025-03-13T03:18:13.562Z","updated_at":"2025-12-28T12:02:59.591Z","avatar_url":"https://github.com/CheeksTheGeek.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lang Design: A Monorepo for Language Interpreters and Compilers\n\nWelcome to **Lang Design**, a monorepo where I explore the design and implementation of various programming language interpreters and compilers. This repository hosts projects that span the entire spectrum of programming languages — from general-purpose languages like C, Python, Rust, and Haskell, to domain-specific languages such as VHDL and Verilog. My work here includes both widely-known languages and languages I've created for specialized purposes.\n\n## Repository Structure\n\nThe monorepo is structured to house individual language projects, each containing its own interpreter or compiler. Below are the key projects:\n\n```\n.\n├── ml-compiler-for-c          # OCaml compiler for a subset of C (MLCC)\n│   ├── README.md\n│   ├── ast.ml                 # Abstract Syntax Tree for the C language\n│   ├── codegen.ml             # Code generation for C into assembly\n│   ├── lexer.mll              # Lexical analyzer for C\n│   ├── main.ml                # Main driver for the compiler\n│   ├── makefile               # Build instructions\n│   ├── parser.mly             # Parser for C\n│   ├── sample.c               # Example C input\n│   └── sample_gold.s          # Example expected assembly output\n├── ml-interpreter-sp-modelling # Tansh: Probabilistic Modelling Interpreter\n│   ├── README.md\n│   ├── ansi.ml                # ANSI color and text styling functions\n│   ├── ast.ml                 # Abstract Syntax Tree for the Tansh language\n│   ├── distributions.ml       # Probability distribution functions\n│   ├── eval.ml                # Interpreter/evaluator for Tansh\n│   ├── lexer.mll              # Lexical analyzer for Tansh\n│   ├── main.ml                # Main driver for the interpreter\n│   ├── makefile               # Build instructions\n│   ├── parser.mly             # Parser for Tansh\n│   └── repl.ml                # Read-Eval-Print-Loop (REPL) implementation\n```\n\n## Projects\n\n### 1. **ML Compiler for C (MLCC)**\n\nThis project is an OCaml-based compiler for a subset of the C language, showcasing the compilation process from source code to assembly. It includes:\n\n- **Abstract Syntax Tree (AST)** for parsing C code.\n- **Code generation** to convert C into assembly.\n- **Lexer and parser** for tokenizing and analyzing C syntax.\n  \nYou can find a sample C program (`sample.c`) and its expected assembly output (`sample_gold.s`) in this project.\n\n### 2. **Tansh: A Stochastic Modelling and Statistical Language Interpreter**\n\nTansh (Turing Approximation for Non-deterministic Stochastic Heuristics) is a custom language designed to model stochastic processes, probabilistic algorithms, and basic machine learning models. It supports:\n\n- **Probabilistic distributions** like Bernoulli, Uniform, and Gaussian.\n- **Basic machine learning models**, including Logistic Regression and K-Means clustering.\n- **Functional programming constructs** like lambda calculus, conditional expressions, and recursion.\n\nThe project is implemented in OCaml, featuring a REPL interface with ANSI color enhancements for improved user interaction.\n\n## Upcoming and Future Projects\n\nThe **Lang Design** monorepo is intended to grow and encompass compilers and interpreters for a variety of languages, spanning both general-purpose and specific-purpose domains. The goal is to explore different paradigms and extremes of the language spectrum.\n\n### Potential Languages to Explore:\n- **General-Purpose Languages**:\n  - Python\n  - C / C++\n  - Rust\n  - Haskell\n  - Lisp (Common Lisp, Scheme)\n  - Go\n  - OCaml\n  - Swift\n  - JavaScript\n  \n- **Specific-Purpose Languages**:\n  - VHDL (Hardware description language)\n  - Verilog / SystemVerilog (Hardware modeling and design)\n  - SQL (Database querying)\n  - LaTeX (Typesetting)\n  - Bash (Shell scripting)\n  \n- **Other Extremes**:\n  - Brainfuck (Esoteric programming)\n  - Malbolge (Difficult-to-program language)\n  - Assembly (Low-level programming)\n\nAs the repository expands, I aim to include new interpreters, compilers, and even custom-designed languages tailored for specific problem domains.\n\n## Getting Started\n\nTo get started with any of the projects, clone the repository and follow the individual `README.md` instructions within each subdirectory.\n\n1. **Clone the repo**:\n\n   ```bash\n   git clone git@github.com:CheeksTheGeek/lang-design.git\n   cd lang-design\n   ```\n\n2. **Navigate to a specific project**:\n\n   ```bash\n   cd ml-compiler-for-c    # Example for the C compiler project\n   ```\n\n3. **Build and run the project** using the provided Makefile:\n\n   ```bash\n   make\n   ./your_executable  # Replace with the appropriate executable (e.g., tansh for the Tansh project)\n   ```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheeksthegeek%2Flang-design","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheeksthegeek%2Flang-design","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheeksthegeek%2Flang-design/lists"}