{"id":44608273,"url":"https://github.com/sauravbhattacharya001/sauravcode","last_synced_at":"2026-04-02T20:34:04.283Z","repository":{"id":262033129,"uuid":"886034860","full_name":"sauravbhattacharya001/sauravcode","owner":"sauravbhattacharya001","description":"Frustrated by syntax-heavy languages, I designed *sauravcode* for simplicity and clarity. It removes unnecessary punctuation and rigid conventions, focusing purely on logic. With minimal syntax, it allows ideas to flow naturally without distraction. *Sauravcode* is my tool for coding as a seamless, intuitive process, free from constraints.","archived":false,"fork":false,"pushed_at":"2026-04-02T13:43:42.000Z","size":1882,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-02T17:41:19.123Z","etag":null,"topics":["c-language","code-generation","compiler","custom-language","interpreter","language-design","parser","programming-language","python","transpiler"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/sauravbhattacharya001.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-10T02:31:57.000Z","updated_at":"2026-04-02T13:43:41.000Z","dependencies_parsed_at":"2026-03-02T07:09:04.932Z","dependency_job_id":null,"html_url":"https://github.com/sauravbhattacharya001/sauravcode","commit_stats":null,"previous_names":["sauravbhattacharya001/sauravcode"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/sauravbhattacharya001/sauravcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sauravbhattacharya001%2Fsauravcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sauravbhattacharya001%2Fsauravcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sauravbhattacharya001%2Fsauravcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sauravbhattacharya001%2Fsauravcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sauravbhattacharya001","download_url":"https://codeload.github.com/sauravbhattacharya001/sauravcode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sauravbhattacharya001%2Fsauravcode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31315999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["c-language","code-generation","compiler","custom-language","interpreter","language-design","parser","programming-language","python","transpiler"],"created_at":"2026-02-14T11:25:55.466Z","updated_at":"2026-04-02T20:34:04.275Z","avatar_url":"https://github.com/sauravbhattacharya001.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003esauravcode\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cstrong\u003eA programming language designed for clarity. No noise, just logic.\u003c/strong\u003e\n  \u003c/p\u003e\n  \u003c!-- CI \u0026 Quality --\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/sauravbhattacharya001/sauravcode/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/sauravbhattacharya001/sauravcode/actions/workflows/ci.yml/badge.svg\" alt=\"Tests\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/sauravbhattacharya001/sauravcode\"\u003e\u003cimg src=\"https://codecov.io/gh/sauravbhattacharya001/sauravcode/branch/main/graph/badge.svg\" alt=\"Coverage\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/sauravbhattacharya001/sauravcode/actions/workflows/codeql.yml\"\u003e\u003cimg src=\"https://github.com/sauravbhattacharya001/sauravcode/actions/workflows/codeql.yml/badge.svg\" alt=\"CodeQL\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/sauravbhattacharya001/sauravcode/actions/workflows/pages.yml\"\u003e\u003cimg src=\"https://github.com/sauravbhattacharya001/sauravcode/actions/workflows/pages.yml/badge.svg\" alt=\"Pages\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003c!-- Package \u0026 Version --\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://pypi.org/project/sauravcode/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/sauravcode?color=blue\" alt=\"PyPI\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/sauravcode/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/dm/sauravcode\" alt=\"Downloads\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/sauravcode/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/pyversions/sauravcode\" alt=\"Python\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/sauravbhattacharya001/sauravcode/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/sauravbhattacharya001/sauravcode\" alt=\"Release\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003c!-- Repo Info --\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/sauravbhattacharya001/sauravcode/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/sauravbhattacharya001/sauravcode\" alt=\"License\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/sauravbhattacharya001/sauravcode\"\u003e\u003cimg src=\"https://img.shields.io/github/languages/top/sauravbhattacharya001/sauravcode\" alt=\"Language\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/sauravbhattacharya001/sauravcode\"\u003e\u003cimg src=\"https://img.shields.io/github/repo-size/sauravbhattacharya001/sauravcode\" alt=\"Repo Size\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/sauravbhattacharya001/sauravcode/commits/main\"\u003e\u003cimg src=\"https://img.shields.io/github/last-commit/sauravbhattacharya001/sauravcode\" alt=\"Last Commit\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003c!-- Community --\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/sauravbhattacharya001/sauravcode/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/sauravbhattacharya001/sauravcode?style=social\" alt=\"Stars\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/sauravbhattacharya001/sauravcode/issues\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/sauravbhattacharya001/sauravcode\" alt=\"Issues\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/sauravbhattacharya001/sauravcode/pulls\"\u003e\u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen\" alt=\"PRs Welcome\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n---\n\n**sauravcode** is a programming language that strips away the ceremony of traditional syntax. No parentheses for function calls. No commas between arguments. No semicolons. No braces. Just clean, readable code that flows like thought.\n\nIt comes with both an **interpreter** for rapid prototyping and a **compiler** that produces native executables via C code generation.\n\n🌐 **[Documentation Site](https://sauravbhattacharya001.github.io/sauravcode/)** · 📖 **[Language Reference](docs/LANGUAGE.md)** · 🏗️ **[Architecture Guide](docs/ARCHITECTURE.md)**\n\n---\n\n## ✨ Features\n\n- **Minimal syntax** — no parentheses, commas, semicolons, or braces\n- **Dual execution** — interpreted (`saurav.py`) or compiled to native (`sauravcc.py`)\n- **Interactive REPL** — experiment with sauravcode in real-time\n- **Functions \u0026 recursion** — with clean call syntax\n- **Lambda expressions** — `lambda x -\u003e x * 2` for inline functions\n- **Pipe operator** — `\"hello\" |\u003e upper |\u003e reverse` for chaining\n- **Dynamic typing** — integers, floats, booleans, strings, lists, maps\n- **Control flow** — if/else if/else, while, range-based for, for-each, break/continue\n- **Pattern matching** — `match` expressions with wildcard and literal patterns\n- **Generators** — functions with `yield` for lazy sequences\n- **Enums** — named constant groups with dot access\n- **Classes** — with fields, methods, and `self`\n- **Error handling** — try/catch/throw blocks\n- **Import system** — `import \"module.srv\"` with closure scoping\n- **Lists** — dynamic arrays with append, pop, len, indexing, slicing, comprehensions\n- **Maps** — key-value dictionaries with `{}` syntax, bracket access, and built-in functions\n- **105 built-in functions** — strings, math, stats, regex, date/time, JSON, encoding, hashing, HTTP, I/O, bitwise\n- **String interpolation** — `f\"Hello {name}, you are {age} years old\"` f-strings\n- **Logical operators** — `and`, `or`, `not`\n- **Compiler generates readable C** — inspect with `--emit-c`\n- **Developer tooling** — formatter, linter, profiler, debugger, coverage, benchmarks, AST visualizer, playground, dependency graph, complexity analyzer, notebook runner, watch mode, snapshot testing\n- **VS Code extension** — syntax highlighting, 25 snippets, and language configuration\n\n## 🚀 Quick Start\n\n### Install from PyPI\n\n```bash\npip install sauravcode\n```\n\nAfter installation, two commands are available globally:\n- `sauravcode` — interpreter + interactive REPL\n- `sauravcode-compile` — compiler (.srv → C → native executable)\n\n### Prerequisites\n\n- **Python 3.8+**\n- **gcc** (for compiler — MinGW on Windows, Xcode CLI on macOS)\n\n### Interactive REPL\n\nStart the REPL with no arguments for instant experimentation:\n\n```bash\npython saurav.py\n```\n\n```\nsauravcode REPL v1.0\nType \"help\" for commands, \"quit\" to exit.\n\n\u003e\u003e\u003e x = 10\n\u003e\u003e\u003e print x + 5\n15\n\u003e\u003e\u003e function double n\n...     return n * 2\n...\n\u003e\u003e\u003e print double x\n20\n\u003e\u003e\u003e vars\n  x = 10\n\u003e\u003e\u003e quit\nBye!\n```\n\nREPL commands: `help`, `vars`, `funcs`, `clear`, `history`, `load FILE`, `quit`\n\n### Run a File\n\n```bash\npython saurav.py hello.srv\n```\n\n### Compile to Native Executable\n\n```bash\npython sauravcc.py hello.srv     # Compile and run\n./hello                          # Run the binary directly\n```\n\n## 📝 Language at a Glance\n\n### Hello World\n\n```\nprint \"Hello, World!\"\n```\n\n### Functions\n\nNo parentheses, no commas — just the function name and its arguments:\n\n```\nfunction greet name\n    print \"Hello,\"\n    print name\n\ngreet \"world\"\n```\n\n### Variables \u0026 Arithmetic\n\n```\nx = 10\ny = 3\nprint x + y      # 13\nprint x * y      # 30\nprint x % y      # 1\n```\n\n### Control Flow\n\n```\nscore = 85\nif score \u003e= 90\n    print \"A\"\nelse if score \u003e= 80\n    print \"B\"\nelse\n    print \"below B\"\n```\n\n### Loops\n\n```\n# While\ni = 0\nwhile i \u003c 5\n    print i\n    i = i + 1\n\n# For (range-based)\nfor i 1 6\n    print i        # prints 1 through 5\n\n# Break and Continue\nfor i 0 10\n    if i == 5\n        break          # exit loop early\n    if i % 2 == 0\n        continue       # skip even numbers\n    print i            # prints 1, 3\n```\n\n### Recursion\n\nUse parentheses only when you need to disambiguate nested expressions:\n\n```\nfunction factorial n\n    if n \u003c= 1\n        return 1\n    return n * factorial (n - 1)\n\nprint factorial 10    # 3628800\n```\n\n### Lists\n\n```\nnums = [10, 20, 30]\nprint nums[0]          # 10\nprint len nums         # 3\nappend nums 40\nprint nums[3]          # 40\n```\n\n### Maps (Dictionaries)\n\n```\n# Create a map with { key: value } syntax\nperson = {\"name\": \"Alice\", \"age\": 30, \"active\": true}\nprint person[\"name\"]    # Alice\n\n# Add/update keys\nperson[\"email\"] = \"alice@example.com\"\nperson[\"age\"] = 31\n\n# Built-in map functions\nk = keys person          # list of keys\nv = values person        # list of values\nprint has_key (person) \"name\"    # true\nprint contains (person) \"email\"  # true\nprint len person                 # 4\nprint type_of person             # map\n\n# Word frequency counter\nwords = split \"hello world hello\" \" \"\nfreq = {}\nfor i 0 len words\n    word = words[i]\n    if contains (freq) word\n        freq[word] = freq[word] + 1\n    else\n        freq[word] = 1\nprint freq[\"hello\"]     # 2\n```\n\n### String Interpolation (F-Strings)\n\nEmbed expressions directly in strings with the `f\"...\"` syntax:\n\n```\nname = \"Alice\"\nage = 30\nprint f\"Hello, {name}!\"           # Hello, Alice!\nprint f\"{name} is {age} years old\" # Alice is 30 years old\nprint f\"2 + 3 = {2 + 3}\"          # 2 + 3 = 5\n\n# Works with any expression\nitems = [1, 2, 3]\nprint f\"count: {len items}\"       # count: 3\nprint f\"upper: {upper name}\"      # upper: ALICE\n\n# Escaped braces: {{ and }} produce literal { and }\nx = 42\nprint f\"value: {{x}} = {x}\"       # value: {x} = 42\n```\n\n### Classes\n\n```\nclass Point\n    function init x y\n        self.x = x\n        self.y = y\n```\n\n### Error Handling\n\n```\ntry\n    x = risky_operation\ncatch err\n    print \"something went wrong\"\n```\n\n### Standard Library\n\nSauravcode includes **95 built-in functions** — no imports needed. See the full [Standard Library Reference](STDLIB.md).\n\n```\n# String functions\nprint upper \"hello\"              # HELLO\nprint lower \"HELLO\"              # hello\nprint trim \"  spaces  \"         # spaces\nprint replace \"hi world\" \"world\" \"sauravcode\"\nwords = split \"a-b-c\" \"-\"       # [\"a\", \"b\", \"c\"]\nprint join \", \" words            # a, b, c\nprint contains \"hello\" \"ell\"    # true\nprint starts_with \"hello\" \"he\"  # true\nprint substring \"hello\" 0 3     # hel\nprint char_at \"hello\" 0         # h\n\n# Math functions\nprint sqrt 16                    # 4\nprint power 2 10                 # 1024\nprint round 3.14159 2           # 3.14\nprint floor 3.7                  # 3\nprint ceil 3.2                   # 4\nprint abs (-42)                  # 42\n\n# Statistics\nprint mean [1, 2, 3, 4, 5]      # 3.0\nprint median [1, 3, 5, 7]       # 4.0\nprint stdev [2, 4, 4, 4, 5]     # 0.894...\n\n# Regex\nprint regex_match \"^\\d+$\" \"42\"   # true\nprint regex_replace \"\\s+\" \"-\" \"a b c\"  # a-b-c\n\n# Date/Time\nprint now                        # 2026-03-07T15:...\nd = date_add (now) 7 \"days\"     # one week from now\n\n# JSON\ndata = json_parse \"{\\\"x\\\": 1}\"   # {\"x\": 1}\nprint json_pretty data           # formatted\n\n# Hashing \u0026 Encoding\nprint sha256 \"hello\"             # 2cf24dba...\nprint base64_encode \"hello\"      # aGVsbG8=\n\n# Map functions\nm = {\"a\": 1, \"b\": 2}\nk = keys m                      # [\"a\", \"b\"]\nv = values m                    # [1, 2]\nprint has_key (m) \"a\"           # true\nprint contains (m) \"c\"          # false\n```\n\nType `builtins` in the REPL to see all available functions with usage.\n\n## ⚙️ Compiler\n\nThe compiler (`sauravcc.py`) translates sauravcode to C, then uses gcc to produce native executables.\n\n```bash\n# Compile and run\npython sauravcc.py program.srv\n\n# Emit C code only (inspect the generated code)\npython sauravcc.py program.srv --emit-c\n\n# Compile to a specific output name\npython sauravcc.py program.srv -o myprogram\n\n# Keep the intermediate .c file\npython sauravcc.py program.srv --keep-c\n\n# Verbose output\npython sauravcc.py program.srv -v\n```\n\n### Compilation Pipeline\n\n```\n┌──────────┐    ┌─────────┐    ┌──────────┐    ┌──────────┐    ┌────────────┐\n│ .srv     │───▶│ Tokenize │───▶│  Parse   │───▶│ Generate │───▶│   gcc      │\n│ source   │    │ (lexer)  │    │  (AST)   │    │  (C code)│    │ (native)   │\n└──────────┘    └─────────┘    └──────────┘    └──────────┘    └────────────┘\n```\n\n### Supported Features\n\n| Feature | Interpreter | Compiler |\n|---------|:-----------:|:--------:|\n| Interactive REPL | ✅ | — |\n| Functions \u0026 recursion | ✅ | ✅ |\n| Variables \u0026 assignment | ✅ | ✅ |\n| Arithmetic (+, -, *, /, %) | ✅ | ✅ |\n| Comparisons (==, !=, \u003c, \u003e, \u003c=, \u003e=) | ✅ | ✅ |\n| Booleans \u0026 logical ops | ✅ | ✅ |\n| If / else if / else | ✅ | ✅ |\n| While loops | ✅ | ✅ |\n| For loops (range-based) | ✅ | ✅ |\n| Break \u0026 continue | ✅ | ✅ |\n| Strings | ✅ | ✅ |\n| Lists (dynamic arrays) | ✅ | ✅ |\n| Maps (dictionaries) | ✅ | — |\n| String interpolation (f-strings) | ✅ | — |\n| Lambda expressions | ✅ | — |\n| Pipe operator | ✅ | — |\n| Pattern matching | ✅ | — |\n| Generators (yield) | ✅ | — |\n| Enums | ✅ | — |\n| Import system | ✅ | — |\n| Classes | ✅ | ✅ |\n| Try / catch | ✅ | ✅ |\n| Parenthesized expressions | ✅ | ✅ |\n| Negative numbers | ✅ | ✅ |\n\n## 🌳 AST Visualizer\n\nExplore how sauravcode parses your programs with the AST visualizer (`sauravast.py`):\n\n```bash\n# Pretty tree view\npython sauravast.py hello.srv\n\n# Limit depth for large programs\npython sauravast.py program.srv --depth 3\n\n# Machine-readable JSON\npython sauravast.py program.srv --json\n\n# Node statistics\npython sauravast.py program.srv --stats\n\n# Graphviz DOT graph (pipe to dot -Tpng for images)\npython sauravast.py program.srv --dot | dot -Tpng -o ast.png\n```\n\nExample output:\n```\nProgram\n├── AssignmentNode\n│   ├── expression: NumberNode\n│   │   └── value: 42.0\n│   └── name: 'x'\n├── FunctionNode\n│   ├── body: [2 items]\n│   │   ├── [0]: PrintNode ...\n│   │   └── [1]: ReturnNode ...\n│   ├── name: 'greet'\n│   └── params: ['name']\n└── FunctionCallNode\n    ├── arguments: [1 items]\n    │   └── [0]: StringNode\n    │       └── value: 'World'\n    └── name: 'greet'\n```\n\n## 🔥 Advanced Features\n\n### Lambda Expressions\n\nInline anonymous functions for quick transformations:\n\n```\ndouble = lambda x -\u003e x * 2\nprint double 5                # 10\n\n# With higher-order functions\nnums = [1, 2, 3, 4, 5]\ndoubled = map (lambda x -\u003e x * 2) nums\nprint doubled                 # [2, 4, 6, 8, 10]\n\nfiltered = filter (lambda x -\u003e x \u003e 3) nums\nprint filtered                # [4, 5]\n```\n\n### Pipe Operator\n\nChain transformations left-to-right for readable data pipelines:\n\n```\nresult = \"hello world\" |\u003e upper |\u003e reverse\nprint result                  # DLROW OLLEH\n\n# Multi-step pipelines\n\"  Hello, World!  \" |\u003e trim |\u003e lower |\u003e print\n# hello, world!\n```\n\n### Pattern Matching\n\nDeclarative branching with `match` expressions:\n\n```\nfunction describe x\n    match x\n        1 -\u003e print \"one\"\n        2 -\u003e print \"two\"\n        3 -\u003e print \"three\"\n        _ -\u003e print \"something else\"\n\ndescribe 2                    # two\ndescribe 99                   # something else\n```\n\n### Generators\n\nLazy sequences with `yield` for memory-efficient iteration:\n\n```\nfunction countdown n\n    while n \u003e 0\n        yield n\n        n = n - 1\n\ngen = countdown 5\nprint next gen                # 5\nprint next gen                # 4\nprint next gen                # 3\n```\n\n### Enums\n\nNamed constant groups with dot-notation access:\n\n```\nenum Color\n    RED\n    GREEN\n    BLUE\n\nc = Color.RED\nprint c                       # Color.RED\n\nmatch c\n    Color.RED -\u003e print \"red!\"\n    Color.GREEN -\u003e print \"green!\"\n    _ -\u003e print \"other\"\n```\n\n### Imports\n\nModular code with file-based imports:\n\n```\n# math_utils.srv\nfunction square x\n    return x * x\n\nfunction cube x\n    return x * x * x\n\n# main.srv\nimport \"math_utils.srv\"\nprint square 5                # 25\nprint cube 3                  # 27\n```\n\n## 🛠️ Developer Tooling\n\nSauravcode ships with a comprehensive suite of developer tools:\n\n| Tool | Command | Description |\n|------|---------|-------------|\n| **Formatter** | `python sauravfmt.py file.srv` | Auto-format code with consistent indentation and spacing |\n| **Linter** | `python sauravlint.py file.srv` | Static analysis for style, complexity, and potential bugs |\n| **Profiler** | `python sauravprof.py file.srv` | Execution profiling with call counts and timing |\n| **Debugger** | `python sauravdb.py file.srv` | Interactive debugger with breakpoints and step-through |\n| **Coverage** | `python sauravcov.py file.srv` | Code coverage analysis (line-level hit/miss) |\n| **Benchmarks** | `python sauravbench.py` | Performance benchmarks (fibonacci, sort, recursion, etc.) |\n| **AST Viewer** | `python sauravast.py file.srv` | Parse tree visualization (text, JSON, Graphviz DOT) |\n| **Playground** | `python sauravplay.py` | Interactive sandbox for experimenting |\n| **Semantic Diff** | `python sauravdiff.py a.srv b.srv` | Structural diff between sauravcode files |\n| **Doc Generator** | `python sauravdoc.py file.srv` | Extract documentation from source files |\n| **Dependency Graph** | `python sauravdeps.py file.srv` | Visualize import dependencies between modules |\n| **Complexity** | `python sauravcomplex.py file.srv` | Cyclomatic complexity analysis per function |\n| **Notebook** | `python sauravnb.py file.srvnb` | Jupyter-style notebook for literate sauravcode |\n| **Watch Mode** | `python sauravwatch.py file.srv` | Auto-rerun on file changes (live reload) |\n| **Snapshot Test** | `python sauravsnap.py file.srv` | Snapshot testing for output verification |\n| **Enhanced REPL** | `python sauravrepl.py` | REPL with history, multi-line editing, and syntax hints |\n| **Canvas** | `python sauravcanvas.py file.srv` | Turtle graphics — generate SVG/HTML from drawing commands |\n\n## 🏗️ Architecture\n\nThe codebase has two execution paths sharing a common tokenizer design:\n\n- **`saurav.py`** — Tree-walk interpreter. Tokenizes, parses to AST, evaluates directly.\n- **`sauravcc.py`** — Compiler. Tokenizes, parses to AST, generates C source, invokes gcc.\n\nThe compiler generates clean, readable C. Lists become dynamic arrays (`SrvList`) with bounds checking. Try/catch maps to `setjmp`/`longjmp`. Classes compile to C structs with associated functions.\n\nFor the full deep-dive, see the [Architecture Guide](docs/ARCHITECTURE.md).\n\n## 📂 Project Structure\n\n```\nsauravcode/\n├── saurav.py           # Interpreter + interactive REPL\n├── sauravcc.py         # Compiler (.srv → C → native)\n├── sauravast.py        # AST visualizer (tree, JSON, DOT, stats)\n├── sauravbench.py      # Benchmark runner (fib, sort, recursion, etc.)\n├── sauravcov.py        # Code coverage analysis\n├── sauravdb.py         # Interactive debugger\n├── sauravdiff.py       # Semantic diff between .srv files\n├── sauravdoc.py        # Documentation generator\n├── sauravfmt.py        # Code formatter\n├── sauravlint.py       # Linter (style, complexity, bugs)\n├── sauravplay.py       # Interactive playground\n├── sauravprof.py       # Execution profiler\n├── sauravcomplex.py    # Cyclomatic complexity analyzer\n├── sauravdeps.py       # Import dependency graph\n├── sauravnb.py         # Jupyter-style notebook runner\n├── sauravrepl.py       # Enhanced REPL with history\n├── sauravsnap.py       # Snapshot testing\n├── sauravwatch.py      # File watcher (live reload)\n├── sauravcanvas.py     # Turtle graphics (SVG/HTML output)\n├── tests/              # 2,300+ pytest tests (40 test modules)\n├── editors/\n│   └── vscode/         # VS Code extension (syntax, snippets)\n├── docs/\n│   ├── LANGUAGE.md     # Language reference \u0026 EBNF grammar\n│   ├── ARCHITECTURE.md # Compiler/interpreter internals\n│   └── EXAMPLES.md     # Annotated examples\n├── site/\n│   └── index.html      # Documentation website\n├── .github/\n│   └── workflows/      # CI/CD (CodeQL, Pages)\n├── STDLIB.md           # Standard library reference (95 functions)\n├── CHANGELOG.md        # Version history\n├── CONTRIBUTING.md     # Contribution guidelines\n└── LICENSE             # MIT License\n```\n\n## 🧪 Running Tests\n\nRun the comprehensive test suite:\n\n```bash\n# Full test suite (interpreter + compiler + REPL)\npython -m pytest tests/ -v\n\n# Run .srv test files directly\npython saurav.py test_all.srv\n\n# Compiler\npython sauravcc.py test_all.srv\n```\n\n## 🔄 Language Comparison\n\nSee how sauravcode compares to other languages for common tasks:\n\n| Task | sauravcode | Python | JavaScript |\n|------|-----------|--------|------------|\n| Print | `print \"hello\"` | `print(\"hello\")` | `console.log(\"hello\")` |\n| Function | `function add a b`\u003cbr\u003e`    return a + b` | `def add(a, b):`\u003cbr\u003e`    return a + b` | `function add(a, b) {`\u003cbr\u003e`    return a + b; }` |\n| Call | `add 3 5` | `add(3, 5)` | `add(3, 5)` |\n| For loop | `for i 1 6`\u003cbr\u003e`    print i` | `for i in range(1, 6):`\u003cbr\u003e`    print(i)` | `for (let i=1; i\u003c6; i++)`\u003cbr\u003e`    console.log(i)` |\n| Lambda | `lambda x -\u003e x * 2` | `lambda x: x * 2` | `x =\u003e x * 2` |\n| Pipe | `\"hi\" \\|\u003e upper \\|\u003e reverse` | N/A (nested calls) | N/A (method chaining) |\n| F-string | `f\"Hi {name}\"` | `f\"Hi {name}\"` | `` `Hi ${name}` `` |\n| List comp | `[x * 2 for x in range 1 6]` | `[x*2 for x in range(1,6)]` | `[...Array(5)].map((_,i)=\u003e(i+1)*2)` |\n\n**Key differences:** No parentheses for calls, no commas between arguments, no semicolons, no braces. Indentation defines blocks (like Python), but function calls are cleaner.\n\n## 🎯 Design Philosophy\n\n\u003e Code should read like thought. No ceremony, no noise — just logic.\n\nTraditional languages carry decades of syntactic baggage. Sauravcode asks: *what if we kept only what matters?*\n\n- **Function calls without parentheses** — `add 3 5` instead of `add(3, 5)`\n- **Indentation-based blocks** — no `{}` or `end` keywords\n- **Minimal punctuation** — colons, semicolons, and most commas are gone\n- **Disambiguation when needed** — parentheses are available for complex expressions\n\nThe result is code that reads almost like pseudocode but actually runs.\n\n## 📖 Documentation\n\n| Document | Description |\n|----------|-------------|\n| [Standard Library](STDLIB.md) | All 95 built-in functions with signatures and examples |\n| [Language Reference](docs/LANGUAGE.md) | Complete spec with EBNF grammar, types, operators, precedence |\n| [Architecture Guide](docs/ARCHITECTURE.md) | How the tokenizer, parser, interpreter, and compiler work |\n| [Examples](docs/EXAMPLES.md) | Annotated programs covering all features |\n| [Changelog](CHANGELOG.md) | Version history and notable changes |\n| [Website](https://sauravbhattacharya001.github.io/sauravcode/) | Interactive documentation |\n| [Home Page](https://sites.google.com/view/sauravcode) | Project home |\n\n## ✏️ Editor Support\n\n### Visual Studio Code\n\nFull syntax highlighting, 25 code snippets, and language configuration for VS Code.\n\n**Quick install:**\n```bash\n# Symlink the extension (Windows)\nmklink /D \"%USERPROFILE%\\.vscode\\extensions\\sauravcode\" \"path\\to\\sauravcode\\editors\\vscode\"\n\n# Symlink the extension (macOS / Linux)\nln -s path/to/sauravcode/editors/vscode ~/.vscode/extensions/sauravcode\n```\n\nSee [`editors/vscode/README.md`](editors/vscode/README.md) for full details.\n\n## 🤝 Contributing\n\nContributions are welcome! Here's how to get started:\n\n1. **Fork** the repository\n2. **Create** a feature branch (`git checkout -b feature/my-feature`)\n3. **Make** your changes with tests\n4. **Test** with both interpreter and compiler\n5. **Submit** a pull request\n\n### Ideas for Contributions\n\n- Additional data structures (sets, tuples)\n- Compiler support for maps, f-strings, generators, and pattern matching\n- Editor support for more editors (Sublime Text, Vim, Emacs, JetBrains)\n- Optimization passes in the compiler\n- Async/concurrent execution\n- Package manager for .srv modules\n\n## 📄 License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n## 👤 Author\n\n**Saurav Bhattacharya** — [GitHub](https://github.com/sauravbhattacharya001)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsauravbhattacharya001%2Fsauravcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsauravbhattacharya001%2Fsauravcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsauravbhattacharya001%2Fsauravcode/lists"}