{
  "schema_version": "1.0.0",
  "languages": [
    {
      "id": "javascript",
      "name": "JavaScript",
      "color": "#f7df1e",
      "description": "JavaScript runs in browsers and on servers (with Node.js). You use it to react to clicks, fetch data from APIs, and build full apps. One core language, many environments — the ideas transfer once you know the basics.",
      "whoItIsFor": "People who have written a little code or HTML and want the web to make sense: how pages update, how data loads, and how small scripts fit together. You do not need to be an expert to start here.",
      "commonUses": [
        "Websites",
        "Web Servers (Node.js)",
        "Mobile Apps (React Native)",
        "Desktop Apps (Electron)"
      ],
      "patterns": [
        {
          "title": "Change the page when someone clicks",
          "code": "// Needs a page with: <button id=\"go\" type=\"button\">Go</button>\nconst btn = document.querySelector('#go');\nbtn.addEventListener('click', () => {\n  btn.textContent = 'Clicked!';\n});",
          "explanation": "Finds an element, listens for a click, then updates what it shows — the usual first step toward interactive pages."
        },
        {
          "title": "Filter and transform a list",
          "code": "const scores = [12, 7, 19, 5];\nconst passed = scores.filter((n) => n >= 10);\nconst doubled = passed.map((n) => n * 2);\nconsole.log(doubled); // [24, 38]",
          "explanation": "filter keeps items that pass a test; map builds a new array from each item. Neither changes the original array."
        },
        {
          "title": "Load JSON from the network with async/await",
          "code": "async function loadTodo() {\n  const res = await fetch('https://jsonplaceholder.typicode.com/todos/1');\n  if (!res.ok) throw new Error('Bad response');\n  const data = await res.json();\n  console.log(data.title);\n}\n\nloadTodo();",
          "explanation": "`fetch` resolves to a `Response`; calling `res.json()` returns another Promise for the parsed body—use `await` on both inside an `async` function (or use `.then` chains). Check `res.ok` before trusting the body; failed requests usually mean an HTTP error status, not only a network failure."
        },
        {
          "title": "Hand an ArrayBuffer to WebAssembly (WASM boundary)",
          "code": "// Fetch and compile a .wasm module\nconst response = await fetch('add.wasm');\nconst bytes = await response.arrayBuffer();\nconst { instance } = await WebAssembly.instantiate(bytes);\n\n// Pass typed array data into WASM memory\nconst wasmMemory = instance.exports.memory;\nconst view = new Int32Array(wasmMemory.buffer);\nview[0] = 10;\nview[1] = 20;\n\n// Call the exported function — reads from WASM linear memory\nconst result = instance.exports.add_offsets(0, 1);\nconsole.log(result); // 30",
          "explanation": "WebAssembly shares a linear ArrayBuffer with JS. You write typed-array data into WASM memory, call an exported function by offset, and read results back. This is the core data-movement pattern for JS to WASM pipelines."
        }
      ],
      "libraries": [
        {
          "name": "React",
          "url": "https://react.dev/",
          "type": "UI Library"
        },
        {
          "name": "Express",
          "url": "https://expressjs.com/",
          "type": "Server Framework"
        }
      ],
      "docs": [
        {
          "name": "MDN Web Docs",
          "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// const = never reassign this binding; let = you may change the value\nconst maxRetries = 3;\nlet attempt = 0;\nattempt += 1;\n\n// maxRetries = 4; // would throw — const cannot be reassigned",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "const score = 85;\n\nif (score >= 70) {\n  console.log('Pass');\n} else if (score >= 50) {\n  console.log('Resit');\n} else {\n  console.log('Fail');\n}\n\n// Shorthand pick between two values\nconst label = score >= 70 ? 'OK' : 'Needs work';",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Count 0, 1, 2\nfor (let i = 0; i < 3; i++) {\n  console.log(i);\n}\n\n// Loop over array values\nfor (const item of ['a', 'b']) {\n  console.log(item);\n}\n\n// Repeat while a condition holds\nlet n = 3;\nwhile (n > 0) {\n  console.log(n);\n  n -= 1;\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "// Regular function declaration\nfunction square(x) {\n  return x * x;\n}\n\n// Arrow: handy for short functions and callbacks\nconst add = (a, b) => a + b;\n\nconsole.log(square(4), add(2, 3));",
          "difficulty": "basic"
        },
        "strings": {
          "code": "const name = 'Alex';              // single quotes\nconst line = \"Also valid\";        // double quotes\nconst greet = `Hello, ${name}!`;  // template: embed expressions\nconsole.log(greet.length);        // how many characters",
          "difficulty": "basic"
        },
        "classes": {
          "code": "class Counter {\n  constructor(start = 0) {\n    this.count = start;   // each instance has its own count\n  }\n  bump() {\n    this.count += 1;\n    return this.count;\n  }\n}\n\nconst c = new Counter(10);\nconsole.log(c.bump()); // 11",
          "difficulty": "basic"
        },
        "errors": {
          "code": "function risky() {\n  throw new Error('Something went wrong');\n}\n\ntry {\n  risky();\n} catch (err) {\n  console.error('Handled:', err.message);\n} finally {\n  console.log('Runs whether or not there was an error');\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "// ES modules (bundlers, modern Node, <script type=\"module\">)\nimport defaultThing from './my-module.js';\nimport { helperA, helperB } from './utils.js';\n\n// Node built-in (note the \"node:\" prefix)\nimport fs from 'node:fs/promises';",
          "difficulty": "basic"
        },
        "performance": {
          "code": "JIT-compiled in typical browsers and Node. Fast for typical web/I/O workloads; engines and tuning vary (V8 is common in Chrome and Node, not universal). Uses more memory than lower-level languages.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "js-tip-equality",
          "title": "Use === instead of ==",
          "body": "Double equals (==) converts types before comparing, so you get surprises like 0 == false being true. Triple equals (===) compares without that conversion. Use === and !== unless you have a rare, deliberate reason not to.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "js-tip-this",
          "title": "The keyword this depends on how you call",
          "body": "In a normal method on an object, this usually refers to that object. If you pass the method somewhere else (for example straight into addEventListener) or mix arrows and methods, this can become undefined or the wrong object. When stuck, capture what you need in a variable or use an arrow for a short callback.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "js-tip-async",
          "title": "async/await and forgotten await",
          "body": "An async function always returns a Promise. If you skip await on something async, you may accidentally pass a Promise where you expected a plain value (for example printing [object Promise]). Await each async step, or use .then(), and use try/catch around awaited code because failures become rejections.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/javascript/",
      "quickTourLabel": "Learn X in Y Minutes — JavaScript",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/javascript",
          "type": "Practice track"
        },
        {
          "name": "freeCodeCamp",
          "url": "https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/",
          "type": "Course"
        }
      ],
      "categories": [
        "web"
      ],
      "overview": "JavaScript runs in browsers and on servers (with Node.js). You use it to react to clicks, fetch data from APIs, and build full apps. One core language, many environments — the ideas transfer once you know the basics.",
      "learning_curve": "Friendly for a first “real” language if you start with small scripts; the web platform adds async, modules, and tooling to layer in gradually.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Huge npm ecosystem and ubiquitous in browsers and Node — many learning resources, and steady framework churn.",
      "common_use_cases": [
        "Websites",
        "Web Servers (Node.js)",
        "Mobile Apps (React Native)",
        "Desktop Apps (Electron)"
      ],
      "docs_url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript",
      "paradigm_primary": "multi-paradigm",
      "paradigm": [
        "event-driven",
        "functional",
        "imperative"
      ],
      "best_for": [
        "Interactive web pages",
        "Full-stack apps with Node.js",
        "cross-platform mobile and desktop builds",
        "Interactive browser UIs with DOM manipulation and async data fetching"
      ],
      "weak_at": [
        "CPU-bound numeric workloads without native extensions or WASM",
        "Large monoliths where strict static typing would catch errors earlier",
        "Hard real-time systems requiring deterministic latency guarantees"
      ],
      "official_url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Parsed and executed by a host engine; modern engines usually JIT-compile hot code (V8, SpiderMonkey, and others)",
        "memory": "Garbage-collected",
        "abstraction": "High-level for typical application code"
      }
    },
    {
      "id": "python",
      "name": "Python",
      "color": "#3776ab",
      "description": "A friendly language where indentation shows structure and you can go from scripts to data work without a steep setup. You read it almost like English, which makes it a common first \"real\" language after HTML or block coding.",
      "whoItIsFor": "Learners who want to automate boring tasks, explore data, or back a web app — and anyone who prefers clear syntax over curly-brace ceremony. A little logic and patience is enough to start.",
      "commonUses": [
        "Data Science",
        "Artificial Intelligence",
        "Web Development",
        "Automation Scripts"
      ],
      "patterns": [
        {
          "title": "Count items with a dictionary",
          "code": "words = [\"python\", \"sql\", \"python\", \"go\"]\ncounts = {}\nfor w in words:\n    counts[w] = counts.get(w, 0) + 1\nprint(counts)  # {\"python\": 2, \"sql\": 1, \"go\": 1}",
          "explanation": "Walks a list and tallies how often each value appears — the same pattern works for log lines, survey answers, or file names."
        },
        {
          "title": "Read a text file safely",
          "code": "from pathlib import Path\n\npath = Path(\"notes.txt\")\nif path.exists():\n    text = path.read_text(encoding=\"utf-8\")\n    for line in text.splitlines():\n        print(line.strip())",
          "explanation": "pathlib keeps paths readable; always pass encoding=\"utf-8\" for text so you do not get surprise bytes on different machines."
        },
        {
          "title": "A small script you can run or import",
          "code": "def main() -> None:\n    name = input(\"Your name? \").strip() or \"friend\"\n    print(f\"Hi, {name}!\")\n\n\nif __name__ == \"__main__\":\n    main()",
          "explanation": "The if __name__ == \"__main__\" guard runs main() only when you execute this file, not when another module imports it — handy as scripts grow."
        },
        {
          "title": "Call a C function via ctypes (FFI boundary)",
          "code": "import ctypes\n\n# Load a shared library\nlibc = ctypes.CDLL(\"libc.so.6\")  # Linux; \"msvcrt\" on Windows\n\n# Describe the C signature: int puts(const char*)\nlibc.puts.restype = ctypes.c_int\nlibc.puts.argtypes = [ctypes.c_char_p]\n\n# Call it — bytes cross the Python → C boundary\nlibc.puts(b\"Hello from C via ctypes\")",
          "explanation": "ctypes lets Python call functions in native shared libraries without writing a C extension. You describe the argument and return types so Python can marshal values across the FFI boundary. The bytes object (b\"...\") becomes a C char* on the other side."
        }
      ],
      "libraries": [
        {
          "name": "Real Python",
          "url": "https://realpython.com/",
          "type": "Tutorials"
        },
        {
          "name": "PyPI",
          "url": "https://pypi.org/",
          "type": "Package index"
        }
      ],
      "docs": [
        {
          "name": "Official Python tutorial",
          "url": "https://docs.python.org/3/tutorial/"
        },
        {
          "name": "Python language reference",
          "url": "https://docs.python.org/3/reference/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# Names point at objects; no keyword to declare\nname = \"Ada\"\ncount = 0\ncount += 1\nPI = 3.14159  # convention: ALL_CAPS for constants",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "score = 72\nif score >= 70:\n    print(\"Pass\")\nelif score >= 50:\n    print(\"Borderline\")\nelse:\n    print(\"Fail\")\n\n# Ternary-style expression\nlabel = \"ok\" if score >= 70 else \"retry\"",
          "difficulty": "basic"
        },
        "loops": {
          "code": "# Repeat a fixed number of times (0 .. 4)\nfor i in range(5):\n    print(i)\n\n# Walk a list directly\nfor item in [\"a\", \"b\"]:\n    print(item)\n\n# While a condition holds\nn = 3\nwhile n > 0:\n    print(n)\n    n -= 1",
          "difficulty": "basic"
        },
        "functions": {
          "code": "def add(a, b):\n    return a + b\n\n# Type hints (optional but helpful in teams)\ndef greet(name: str) -> str:\n    return f\"Hello, {name}\"\n\nsquare = lambda x: x * x",
          "difficulty": "basic"
        },
        "strings": {
          "code": "single = \"double quotes work too\"\nmultiline = \"\"\"Several\nlines\"\"\"\nname = \"Ada\"\ngreeting = f\"Hi, {name}!\"  # f-string embeds values",
          "difficulty": "basic"
        },
        "classes": {
          "code": "class Counter:\n    def __init__(self, start: int = 0) -> None:\n        self.count = start\n\n    def bump(self) -> int:\n        self.count += 1\n        return self.count\n\n\nc = Counter(10)\nprint(c.bump())  # 11",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try:\n    value = int(input(\"Enter a number: \"))\nexcept ValueError:\n    print(\"That was not an integer.\")\nfinally:\n    print(\"Done asking.\")",
          "difficulty": "basic"
        },
        "imports": {
          "code": "# Standard library\nimport json\nfrom pathlib import Path\n\n# Your own module in the same folder\n# import helpers  (would load helpers.py)",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Interpreted. Generally slower execution speed compared to compiled languages, but highly optimised C-extensions (like NumPy) make it fast for data math.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "py-tip-indent",
          "title": "Indentation is part of the grammar",
          "body": "Blocks are defined by indenting with spaces (PEP 8 suggests 4 per level). Mixing tabs and spaces, or indenting one branch differently from another, raises IndentationError. Set your editor to show whitespace and to insert spaces for Tab.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "py-tip-mutable-default",
          "title": "Mutable default arguments are shared",
          "body": "Writing `def save(items=[])` reuses one list for every call because default values are evaluated when the function is defined, not on each call—so appends pile up across callers. Use `def save(items=None):` and assign `items = []` when `items is None` before you mutate, or copy what was passed (e.g. `items = list(items)`) if callers always supply an iterable.",
          "tag": "common mistake",
          "status": "curated"
        },
        {
          "id": "py-tip-eq-is",
          "title": "Use == for value, `is` for same object",
          "body": "== asks whether values match. `is` checks object identity. For None, write `x is None`. For numbers and strings you usually want ==, not `is`, even if small integers sometimes look like they work with `is` in CPython.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "py-tip-range",
          "title": "`range` stops before the end value",
          "body": "range(3) yields 0, 1, 2 — not 3. range(1, 4) yields 1, 2, 3. Off-by-one bugs often come from forgetting the stop is exclusive.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/python/",
      "quickTourLabel": "Learn X in Y Minutes — Python",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/python",
          "type": "Practice track"
        },
        {
          "name": "Python Tutor (visualise)",
          "url": "https://pythontutor.com/",
          "type": "Step-through visualiser"
        }
      ],
      "categories": [
        "data",
        "web"
      ],
      "overview": "A friendly language where indentation shows structure and you can go from scripts to data work without a steep setup. You read it almost like English, which makes it a common first \"real\" language after HTML or block coding.",
      "learning_curve": "Often used as a first language: indentation-based structure reads clearly, with a large standard library for quick wins.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Strong for data, scripting, and teaching; virtual environments and packaging are common early hurdles.",
      "common_use_cases": [
        "Data Science",
        "Artificial Intelligence",
        "Web Development",
        "Automation Scripts"
      ],
      "docs_url": "https://docs.python.org/3/",
      "paradigm_primary": "multi-paradigm",
      "paradigm": [
        "imperative",
        "object-oriented",
        "functional"
      ],
      "best_for": [
        "data science and machine learning",
        "backend APIs and automation scripts",
        "scientific computing and research prototyping"
      ],
      "weak_at": [
        "Low-latency systems where interpreter overhead is unacceptable",
        "Mobile-first native UI development without cross-platform wrappers",
        "Browser-only client apps without a separate compilation step"
      ],
      "official_url": "https://www.python.org/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic (optional type hints; runtime typing stays dynamic unless you use a separate checker)",
        "runtime": "Bytecode interpreter in CPython; other implementations (PyPy, Jython, and others) differ",
        "memory": "Garbage-collected in CPython and most mainstream implementations",
        "abstraction": "High-level for typical scripts and application code"
      }
    },
    {
      "id": "java",
      "name": "Java",
      "color": "#007396",
      "description": "A statically typed, object-oriented language that runs on the JVM — one bytecode build usually runs wherever a compatible Java runtime is installed.",
      "whoItIsFor": "Enterprise developers, Android teams, and backend engineers building large-scale systems.",
      "commonUses": [
        "Enterprise backends",
        "Android apps",
        "Big data (Hadoop/Spark)",
        "Microservices"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "public class Main {\n  public static void main(String[] args) {\n    System.out.println(\"Hello, World!\");\n  }\n}",
          "explanation": "The usual entry point is a class with a public static void main(String[] args) method."
        },
        {
          "title": "Variables",
          "code": "int x = 10;\nString name = \"Ada\";\nfinal double PI = 3.14;",
          "explanation": "Explicit types; final makes a constant."
        },
        {
          "title": "Classes",
          "code": "class Dog {\n  String name;\n  Dog(String name) { this.name = name; }\n  void bark() { System.out.println(name + \" barks!\"); }\n}",
          "explanation": "Most application code is organized in classes; interfaces, records, and enums are common too."
        },
        {
          "title": "Call a native C function via JNI (FFI boundary)",
          "code": "// Java side\npublic class NativeAdd {\n    static {\n        System.loadLibrary(\"nativeadd\"); // loads libnativeadd.so\n    }\n\n    // Declare the native method\n    private native int add(int a, int b);\n\n    public static void main(String[] args) {\n        System.out.println(new NativeAdd().add(3, 4)); // 7\n    }\n}\n\n/* C side (generated header: NativeAdd.h)\n#include <jni.h>\nJNIEXPORT jint JNICALL Java_NativeAdd_add(\n    JNIEnv *env, jobject obj, jint a, jint b) {\n    return a + b;\n}\n*/",
          "explanation": "JNI (Java Native Interface) is the FFI boundary between Java and C/C++. Java declares a native method; the JDK's javac can emit a C header that matches the mangled JNI signature (exact flags vary by JDK version and build setup). The C implementation receives a JNIEnv pointer for converting between Java and C types. The shared library is loaded at runtime with System.loadLibrary()."
        }
      ],
      "libraries": [
        {
          "name": "Spring Boot",
          "url": "https://spring.io/projects/spring-boot",
          "type": "Web framework"
        },
        {
          "name": "Maven Central",
          "url": "https://search.maven.org/",
          "type": "Package repository"
        }
      ],
      "docs": [
        {
          "name": "Oracle Java Docs",
          "url": "https://docs.oracle.com/en/java/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "int x = 10;\nString name = \"Ada\";",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5) {\n  System.out.println(\"big\");\n} else {\n  System.out.println(\"small\");\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for (int i = 0; i < 5; i++) {\n  System.out.println(i);\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "static int add(int a, int b) {\n  return a + b;\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "JIT-compiled on the JVM; long-running services often see strong throughput, but GC, allocation patterns, and tuning still matter.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "String a = \"hello\";\nString b = \"line1\\n\" + \"line2\";",
          "difficulty": "basic"
        },
        "classes": {
          "code": "public class Point {\n  public final int x, y;\n  public Point(int x, int y) { this.x = x; this.y = y; }\n}",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try {\n  Integer.parseInt(\"x\");\n} catch (NumberFormatException e) {\n  System.err.println(e.getMessage());\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "import java.util.List;\nimport java.nio.file.Path;",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "java-tip-1",
          "title": "Check Array Bounds",
          "body": "Always ensure you are not accessing an index outside the size of your array to avoid ArrayIndexOutOfBoundsException.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/java/",
      "quickTourLabel": "Learn X in Y Minutes — Java",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/java",
          "type": "Practice track"
        }
      ],
      "categories": [
        "web",
        "mobile",
        "data"
      ],
      "overview": "A statically typed, class-based language that compiles to JVM bytecode, so one build runs wherever a compatible Java runtime is installed — common for backend services and internal tools. Android shares the same platform libraries and tooling; many new apps are written in Kotlin alongside Java. Third-party code usually arrives as JARs from Maven-compatible repositories.",
      "learning_curve": "Moderate — verbose but predictable syntax, strong IDE support, and abundant learning resources. Object-oriented thinking and the JVM ecosystem (Maven/Gradle) are the main hurdles for newcomers.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Enormous: Spring, Maven Central, Gradle. Verbose boilerplate is the common complaint. JVM tuning and classpath issues frustrate beginners. Still common in large-enterprise backends; on Android it often appears alongside Kotlin.",
      "common_use_cases": [
        "Enterprise backends",
        "Android apps",
        "Big data (Hadoop/Spark)",
        "Microservices"
      ],
      "docs_url": "https://docs.oracle.com/en/java/",
      "paradigm_primary": "object-oriented",
      "paradigm": [
        "object-oriented",
        "imperative",
        "generic"
      ],
      "best_for": [
        "Enterprise backend services",
        "Android app development",
        "large-scale distributed systems",
        "Enterprise backend services with mature JVM ecosystem tooling"
      ],
      "weak_at": [
        "Quick one-off scripts where startup time and boilerplate feel heavy",
        "Systems programming close to hardware without JNI complexity",
        "Small embedded firmware with tight memory budgets"
      ],
      "official_url": "https://openjdk.org/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static (checked at compile time)",
        "runtime": "JVM bytecode; HotSpot and other common runtimes JIT-compile at runtime",
        "memory": "Garbage-collected on typical JVM deployments",
        "abstraction": "High-level for typical application code on the JVM"
      }
    },
    {
      "id": "csharp",
      "name": "C#",
      "color": "#239120",
      "description": "A modern, object-oriented language for .NET — common for web APIs and services, desktop and CLI tools, and game code (for example with Unity).",
      "whoItIsFor": "Enterprise .NET developers, Unity game developers, and engineers shipping cross-platform or Windows-centric .NET workloads.",
      "commonUses": [
        "Web APIs (ASP.NET)",
        "Unity games",
        "Desktop apps (WPF/MAUI)",
        "Cloud services (Azure)"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "Console.WriteLine(\"Hello, World!\");",
          "explanation": "Top-level statements are supported in recent C# versions; many SDK templates compile a Program entry point without an explicit Main wrapper."
        },
        {
          "title": "Variables",
          "code": "int x = 10;\nvar name = \"Ada\";\nconst double Pi = 3.14;",
          "explanation": "var infers the type; const is compile-time constant."
        },
        {
          "title": "Classes",
          "code": "class Dog {\n  public string Name { get; set; }\n  public void Bark() => Console.WriteLine($\"{Name} barks!\");\n}",
          "explanation": "Properties and expression-bodied members."
        },
        {
          "title": "Call a native C function via P/Invoke (FFI boundary)",
          "code": "using System;\nusing System.Runtime.InteropServices;\n\npublic class NativeInterop {\n    // Declare the C function signature\n    [DllImport(\"libc.so.6\", EntryPoint = \"puts\")]\n    private static extern int puts(string s);\n\n    // Custom struct matching a C layout\n    [StructLayout(LayoutKind.Sequential)]\n    public struct Point { public int X; public int Y; }\n\n    public static void Main() {\n        puts(\"Hello from C via P/Invoke\");\n    }\n}",
          "explanation": "P/Invoke (Platform Invoke) is .NET's FFI for calling native code in shared libraries (DLL / .so / dylib depending on OS). DllImport names the library and entry point — the string here is a Linux-oriented libc example, not universal. The runtime marshals managed types (string, struct) to native layouts; StructLayout aligns struct packing with what the native side expects."
        }
      ],
      "libraries": [
        {
          "name": "NuGet",
          "url": "https://www.nuget.org/",
          "type": "Package manager"
        },
        {
          "name": "ASP.NET Core",
          "url": "https://dotnet.microsoft.com/apps/aspnet",
          "type": "Web framework"
        }
      ],
      "docs": [
        {
          "name": "Microsoft C# Docs",
          "url": "https://learn.microsoft.com/dotnet/csharp/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "int x = 10;\nvar y = 20;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5) {\n  Console.WriteLine(\"big\");\n} else {\n  Console.WriteLine(\"small\");\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for (int i = 0; i < 5; i++) {\n  Console.WriteLine(i);\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "int Add(int a, int b) => a + b;",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Typically JIT-compiled on the CLR for many deployments; throughput depends on workload, GC, and runtime settings — not a single cross-language score.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "var a = \"interp\";\nvar v = $\"x={1 + 1}\";\nvar multi = \"line1\\n\" + \"line2\";",
          "difficulty": "basic"
        },
        "classes": {
          "code": "public class Point {\n  public int X { get; set; }\n  public int Y { get; set; }\n}",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try {\n  int.Parse(\"x\");\n} catch (FormatException ex) {\n  Console.Error.WriteLine(ex.Message);\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "using System.Linq;\nusing System.IO;",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "csharp-tip-browser-state-and-async-timing-hide-bugs",
          "title": "Browser state and async timing hide bugs",
          "body": "In C#, UI bugs often come from stale state, event timing, or a missing await/fetch boundary. Reproduce the issue with one interaction and log the state transition before changing the view code.",
          "tag": "frontend",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/csharp/",
      "quickTourLabel": "Learn X in Y Minutes — C#",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/csharp",
          "type": "Practice track"
        }
      ],
      "categories": [
        "web",
        "games",
        "enterprise",
        "desktop"
      ],
      "overview": "C# is the primary language for modern .NET — the cross-platform runtime and SDKs that grew out of .NET Core, so teams routinely build and deploy on Linux and macOS as well as Windows. Typical work includes ASP.NET Core services, desktop and CLI tools, and Unity game code; libraries usually come from NuGet.",
      "learning_curve": "Moderate — C-like syntax with rich IDE support (Visual Studio, Rider). LINQ and async/await are powerful but take time to master. The cross-platform .NET Core / .NET 5+ line widened where typical workloads run.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "NuGet is the usual package feed. ASP.NET Core is a common stack for web APIs and services. Unity remains a major games client for C#. Cross-platform .NET is mainstream now, though a Windows-first history still shapes some tooling and docs.",
      "common_use_cases": [
        "Web APIs (ASP.NET)",
        "Unity games",
        "Desktop apps (WPF/MAUI)",
        "Cloud services (Azure)"
      ],
      "docs_url": "https://learn.microsoft.com/dotnet/csharp/",
      "paradigm_primary": "object-oriented",
      "paradigm": [
        "object-oriented",
        "imperative",
        "functional"
      ],
      "best_for": [
        "cross-platform enterprise apps",
        "Unity game development",
        "Azure cloud services and APIs",
        "Cross-platform .NET services, APIs, and cloud-native workloads"
      ],
      "weak_at": [
        "Platforms without official .NET runtime support or long-term patches",
        "Ultra-lightweight embedded targets with kilobyte-scale footprints",
        "Ecosystems expecting purely functional purity without OOP idioms"
      ],
      "official_url": "https://dotnet.microsoft.com/languages/csharp",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static",
        "runtime": ".NET runtime (JIT or ahead-of-time depending on deployment)",
        "memory": "Garbage-collected",
        "abstraction": "High-level"
      }
    },
    {
      "id": "typescript",
      "name": "TypeScript",
      "color": "#3178c6",
      "description": "JavaScript with optional static types checked when you typecheck or build. Types are erased from the emitted output, so you ship plain JS — and you often catch many mistakes in the editor or at compile time.",
      "whoItIsFor": "Developers who already know some JavaScript and want safer refactors, clearer APIs, or better editor hints on larger projects. You can adopt it file by file.",
      "commonUses": [
        "Web frontends (React, Angular, Vue)",
        "Node.js backends",
        "Full-stack apps",
        "Library authoring"
      ],
      "patterns": [
        {
          "title": "Fetch JSON with a typed shape",
          "code": "type User = { id: string; name: string };\n\nasync function loadUser(id: string): Promise<User> {\n  const res = await fetch(`/api/users/${id}`);\n  if (!res.ok) throw new Error(`HTTP ${res.status}`);\n  const data = await res.json();\n  return data as User;\n}",
          "explanation": "Describes what you expect back from the API. You still validate at runtime if the server is untrusted; types help your editor and catch obvious mistakes."
        },
        {
          "title": "Model data with unions and readonly ids",
          "code": "type Status = \"draft\" | \"published\";\n\ninterface Post {\n  readonly id: string;\n  title: string;\n  status: Status;\n}\n\nfunction canEdit(p: Post): boolean {\n  return p.status === \"draft\";\n}",
          "explanation": "Unions limit strings to real states; readonly stops accidental reassignment of identifiers while you still change other fields."
        },
        {
          "title": "Reusable logic with a generic helper",
          "code": "function first<T>(items: T[]): T | undefined {\n  return items[0];\n}\n\nconst n = first([1, 2, 3]);      // number | undefined\nconst s = first([\"a\", \"b\"]);   // string | undefined",
          "explanation": "Generics let one function work on many types while keeping inference — better than forcing everything through any."
        },
        {
          "title": "Typed WASM interop — describe the boundary",
          "code": "interface WasmExports {\n  memory: WebAssembly.Memory;\n  add(a: number, b: number): number;\n}\n\nasync function loadWasm(url: string): Promise<WasmExports> {\n  const res = await fetch(url);\n  const { instance } = await WebAssembly.instantiate(await res.arrayBuffer());\n  return instance.exports as unknown as WasmExports;\n}\n\n// Usage — TypeScript checks the shape of what comes back\nconst wasm = await loadWasm('math.wasm');\nconsole.log(wasm.add(3, 4)); // 7",
          "explanation": "Casting WASM exports to a typed interface gives you editor autocomplete and catches mismatched signatures at build time. The actual runtime contract is still just the WASM binary — types are a development aid, not a runtime guarantee."
        }
      ],
      "libraries": [
        {
          "name": "DefinitelyTyped",
          "url": "https://github.com/DefinitelyTyped/DefinitelyTyped",
          "type": "Community type definitions"
        },
        {
          "name": "TypeScript compiler",
          "url": "https://www.typescriptlang.org/download/",
          "type": "Toolchain"
        }
      ],
      "docs": [
        {
          "name": "TypeScript Handbook",
          "url": "https://www.typescriptlang.org/docs/handbook/intro.html"
        },
        {
          "name": "Handbook — Everyday types",
          "url": "https://www.typescriptlang.org/docs/handbook/2/everyday-types.html"
        },
        {
          "name": "TypeScript for JavaScript Programmers",
          "url": "https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "let count: number = 0;\nconst title: string = \"Notes\";\n// Widen only when you mean it\nlet flexible: string | number = 42;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "function describe(x: string | number) {\n  if (typeof x === \"string\") {\n    return x.toUpperCase();\n  }\n  return x.toFixed(2);\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "const nums: number[] = [1, 2, 3];\nfor (const n of nums) {\n  console.log(n);\n}\n\n// index loop when you need it\nfor (let i = 0; i < nums.length; i++) {\n  console.log(i, nums[i]);\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "// Params and return typed\nfunction add(a: number, b: number): number {\n  return a + b;\n}\n\n// Arrow with explicit return\nconst square = (x: number): number => x * x;\n\n// Basic generic: one helper, many item types\nfunction first<T>(items: T[]): T | undefined {\n  return items[0];\n}",
          "difficulty": "basic"
        },
        "strings": {
          "code": "const a: string = \"hello\";\nconst n = 3;\nconst msg: string = `count=${n}`;",
          "difficulty": "basic"
        },
        "classes": {
          "code": "// interface: describe an object shape\ninterface User {\n  id: string;\n  name: string;\n}\n\n// type alias: unions and other aliases\ntype Role = \"admin\" | \"member\";\n\n// class can implement an interface\nclass Account implements User {\n  constructor(readonly id: string, public name: string, public role: Role) {}\n}",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try {\n  maybeThrows();\n} catch (e) {\n  console.error(e instanceof Error ? e.message : String(e));\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "// Values\nimport { readFile } from \"node:fs/promises\";\n\n// Type-only (erased from output)\nimport type { Stats } from \"node:fs\";\n\n// Your modules\nexport type Id = string;",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiles to JavaScript with types erased from output — no second type system at runtime. Speed follows your JS engine, bundler choices, and how you write the program, not TypeScript itself.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "ts-tip-any",
          "title": "Do not use `any` as a permanent escape hatch",
          "body": "any disables checking for that value. Prefer unknown and narrow with typeof, in, or custom guards — or fix the type at the source.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "ts-tip-type-interface",
          "title": "`interface` vs `type`",
          "body": "Both describe shapes. interface can merge in declaration merging; type is better for unions, mapped types, and conditional types. For a plain object props shape, either works — pick one style per project and stay consistent.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "ts-tip-narrowing",
          "title": "Narrow before you use specific members",
          "body": "After optional chaining or a union, TypeScript may still think a value is undefined or a wider union. Use if checks, early returns, or assertions sparingly so the checker understands the safe branch.",
          "tag": "common mistake",
          "status": "curated"
        },
        {
          "id": "ts-tip-strict",
          "title": "strictNullChecks changes real bugs into red squiggles",
          "body": "With strict null checks, you must handle null and undefined explicitly. It feels noisy at first but prevents crashes like reading property of undefined.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/typescript/",
      "quickTourLabel": "Learn X in Y Minutes — TypeScript",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/typescript",
          "type": "Practice track"
        },
        {
          "name": "TypeScript Playground",
          "url": "https://www.typescriptlang.org/play",
          "type": "Online editor"
        }
      ],
      "categories": [
        "web"
      ],
      "overview": "Built on JavaScript: same familiar syntax and the usual JavaScript hosts (browsers, Node, and other runtimes your toolchain targets), with optional static types checked when you compile. The emitted output is plain JavaScript — types are erased — so runtime behaviour stays the JS model; how much the checker helps depends on your `tsconfig` strictness and how consistently you type things.",
      "learning_curve": "Approachable if you know JavaScript; types add a learning layer that pays off on larger projects.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Shares the npm ecosystem with JS. Many libraries ship their own types; DefinitelyTyped (`@types/*`) fills gaps for a lot of the stack — niche or outdated typings still happen, so check what each dependency actually provides.",
      "common_use_cases": [
        "Web frontends (React, Angular, Vue)",
        "Node.js backends",
        "Full-stack apps",
        "Library authoring"
      ],
      "docs_url": "https://www.typescriptlang.org/docs/",
      "paradigm_primary": "multi-paradigm",
      "paradigm": [
        "object-oriented",
        "functional",
        "imperative"
      ],
      "best_for": [
        "Large-scale web applications",
        "type-safe codebases at team scale",
        "framework development and library authoring",
        "Large-scale web applications needing static types over JavaScript"
      ],
      "weak_at": [
        "Greenfield projects where build tooling overhead is undesirable",
        "Runtimes that cannot consume transpiled or bundled JavaScript output",
        "Domains needing compile-time memory safety beyond type checking"
      ],
      "official_url": "https://www.typescriptlang.org/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static when you typecheck or build (types erased; runtime behaviour is JavaScript)",
        "runtime": "Same host engines as JavaScript after compile (see JavaScript runtime model)",
        "memory": "Garbage-collected (inherits the host JavaScript engine)"
      }
    },
    {
      "id": "cpp",
      "name": "C++",
      "color": "#00599C",
      "description": "A powerful systems language with zero-cost abstractions where you use them. Common in game engines, native applications, and performance-sensitive parts of browsers and OS stacks — usually alongside C and other languages, not as the only layer everywhere.",
      "whoItIsFor": "Systems programmers, game engine developers, and performance-critical application authors.",
      "commonUses": [
        "Game engines (Unreal)",
        "Operating systems",
        "Browsers",
        "Embedded systems"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "#include <iostream>\nint main() {\n  std::cout << \"Hello, World!\" << std::endl;\n  return 0;\n}",
          "explanation": "iostream for output; main returns int."
        },
        {
          "title": "Variables",
          "code": "int x = 10;\nauto name = std::string(\"Ada\");\nconst double pi = 3.14;",
          "explanation": "auto deduces type; const prevents mutation."
        },
        {
          "title": "Classes",
          "code": "class Dog {\npublic:\n  std::string name;\n  void bark() { std::cout << name << \" barks!\" << std::endl; }\n};",
          "explanation": "A class bundles state and behavior; `public` marks what outside code may use. The `std::string` member is a small example of RAII — its storage is released when the `Dog` object is destroyed, which is the usual pattern: constructors set up, destructors clean up, and resource lifetime follows object lifetime."
        },
        {
          "title": "Expose a C API boundary and manage memory layout",
          "code": "// C++ side — extern \"C\" prevents name mangling\nextern \"C\" {\n    struct Buffer { float* data; int len; };\n\n    Buffer create_buffer(int len) {\n        return { new float[len](), len };\n    }\n    float sum(const Buffer* buf) {\n        float total = 0;\n        for (int i = 0; i < buf->len; ++i) total += buf->data[i];\n        return total;\n    }\n    void destroy_buffer(Buffer* buf) {\n        delete[] buf->data;\n    }\n}\n\n// C or Python caller — no C++ runtime needed\n// Buffer b = create_buffer(1024);\n// float s = sum(&b);\n// destroy_buffer(&b);",
          "explanation": "extern \"C\" gives your C++ functions a stable C ABI so any language can call them. Plain structs with no methods traverse the boundary cleanly. Always pair create/destroy so callers never touch new/delete directly."
        }
      ],
      "libraries": [
        {
          "name": "Boost",
          "url": "https://www.boost.org/",
          "type": "Utility libraries"
        },
        {
          "name": "vcpkg",
          "url": "https://vcpkg.io/",
          "type": "Package manager"
        }
      ],
      "docs": [
        {
          "name": "cppreference",
          "url": "https://en.cppreference.com/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "int x = 10;\nauto y = 20;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5) {\n  std::cout << \"big\";\n} else {\n  std::cout << \"small\";\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for (int i = 0; i < 5; i++) {\n  std::cout << i;\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "int add(int a, int b) {\n  return a + b;\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiled to native; strong when you need low-level control and predictable machine mapping. Real speed and memory still depend on workload, allocator, STL choices, and hot-path code — not a blanket “fastest in every task” story.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "std::string a = \"hi\";\nauto v = std::string_view{\"sv\"};",
          "difficulty": "basic"
        },
        "classes": {
          "code": "struct Point { int x, y; };",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try {\n  throw std::runtime_error(\"bad\");\n} catch (const std::exception& e) {\n  std::cerr << e.what();\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "#include <vector>\n#include <iostream>",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "cpp-tip-the-compiler-removes-bug-classes-not-design-mist",
          "title": "The compiler removes bug classes, not design mistakes",
          "body": "C++ makes ownership and lifetime rules explicit, which catches dangling references and race-prone patterns early. That still leaves you responsible for data flow, API boundaries, and the shape of your abstractions.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/c++/",
      "quickTourLabel": "Learn X in Y Minutes — C++",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/cpp",
          "type": "Practice track"
        }
      ],
      "categories": [
        "systems",
        "games"
      ],
      "overview": "A powerful systems language with zero-cost abstractions where you use them. Common in game engines, native applications, and performance-sensitive parts of browsers and OS stacks — usually alongside C and other languages, not as the only layer everywhere.",
      "learning_curve": "Very steep — manual memory management, complex build system, and subtle undefined-behaviour traps. Power users love the control.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Large ecosystem: Qt, Unreal, Boost, vcpkg, and many domain libraries. Build systems (CMake, Bazel, etc.) and header/ABI management stay common friction.",
      "common_use_cases": [
        "Game engines (Unreal)",
        "Operating systems",
        "Browsers",
        "Embedded systems"
      ],
      "docs_url": "https://en.cppreference.com/",
      "paradigm_primary": "multi-paradigm",
      "paradigm": [
        "imperative",
        "object-oriented",
        "generic"
      ],
      "best_for": [
        "game engines and rendering systems",
        "high-frequency trading and real-time systems",
        "resource-constrained embedded development",
        "Performance-critical native applications and game engines"
      ],
      "weak_at": [
        "Rapid application prototyping where compile times dominate iteration",
        "Teams without capacity to manage memory safety and ABI complexity",
        "Simple CRUD web services better served by managed runtimes"
      ],
      "official_url": "https://isocpp.org/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static",
        "runtime": "Compiled ahead-of-time to native machine code",
        "memory": "Manual by default; destructors, smart pointers, and RAII are common in modern C++"
      }
    },
    {
      "id": "c",
      "name": "C",
      "color": "#A8B9CC",
      "description": "The foundational systems language — small, fast, and close to the hardware. Much of today's kernels and systems software still rely on it heavily.",
      "whoItIsFor": "Kernel developers, embedded engineers, and anyone who needs direct hardware access.",
      "commonUses": [
        "Operating systems (Linux kernel)",
        "Embedded firmware",
        "Compilers",
        "Databases"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "#include <stdio.h>\nint main() {\n  printf(\"Hello, World!\\n\");\n  return 0;\n}",
          "explanation": "stdio.h for printf; main returns 0 on success."
        },
        {
          "title": "Variables",
          "code": "int x = 10;\nconst char *name = \"Ada\";\ndouble pi = 3.14;",
          "explanation": "Explicit types; pointers for strings."
        },
        {
          "title": "Structs",
          "code": "typedef struct {\n  int x;\n  int y;\n} Point;\nPoint p = {3, 4};",
          "explanation": "Structs group related data into named fields — the foundation of organised memory in C."
        },
        {
          "title": "Load a shared library at runtime with dlopen (FFI boundary)",
          "code": "#include <stdio.h>\n#include <dlfcn.h>\n\nint main() {\n    // Open a shared library at runtime\n    void *lib = dlopen(\"./libmath.so\", RTLD_LAZY);\n    if (!lib) {\n        fprintf(stderr, \"dlopen: %s\\n\", dlerror());\n        return 1;\n    }\n\n    // Look up a symbol by name\n    typedef int (*AddFn)(int, int);\n    AddFn add = (AddFn)dlsym(lib, \"add\");\n    if (!add) {\n        fprintf(stderr, \"dlsym: %s\\n\", dlerror());\n        dlclose(lib);\n        return 1;\n    }\n\n    // Call through the function pointer\n    printf(\"add(3, 4) = %d\\n\", add(3, 4));\n    dlclose(lib);\n}",
          "explanation": "dlopen/dlsym is the dynamic FFI boundary in C — load any shared library and call its functions by symbol name at runtime. This is how Python ctypes, Lua modules, and plugin systems work under the hood. The function pointer cast bridges the void* from dlsym to a typed callable."
        }
      ],
      "libraries": [
        {
          "name": "glibc",
          "url": "https://www.gnu.org/software/libc/",
          "type": "Standard library"
        },
        {
          "name": "SDL2",
          "url": "https://www.libsdl.org/",
          "type": "Multimedia"
        }
      ],
      "docs": [
        {
          "name": "cppreference (C)",
          "url": "https://en.cppreference.com/w/c"
        }
      ],
      "compareData": {
        "variables": {
          "code": "int x = 10;\nconst char *s = \"hello\";",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5) {\n  printf(\"big\\n\");\n} else {\n  printf(\"small\\n\");\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for (int i = 0; i < 5; i++) {\n  printf(\"%d\\n\", i);\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "int add(int a, int b) {\n  return a + b;\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiled to native; minimal runtime overhead.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "char s[] = \"literal\";\nconst char *p = \"ptr\";",
          "difficulty": "basic"
        },
        "classes": {
          "code": "/* no classes; use struct */\nstruct Point { int x, y; };",
          "difficulty": "basic"
        },
        "errors": {
          "code": "/* return codes / errno */\nif (ptr == NULL) { perror(\"alloc\"); }",
          "difficulty": "basic"
        },
        "imports": {
          "code": "#include <stdio.h>\n#include <stdlib.h>",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "c-tip-ub-standards",
          "title": "Undefined behaviour is not “maybe a crash”",
          "body": "The C standard uses terms like undefined behaviour and implementation-defined precisely. Some mistakes (for example using a pointer after its object's lifetime, or reading uninitialized memory) do not guarantee a crash or a compiler error — the program might appear to work until optimization or a different platform changes results. Treat warnings seriously, test with sanitizers when you can, and use cppreference or the C standard (public drafts on open-std.org) when you need the exact rules.",
          "tag": "intermediate",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/c/",
      "quickTourLabel": "Learn X in Y Minutes — C",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/c",
          "type": "Practice track"
        }
      ],
      "categories": [
        "systems"
      ],
      "overview": "The foundational systems language — small, fast, and close to the hardware. Much of today's kernels and systems software still rely on it heavily.",
      "learning_curve": "Steep for beginners — pointers, manual memory management, and undefined behaviour trap the unwary. Rewarding for those who want to understand how computers actually work.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "No official package manager; rely on OS package managers and build systems (make, CMake). glibc/POSIX is the universal API surface. Most native-code FFIs still surface a C ABI at some layer—even when higher-level bindings wrap it.",
      "common_use_cases": [
        "Operating systems (Linux kernel)",
        "Embedded firmware",
        "Compilers",
        "Databases"
      ],
      "docs_url": "https://en.cppreference.com/w/c",
      "paradigm_primary": "imperative",
      "paradigm": [
        "imperative",
        "procedural",
        "structured"
      ],
      "best_for": [
        "Embedded systems and firmware",
        "Operating system kernels",
        "high-performance libraries and drivers",
        "Embedded systems firmware and microcontroller programming"
      ],
      "weak_at": [
        "Application development where memory safety tooling is mandatory",
        "Web-facing services without careful bounds-checking discipline",
        "Rapid UI iteration without manual memory and build complexity"
      ],
      "official_url": "https://www.open-std.org/jtc1/sc22/wg14/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static",
        "runtime": "Compiled ahead-of-time to native machine code",
        "memory": "Manual (developer-managed)",
        "abstraction": "Low-level by design"
      }
    },
    {
      "id": "ruby",
      "name": "Ruby",
      "color": "#CC342D",
      "description": "An elegant, expressive general-purpose language — Ruby on Rails is a major web ecosystem, not the whole story.",
      "whoItIsFor": "Web developers and startup teams who value readability and developer happiness — especially for Rails APIs, prototyping, and scripting glue.",
      "commonUses": [
        "Web apps (Rails)",
        "Scripting",
        "Automation & internal tools",
        "Prototyping"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "puts \"Hello, World!\"",
          "explanation": "puts prints with a newline appended — Ruby's idiomatic way to output text."
        },
        {
          "title": "Variables",
          "code": "name = 'Ada'\nage = 36\nPI = 3.14",
          "explanation": "Dynamic typing; UPPERCASE = constant."
        },
        {
          "title": "Blocks",
          "code": "[1, 2, 3].each do |n|\n  puts n * 2\nend",
          "explanation": "Blocks are closures passed to methods."
        },
        {
          "title": "Call a C function via Ruby C extensions (FFI boundary)",
          "code": "# Using FFI gem — dynamic binding, no compile step\nrequire 'ffi'\n\nmodule MathLib\n  extend FFI::Library\n  ffi_lib './libmath.so'\n  attach_function :add, [:int, :int], :int\n  attach_function :puts, [:string], :int\nend\n\nputs \"C says: #{MathLib.add(3, 4)}\"  # 7\nMathLib.puts(\"Hello from C via Ruby FFI\")\n\n# Using inline C via RubyInline\n# require 'inline'\n# class FastMath\n#   inline do |builder|\n#     builder.c \"int fast_add(int a, int b) { return a + b; }\"\n#   end\n# end",
          "explanation": "Ruby's FFI gem provides dynamic binding to C shared libraries without writing C extension code. attach_function maps C signatures to Ruby methods with automatic type conversion. For performance-critical paths, RubyInline embeds C that compiles at runtime. Traditional C extensions (using ruby.h) are the lowest-level option. This boundary is how gems like Nokogiri (libxml2) and PG (libpq) work."
        }
      ],
      "libraries": [
        {
          "name": "RubyGems",
          "url": "https://rubygems.org/",
          "type": "Package manager"
        },
        {
          "name": "Rails",
          "url": "https://rubyonrails.org/",
          "type": "Web framework"
        }
      ],
      "docs": [
        {
          "name": "Ruby docs",
          "url": "https://ruby-doc.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "x = 10\ny = 20",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5\n  puts 'big'\nelse\n  puts 'small'\nend",
          "difficulty": "basic"
        },
        "loops": {
          "code": "5.times { |i| puts i }",
          "difficulty": "basic"
        },
        "functions": {
          "code": "def add(a, b)\n  a + b\nend",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Interpreted (CRuby); optimised for developer productivity over raw speed.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "a = 'single'\nb = \"dbl with #{name}\"\nc = %{braces need no \"quote\" escapes}\nd = %q{no #{interpolation} here}",
          "difficulty": "basic"
        },
        "classes": {
          "code": "class Point\n  attr_reader :x, :y\n  def initialize(x, y) = (@x, @y = x, y)\nend",
          "difficulty": "basic"
        },
        "errors": {
          "code": "begin\n  Integer(\"x\")\nrescue ArgumentError => e\n  warn e.message\nend",
          "difficulty": "basic"
        },
        "imports": {
          "code": "require 'json'\nrequire_relative './helper'",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "ruby-tip-format-pass11",
          "title": "Gems and Ruby version managers disagree",
          "body": "Most Ruby surprises are Ruby/Bundler version skew or native extension builds. Pin Ruby with a version manager and commit Gemfile.lock.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/ruby/",
      "quickTourLabel": "Learn X in Y Minutes — Ruby",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/ruby",
          "type": "Practice track"
        }
      ],
      "categories": [
        "web"
      ],
      "overview": "Designed for readable code and quick iteration. Rails is a major web stack; Ruby is also widely used for scripting, internal tools, and services outside Rails.",
      "learning_curve": "Gentle — designed for developer happiness with readable syntax and extensive standard library. The main hurdles are metaprogramming, the object model, and the 'magic' of Rails conventions.",
      "good_for_teaching": "good",
      "ecosystem_notes": "RubyGems and Bundler are mature. Rails anchors much of the Ruby web ecosystem. Ruby also stays common for scripting, background jobs, and internal tooling—including automation in CI and operations. YJIT in Ruby 3.1+ improved hot-path performance; Ruby still favors developer iteration speed over chasing peak microbenchmark scores.",
      "common_use_cases": [
        "Web apps (Rails)",
        "Scripting",
        "Automation & internal tools",
        "Prototyping"
      ],
      "docs_url": "https://www.ruby-lang.org/en/documentation/",
      "paradigm_primary": "object-oriented",
      "paradigm": [
        "object-oriented",
        "imperative",
        "functional"
      ],
      "best_for": [
        "rapid web prototyping with Rails",
        "Automation and internal tools",
        "Scripting with readable code",
        "Productive web backends with Rails and convention-over-configuration"
      ],
      "weak_at": [
        "CPU-intensive batch jobs where interpreter speed becomes a bottleneck",
        "Mobile native apps outside limited RubyMotion-style niches",
        "Statically typed large teams preferring compile-time contract enforcement"
      ],
      "official_url": "https://www.ruby-lang.org/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Interpreted (MRI/YARV; other implementations vary)",
        "memory": "Garbage-collected",
        "abstraction": "High-level"
      }
    },
    {
      "id": "go",
      "name": "Go",
      "color": "#00ADD8",
      "description": "A statically typed, open-source language that started at Google—small core, built-in concurrency, and fast compilation. Common for networked services and CLIs; Docker and Kubernetes are well-known Go codebases, but cloud and platform work stays polyglot.",
      "whoItIsFor": "Backend engineers, DevOps teams, and anyone building networked services or CLI tools.",
      "commonUses": [
        "Cloud services",
        "CLI tools",
        "Microservices",
        "Container & platform tooling (e.g. Docker/K8s ecosystems)"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "package main\nimport \"fmt\"\nfunc main() {\n  fmt.Println(\"Hello, World!\")\n}",
          "explanation": "Package main + func main is the entry point."
        },
        {
          "title": "Variables",
          "code": "x := 10\nvar name string = \"Ada\"",
          "explanation": ":= is short variable declaration — infers type from the right-hand side automatically."
        },
        {
          "title": "Goroutines",
          "code": "go func() {\n  fmt.Println(\"concurrent!\")\n}()",
          "explanation": "Lightweight concurrency with the go keyword."
        },
        {
          "title": "Call a C function via cgo (FFI boundary)",
          "code": "// go:build ignore\n// File: main.go\npackage main\n\n/*\n#include <stdio.h>\n#include <stdlib.h>\n\nint add(int a, int b) { return a + b; }\n*/\nimport \"C\"\nimport \"fmt\"\nimport \"unsafe\"\n\nfunc main() {\n    // Call the C function directly\n    result := C.add(C.int(10), C.int(20))\n    fmt.Println(\"C says:\", int(result))\n\n    // Pass a Go string to C\n    goStr := \"Hello from Go\"\n    cStr := C.CString(goStr)\n    defer C.free(unsafe.Pointer(cStr))\n    C.puts(cStr)\n}",
          "explanation": "cgo lets Go call C functions by writing C declarations in a comment block above import \"C\". C.int() converts Go values to C types; C.CString allocates a C heap string that you must free with C.free(). The import \"C\" line must appear immediately after the comment — no blank lines."
        }
      ],
      "libraries": [
        {
          "name": "Go modules",
          "url": "https://pkg.go.dev/",
          "type": "Package registry"
        },
        {
          "name": "Gin",
          "url": "https://gin-gonic.com/",
          "type": "Web framework"
        }
      ],
      "docs": [
        {
          "name": "Go docs",
          "url": "https://go.dev/doc/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "x := 10\nvar y int = 20",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5 {\n  fmt.Println(\"big\")\n} else {\n  fmt.Println(\"small\")\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for i := 0; i < 5; i++ {\n  fmt.Println(i)\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "func add(a, b int) int {\n  return a + b\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiled to native with a compact runtime; fast builds are a hallmark. Throughput and latency still depend on workload, GC, and how you structure concurrency—not automatic leadership over every other language.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "a := \"raw\\nstring\"\nb := `verbatim\n`",
          "difficulty": "basic"
        },
        "classes": {
          "code": "type Point struct { X, Y int }\nfunc NewPoint(x, y int) Point { return Point{x, y} }",
          "difficulty": "basic"
        },
        "errors": {
          "code": "if err != nil {\n  return fmt.Errorf(\"wrap: %w\", err)\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "import (\n  \"fmt\"\n  \"os\"\n)",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "go-tip-goroutines-channels",
          "title": "Goroutines coordinate work; channels are one tool",
          "body": "The `go` keyword starts a goroutine so a function runs concurrently with the rest of the program. Channels (`chan`) pass values between goroutines and are a common way to structure pipelines, but mutexes, `sync.WaitGroup`, and other patterns are idiomatic when shared state is clearer. You still design for shutdown, errors, and synchronization — concurrency is a normal part of Go, not something the runtime fixes for you.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "go-tip-error-return",
          "title": "Check errors; do not ignore the second return",
          "body": "Many Go APIs return `(value, error)`. Ignoring `err` (or using `_`) hides failures until something later panics or corrupts data. Handle the error near the call, wrap it with context when you return it, or document why it is safe to ignore.",
          "tag": "common mistake",
          "status": "curated"
        },
        {
          "id": "go-tip-slices-share-array",
          "title": "Slices can share an underlying array",
          "body": "Reslicing or appending within capacity can mutate memory still visible through another slice. Copy when you need isolation (`copy` or `append([]T(nil), s...)`), and treat capacity as part of the contract when APIs return slices.",
          "tag": "common mistake",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/go/",
      "quickTourLabel": "Learn X in Y Minutes — Go",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/go",
          "type": "Practice track"
        }
      ],
      "categories": [
        "systems",
        "web"
      ],
      "overview": "A statically typed, open-source language that started at Google—small core, built-in concurrency, and fast compilation. Common for networked services and CLIs; Docker and Kubernetes are well-known Go codebases, but cloud and platform work stays polyglot.",
      "learning_curve": "Gentle for experienced developers — small syntax, fast compiler, and clear concurrency model (goroutines). The main learning hump is Go's approach to error handling (no exceptions) and interface-based polymorphism.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Strong standard library (net/http, encoding/json, testing). Go modules are mature. Docker and Kubernetes are prominent Go projects, not proof that Go “owns” infrastructure—those ecosystems include many languages. Verbose error handling and lack of generics until Go 1.18 were common complaints; generics landed but ecosystem patterns are still settling in places.",
      "common_use_cases": [
        "Cloud services",
        "CLI tools",
        "Microservices",
        "Container & platform tooling (e.g. Docker/K8s ecosystems)"
      ],
      "docs_url": "https://go.dev/doc/",
      "paradigm_primary": "concurrent",
      "paradigm": [
        "concurrent",
        "imperative",
        "procedural"
      ],
      "best_for": [
        "Cloud-native microservices",
        "CLI tools and infrastructure automation",
        "high-concurrency network services",
        "Cloud-native microservices with simple deployment artifacts"
      ],
      "weak_at": [
        "Rich generic metaprogramming beyond Go 1.18+ type parameters",
        "GUI-heavy desktop apps without substantial third-party UI stacks",
        "Hard real-time control loops needing deterministic GC pauses"
      ],
      "official_url": "https://go.dev/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static",
        "runtime": "Compiled ahead-of-time to native machine code in typical `go build` workflows",
        "memory": "Garbage-collected"
      }
    },
    {
      "id": "rust",
      "name": "Rust",
      "color": "#DEA584",
      "description": "A systems language where safe code gets memory safety and data-race freedom enforced at compile time — no garbage collector (`unsafe` and FFI still need discipline).",
      "whoItIsFor": "Systems programmers who need memory safety without garbage collection — ideal for kernels, browsers, CLI tools, and latency-critical services.",
      "commonUses": [
        "Systems tools (ripgrep)",
        "WebAssembly",
        "Embedded",
        "Blockchain"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "fn main() {\n  println!(\"Hello, World!\");\n}",
          "explanation": "println! is a macro (note the !) — Rust macros generate code at compile time."
        },
        {
          "title": "Variables",
          "code": "let x = 10;\nlet mut y = 20;\ny = 21;",
          "explanation": "Immutable by default; mut opts into mutation."
        },
        {
          "title": "Ownership",
          "code": "let s1 = String::from(\"hello\");\nlet s2 = s1; // s1 is moved, no longer usable",
          "explanation": "Each value has one owner who drops it; moving transfers that duty. References (`&` / `&mut`) borrow temporarily, and the borrow checker enforces those rules at compile time—many use-after-move and aliasing mistakes become errors, and you learn to shape data flow so the checker can validate it."
        },
        {
          "title": "Export a C-compatible function for FFI or WASM",
          "code": "// Rust function callable from C or WASM\n#[no_mangle]\npub extern \"C\" fn add_numbers(a: i32, b: i32) -> i32 {\n    a + b\n}\n\n// For WASM, wasm-bindgen wraps this automatically:\n// #[wasm_bindgen]\n// pub fn add_numbers(a: i32, b: i32) -> i32 { a + b }",
          "explanation": "extern \"C\" forces the C calling convention so other languages can call the function by symbol name. #[no_mangle] keeps the name readable. wasm-bindgen generates JS glue so Rust functions can be called from the browser without manual marshalling."
        }
      ],
      "libraries": [
        {
          "name": "Cargo book",
          "url": "https://doc.rust-lang.org/cargo/",
          "type": "Package registry"
        },
        {
          "name": "Tokio",
          "url": "https://tokio.rs/",
          "type": "Async runtime"
        }
      ],
      "docs": [
        {
          "name": "The Rust Book",
          "url": "https://doc.rust-lang.org/book/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "let x: i32 = 10;\nlet mut y = 20;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5 {\n  println!(\"big\");\n} else {\n  println!(\"small\");\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for i in 0..5 {\n  println!(\"{}\", i);\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "fn add(a: i32, b: i32) -> i32 {\n  a + b\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiled to native; many abstractions optimize well, but speed and memory still depend on algorithms and how you structure the code.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "let a = \"str\";\nlet b = String::from(\"owned\");",
          "difficulty": "basic"
        },
        "classes": {
          "title": "Structs & impl",
          "code": "struct Point { x: i32, y: i32 }\nimpl Point {\n  fn new(x: i32, y: i32) -> Self { Self { x, y } }\n}",
          "difficulty": "basic"
        },
        "errors": {
          "code": "fn may_fail() -> Result<i32, String> {\n  Err(\"oops\".into())\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "use std::fs::File;\nuse std::io::{self, Read};",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "rust-tip-the-compiler-removes-bug-classes-not-design-mist",
          "title": "The compiler removes bug classes, not design mistakes",
          "body": "Rust makes ownership and lifetime rules explicit, which catches dangling references and race-prone patterns early. That still leaves you responsible for data flow, API boundaries, and the shape of your abstractions.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "rust-tip-clone-vs-borrow",
          "title": "Prefer borrowing before cloning",
          "body": "`.clone()` is sometimes the right fix, but it can hide ownership design. Prefer `&T` / `&mut T`, then owned values when you truly need independent data. If the compiler asks for a static lifetime or owned types, check whether a shorter lifetime or `Arc`/`Rc` matches the real sharing model.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "rust-tip-result-question-mark",
          "title": "`?` propagates compatible errors",
          "body": "The `?` operator returns early on `Err` when the error type can convert into the function’s error type. It does not log or recover. Use `match`, `map_err`, or libraries like `anyhow`/`thiserror` when you need context, and avoid `unwrap`/`expect` outside demos and tests unless failure is truly impossible.",
          "tag": "common mistake",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/rust/",
      "quickTourLabel": "Learn X in Y Minutes — Rust",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/rust",
          "type": "Practice track"
        }
      ],
      "categories": [
        "systems",
        "web",
        "blockchain"
      ],
      "overview": "A systems language where safe Rust enforces memory safety and data-race rules at compile time — no garbage collector; `unsafe` and native interop are explicit escape hatches.",
      "learning_curve": "Steep initial ramp — ownership, borrowing, and the borrow checker require unlearning habits from GC languages. Productivity increases sharply once the model clicks.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "crates.io lists a large, growing set of community crates — exact counts change often, so treat registry scale as a moving snapshot, not a fixed statistic. Async I/O commonly builds on Tokio or other runtimes; pick what fits your stack. Compile times and the ownership learning curve remain the usual pain points.",
      "common_use_cases": [
        "Systems tools (ripgrep)",
        "WebAssembly",
        "Embedded",
        "Blockchain"
      ],
      "docs_url": "https://doc.rust-lang.org/",
      "paradigm_primary": "multi-paradigm",
      "paradigm": [
        "concurrent",
        "functional",
        "imperative"
      ],
      "best_for": [
        "Performance-critical systems",
        "WebAssembly targets",
        "embedded and safety-sensitive applications",
        "Memory-safe systems programming without garbage collection overhead"
      ],
      "weak_at": [
        "Fast prototyping when borrow-checker friction slows early exploration",
        "Teams unwilling to invest in Rust learning curve and compile times",
        "Simple CRUD APIs where Python or Go ship features faster"
      ],
      "official_url": "https://www.rust-lang.org/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static, with ownership and borrow checking at compile time",
        "runtime": "Compiled ahead-of-time to native machine code (`rustc` and compatible toolchains)",
        "memory": "Ownership-based; no garbage collector in the core language model"
      }
    },
    {
      "id": "swift",
      "name": "Swift",
      "color": "#F05138",
      "description": "Apple's primary language for iOS, macOS, and related platforms — memory-safe by default for common mistakes, with growing use on servers and other targets.",
      "whoItIsFor": "iOS and macOS developers building native Apple platform applications — also used for server-side Swift and embedded prototyping.",
      "commonUses": [
        "iOS apps",
        "macOS apps",
        "watchOS/tvOS",
        "Server-side Swift"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "print(\"Hello, World!\")",
          "explanation": "Top-level code runs directly — Swift scripts can execute statements outside any function."
        },
        {
          "title": "Variables",
          "code": "var x = 10\nlet name = \"Ada\"",
          "explanation": "var is mutable; let is immutable — Swift encourages immutability by default for safety."
        },
        {
          "title": "Optionals",
          "code": "var age: Int? = nil\nage = 36\nif let a = age {\n  print(a)\n}",
          "explanation": "Optionals handle the absence of a value safely."
        },
        {
          "title": "Call a C function and bridge with Objective-C (FFI boundary)",
          "code": "// Swift can call C functions directly — the bridging header\n// exposes them automatically.\nimport Foundation\n\n// C function declared in bridging header:\n// int add(int a, int b);\nlet result = add(3, 4)\nprint(\"C says: \\(result)\")  // 7\n\n// Pass a Swift string to C\nlet swiftStr = \"Hello from Swift\"\nswiftStr.withCString { cStr in\n    puts(cStr)  // C function, available via bridging header\n}\n\n// Mark a Swift class visible to Objective-C runtime\n@objc class Helper: NSObject {\n    @objc func greet(_ name: String) -> String {\n        return \"Hello, \\(name)\"\n    }\n}",
          "explanation": "Swift interoperates with C through a bridging header that makes C declarations available in Swift without wrappers. Swift strings and arrays convert to C equivalents via withCString and similar methods. @objc exposes Swift classes to the Objective-C runtime — essential for UIKit integration and dynamic dispatch."
        }
      ],
      "libraries": [
        {
          "name": "Swift packages",
          "url": "https://www.swift.org/packages/",
          "type": "Packages"
        },
        {
          "name": "SwiftUI",
          "url": "https://developer.apple.com/xcode/swiftui/",
          "type": "UI framework"
        }
      ],
      "docs": [
        {
          "name": "Swift.org docs",
          "url": "https://www.swift.org/documentation/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "var x = 10\nlet y = 20",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5 {\n  print(\"big\")\n} else {\n  print(\"small\")\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for i in 0..<5 {\n  print(i)\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "func add(_ a: Int, _ b: Int) -> Int {\n  return a + b\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiled with LLVM; speed depends on workload, optimization settings, and how you use reference types vs value types.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "let a = \"str\"\nlet m = \"\"\"\nraw\n\"\"\"",
          "difficulty": "basic"
        },
        "classes": {
          "code": "struct Point { var x, y: Int }",
          "difficulty": "basic"
        },
        "errors": {
          "code": "enum Err: Error { case bad }\n// throw Err.bad in throwing func",
          "difficulty": "basic"
        },
        "imports": {
          "code": "import Foundation\nimport SwiftUI // UI only",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "swift-tip-lifecycle-edges-are-where-mobile-code-breaks",
          "title": "Lifecycle edges are where mobile code breaks",
          "body": "With Swift, backgrounding, permissions, and lifecycle callbacks can matter more than the happy path. Test the resume/restart flow explicitly instead of only the first launch path.",
          "tag": "mobile",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/swift/",
      "quickTourLabel": "Learn X in Y Minutes — Swift",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/swift",
          "type": "Practice track"
        }
      ],
      "categories": [
        "mobile",
        "desktop",
        "systems"
      ],
      "overview": "Apple's primary language for iOS, macOS, and related platforms — memory-safe by default for common mistakes, with growing use on servers and other targets.",
      "learning_curve": "Moderate — familiar if you know C-family languages, but optionals, value types, and protocol-oriented design require adjustment. SwiftUI adds a declarative paradigm on top.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Apple-platform dominant; Swift on Linux/Windows is growing but secondary. Swift Package Manager is mature. SwiftUI and Combine are the modern UI stack. Objective-C interop is usually straightforward but still adds bridging rules and runtime surface area.",
      "common_use_cases": [
        "iOS apps",
        "macOS apps",
        "watchOS/tvOS",
        "Server-side Swift"
      ],
      "docs_url": "https://docs.swift.org/",
      "paradigm_primary": "multi-paradigm",
      "paradigm": [
        "object-oriented",
        "functional",
        "protocol-oriented"
      ],
      "best_for": [
        "IOS and macOS app development",
        "WatchOS and tvOS applications",
        "performance-sensitive Apple platform code",
        "Native iOS, macOS, watchOS, and tvOS application development"
      ],
      "weak_at": [
        "Cross-platform Android or Windows-first product strategies",
        "Legacy codebases deeply tied to Objective-C macros and runtime quirks",
        "Domains demanding a mature package ecosystem outside Apple circles"
      ],
      "official_url": "https://www.swift.org/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static",
        "runtime": "Compiled (native binaries on Apple platforms; toolchains vary elsewhere)",
        "memory": "Automatic reference counting with compile-time ownership checking",
        "abstraction": "High-level"
      }
    },
    {
      "id": "kotlin",
      "name": "Kotlin",
      "color": "#7F52FF",
      "description": "A modern JVM-centered language from JetBrains — concise, null-safe in the type system, and interoperable with Java (Android and servers are major use cases).",
      "whoItIsFor": "Android developers and JVM teams wanting a more expressive, concise alternative to Java — with null safety, coroutines, and full interop.",
      "commonUses": [
        "Android apps",
        "Server-side (Ktor/Spring)",
        "Multiplatform (KMP)",
        "Scripting"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "fun main() {\n  println(\"Hello, World!\")\n}",
          "explanation": "Top-level functions; no class wrapper needed."
        },
        {
          "title": "Variables",
          "code": "val x = 10\nvar y = 20\ny = 21",
          "explanation": "val is immutable; var is mutable — Kotlin's type inference lets you omit types on both."
        },
        {
          "title": "Data classes",
          "code": "data class User(val name: String, val age: Int)",
          "explanation": "Auto-generates equals, hashCode, toString, copy."
        },
        {
          "title": "Call native C via Kotlin/Native cinterop (FFI boundary)",
          "code": "// File: src/nativeInterop/cinterop/libc.def\n// headers = stdio.h\n\n// Kotlin side\nimport kotlinx.cinterop.*\nimport platform.posix.*\n\nfun main() {\n    // Call C printf directly\n    printf(\"Hello from C via Kotlin/Native\\n\")\n\n    // Allocate and pass a C struct\n    memScoped {\n        val pt = alloc<point>()\n        pt.x = 10\n        pt.y = 20\n        println(\"Point: \" + pt.x + \", \" + pt.y)\n    }\n}",
          "explanation": "Kotlin/Native's cinterop tool generates Kotlin bindings from C headers defined in .def files. memScoped ensures C allocations are freed when the block exits. This is the FFI boundary for Kotlin when targeting native binaries (iOS, macOS, Linux) without a JVM."
        }
      ],
      "libraries": [
        {
          "name": "Ktor",
          "url": "https://ktor.io/",
          "type": "Web framework"
        },
        {
          "name": "Kotlin stdlib",
          "url": "https://kotlinlang.org/api/latest/jvm/stdlib/",
          "type": "Standard library"
        }
      ],
      "docs": [
        {
          "name": "Kotlin docs",
          "url": "https://kotlinlang.org/docs/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "val x = 10\nvar y = 20",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5) println(\"big\") else println(\"small\")",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for (i in 0 until 5) {\n  println(i)\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "fun add(a: Int, b: Int): Int = a + b",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Runs on the JVM; similar bytecode means performance is usually close to Java for comparable code.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "val a = \"s\"\nval m = \"\"\"multi\nline\"\"\"",
          "difficulty": "basic"
        },
        "classes": {
          "code": "data class Point(val x: Int, val y: Int)",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try {\n  \"x\".toInt()\n} catch (e: NumberFormatException) {\n  println(e.message)\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "import kotlin.io.path.Path\nimport java.io.File",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "kotlin-tip-browser-state-and-async-timing-hide-bugs",
          "title": "Browser state and async timing hide bugs",
          "body": "In Kotlin, UI bugs often come from stale state, event timing, or a missing await/fetch boundary. Reproduce the issue with one interaction and log the state transition before changing the view code.",
          "tag": "frontend",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/kotlin/",
      "quickTourLabel": "Learn X in Y Minutes — Kotlin",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/kotlin",
          "type": "Practice track"
        }
      ],
      "categories": [
        "mobile",
        "web",
        "desktop"
      ],
      "overview": "A modern JVM-centered language from JetBrains — concise, null-safe in the type system, and interoperable with Java. Android is a major use case; server and Kotlin Multiplatform are common too.",
      "learning_curve": "Easy if you know Java — similar syntax with null safety, coroutines, and extension functions. Kotlin/Native and multiplatform add complexity for cross-compilation.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Widely used for Android alongside Java; Kotlin Multiplatform is maturing for iOS/desktop. Coroutines are the standard async model. JVM projects commonly use Gradle or Maven (Android tooling often centers on Gradle). JetBrains drives the ecosystem.",
      "common_use_cases": [
        "Android apps",
        "Server-side (Ktor/Spring)",
        "Multiplatform (KMP)",
        "Scripting"
      ],
      "docs_url": "https://kotlinlang.org/docs/home.html",
      "paradigm_primary": "multi-paradigm",
      "paradigm": [
        "object-oriented",
        "functional",
        "concurrent"
      ],
      "best_for": [
        "Android app development",
        "Server-side JVM applications",
        "cross-platform mobile with KMP",
        "Android app development with modern language features and coroutines"
      ],
      "weak_at": [
        "Greenfield iOS-only apps where Swift is the platform default",
        "Ultra-low-latency native code without JVM warmup considerations",
        "Teams standardized on purely dynamic scripting without compilation"
      ],
      "official_url": "https://kotlinlang.org/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static (checked at compile time)",
        "runtime": "JVM bytecode on typical Android and server targets; Kotlin/Native and other targets compile differently",
        "memory": "Garbage-collected on JVM targets; Kotlin/Native uses a different model"
      }
    },
    {
      "id": "php",
      "name": "PHP",
      "color": "#777BB4",
      "description": "Widely used for server-side web apps — WordPress, Laravel, and a huge share of shared-hosting deployments. Runs on nearly every web host, making it easy to find help and hosting.",
      "whoItIsFor": "Web developers building server-rendered sites, CMS platforms like WordPress, and APIs — still powers a huge share of the public web.",
      "commonUses": [
        "WordPress",
        "Web APIs (Laravel)",
        "CMS platforms",
        "E-commerce"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "<?php\necho \"Hello, World!\";",
          "explanation": "PHP tags wrap server-side code that the web server processes before sending HTML to the browser."
        },
        {
          "title": "Variables",
          "code": "$x = 10;\n$name = 'Ada';",
          "explanation": "Dollar-sign prefix marks variables; PHP uses dynamic typing so a variable can hold any type."
        },
        {
          "title": "Arrays",
          "code": "$fruits = ['apple', 'banana'];\n$fruits[] = 'orange';",
          "explanation": "Short array syntax with brackets; use [] to append elements or write out keys and values."
        },
        {
          "title": "Call a C function via PHP FFI (FFI boundary)",
          "code": "// PHP 7.4+ FFI — call C directly without extensions\n$ffi = FFI::cdef(\n    \"int add(int a, int b);\",\n    \"./libmath.so\"\n);\n\necho \"C says: \" . $ffi->add(3, 4) . \"\\n\";  // 7\n\n// Traditional C extension approach (PHP extension skeleton)\n// ZEND_FUNCTION(add) {\n//   zend_long a, b;\n//   ZEND_PARSE_PARAMETERS_START(2, 2)\n//     Z_PARAM_LONG(a)\n//     Z_PARAM_LONG(b)\n//   ZEND_PARSE_PARAMETERS_END();\n//   RETURN_LONG(a + b);\n// }",
          "explanation": "PHP's FFI class (PHP 7.4+) binds C functions dynamically — define the C signature in a string, load the shared library, and call it like a method. Performance-sensitive paths often use C extensions with the Zend API (ZEND_FUNCTION macros, parameter parsing). The runtime relies heavily on C, but user-facing functions are not uniformly native all the way down—internals shift across PHP versions. FFI and extensions remain the practical boundary when you need to call specific native libraries. This is how polyglot PHP systems bridge to native code."
        }
      ],
      "libraries": [
        {
          "name": "Composer/Packagist",
          "url": "https://packagist.org/",
          "type": "Package manager"
        },
        {
          "name": "Laravel",
          "url": "https://laravel.com/",
          "type": "Web framework"
        }
      ],
      "docs": [
        {
          "name": "PHP Manual",
          "url": "https://www.php.net/manual/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "$x = 10;\n$y = 20;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if ($x > 5) {\n  echo 'big';\n} else {\n  echo 'small';\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for ($i = 0; $i < 5; $i++) {\n  echo $i;\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "function add(int $a, int $b): int {\n  return $a + $b;\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Interpreted; modern PHP 8 with JIT is significantly faster than older versions.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "$a = 'single';\n$b = \"dbl $a\";",
          "difficulty": "basic"
        },
        "classes": {
          "code": "class Point {\n  public function __construct(public int $x, public int $y) {}\n}",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try {\n  throw new Exception(\"fail\");\n} catch (Throwable $e) {\n  echo $e->getMessage();\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "require_once \"vendor/autoload.php\";\nuse Some\\Ns\\ClassName;",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "php-tip-format-pass11",
          "title": "PHP version and extensions",
          "body": "Many PHP bugs are missing extensions or ini settings. Print `php -v` and loaded modules in the failing environment.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/php/",
      "quickTourLabel": "Learn X in Y Minutes — PHP",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/php",
          "type": "Practice track"
        }
      ],
      "categories": [
        "web"
      ],
      "overview": "Widely used for server-side web apps — WordPress, Laravel, and a huge share of shared-hosting deployments. Runs on nearly every web host, making it easy to find help and hosting.",
      "learning_curve": "Easy for beginners — ubiquitous hosting, simple deployment, and huge tutorial base. Advanced PHP (OOP, PSRs, Composer) is a separate learning curve. The language's inconsistencies trip up intermediate developers.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Composer is the package manager. Laravel and Symfony are major frameworks. WordPress still powers a large share of public sites—headline percentages vary by survey and year, so treat market-share numbers as snapshots. PHP 8+ has improved significantly (JIT, enums, fibers, readonly properties).",
      "common_use_cases": [
        "WordPress",
        "Web APIs (Laravel)",
        "CMS platforms",
        "E-commerce"
      ],
      "docs_url": "https://www.php.net/docs.php",
      "paradigm_primary": "imperative",
      "paradigm": [
        "imperative",
        "object-oriented",
        "functional"
      ],
      "best_for": [
        "WordPress and CMS sites",
        "RESTful API backends",
        "E-commerce platforms",
        "WordPress, Drupal, and CMS-driven content sites at scale"
      ],
      "weak_at": [
        "Long-running worker processes without careful memory leak discipline",
        "Strictly typed large systems preferring compile-time guarantees",
        "Native mobile or desktop UI outside embedded WebView shells"
      ],
      "official_url": "https://www.php.net/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Usually interpreted per request on common web hosts (engine varies)",
        "memory": "Garbage-collected in common engines",
        "abstraction": "High-level"
      }
    },
    {
      "id": "sql",
      "name": "SQL",
      "color": "#E38C00",
      "description": "The shared way to query relational data: SELECT, WHERE, JOIN, and GROUP BY express what rows you need — patterns most engines recognise. Built-in functions, data types, and edge-case syntax still vary by dialect, so the same idea may need small rewrites when you move between PostgreSQL, MySQL, SQLite, SQL Server, or others.",
      "whoItIsFor": "Analysts, backend developers, and anyone who touches a database — even occasionally — who wants readable queries and fewer accidental full-table updates.",
      "commonUses": [
        "Database queries",
        "Data analysis",
        "Reporting",
        "ETL pipelines"
      ],
      "patterns": [
        {
          "title": "Top customers by total spend",
          "code": "SELECT\n  c.id,\n  c.name,\n  SUM(o.total) AS spend\nFROM customers c\nJOIN orders o ON o.customer_id = c.id\nGROUP BY c.id, c.name\nORDER BY spend DESC\nLIMIT 10;",
          "explanation": "Joins orders to customers, adds up totals per customer, sorts by money spent, and returns only the top ten — classic reporting shape."
        },
        {
          "title": "Count events per calendar day",
          "code": "SELECT\n  CAST(created_at AS DATE) AS day,\n  COUNT(*) AS events\nFROM page_views\nGROUP BY CAST(created_at AS DATE)\nORDER BY day DESC\nLIMIT 30;",
          "explanation": "Buckets timestamps into days with CAST(... AS DATE) (syntax may vary slightly by engine), then counts rows in each bucket."
        },
        {
          "title": "Average order size by category",
          "code": "SELECT\n  p.category,\n  AVG(o.line_total) AS avg_line\nFROM order_lines o\nJOIN products p ON p.id = o.product_id\nGROUP BY p.category\nORDER BY avg_line DESC;",
          "explanation": "JOIN brings product details onto each line item; AVG with GROUP BY summarises typical line size per category."
        },
        {
          "title": "Parameterized query — driver round-trip boundary",
          "code": "-- PostgreSQL-flavoured prepared statement example; other engines and drivers use different bind syntax\n-- Never concatenate user input into SQL strings\nPREPARE get_customer AS\n  SELECT id, name, email FROM customers WHERE region = $1 AND active = $2;\n\nEXECUTE get_customer('EMEA', true);\n\nDEALLOCATE get_customer;\n\n-- Application side (Python/psycopg2 example):\n-- cursor.execute(\"SELECT id, name FROM customers WHERE region = %s AND active = %s\", (\"EMEA\", True))\n-- Other tools may use ?, :name, @p1, or different PREPARE/bind conventions.\n-- The portable idea is that values travel separately from the SQL text.",
          "explanation": "This is a PostgreSQL-flavoured example: `$1` placeholders plus `PREPARE` / `EXECUTE` are not universal SQL syntax, and application drivers often expose their own marker styles such as `?`, `%s`, or named parameters. The portable lesson is the boundary: keep query text and values separate so the driver or database binds parameters instead of concatenating user input into the SQL string."
        }
      ],
      "libraries": [
        {
          "name": "PostgreSQL documentation",
          "url": "https://www.postgresql.org/docs/",
          "type": "Database docs"
        },
        {
          "name": "SQLite documentation",
          "url": "https://www.sqlite.org/docs.html",
          "type": "Embedded SQL"
        }
      ],
      "docs": [
        {
          "name": "SQLBolt (interactive tutorial)",
          "url": "https://sqlbolt.com/"
        },
        {
          "name": "Mode SQL tutorial",
          "url": "https://mode.com/sql-tutorial/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "-- Columns and aliases in the SELECT list\nSELECT\n  id,\n  first_name AS fname,\n  unit_price * qty AS line_total\nFROM order_lines;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "-- Filter rows; combine predicates carefully (use parentheses)\nSELECT *\nFROM orders\nWHERE status = 'paid'\n  AND (country = 'GB' OR country = 'IE');\n\n-- Inline conditional expression\nSELECT name, CASE WHEN age >= 18 THEN 'adult' ELSE 'minor' END AS bucket\nFROM people;",
          "difficulty": "basic"
        },
        "loops": {
          "code": "-- SQL is set-based; \"repeat\" often means sort + slice\nSELECT id, title\nFROM posts\nORDER BY created_at DESC\nLIMIT 20 OFFSET 40;  -- page 3 if page size is 20",
          "difficulty": "basic"
        },
        "functions": {
          "code": "-- Aggregate functions summarise groups\nSELECT department, COUNT(*) AS headcount, AVG(salary) AS avg_pay\nFROM employees\nGROUP BY department\nHAVING COUNT(*) > 5;",
          "difficulty": "basic"
        },
        "strings": {
          "code": "-- Single-quoted literals; pattern match\nSELECT email\nFROM users\nWHERE email LIKE '%@company.com'\n  AND name NOT LIKE 'Test%';",
          "difficulty": "basic"
        },
        "classes": {
          "code": "-- Tables define structure (like a schema type)\nCREATE TABLE customers (\n  id INTEGER PRIMARY KEY,\n  name TEXT NOT NULL,\n  created_at TEXT NOT NULL DEFAULT (CURRENT_TIMESTAMP)\n);",
          "difficulty": "basic"
        },
        "errors": {
          "code": "-- Safer update: always constrain rows\nBEGIN TRANSACTION;\nUPDATE inventory\nSET qty = qty - 1\nWHERE sku = 'ABC-123' AND qty > 0;\n-- ROLLBACK;  -- if something looks wrong\nCOMMIT;",
          "difficulty": "basic"
        },
        "imports": {
          "code": "-- Add rows (input to the database)\nINSERT INTO audit_log (message, created_at)\nVALUES ('checkout completed', CURRENT_TIMESTAMP);",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Performance depends on the database engine, indexes, and query plan.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "sql-tip-where",
          "title": "UPDATE and DELETE without WHERE touch every row",
          "body": "A missing WHERE clause updates or removes the whole table. Type the WHERE first, run a SELECT with the same filter to preview rows, then wrap the write in a transaction if your engine supports it.",
          "tag": "common mistake",
          "status": "curated"
        },
        {
          "id": "sql-tip-cross",
          "title": "Accidental cross joins explode row counts",
          "body": "If you list two tables in FROM without a join condition, you get every combination of rows (Cartesian product). Always relate tables with ON or WHERE joins when that is what you mean.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "sql-tip-and-or",
          "title": "AND binds tighter than OR",
          "body": "Without parentheses, AND is evaluated before OR. If you mean \"status is paid and (country is GB or IE)\", write the parentheses explicitly or you may include unintended rows.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "sql-tip-limit",
          "title": "LIMIT and OFFSET are easy to get wrong",
          "body": "LIMIT n returns n rows. OFFSET skips rows for paging but can be slow on huge tables without ordering. Page 2 with page size 20 is often LIMIT 20 OFFSET 20, not OFFSET 2.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/sql/",
      "quickTourLabel": "Learn X in Y Minutes — SQL",
      "practiceLinks": [
        {
          "name": "SQLBolt",
          "url": "https://sqlbolt.com/",
          "type": "Interactive lessons"
        },
        {
          "name": "HackerRank SQL",
          "url": "https://www.hackerrank.com/domains/sql",
          "type": "Practice problems"
        }
      ],
      "categories": [
        "data",
        "query"
      ],
      "overview": "The shared way to query relational data: SELECT, WHERE, JOIN, and GROUP BY express what rows you need — patterns most engines recognise. Built-in functions, data types, and edge-case syntax still vary by dialect, so the same idea may need small rewrites when you move between PostgreSQL, MySQL, SQLite, SQL Server, or others.",
      "learning_curve": "Gentle for basic SELECT/INSERT — most developers learn SQL incrementally. Advanced SQL (window functions, recursive CTEs, query planning) is a deep discipline of its own.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Every database has its own dialect (PostgreSQL, MySQL, SQL Server). ANSI SQL is the portable core. ORM layers (Prisma, SQLAlchemy) abstract SQL but understanding it directly remains essential.",
      "common_use_cases": [
        "Database queries",
        "Data analysis",
        "Reporting",
        "ETL pipelines"
      ],
      "docs_url": "https://www.postgresql.org/docs/current/",
      "paradigm_primary": "declarative",
      "paradigm": [
        "declarative",
        "query",
        "relational"
      ],
      "best_for": [
        "relational database querying and manipulation",
        "data analysis with aggregation and joins",
        "transactional database application logic",
        "Relational data querying, reporting, and analytics workloads"
      ],
      "weak_at": [
        "General-purpose application logic better expressed in host languages",
        "Document or graph models without schema migration planning",
        "Event-driven streaming transforms outside database-native engines"
      ],
      "official_url": "https://www.iso.org/standard/76583.html",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative query or policy notation (schema- or engine-driven)",
        "runtime": "Executed by a database, API server, or policy engine (product-specific)",
        "memory": "Managed by the host system running the query or policy"
      }
    },
    {
      "id": "html",
      "name": "HTML/CSS",
      "color": "#E34F26",
      "description": "HyperText Markup Language — the structure of web documents. Not a general-purpose programming language. CSS supplies declarative presentation rules (also not general-purpose code in the Python sense); JavaScript adds behavior.",
      "whoItIsFor": "Everyone who builds for the web — it's the skeleton that CSS and JS bring to life.",
      "commonUses": [
        "Web page structure",
        "Email templates",
        "Documentation",
        "Web components"
      ],
      "patterns": [
        {
          "title": "Page skeleton",
          "code": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>My Page</title>\n</head>\n<body>\n  <h1>Hello</h1>\n</body>\n</html>",
          "explanation": "Minimal valid HTML document — doctype, head, body form every web page's structure."
        },
        {
          "title": "Links & images",
          "code": "<a href=\"https://example.com\">Visit</a>\n<img src=\"photo.jpg\" alt=\"A photo\">",
          "explanation": "Anchor tags link; img embeds images."
        },
        {
          "title": "Semantic structure and accessibility boundary (DOM bridge)",
          "code": "<!-- Semantic HTML creates the boundary between content and accessibility APIs -->\n<article>\n  <header>\n    <h1>CacheSphere Language Guide</h1>\n    <nav aria-label=\"Breadcrumb\">\n      <a href=\"/\">Home</a> / <a href=\"/languages\">Languages</a> / <span>Guide</span>\n    </nav>\n  </header>\n  <section aria-labelledby=\"intro\">\n    <h2 id=\"intro\">Introduction</h2>\n    <p>Compare <strong>any</strong> two languages side by side.</p>\n  </section>\n</article>\n\n<!-- ARIA maps HTML semantics to the accessibility tree (screen readers, assistive tech) -->\n<!-- This is HTML's \"boundary\" — structured content crossing into the browser's accessibility API -->",
          "explanation": "HTML's primary boundary is not an FFI line but the DOM: structured markup becomes the accessibility tree, the rendering tree, and the JavaScript DOM API. Semantic elements (article, nav, h1) and ARIA attributes define how content crosses into assistive technologies and scripts. This is HTML's data-movement pattern — content structure becomes programmatically accessible."
        }
      ],
      "libraries": [
        {
          "name": "MDN HTML",
          "url": "https://developer.mozilla.org/en-US/docs/Web/HTML",
          "type": "Reference"
        },
        {
          "name": "Can I Use",
          "url": "https://caniuse.com/",
          "type": "Browser support"
        }
      ],
      "docs": [
        {
          "name": "MDN HTML docs",
          "url": "https://developer.mozilla.org/en-US/docs/Web/HTML"
        }
      ],
      "compareData": {
        "variables": {
          "code": "<!-- HTML has no variables; use data attributes -->\n<div data-count=\"10\">",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "<!-- No conditionals; use JS or server-side templates -->",
          "difficulty": "basic"
        },
        "loops": {
          "code": "<!-- No loops; generate HTML from JS or a template engine -->",
          "difficulty": "basic"
        },
        "functions": {
          "code": "<!-- No functions; HTML is declarative markup -->",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Parsed by the browser; performance depends on DOM size and rendering.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "<!-- No class system — HTML is markup, not a programming language -->",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "<p>Hello, World!</p>\n<!-- Text content is the \"string\" — no string type or operations -->",
          "difficulty": "N/A"
        },
        "errors": {
          "code": "<!-- No error handling — browser parser recovers silently -->\n<!-- Use validators (W3C, nu) to catch mistakes -->",
          "difficulty": "N/A"
        },
        "imports": {
          "code": "<!-- No import system — link external resources -->\n<link rel=\"stylesheet\" href=\"styles.css\">\n<script src=\"app.js\"></script>",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "html-tip-escape-for-the-output-context",
          "title": "Escape for the output context",
          "body": "In HTML/CSS, the dangerous bug is often not the syntax but the context shift: HTML, attribute, URL, and script contexts all need different escaping. If data can cross a trust boundary, sanitize it for that exact output surface.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "html-tip-keep-logic-out-of-the-template-when-it-grows",
          "title": "Keep logic out of the template when it grows",
          "body": "HTML/CSS stays pleasant when templates stay declarative. Once you start encoding business rules inside the view layer, debugging becomes guesswork and the same rule gets duplicated in several places.",
          "tag": "architecture",
          "status": "curated"
        }
      ],
      "categories": [
        "markup",
        "web"
      ],
      "overview": "HyperText Markup Language — the structure of web documents. It is not a general-purpose programming language. CSS handles styling as declarative rules (preprocessors like Sass extend authoring, but the core job is still presentation); JavaScript handles interactivity. The three are usually authored together.",
      "learning_curve": "Gentle — tags and attributes are intuitive. Semantic HTML, accessibility (ARIA), and cross-browser quirks add depth. Most developers learn HTML first but mastery requires understanding the DOM boundary and accessibility contracts.",
      "good_for_teaching": "good",
      "ecosystem_notes": "The foundation of the web. No package manager — HTML is always paired with CSS and JavaScript. MDN Web Docs is the canonical reference. Validators (W3C, nu) catch mistakes. Frameworks (React, Vue) generate HTML programmatically.",
      "common_use_cases": [
        "Web page structure",
        "Email templates",
        "Documentation",
        "Web components"
      ],
      "docs_url": "https://html.spec.whatwg.org/",
      "best_for": [
        "web page structure and semantics",
        "Accessible document markup",
        "Email and CMS templates",
        "Semantic document structure for accessible public web pages"
      ],
      "weak_at": [
        "Application state management without companion scripting layers",
        "Complex data processing or business logic in markup alone",
        "Native mobile performance without WebView or hybrid compromises"
      ],
      "official_url": "https://html.spec.whatwg.org/",
      "paradigm": [
        "declarative",
        "markup"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Markup or data format (not a general-purpose programming language)",
        "runtime": "Parsed and validated by tools, pipelines, or hosts — no single standard VM",
        "memory": "Not an executable program on its own; hosts manage storage and memory"
      }
    },
    {
      "id": "shell",
      "name": "Shell",
      "color": "#4EAA25",
      "description": "Bash and other Unix shells — the command-line glue that ties programs together with pipes and scripts. Automate repetitive tasks, chain tools, and manage systems.",
      "whoItIsFor": "Sysadmins, DevOps engineers, and anyone automating tasks on Unix/Linux/macOS — essential for CI pipelines, provisioning, and glue scripts.",
      "commonUses": [
        "Automation scripts",
        "CI/CD pipelines",
        "System administration",
        "File processing"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "#!/bin/bash\necho \"Hello, World!\"",
          "explanation": "The shebang line tells the OS which interpreter to use; echo prints text to stdout."
        },
        {
          "title": "Variables",
          "code": "NAME=\"Ada\"\necho \"Hello, $NAME\"",
          "explanation": "No spaces around =; $ expands variables."
        },
        {
          "title": "Loop",
          "code": "for i in 1 2 3 4 5; do\n  echo \"$i\"\ndone",
          "explanation": "Iterates over a word list, running the body once per item — the classic shell iteration construct."
        },
        {
          "title": "Pipe data between processes — the Unix boundary",
          "code": "# Pipe: stdout of one process becomes stdin of the next\ncat access.log | grep \"ERROR\" | cut -d' ' -f2 | sort | uniq -c | sort -rn\n\n# Process substitution: pass output as a filename\ndiff <(sort file1.txt) <(sort file2.txt)\n\n# Here-doc: feed multi-line input to a command\nsqlplus -s db/user <<EOF\nSELECT count(*) FROM logs;\nEXIT;\nEOF",
          "explanation": "The pipe (|) is the shell's core data boundary — it connects processes via file descriptors without any serialization. Process substitution <() goes further, presenting a command's output as a temporary file path. Here-docs (<<EOF) feed structured text into programs that expect stdin. This is how shell orchestrates polyglot pipelines."
        }
      ],
      "libraries": [
        {
          "name": "ShellCheck",
          "url": "https://www.shellcheck.net/",
          "type": "Linter"
        },
        {
          "name": "Bash manual",
          "url": "https://www.gnu.org/software/bash/manual/",
          "type": "Reference"
        }
      ],
      "docs": [
        {
          "name": "Bash Reference Manual",
          "url": "https://www.gnu.org/software/bash/manual/bash.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "X=10\nNAME=\"Ada\"",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if [ \"$X\" -gt 5 ]; then\n  echo big\nelse\n  echo small\nfi",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for i in $(seq 0 4); do\n  echo \"$i\"\ndone",
          "difficulty": "basic"
        },
        "functions": {
          "code": "add() {\n  echo $(( $1 + $2 ))\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Interpreted; fine for glue scripts, not for heavy computation.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "# No class system — shell uses functions and sourced scripts\n# Organise with directories and shebangs\nsource ./lib/utils.sh",
          "difficulty": "basic"
        },
        "strings": {
          "code": "greeting='Hello'\nname='World'\necho \"$greeting, $name!\"    # double quotes: expands $var\necho '$greeting'             # single quotes: literal",
          "difficulty": "basic"
        },
        "errors": {
          "code": "if ! cp file.txt /backup/; then\n  echo \"Copy failed\" >&2\n  exit 1\nfi\n\n# Or use set -e to exit on any error\nset -e",
          "difficulty": "basic"
        },
        "imports": {
          "code": "source ./lib/helpers.sh   # load functions\n# Or in PATH: ./script.sh calls other scripts",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "shell-tip-posix-vs-bash",
          "title": "POSIX sh vs bash extensions",
          "body": "Scripts that start with `#!/bin/sh` are often expected to run on any POSIX shell. Bash-only features (arrays, `[[ ]]`, `function` keyword, `{1..10}` brace expansion, etc.) can break on plain `sh` or on macOS's older bash. If you need bash, use `#!/usr/bin/env bash` and document it; if you need portability, test under `dash` or `sh` and stick to POSIX constructs.",
          "tag": "intermediate",
          "status": "curated"
        }
      ],
      "categories": [
        "devops",
        "scripting"
      ],
      "overview": "Bash and other Unix shells — the command-line glue that ties programs together with pipes and scripts. Automate repetitive tasks, chain tools, and manage systems.",
      "learning_curve": "Gentle for basic commands — pipelines, variables, and conditionals come quickly. Advanced shell (process substitution, signal handling, quoting rules) is a deep and sometimes surprising discipline.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "No package manager in the language itself; tools like Homebrew, apt, and nix manage external programs. Shellcheck is the go-to linter. POSIX sh is the portable baseline; bash and zsh add convenience features.",
      "common_use_cases": [
        "Automation scripts",
        "CI/CD pipelines",
        "System administration",
        "File processing"
      ],
      "docs_url": "https://www.gnu.org/software/bash/manual/bash.html",
      "best_for": [
        "automation scripts and task orchestration",
        "CI/CD pipeline scripting",
        "Unix system administration",
        "CI/CD pipeline scripting and release automation on Unix hosts"
      ],
      "weak_at": [
        "Cross-platform logic on Windows without PowerShell equivalents",
        "Large maintainable codebases needing modules and static analysis",
        "Performance-critical algorithms better compiled than interpreted"
      ],
      "official_url": "https://www.gnu.org/software/bash/",
      "paradigm": [
        "imperative",
        "scripting"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Commands and text expansion (typically untyped at the shell level)",
        "runtime": "Interpreted by a shell, editor, or automation host",
        "memory": "Managed by the host process running the script"
      }
    },
    {
      "id": "r",
      "name": "R",
      "color": "#276DC3",
      "description": "A language and environment for statistical computing and graphics — the go-to for data analysis, modelling, and visualisation in research and industry.",
      "whoItIsFor": "Statisticians, data analysts, and researchers doing exploratory data work — especially in academia, biostatistics, and social sciences.",
      "commonUses": [
        "Statistical analysis",
        "Data visualisation (ggplot2)",
        "Bioinformatics",
        "Academic research"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "print(\"Hello, World!\")",
          "explanation": "print() outputs its argument to the console; cat() is the alternative for raw strings."
        },
        {
          "title": "Vectors",
          "code": "x <- c(1, 2, 3, 4, 5)\nmean(x)",
          "explanation": "c() creates a vector; <- is assignment."
        },
        {
          "title": "Plot",
          "code": "plot(1:10, (1:10)^2, type='l', main='Squares')",
          "explanation": "Built-in plotting with plot() creates scatter, line, and bar charts from vectors and data frames."
        },
        {
          "title": "Call C via .Call and Rcpp (FFI boundary)",
          "code": "# R's .Call interface — pass R objects directly to C\nresult <- .Call(\"c_sum\", c(1.0, 2.0, 3.0))\n\n# Rcpp wraps the .Call interface elegantly\n# Rcpp::cppFunction('\n#   double rcpp_sum(NumericVector x) {\n#     double total = 0;\n#     for (double val : x) total += val;\n#     return total;\n#   }\n# ')\n# rcpp_sum(c(1, 2, 3))  # returns 6",
          "explanation": "R's .Call() passes R SEXP objects (the internal representation) directly to C functions — no copying needed. Rcpp wraps this boundary with C++ classes that map R vectors to native types. This is how high-performance R packages (dplyr, data.table, glmnet) achieve speed: C/C++ inner loops, R outer interface."
        }
      ],
      "libraries": [
        {
          "name": "CRAN",
          "url": "https://cran.r-project.org/",
          "type": "Package repository"
        },
        {
          "name": "tidyverse",
          "url": "https://www.tidyverse.org/",
          "type": "Data science toolkit"
        }
      ],
      "docs": [
        {
          "name": "R documentation",
          "url": "https://www.r-project.org/other-docs.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "x <- 10\ny <- 20",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5) {\n  print('big')\n} else {\n  print('small')\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for (i in 1:5) {\n  print(i)\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "add <- function(a, b) a + b",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Interpreted; vectorised operations are fast, loops can be slow.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "a <- \"chr\"\nb <- paste0(\"a\", 1)",
          "difficulty": "basic"
        },
        "classes": {
          "code": "setClass(\"Point\", slots=c(x=\"numeric\", y=\"numeric\"))",
          "difficulty": "basic"
        },
        "errors": {
          "code": "tryCatch(stop(\"bad\"), error=function(e) print(e$message))",
          "difficulty": "basic"
        },
        "imports": {
          "code": "library(dplyr)\nsource(\"helpers.R\")",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "r-tip-format-pass11",
          "title": "Library paths and session state",
          "body": "R results depend on library versions, `.libPaths()`, and session options. Save a minimal script and `sessionInfo()` with the bug.",
          "tag": "repro",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/r/",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/r",
          "type": "Practice track"
        }
      ],
      "categories": [
        "data"
      ],
      "overview": "A language and environment for statistical computing and graphics — the go-to for data analysis, modelling, and visualisation in research and industry. Statisticians, data analysts, and researchers doing exploratory data work — especially in academia, biostatistics, and social sciences.\n\nTypical projects include Statistical analysis, Data visualisation (ggplot2), Bioinformatics. CRAN offers 20k+ packages with Tidyverse driving most data workflows; Posit tooling is central in academia and biostatistics.",
      "learning_curve": "Moderate for data analysis — vector syntax is intuitive, and tidyverse packages are well-documented. The base R language has quirks (1-indexed, copy-on-modify semantics) that trip up programmers from other languages.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "CRAN has 20k+ packages. Tidyverse (dplyr, ggplot2, tidyr) is the dominant data workflow. RStudio/Posit drives tooling. Strong in biostatistics, social science, and academic research. Performance-sensitive code calls C via Rcpp.",
      "common_use_cases": [
        "Statistical analysis",
        "Data visualisation (ggplot2)",
        "Bioinformatics",
        "Academic research"
      ],
      "docs_url": "https://cran.r-project.org/manuals.html",
      "paradigm_primary": "functional",
      "paradigm": [
        "functional",
        "imperative",
        "object-oriented"
      ],
      "best_for": [
        "statistical analysis and modelling",
        "Scientific data visualization",
        "biostatistics and research pipelines",
        "Statistical analysis, biostatistics, and reproducible research notebooks"
      ],
      "weak_at": [
        "Low-latency production services outside the R runtime model",
        "Large-scale web application backends with conventional MVC patterns",
        "Mobile or embedded deployments expecting single-binary artifacts"
      ],
      "official_url": "https://www.r-project.org/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Interpreted or bytecode-based in common implementations (engines vary)",
        "memory": "Garbage-collected in mainstream implementations",
        "abstraction": "High-level for typical scripting and application use"
      }
    },
    {
      "id": "dart",
      "name": "Dart",
      "color": "#0175C2",
      "description": "An open-source, Google-originated language optimised for UI-heavy clients — Flutter is the biggest adoption driver, but Dart also ships command-line tools, servers, and scripts outside Flutter; not every Dart user is building a mobile app.",
      "whoItIsFor": "Flutter teams first, plus developers using Dart for CLIs, small services, or tooling where the language and pub.dev packages fit — expect Flutter-centric docs and community defaults.",
      "commonUses": [
        "Flutter mobile apps",
        "Flutter web",
        "Server-side (Dart Frog)",
        "CLI tools"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "void main() {\n  print('Hello, World!');\n}",
          "explanation": "main() is the entry point — every Dart program begins execution from a top-level main function."
        },
        {
          "title": "Variables",
          "code": "var x = 10;\nfinal name = 'Ada';\nconst pi = 3.14;",
          "explanation": "var is mutable; final/const are immutable."
        },
        {
          "title": "Classes",
          "code": "class Dog {\n  final String name;\n  Dog(this.name);\n  void bark() => print('$name barks!');\n}",
          "explanation": "this.name shorthand in constructor — Dart's syntactic sugar for assigning parameters to fields."
        },
        {
          "title": "Call a native C function via dart:ffi (FFI boundary)",
          "code": "import 'dart:ffi';\nimport 'package:ffi/ffi.dart'; // for Utf8 helpers\n\n// Define the C function signature\ntypedef AddNative = Int32 Function(Int32 a, Int32 b);\ntypedef AddDart = int Function(int a, int b);\n\nvoid main() {\n  // Load the shared library\n  final dylib = DynamicLibrary.open('./libmath.so');\n\n  // Look up the function by name\n  final addFn = dylib.lookupFunction<AddNative, AddDart>('add');\n\n  final result = addFn(3, 4);\n  print('add(3, 4) = ' + result.toString()); // 7\n\n  // Pass a string to C\n  final puts = dylib.lookupFunction<Int32 Function(Pointer<Utf8>), int Function(Pointer<Utf8>)>('puts');\n  final msg = 'Hello from Dart'.toNativeUtf8();\n  try {\n    puts(msg);\n  } finally {\n    malloc.free(msg); // always free native memory\n  }\n}",
          "explanation": "dart:ffi is Dart's C interop mechanism — load a shared library, look up symbols by name, and call them. lookupFunction bridges the native signature to a Dart callable. Strings must be converted to native Utf8 and freed manually. This is how Flutter plugins access platform-native APIs."
        }
      ],
      "libraries": [
        {
          "name": "pub.dev",
          "url": "https://pub.dev/",
          "type": "Package repository"
        },
        {
          "name": "Flutter",
          "url": "https://flutter.dev/",
          "type": "UI framework"
        }
      ],
      "docs": [
        {
          "name": "Dart docs",
          "url": "https://dart.dev/guides"
        }
      ],
      "compareData": {
        "variables": {
          "code": "var x = 10;\nfinal y = 20;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5) {\n  print('big');\n} else {\n  print('small');\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for (var i = 0; i < 5; i++) {\n  print(i);\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "int add(int a, int b) => a + b;",
          "difficulty": "basic"
        },
        "performance": {
          "code": "JIT during development; AOT/native compilation for many release builds (e.g. Flutter targets). Startup and memory depend on embedder — Flutter apps vs `dart run` vs compiled binaries are different stories.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "final a = 'x';\nfinal i = r'''raw''';",
          "difficulty": "basic"
        },
        "classes": {
          "code": "class Point {\n  final int x, y;\n  const Point(this.x, this.y);\n}",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try {\n  throw FormatException(\"bad\");\n} on FormatException catch (e) {\n  print(e.message);\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "import 'dart:io';\nimport 'package:http/http.dart' as http;",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "dart-tip-browser-state-and-async-timing-hide-bugs",
          "title": "Browser state and async timing hide bugs",
          "body": "In Dart, UI bugs often come from stale state, event timing, or a missing await/fetch boundary. Reproduce the issue with one interaction and log the state transition before changing the view code.",
          "tag": "frontend",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/dart/",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/dart",
          "type": "Practice track"
        }
      ],
      "categories": [
        "mobile",
        "web"
      ],
      "overview": "An open-source, Google-originated language optimised for UI-heavy clients — Flutter is the biggest adoption driver, but Dart also ships command-line tools, servers, and scripts outside Flutter; not every Dart user is building a mobile app.",
      "learning_curve": "Gentle if you know Java or JavaScript — familiar C-like syntax with sound null safety. Flutter's widget tree is the bigger learning curve.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Flutter drives most Dart adoption. pub.dev hosts packages; server-side and embedded Dart exist but are a smaller slice of the community than Flutter clients. Hot reload is a standout on supported Flutter workflows — not a universal guarantee for every Dart runtime.",
      "common_use_cases": [
        "Flutter mobile apps",
        "Flutter web",
        "Server-side (Dart Frog)",
        "CLI tools"
      ],
      "docs_url": "https://dart.dev/guides",
      "paradigm_primary": "object-oriented",
      "paradigm": [
        "object-oriented",
        "functional",
        "concurrent"
      ],
      "best_for": [
        "cross-platform mobile apps with Flutter",
        "Web frontend development",
        "desktop applications from a single codebase",
        "Flutter cross-platform mobile, web, and desktop UI development"
      ],
      "weak_at": [
        "Native iOS/Android modules requiring platform-specific Swift or Kotlin",
        "Systems programming or kernel-level work outside VM abstractions",
        "Teams committed to non-Flutter web stacks without Dart compilation"
      ],
      "official_url": "https://dart.dev/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static with sound null safety in modern Dart",
        "runtime": "JIT-compiled in development; ahead-of-time compiled for release builds on mobile and desktop",
        "memory": "Garbage-collected on the Dart VM and AOT targets"
      }
    },
    {
      "id": "lua",
      "name": "Lua",
      "color": "#2C2D72",
      "description": "A tiny, fast, embeddable scripting language — often used as a host-controlled scripting layer in games, Redis, Nginx/OpenResty, and many other products (each host picks versions, sandboxes, and APIs).",
      "whoItIsFor": "Game developers (Roblox, WoW addons), embedded scripters, and config authors — lightweight, fast, and easy to embed in host applications.",
      "commonUses": [
        "Game scripting (Roblox, Love2D)",
        "Embedded scripting",
        "Redis scripts",
        "Neovim config"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "print(\"Hello, World!\")",
          "explanation": "Global print function — Lua's simplest output; string arguments print followed by a newline."
        },
        {
          "title": "Tables",
          "code": "local t = {name = 'Ada', age = 36}\nprint(t.name)",
          "explanation": "Tables are Lua's only data structure."
        },
        {
          "title": "Functions",
          "code": "local function add(a, b)\n  return a + b\nend",
          "explanation": "local scopes the function name — prefer local to avoid polluting the global namespace."
        },
        {
          "title": "C API — push and call across the Lua boundary",
          "code": "/* C side: push a C function into Lua */\n#include <lua.h>\n#include <lauxlib.h>\n\nstatic int c_add(lua_State *L) {\n    double a = luaL_checknumber(L, 1);\n    double b = luaL_checknumber(L, 2);\n    lua_pushnumber(L, a + b);\n    return 1;  /* number of return values */\n}\n\n/* Register it */\nlua_register(L, \"c_add\", c_add);",
          "explanation": "Lua's C API lets you push values onto the Lua stack and call functions across the boundary — the core FFI mechanism for extending Lua with native code."
        }
      ],
      "libraries": [
        {
          "name": "LuaRocks",
          "url": "https://luarocks.org/",
          "type": "Package manager"
        },
        {
          "name": "Love2D",
          "url": "https://love2d.org/",
          "type": "Game framework"
        }
      ],
      "docs": [
        {
          "name": "Lua Reference Manual",
          "url": "https://www.lua.org/manual/5.4/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "local x = 10\nlocal y = 20",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5 then\n  print('big')\nelse\n  print('small')\nend",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for i = 0, 4 do\n  print(i)\nend",
          "difficulty": "basic"
        },
        "functions": {
          "code": "local function add(a, b)\n  return a + b\nend",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Often interpreted; LuaJIT or other VMs can be much faster where the host ships and allows them. Memory use is usually small but depends on the embedding and libraries.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "local a = 'single'\nlocal b = [[long string]]",
          "difficulty": "basic"
        },
        "classes": {
          "code": "-- tables as objects\nlocal Point = {}\nfunction Point:new(x, y) return setmetatable({x=x,y=y}, self) end",
          "difficulty": "basic"
        },
        "errors": {
          "code": "local ok, err = pcall(function() error(\"x\") end)",
          "difficulty": "basic"
        },
        "imports": {
          "code": "local json = require(\"json\")",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "lua-tip-format-pass11",
          "title": "Lua vs LuaJIT and 5.x versions",
          "body": "Lua 5.1/5.2/5.3/5.4 and LuaJIT disagree on bitops and integer division. Pin the interpreter your host embeds.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/lua/",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/lua",
          "type": "Practice track"
        }
      ],
      "categories": [
        "games",
        "web"
      ],
      "overview": "A tiny, fast, embeddable scripting language — often used as a host-controlled scripting layer in games, Redis, Nginx/OpenResty, and many other products (each host picks versions, sandboxes, and APIs).",
      "learning_curve": "Gentle syntax — tables as the one data structure, no braces, minimal keywords. The main learning hump is metatables and the C API if you embed Lua.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Tiny core; LuaRocks for packages. Common as an embedded scripting language (games, Redis module scripts, Neovim, OpenResty / Nginx Lua) — not the only scripting option in those stacks. LuaJIT can be very fast on supported platforms, but many deployments stay on the reference interpreter.",
      "common_use_cases": [
        "Game scripting (Roblox, Love2D)",
        "Embedded scripting",
        "Redis scripts",
        "Neovim config"
      ],
      "docs_url": "https://www.lua.org/manual/5.4/",
      "paradigm_primary": "imperative",
      "paradigm": [
        "imperative",
        "procedural",
        "functional"
      ],
      "best_for": [
        "Game scripting and modding",
        "embedded configuration and plugins",
        "Neovim extension and Redis scripting",
        "Game scripting, modding APIs, and embedded configuration languages"
      ],
      "weak_at": [
        "Large application codebases without disciplined module boundaries",
        "Static typing requirements across multi-team enterprise repos",
        "Ecosystems expecting batteries-included standard libraries at scale"
      ],
      "official_url": "https://www.lua.org/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Interpreted or bytecode-based in common implementations (engines vary)",
        "memory": "Garbage-collected in mainstream implementations",
        "abstraction": "High-level for typical scripting and application use"
      }
    },
    {
      "id": "assembly",
      "name": "Assembly",
      "color": "#6E4C13",
      "description": "The lowest-level human-readable code — one step above machine code, specific to each CPU architecture. Essential for OS kernels, bootloaders, and extreme performance tuning.",
      "whoItIsFor": "OS kernel developers, reverse engineers, and people who need every last cycle of performance.",
      "commonUses": [
        "OS kernels",
        "Bootloaders",
        "Reverse engineering",
        "Performance-critical inner loops"
      ],
      "patterns": [
        {
          "title": "Hello (x86-64 Linux)",
          "code": "section .data\n  msg db 'Hello', 0xa\nsection .text\n  global _start\n_start:\n  mov rax, 1\n  mov rdi, 1\n  mov rsi, msg\n  mov rdx, 6\n  syscall\n  mov rax, 60\n  xor rdi, rdi\n  syscall",
          "explanation": "Linux syscall to write a string to stdout then exit — the assembly equivalent of Hello World."
        },
        {
          "title": "Function prologue/epilogue — the ABI boundary",
          "code": "; x86-64 System V ABI: function call boundary\n; Arguments in rdi, rsi, rdx, rcx, r8, r9\n; Return value in rax\n\nsection .text\nglobal add_numbers\n\nadd_numbers:\n    ; Prologue — save caller's base pointer\n    push rbp\n    mov rbp, rsp\n    \n    ; Access arguments (already in registers)\n    add rdi, rsi        ; rdi = a + b\n    mov rax, rdi        ; return value in rax\n    \n    ; Epilogue — restore and return\n    pop rbp\n    ret",
          "explanation": "The function prologue (push rbp; mov rbp, rsp) and epilogue (pop rbp; ret) are the ABI boundary in assembly. Arguments arrive in registers per the calling convention; the return value goes in rax. Stack alignment (16-byte on System V) must be maintained. This is the lowest-level data boundary — every higher-level language compiles down to this."
        },
        {
          "title": "Syscall — operating system boundary",
          "code": "; x86-64 Linux syscall boundary\n; syscall number in rax, args in rdi, rsi, rdx, r10, r8, r9\n\nsection .text\nglobal _start\n\n_start:\n    ; write(1, msg, len)\n    mov rax, 1          ; sys_write\n    mov rdi, 1          ; stdout\n    mov rsi, msg\n    mov rdx, 14\n    syscall\n\n    ; exit(0)\n    mov rax, 60         ; sys_exit\n    mov rdi, 0\n    syscall",
          "explanation": "syscall is the boundary between user-space code and the kernel. The syscall number in rax selects the kernel function; arguments follow the kernel calling convention (different from user-space ABI). This is how assembly programs request OS services — file I/O, memory allocation, process control — without any runtime library."
        }
      ],
      "libraries": [
        {
          "name": "NASM",
          "url": "https://nasm.us/",
          "type": "Assembler"
        },
        {
          "name": "Godbolt",
          "url": "https://godbolt.org/",
          "type": "Compiler Explorer"
        }
      ],
      "docs": [
        {
          "name": "x86 reference",
          "url": "https://www.felixcloutier.com/x86/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "; x86-64\nmov rax, 10  ; 'variable' in a register",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "cmp rax, 5\njg .big\n; else branch\n.big:",
          "difficulty": "basic"
        },
        "loops": {
          "code": "mov rcx, 5\n.loop:\n  ; body\n  dec rcx\n  jnz .loop",
          "difficulty": "basic"
        },
        "functions": {
          "code": "; Call convention: args in rdi, rsi, ...\nadd_fn:\n  lea rax, [rdi + rsi]\n  ret",
          "difficulty": "basic"
        },
        "performance": {
          "code": "As fast as the hardware allows — you control every instruction.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "; No class system — organise with sections and labels\n; Data structures are manual:\n;   struct Point { int x, y; }\n;   point_x equ 0\n;   point_y equ 4",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "; No string type — byte arrays in data section\nsection .data\n    msg db 'Hello, World!', 0xA\n    len equ $ - msg",
          "difficulty": "N/A"
        },
        "errors": {
          "code": "; No exception system — check return values manually\n    syscall             ; sys_call returns status in rax\n    cmp rax, 0\n    jl .error_handler   ; jump on negative (error)\n    ; continue on success",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "; No imports — link against external libraries at build time\n; Declare external symbols:\nextern printf\nextern exit",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "asm-tip-abi",
          "title": "Calling conventions are part of the language",
          "body": "Registers and stack layout for arguments/returns differ by OS and architecture (for example System V AMD64 vs Windows x64). Match the ABI your toolchain expects, or calls corrupt state in ways that look like random bugs.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "asm-tip-syntax",
          "title": "Intel vs AT&T syntax is not interchangeable",
          "body": "Operand order, register prefixes, and immediate syntax differ between assemblers. Copy snippets only into the dialect your assembler documents (NASM, GAS, MASM, etc.).",
          "tag": "common mistake",
          "status": "curated"
        }
      ],
      "categories": [
        "systems",
        "low-level"
      ],
      "overview": "The lowest-level human-readable code — one step above machine code, specific to each CPU architecture. Essential for OS kernels, bootloaders, and extreme performance tuning.",
      "learning_curve": "Very steep — requires understanding registers, memory layout, calling conventions, and kernel interfaces. Rewarding for systems programmers who need absolute control.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Architecture-specific (x86-64, ARM, RISC-V). NASM and GAS are the main assemblers. Used in OS kernels, bootloaders, JIT backends, and security exploits. Most assembly is compiler-generated; hand-written assembly is rare but critical for hot paths.",
      "common_use_cases": [
        "OS kernels",
        "Bootloaders",
        "Reverse engineering",
        "Performance-critical inner loops"
      ],
      "docs_url": "https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html",
      "best_for": [
        "low-level embedded programming",
        "bootloader and firmware development",
        "performance-critical inner loops",
        "Hand-optimized hot paths in compilers, kernels, and bootloaders"
      ],
      "weak_at": [
        "Productive application development with readable maintenance cycles",
        "Portable business logic across operating systems and ISAs",
        "Rapid feature iteration where higher-level languages dominate"
      ],
      "official_url": "https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html",
      "paradigm": [
        "imperative",
        "low-level"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Untyped at the language level (mnemonics map to machine instructions)",
        "runtime": "Assembled or compiled to machine code for a target architecture",
        "memory": "Manual and architecture-specific",
        "abstraction": "Low-level by design"
      },
      "notes": [
        "Assembly is ISA-specific; Intel SDM is one reference, not a universal official language site."
      ]
    },
    {
      "id": "scala",
      "name": "Scala",
      "color": "#DC322F",
      "description": "A JVM language blending object-oriented and functional programming — expressive, with rich static typing (compile-time checks help, but reflection, Java interop, casts, and modelling gaps can still surface at runtime).",
      "whoItIsFor": "Teams on JVM data stacks (Spark is a common fit, not the only story), backend developers, and polyglots who want functional idioms on the JVM.",
      "commonUses": [
        "Apache Spark",
        "JVM backend services (many frameworks; actor stacks like Akka/Pekko are one slice of that space)",
        "Data pipelines",
        "Distributed systems"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "@main def hello() = println(\"Hello, World!\")",
          "explanation": "Scala 3 @main entry style; Scala 2 often used `object ... extends App` or an explicit `main` method."
        },
        {
          "title": "Val/Var",
          "code": "val x = 10\nvar y = 20\ny = 21",
          "explanation": "val is immutable — once assigned it cannot change; var is mutable and can be reassigned."
        },
        {
          "title": "Case class",
          "code": "case class User(name: String, age: Int)",
          "explanation": "Immutable data with auto-generated methods."
        },
        {
          "title": "Call native C via JNI and interop with Java (FFI boundary)",
          "code": "// Scala can call Java libraries directly\nval list = java.util.Arrays.asList(\"hello\", \"scala\")\nprintln(s\"Java list size: \" + list.size())\n\n// For native C, use JNI via Scala (same as Java)\nclass NativeAdd {\n  @native def add(a: Int, b: Int): Int\n}\n\n// Load the native library\nSystem.loadLibrary(\"nativeadd\")\n\n// Scala-specific: use the foreign function API (JEP 419, Panama)\n// val linker = Linker.nativeLinker()\n// val symbol = linker.defaultLookup(\"add\")\n// val desc = FunctionDescriptor.of(ValueLayout.JAVA_INT,\n//   ValueLayout.JAVA_INT, ValueLayout.JAVA_INT)\n// val handle = linker.downcallHandle(symbol, desc)",
          "explanation": "Scala's primary FFI boundary is the JVM — it calls Java libraries directly without a separate language interop layer for typical Java APIs (you still pay normal JVM costs like boxing, erased generics, and virtual calls). For native C, it uses JNI (same as Java) or the Foreign Function & Memory API on newer JDKs (availability varies by version). Scala's @native annotation declares native methods, and System.loadLibrary loads the C shared library."
        }
      ],
      "libraries": [
        {
          "name": "sbt",
          "url": "https://www.scala-sbt.org/",
          "type": "Build tool"
        },
        {
          "name": "Akka",
          "url": "https://akka.io/",
          "type": "Concurrency toolkit"
        }
      ],
      "docs": [
        {
          "name": "Scala docs",
          "url": "https://docs.scala-lang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "val x = 10\nvar y = 20",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5 then \"big\" else \"small\"",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for i <- 0 until 5 do println(i)",
          "difficulty": "basic"
        },
        "functions": {
          "code": "def add(a: Int, b: Int): Int = a + b",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Runs on the JVM; often comparable to Java for straightforward code — collections, higher-order abstractions, boxing, and implicit conversions can shift real workloads.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "val a = \"s\"\nval m = \"\"\"multi\"\"\"",
          "difficulty": "basic"
        },
        "classes": {
          "code": "case class Point(x: Int, y: Int)",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try {\n  1 / 0\n} catch {\n  case e: ArithmeticException => println(e.getMessage)\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "import scala.collection.mutable\nimport java.nio.file.Paths",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "scala-tip-recursion-and-immutability-are-the-defaults-not",
          "title": "Recursion and immutability are the defaults, not the extras",
          "body": "In Scala, the cleanest code usually leans on recursion, pure functions, and immutable data. If you force an imperative style too early, you often make the program harder to reason about than the language intended.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "scala-tip-macros-and-types-deserve-separate-debugging-stra",
          "title": "Macros and types deserve separate debugging strategies",
          "body": "Scala can make abstraction powerful, but that also means errors can hide in macro expansion, type inference, or higher-order composition. Reduce the problem to a tiny expansion or value first, then rebuild the abstraction around it.",
          "tag": "compiler",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/scala/",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/scala",
          "type": "Practice track"
        }
      ],
      "categories": [
        "data",
        "web",
        "functional"
      ],
      "overview": "A JVM language blending object-oriented and functional programming — expressive, with rich static typing (compile-time checks help, but reflection, Java interop, casts, and modelling gaps can still surface at runtime).",
      "learning_curve": "Moderate to steep — powerful type system, implicit parameters/conversions, and functional features. Scala 3 simplified many pain points (given/using, fewer braces). JVM knowledge required.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Full JVM library access plus Scala-native stacks (Cats, ZIO, Akka/Pekko for actors). Sbt is the longest-running standard build tool; Mill and other tools are alternatives — pick by team conventions. Common in JVM data tooling (often Spark; Kafka clients are polyglot) and in services where Scala's type system pays off.",
      "common_use_cases": [
        "Apache Spark",
        "JVM backend services (many frameworks; actor stacks like Akka/Pekko are one slice of that space)",
        "Data pipelines",
        "Distributed systems"
      ],
      "docs_url": "https://docs.scala-lang.org/",
      "paradigm_primary": "multi-paradigm",
      "paradigm": [
        "functional",
        "object-oriented",
        "concurrent"
      ],
      "best_for": [
        "Functional JVM services",
        "Big data pipelines with Spark",
        "Type-safe DSL construction",
        "Functional JVM services combining immutability with Java interop"
      ],
      "weak_at": [
        "Teams wanting minimal syntax and fast compile-feedback loops",
        "JavaScript-first front-end shops without JVM operational expertise",
        "Simple scripting tasks where Scala build tooling feels heavyweight"
      ],
      "official_url": "https://www.scala-lang.org/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static (checked at compile time)",
        "runtime": "JVM bytecode on typical deployments",
        "memory": "Garbage-collected on the JVM",
        "abstraction": "High-level for typical application code on the JVM"
      }
    },
    {
      "id": "perl",
      "name": "Perl",
      "color": "#0298C3",
      "description": "The Swiss Army chainsaw of text processing — regex-native, CPAN-rich, and unapologetically expressive. Still powers sysadmin scripts and bioinformatics pipelines worldwide.",
      "whoItIsFor": "Sysadmins, bioinformaticians, and anyone doing heavy text manipulation — still vital for legacy automation, log munging, and bioinformatics pipelines.",
      "commonUses": [
        "Text processing",
        "System administration",
        "Bioinformatics",
        "Legacy web (CGI)"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "print \"Hello, World!\\n\";",
          "explanation": "print with explicit newline character; say (in modern Perl) adds one automatically."
        },
        {
          "title": "Regex",
          "code": "my $text = 'Hello World';\nif ($text =~ /World/) {\n  print \"Found it!\\n\";\n}",
          "explanation": "The =~ operator applies a regex match against a string; captures go into $1, $2, etc."
        },
        {
          "title": "Arrays",
          "code": "my @nums = (1, 2, 3);\npush @nums, 4;\nprint \"@nums\\n\";",
          "explanation": "The @ sigil marks arrays; use $arr[0] for individual elements and push to grow."
        },
        {
          "title": "Call a C function via XS/Inline::C (FFI boundary)",
          "code": "# Using Inline::C — the easiest way to call C from Perl\nuse Inline C => <<'END';\n  int add(int a, int b) {\n    return a + b;\n  }\nEND\n\nprint \"C says: \" . add(3, 4) . \"\\n\";  # 7\n\n# Using FFI::Platypus for dynamic binding (no compile step)\nuse FFI::Platypus;\nmy $ffi = FFI::Platypus->new;\n$ffi->lib('./libmath.so');\n$ffi->attach(add => ['int', 'int'] => 'int');\nprint \"Dynamic: \" . add(3, 4) . \"\\n\";",
          "explanation": "Perl's FFI boundary has two paths: Inline::C embeds C code directly in Perl (compiles at load time), while FFI::Platypus binds to shared libraries dynamically without compilation. Both let Perl call C functions with automatic type marshalling. XS is the traditional (lower-level) mechanism. This makes Perl effective for systems scripting and glue code in polyglot pipelines."
        }
      ],
      "libraries": [
        {
          "name": "CPAN",
          "url": "https://www.cpan.org/",
          "type": "Package repository"
        },
        {
          "name": "Mojolicious",
          "url": "https://mojolicious.org/",
          "type": "Web framework"
        }
      ],
      "docs": [
        {
          "name": "perldoc",
          "url": "https://perldoc.perl.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "my $x = 10;\nmy $y = 20;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if ($x > 5) {\n  print \"big\\n\";\n} else {\n  print \"small\\n\";\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for my $i (0..4) {\n  print \"$i\\n\";\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "sub add { return $_[0] + $_[1]; }",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Interpreted; fast for text processing, slower for number crunching.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "my $a = 'single';\nmy $b = qq(interpolated $a);",
          "difficulty": "basic"
        },
        "classes": {
          "code": "package Point;\nsub new { bless { x=>$_[1], y=>$_[2] }, shift }",
          "difficulty": "basic"
        },
        "errors": {
          "code": "eval { die \"x\" }; warn $@ if $@;",
          "difficulty": "basic"
        },
        "imports": {
          "code": "use strict;\nuse warnings;\nuse JSON qw(encode_json);",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "perl-tip-format-pass11",
          "title": "Perl version and @INC path",
          "body": "Perl portability issues are usually interpreter version and module paths. Print `$^V` and `@INC` in the failing environment.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/perl/",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/perl5",
          "type": "Practice track"
        }
      ],
      "categories": [
        "web",
        "devops"
      ],
      "overview": "The Swiss Army chainsaw of text processing — regex-native, CPAN-rich, and unapologetically expressive. Still powers sysadmin scripts and bioinformatics pipelines worldwide.",
      "learning_curve": "Gentle for quick scripts — there's more than one way to do it. Steeper for larger projects: context-dependent sigils, regex-as-syntax, and Perl's many idioms take time to internalise.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "CPAN is one of the oldest and most comprehensive package repositories (200k+ modules). Dominant in bioinformatics, system administration, and legacy web. Perl 5 is stable; Perl 7/Raku are separate paths.",
      "common_use_cases": [
        "Text processing",
        "System administration",
        "Bioinformatics",
        "Legacy web (CGI)"
      ],
      "docs_url": "https://perldoc.perl.org/",
      "best_for": [
        "Legacy system maintenance",
        "Text processing with regex",
        "One-liner automation scripts",
        "Legacy system maintenance and text munging in Unix environments"
      ],
      "weak_at": [
        "Greenfield services where hiring and long-term support are concerns",
        "Strict memory-safe systems without disciplined testing culture",
        "Modern async web stacks expecting first-class HTTP/2 frameworks"
      ],
      "official_url": "https://www.perl.org/",
      "paradigm": [
        "imperative",
        "procedural",
        "functional"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Interpreted or bytecode-based in common implementations (engines vary)",
        "memory": "Garbage-collected in mainstream implementations",
        "abstraction": "High-level for typical scripting and application use"
      }
    },
    {
      "id": "haskell",
      "name": "Haskell",
      "color": "#5E5086",
      "description": "A pure functional language with lazy evaluation and strong static typing — immutability by default, expressive types, and FFI/`unsafe` escape hatches when you need them.",
      "whoItIsFor": "Functional programmers, compiler and DSL authors, teams wanting strong reasoning guarantees, and polyglots wiring Haskell into services or tooling (niche vs mainstream stacks).",
      "commonUses": [
        "Native services and CLIs (GHC)",
        "Web backends (e.g. Servant, Yesod)",
        "Compilers, linters, and DSLs",
        "Research, teaching, and formal-methods-adjacent work"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "main :: IO ()\nmain = putStrLn \"Hello, World!\"",
          "explanation": "Programs live in `IO` for side effects; `putStrLn` prints a line (not `print` from Python-style tutorials)."
        },
        {
          "title": "Variable Assignment",
          "code": "x :: Int\nx = 10",
          "explanation": "Top-level bindings are immutable names; inside `do` blocks you usually use `let ... in` or `<-` with monadic actions."
        },
        {
          "title": "Simple Function",
          "code": "add :: Int -> Int -> Int\nadd a b = a + b",
          "explanation": "Functions are first-class; type signatures are optional in small examples but typical in real modules."
        },
        {
          "title": "Call a C function via the FFI (foreign import)",
          "code": "-- Haskell side: declare the C function\nforeign import ccall \"add\" c_add :: CInt -> CInt -> CInt\n\n-- Use it in Haskell\nhaskellAdd :: Int -> Int -> Int\nhaskellAdd x y = fromIntegral (c_add (fromIntegral x) (fromIntegral y))\n\n-- Export a Haskell function for C\nforeign export ccall \"hs_greet\" hsGreet :: CString -> IO ()\n\nhsGreet :: CString -> IO ()\nhsGreet name = do\n  n <- peekCString name\n  putStrLn (\"Hello from Haskell, \" ++ n)",
          "explanation": "foreign import ccall declares a C entry point the linker/runtime resolves; fromIntegral bridges `Int` and `CInt`. foreign export ccall exposes a Haskell `IO` action to C callers. Linker flags, calling conventions, and GC interaction are the practical sharp edges — not \"free\" like calling a pure helper."
        }
      ],
      "libraries": [
        {
          "name": "Hackage",
          "url": "https://hackage.haskell.org/",
          "type": "Package registry"
        },
        {
          "name": "Yesod",
          "url": "https://www.yesodweb.com/",
          "type": "Web framework"
        }
      ],
      "docs": [
        {
          "name": "Haskell Documentation",
          "url": "https://www.haskell.org/documentation/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "x :: Int\nx = 10",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "let x = 10 :: Int\nin if x > 5 then \"big\" else \"small\"",
          "difficulty": "basic"
        },
        "loops": {
          "code": "import Control.Monad (forM_)\n\nmain :: IO ()\nmain = forM_ [0..4] print",
          "difficulty": "basic"
        },
        "functions": {
          "code": "square :: Int -> Int\nsquare n = n * n",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Lazy evaluation + GC: great for abstraction; time/space can surprise vs strict languages — profile real workloads.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "a :: String\na = \"unicode ok\"\nb = \"concat \" ++ \"strings\"",
          "difficulty": "basic"
        },
        "classes": {
          "code": "data Point = Point { x :: Int, y :: Int }",
          "difficulty": "basic"
        },
        "errors": {
          "code": "safeHead :: [a] -> Maybe a\nsafeHead []    = Nothing\nsafeHead (x:_) = Just x\n\n-- Either for recoverable errors\ndivide :: Int -> Int -> Either String Int\ndivide _ 0 = Left \"Division by zero\"\ndivide x y = Right (x `div` y)",
          "difficulty": "basic"
        },
        "imports": {
          "code": "import Data.List (sort)\nimport qualified Data.Text as T",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "haskell-tip-recursion-and-immutability-are-the-defaults-not",
          "title": "Recursion and immutability are the defaults, not the extras",
          "body": "In Haskell, the cleanest code usually leans on recursion, pure functions, and immutable data. If you force an imperative style too early, you often make the program harder to reason about than the language intended.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/haskell/",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/haskell",
          "type": "Practice track"
        }
      ],
      "categories": [
        "functional",
        "research"
      ],
      "overview": "A pure functional language with lazy evaluation and strong static typing — immutability by default, expressive types, and FFI/`unsafe` escape hatches when you need them.",
      "learning_curve": "Steep — lazy evaluation, monads, and the type system require a mindset shift. Rewarding for correctness and abstraction once concepts click; most give up before that point.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Strong in compilers, formal-methods-adjacent work, and some finance stacks. Cabal and Stack are common build workflows; Hackage is a large central package repository (exact counts drift). Smaller mainstream industry share than Python or Java, but a long-lived research and tooling niche.",
      "common_use_cases": [
        "Native services and CLIs (GHC)",
        "Web backends (e.g. Servant, Yesod)",
        "Compilers, linters, and DSLs",
        "Research, teaching, and formal-methods-adjacent work"
      ],
      "docs_url": "https://www.haskell.org/documentation/",
      "paradigm_primary": "functional",
      "paradigm": [
        "functional",
        "purely functional"
      ],
      "best_for": [
        "compiler and toolchain development",
        "formal-verification-adjacent systems",
        "Pure functional domain logic",
        "Pure functional domain modeling with strong type-driven design"
      ],
      "weak_at": [
        "Teams needing quick onboarding without functional programming background",
        "Legacy OOP codebases requiring incremental migration paths",
        "Runtime environments with strict memory footprint caps"
      ],
      "official_url": "https://www.haskell.org/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static (often with type inference)",
        "runtime": "Compiled to native code or bytecode; implementation and runtime vary by compiler",
        "memory": "Garbage-collected in most mainstream compilers"
      }
    },
    {
      "id": "elixir",
      "name": "Elixir",
      "color": "#4E2A8E",
      "description": "A functional language on the BEAM (Erlang’s VM): lightweight processes, message passing, and OTP supervision patterns — Ruby-ish syntax, immutable data, and concurrency-first design without claiming automatic scale or zero downtime.",
      "whoItIsFor": "Teams building services, real-time channels, and distributed systems who want the BEAM’s process model; Ruby/Python polyglots learning OTP; and maintainers of long-running systems where isolation and supervision matter — still a smaller pool than mainstream stacks.",
      "commonUses": [
        "Web apps and APIs (e.g. Phoenix)",
        "Real-time channels / LiveView-style UIs",
        "Background jobs, messaging, and integrations",
        "Embedded and CLI tooling on the BEAM"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "IO.puts(\"Hello, World!\")",
          "explanation": "`IO.puts/1` writes a line; scripts and `mix` projects usually live inside modules, but this is the direct console idiom."
        },
        {
          "title": "Variable Assignment",
          "code": "x = 10",
          "explanation": "`=` binds (rebinds) a name; values are immutable — you replace the binding, not mutate the value in place."
        },
        {
          "title": "Simple Function",
          "code": "def add(a, b), do: a + b",
          "explanation": "Named functions live in modules (`def` / `defp`); one-liner `do:` form is common in docs and scripts."
        },
        {
          "title": "Call a C function via Erlang NIF (FFI boundary)",
          "code": "# Elixir wraps Erlang NIFs — load a native library\ndefmodule MathNif do\n  @on_load :init\n  def init, do: :erlang.load_nif('./math_nif', 0)\n\n  def add(_a, _b), do: exit(:nif_not_loaded)\nend\n\n# Usage\nMathNif.add(3, 4)  # calls C directly\n\n# For more complex interop, use Ports (message-passing boundary)\nport = Port.open({:spawn, \"./my_c_program\"}, [:binary])\nsend(port, {self(), {:command, \"hello\"}})\nreceive do\n  {^port, {:data, response}} -> IO.puts(\"C replied: \" <> response)\nend",
          "explanation": "Elixir uses Erlang NIFs for in-process C and Ports for out-of-process workers. NIFs can block or crash the runtime if misused; Ports trade throughput for isolation via messaging. Pick NIFs for tight native loops you trust; Ports when a fault boundary matters."
        }
      ],
      "libraries": [
        {
          "name": "Hex",
          "url": "https://hex.pm/",
          "type": "Package manager"
        },
        {
          "name": "Phoenix",
          "url": "https://www.phoenixframework.org/",
          "type": "Web framework"
        }
      ],
      "docs": [
        {
          "name": "Elixir docs",
          "url": "https://elixir-lang.org/docs.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "x = 10",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "x = 10\nif x > 5, do: \"big\", else: \"small\"",
          "difficulty": "basic"
        },
        "loops": {
          "code": "Enum.each(0..4, fn i -> IO.inspect(i) end)",
          "difficulty": "basic"
        },
        "functions": {
          "code": "def double(n), do: n * 2",
          "difficulty": "basic"
        },
        "performance": {
          "code": "BEAM: huge concurrency via processes; raw number crunching may lag native code — profile, and use NIFs/ports when appropriate.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "a = \"interp #{1 + 1}\"\nb = \"\"\"\nheredoc\n\"\"\"",
          "difficulty": "basic"
        },
        "classes": {
          "code": "defmodule Point do\n  defstruct [:x, :y]\nend",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try do\n  raise \"boom\"\nrescue\n  e in RuntimeError -> IO.puts(e.message)\nend",
          "difficulty": "basic"
        },
        "imports": {
          "code": "import Enum, only: [map: 2]\nalias MyApp.User",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "elixir-tip-format-pass11",
          "title": "OTP and Elixir version pairs",
          "body": "Elixir apps are sensitive to Elixir/OTP pairing. Pin both in `.tool-versions` or Docker and match CI to production.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/elixir/",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/elixir",
          "type": "Practice track"
        }
      ],
      "categories": [
        "functional",
        "web"
      ],
      "overview": "A functional language on the BEAM (Erlang’s VM): lightweight processes, message passing, and OTP supervision patterns — Ruby-ish syntax, immutable data, and concurrency-first design without claiming automatic scale or zero downtime.",
      "learning_curve": "Moderate if you know Ruby — familiar syntax, but the BEAM concurrency model, immutability, and OTP supervision trees require new mental models. The community is welcoming and documentation is excellent.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Hex.pm for packages; Phoenix and LiveView are common web stacks. The BEAM shines at many concurrent tasks, fault isolation, and OTP supervision — but reliability still depends on how you design, deploy, and operate the system.",
      "common_use_cases": [
        "Web apps and APIs (e.g. Phoenix)",
        "Real-time channels / LiveView-style UIs",
        "Background jobs, messaging, and integrations",
        "Embedded and CLI tooling on the BEAM"
      ],
      "docs_url": "https://hexdocs.pm/elixir/",
      "paradigm_primary": "functional",
      "paradigm": [
        "functional",
        "concurrent",
        "distributed"
      ],
      "best_for": [
        "real-time web apps with Phoenix",
        "distributed fault-tolerant systems",
        "background job processing on the BEAM",
        "Fault-tolerant telephony and messaging backends on the BEAM VM"
      ],
      "weak_at": [
        "CPU-bound numeric workloads without NIF or Rust port offload",
        "Windows-centric teams without Erlang/OTP operational familiarity",
        "Single-threaded embedded firmware outside BEAM deployment models"
      ],
      "official_url": "https://elixir-lang.org/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic with optional typespecs and gradual typing tools on some projects",
        "runtime": "BEAM virtual machine (Erlang/OTP ecosystem)",
        "memory": "Garbage-collected per process on the BEAM"
      }
    },
    {
      "id": "clojure",
      "name": "Clojure",
      "color": "#5881D8",
      "description": "A Lisp for the JVM (and sibling hosts like ClojureScript on JS): immutable-by-default data, REPL-first workflow, macros, and first-class Java interop — expressive, but the parentheses-and-stacks mindset is a real team-fit filter.",
      "whoItIsFor": "JVM teams who want a data-oriented functional style, Lisp-experienced developers, and polyglots wiring services or tools where immutable collections and REPL iteration pay off — expect a smaller hiring/onboarding pool than Java or Kotlin shops.",
      "commonUses": [
        "HTTP services (Ring, Reitit, Pedestal)",
        "Data pipelines and ETL on the JVM",
        "Internal tools, CLIs, and REPL-driven ops",
        "ClojureScript front ends or full-stack (separate host)"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "(println \"Hello, World!\")",
          "explanation": "`println` is the usual quick console print; namespaces and `defn` come in as soon as you leave one-liners."
        },
        {
          "title": "Variable Assignment",
          "code": "(def x 10)",
          "explanation": "`def` binds a top-level var in a namespace; locals use `let [x 10] ...`. Values are immutable — you replace bindings, not mutate in place."
        },
        {
          "title": "Simple Function",
          "code": "(defn add [a b]\n  (+ a b))",
          "explanation": "`defn` defines a function; vectors are the parameter list; prefix calls (`+ a b`) are normal Lisp style."
        },
        {
          "title": "Call Java methods and interop with the JVM (FFI boundary)",
          "code": ";; Clojure runs on the JVM — Java interop is first-class\n\n;; Call a Java method directly\n(.indexOf \"hello world\" \"world\")  ; => 6\n\n;; Create a Java object and use it\n(def sb (StringBuilder. \"Hello\"))\n(.append sb \", Clojure!\")\n(.toString sb)  ; => \"Hello, Clojure!\"\n\n;; Use Java libraries\n(import '[java.time LocalDate])\n(def today (LocalDate/now))\n(.toString today)  ; => \"2026-07-04\"\n\n;; Define a Clojure function implementable from Java\n(defn greet [name]\n  (str \"Hello, \" name))",
          "explanation": "On the JVM, Clojure’s main native boundary is Java: dot/collection/constructor forms call into the same classpath your process loads. That unlocks most Java libraries, but you still manage versions, generics, nulls, and build tooling like any JVM shop — interop is strong, not magic."
        }
      ],
      "libraries": [
        {
          "name": "Clojars",
          "url": "https://clojars.org/",
          "type": "Package registry"
        },
        {
          "name": "Ring",
          "url": "https://github.com/ring-clojure/ring",
          "type": "HTTP library"
        }
      ],
      "docs": [
        {
          "name": "Clojure docs",
          "url": "https://clojure.org/reference/reader"
        }
      ],
      "compareData": {
        "variables": {
          "code": "(def x 10)",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "(let [x 10]\n  (if (> x 5) \"big\" \"small\"))",
          "difficulty": "basic"
        },
        "loops": {
          "code": "(doseq [i (range 5)]\n  (println i))",
          "difficulty": "basic"
        },
        "functions": {
          "code": "(defn square [n]\n  (* n n))",
          "difficulty": "basic"
        },
        "performance": {
          "code": "JVM: startup and warmup matter; GC and data structures dominate — great for many services, not a blanket “faster than X.”",
          "difficulty": "basic"
        },
        "strings": {
          "code": "(def s \"hello\")\n(str \"a\" \"b\")",
          "difficulty": "basic"
        },
        "classes": {
          "code": ";; records / deftype\n(defrecord Point [x y])",
          "difficulty": "basic"
        },
        "errors": {
          "code": "(try\n  (/ 1 0)\n  (catch ArithmeticException e (.getMessage e)))",
          "difficulty": "basic"
        },
        "imports": {
          "code": "(ns my.app (:require [clojure.string :as str]))",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "clojure-tip-recursion-and-immutability-are-the-defaults-not",
          "title": "Recursion and immutability are the defaults, not the extras",
          "body": "In Clojure, the cleanest code usually leans on recursion, pure functions, and immutable data. If you force an imperative style too early, you often make the program harder to reason about than the language intended.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "clojure-tip-macros-and-types-deserve-separate-debugging-stra",
          "title": "Macros and types deserve separate debugging strategies",
          "body": "Clojure can make abstraction powerful, but that also means errors can hide in macro expansion, type inference, or higher-order composition. Reduce the problem to a tiny expansion or value first, then rebuild the abstraction around it.",
          "tag": "compiler",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/clojure/",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/clojure",
          "type": "Practice track"
        }
      ],
      "categories": [
        "functional",
        "web",
        "data"
      ],
      "overview": "A Lisp for the JVM (and sibling hosts like ClojureScript on JS): immutable-by-default data, REPL-first workflow, macros, and first-class Java interop — expressive, but the parentheses-and-stacks mindset is a real team-fit filter.",
      "learning_curve": "Moderate to steep — Lisp syntax, immutability-by-default, and the macro system are powerful but unfamiliar to most developers. JVM interop adds Java knowledge requirements.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Leiningen and tools.deps (`deps.edn`) are common build paths; Clojars for packages. Healthy niches in HTTP services (Ring ecosystem, Reitit), data-oriented backends, and REPL-driven workflows — smaller mainstream footprint than Java/Kotlin, with a concentrated community.",
      "common_use_cases": [
        "HTTP services (Ring, Reitit, Pedestal)",
        "Data pipelines and ETL on the JVM",
        "Internal tools, CLIs, and REPL-driven ops",
        "ClojureScript front ends or full-stack (separate host)"
      ],
      "docs_url": "https://clojure.org/guides/getting_started",
      "paradigm_primary": "functional",
      "paradigm": [
        "functional",
        "concurrent"
      ],
      "best_for": [
        "data pipeline services on the JVM",
        "REPL-driven backend development",
        "Interactive data exploration",
        "Interactive REPL-driven development on JVM, CLR, or ClojureScript"
      ],
      "weak_at": [
        "Teams allergic to parentheses-heavy syntax and dynamic typing",
        "Mobile-native UI without JavaScript compilation targets",
        "Hard real-time loops where GC pauses must be bounded tightly"
      ],
      "official_url": "https://clojure.org/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic (optional type hints; Clojure.spec for validation)",
        "runtime": "Runs on the JVM (Clojure), JavaScript (ClojureScript), or native (ClojureCLR) depending on dialect",
        "memory": "Garbage-collected on the host runtime (JVM, JS engine, etc.)"
      }
    },
    {
      "id": "objective-c",
      "name": "Objective-C",
      "color": "#438EFF",
      "description": "Apple's object-oriented layer on C: Smalltalk-style `[receiver message]` dispatch on top of C syntax, historically central to macOS and iOS — today mostly legacy maintenance, mixed Swift codebases, and SDKs that still expose ObjC headers, not a typical choice for brand-new greenfield apps.",
      "whoItIsFor": "Maintainers extending older Apple-platform apps, teams bridging Swift and ObjC in the same targets, and anyone who must read Cocoa/Cocoa Touch-era code — fewer new hires train here first compared to Swift.",
      "commonUses": [
        "Legacy iOS and macOS apps",
        "Mixed Swift/ObjC modules and bridging headers",
        "System-style Apple development where ObjC APIs remain",
        "Maintaining libraries with long-lived ObjC public headers"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "#import <Foundation/Foundation.h>\n\nint main(int argc, const char * argv[]) {\n    @autoreleasepool {\n        NSLog(@\"Hello, World!\");\n    }\n    return 0;\n}",
          "explanation": "Foundation’s `NSLog` is the usual starter print path; `@autoreleasepool` scopes autorelease churn in CLI-style `main`."
        },
        {
          "title": "Variable Assignment",
          "code": "NSInteger count = 10;",
          "explanation": "Scalar locals look like C; object pointers use `NSString *`, `id`, etc., and naming conventions differ from other ecosystems."
        },
        {
          "title": "Simple Function",
          "code": "static NSInteger Add(NSInteger a, NSInteger b) {\n    return a + b;\n}",
          "explanation": "Plain C functions live in `.m` files; methods use `-` / `+` declarations inside `@interface` / `@implementation` blocks."
        },
        {
          "title": "objc_msgSend and C interop — the Objective-C boundary",
          "code": "// Objective-C calls C directly — it's a strict superset of C\n#include <stdio.h>\nprintf(\"From C: %d\\n\", 42);  // works in any .m file\n\n// The objc_msgSend boundary: every method call goes through the runtime\nid result = [obj performSelector:@selector(add:) withObject:@(3)];\n\n// Bridging to Swift (modern Objective-C interop)\n// NS_SWIFT_NAME(MathHelper.add(_:b:))\n+ (NSInteger)add:(NSInteger)a b:(NSInteger)b NS_SWIFT_NAME(add(a:b:));",
          "explanation": "Method calls are dynamic messages resolved by the Objective-C runtime (`objc_msgSend` in the ABI you target). C calls in `.m` files compile like C; messages add indirection and runtime metadata compared with a direct function call, though caches and the linker story vary by platform. Swift interop relies on annotated headers (`NS_SWIFT_NAME`, nullability) and module maps — useful, not automatic perfection."
        }
      ],
      "libraries": [
        {
          "name": "CocoaPods",
          "url": "https://cocoapods.org/",
          "type": "Package manager"
        },
        {
          "name": "Foundation",
          "url": "https://developer.apple.com/documentation/foundation",
          "type": "Core framework"
        }
      ],
      "docs": [
        {
          "name": "Apple Developer Docs",
          "url": "https://developer.apple.com/documentation/objectivec"
        }
      ],
      "compareData": {
        "variables": {
          "code": "NSInteger x = 10;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "NSInteger x = 10;\nif (x > 5) {\n    NSLog(@\"big\");\n} else {\n    NSLog(@\"small\");\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for (NSInteger i = 0; i < 5; i++) {\n    NSLog(@\"%ld\", (long)i);\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "static void Greet(void) {\n    NSLog(@\"Hello\");\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Native Apple toolchains; message send costs vs direct C calls — profile hot paths, especially when mixing ObjC, C, and Swift.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "@interface Point : NSObject\n@property (nonatomic) CGFloat x, y;\n- (instancetype)initWithX:(CGFloat)x y:(CGFloat)y;\n@end\n\n@implementation Point\n- (instancetype)initWithX:(CGFloat)x y:(CGFloat)y {\n    self = [super init];\n    if (self) { _x = x; _y = y; }\n    return self;\n}\n@end",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "NSString *greeting = @\"Hello\";\nNSString *name = @\"Objective-C\";\nNSString *full = [greeting stringByAppendingFormat:@\", %@!\", name];",
          "difficulty": "basic"
        },
        "errors": {
          "code": "NSError *error = nil;\nBOOL ok = [self performRiskyOp:&error];\nif (!ok) {\n    NSLog(@\"Error: %@\", error.localizedDescription);\n}",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "#import <Foundation/Foundation.h>\n#import \"MyClass.h\"",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "objective-c-tip-lifecycle-edges-are-where-mobile-code-breaks",
          "title": "Lifecycle edges are where mobile code breaks",
          "body": "With Objective-C, backgrounding, permissions, and lifecycle callbacks can matter more than the happy path. Test the resume/restart flow explicitly instead of only the first launch path.",
          "tag": "mobile",
          "status": "curated"
        }
      ],
      "categories": [
        "mobile"
      ],
      "overview": "Apple's object-oriented layer on C: Smalltalk-style `[receiver message]` dispatch on top of C syntax, historically central to macOS and iOS — today mostly legacy maintenance, mixed Swift codebases, and SDKs that still expose ObjC headers, not a typical choice for brand-new greenfield apps.",
      "learning_curve": "Moderate to steep — verbose syntax [obj message:arg], pointer management, and the Objective-C runtime concepts (selectors, dynamic dispatch). ARC simplifies memory but the mental model differs from C++/Swift.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Dominant Apple language before Swift (2014). Huge legacy surface on Apple platforms; new product code is usually Swift-first, but mixed targets and bridging remain common. CocoaPods and Swift Package Manager both show up in real repos; expect to read headers, module maps, and clang warnings when straddling languages.",
      "common_use_cases": [
        "Legacy iOS and macOS apps",
        "Mixed Swift/ObjC modules and bridging headers",
        "System-style Apple development where ObjC APIs remain",
        "Maintaining libraries with long-lived ObjC public headers"
      ],
      "docs_url": "https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/",
      "best_for": [
        "legacy iOS and macOS maintenance",
        "existing Objective-C codebase preservation",
        "Apple framework internals work",
        "Maintaining legacy Apple frameworks and mixed Swift/ObjC codebases"
      ],
      "weak_at": [
        "Greenfield Apple development where Swift is the default choice",
        "Cross-platform products targeting Windows or Android natively",
        "Teams seeking memory safety without manual retain/release discipline"
      ],
      "official_url": "https://developer.apple.com/documentation/objectivec",
      "paradigm": [
        "object-oriented",
        "imperative",
        "message-passing"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic messaging with static types when annotated (Apple toolchains)",
        "runtime": "Compiled to native code; Objective-C runtime on Apple platforms",
        "memory": "Automatic reference counting in modern Apple toolchains (manual retain/release still appears in older code)"
      }
    },
    {
      "id": "lisp",
      "name": "Lisp",
      "color": "#3A9EA2",
      "description": "A family label for languages built from S-expressions — prefix calls, homoiconic programs-as-data, and (in many stacks) macros. Common Lisp, Scheme, Racket, Emacs Lisp, and Clojure are all “Lisps” in different corners of the industry; they are not interchangeable: pick a dialect, then learn that ecosystem.",
      "whoItIsFor": "People extending Emacs (Emacs Lisp), students and researchers on a chosen Scheme/Racket/CL stack, DSL authors, and polyglots who already committed to a specific implementation — not “learn Lisp” as if one download covered every dialect.",
      "commonUses": [
        "Emacs customization and tooling (Emacs Lisp)",
        "CS teaching and small research prototypes (often Scheme/Racket-shaped)",
        "Common Lisp or Scheme services where the team already standardized",
        "Metaprogramming-heavy internal languages (dialect-dependent)"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "(format t \"Hello, World!~%\")",
          "explanation": "Common Lisp-style `format` to standard out; `print`/`write-line` also exist — exact I/O names differ by dialect."
        },
        {
          "title": "Variable Assignment",
          "code": "(let ((x 10))\n  (+ x 1))",
          "explanation": "`let` binds locals in Common Lisp; Scheme/Racket use similar binding forms with different scoping rules — there is no single universal “assignment” story across Lisps."
        },
        {
          "title": "Simple Function",
          "code": "(defun add (a b)\n  (+ a b))",
          "explanation": "`defun` defines a global function in Common Lisp; Scheme uses `define`, Racket uses `define` with a different module story, etc."
        },
        {
          "title": "FFI in Lisp implementations (CFFI in CL, varies by dialect)",
          "code": ";; Common Lisp: CFFI — the standard cross-implementation FFI\n;; (ql:quickload :cffi)\n(cffi:defcfun \"add\" :int (a :int) (b :int))\n(print (cffi:foreign-funcall \"add\" :int 3 :int 4 :int))  ;; 7\n\n;; Scheme (Guile): dynamic FFI\n;; (use-modules (system foreign))\n;; (dynamic-func \"add\" (dynamic-link \"./libmath\"))\n\n;; Note: FFI mechanisms vary by Lisp dialect and implementation.\n;; CFFI is the standard for Common Lisp; Scheme and Clojure have their own.",
          "explanation": "FFI is per dialect and implementation: Common Lisp often uses CFFI across SBCL/CCL/ECL, but you still ship and debug native libs yourself. Scheme/Racket/Guile each bring different FFI stories; Clojure’s boundary is usually the JVM, not CFFI. There is no one “Lisp FFI” — only the one your chosen runtime documents."
        }
      ],
      "libraries": [
        {
          "name": "Quicklisp",
          "url": "https://www.quicklisp.org/",
          "type": "Package manager"
        },
        {
          "name": "SBCL",
          "url": "https://www.sbcl.org/",
          "type": "Implementation"
        }
      ],
      "docs": [
        {
          "name": "Common Lisp HyperSpec",
          "url": "https://www.lispworks.com/documentation/HyperSpec/Front/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "(let ((x 10))\n  x)",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "(let ((x 10))\n  (if (> x 5) \"big\" \"small\"))",
          "difficulty": "basic"
        },
        "loops": {
          "code": "(dotimes (i 5)\n  (print i))",
          "difficulty": "basic"
        },
        "functions": {
          "code": "(defun square (n)\n  (* n n))",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Depends on dialect and implementation (native CL compilers vs small interpreters); macros help expressiveness, not automatic speed — benchmark your stack.",
          "difficulty": "basic"
        },
        "classes": {
          "code": ";; No class system in classic Lisp\n;; Common Lisp: CLOS (Common Lisp Object System)\n(defclass point ()\n  ((x :initarg :x :accessor point-x)\n   (y :initarg :y :accessor point-y)))\n\n;; Scheme: no standard object system (varies by implementation)",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "(defvar greeting \"Hello, Lisp!\")\n(format t \"~a\" greeting)  ; Common Lisp\n;; Strings are immutable in most implementations",
          "difficulty": "basic"
        },
        "errors": {
          "code": ";; Common Lisp: condition system (different style from try/catch)\n(handler-case\n    (risky-operation)\n  (error (c) (format t \"Caught: ~a~%\" c)))\n\n;; Scheme: guard / with-exception-handler",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": ";; Common Lisp\n(require :asdf)\n(asdf:load-system :cl-ppcre)\n\n;; Scheme\n(import (rnrs base))",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "lisp-tip-recursion-and-immutability-are-the-defaults-not",
          "title": "Recursion and immutability are the defaults, not the extras",
          "body": "In Lisp, the cleanest code usually leans on recursion, pure functions, and immutable data. If you force an imperative style too early, you often make the program harder to reason about than the language intended.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "lisp-tip-macros-and-types-deserve-separate-debugging-stra",
          "title": "Macros and types deserve separate debugging strategies",
          "body": "Lisp can make abstraction powerful, but that also means errors can hide in macro expansion, type inference, or higher-order composition. Reduce the problem to a tiny expansion or value first, then rebuild the abstraction around it.",
          "tag": "compiler",
          "status": "curated"
        }
      ],
      "categories": [
        "functional",
        "academic"
      ],
      "overview": "A family label for languages built from S-expressions — prefix calls, homoiconic programs-as-data, and (in many stacks) macros. Common Lisp, Scheme, Racket, Emacs Lisp, and Clojure are all “Lisps” in different corners of the industry; they are not interchangeable: pick a dialect, then learn that ecosystem.",
      "learning_curve": "Steep — prefix notation, deeply nested parentheses, and macro mental models differ by dialect (Common Lisp `defmacro` vs Scheme hygienic macros, etc.). Common Lisp is a large ANSI-shaped language; Scheme is smaller in the standard but implementations add their own pieces. Rewarding for language-oriented work once you commit to a specific stack.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Fragmented by design: Common Lisp (Quicklisp, SBCL, CCL, …), Scheme/Racket ecosystems, Emacs Lisp inside Emacs, Clojure on the JVM with its own tooling — related ideas, different package worlds. Historical AI ties show up in textbooks more than today’s mainstream hiring pipelines; expect smaller job markets outside niche teams.",
      "common_use_cases": [
        "Emacs customization and tooling (Emacs Lisp)",
        "CS teaching and small research prototypes (often Scheme/Racket-shaped)",
        "Common Lisp or Scheme services where the team already standardized",
        "Metaprogramming-heavy internal languages (dialect-dependent)"
      ],
      "docs_url": "https://www.lispworks.com/documentation/HyperSpec/Front/",
      "best_for": [
        "AI research and symbolic computation",
        "education in functional programming fundamentals",
        "metaprogramming and DSL construction",
        "Symbolic AI research, DSL experimentation, and macro-heavy metaprogramming"
      ],
      "weak_at": [
        "Mainstream product delivery with large hiring pools and libraries",
        "Static typing mandates across enterprise compliance environments",
        "Mobile-first consumer apps expecting polished UI framework ecosystems"
      ],
      "official_url": "https://common-lisp.net/",
      "paradigm": [
        "functional",
        "lisp",
        "meta-programming"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic (optional static checks in some dialects and tooling)",
        "runtime": "Interpreted or compiled to bytecode/native depending on implementation",
        "memory": "Garbage-collected in mainstream implementations"
      }
    },
    {
      "id": "fortran",
      "name": "Fortran",
      "color": "#4D41B1",
      "description": "The original scientific computing language — still dominant in HPC, weather modelling, and physics simulations.",
      "whoItIsFor": "Scientists and engineers running large-scale numerical simulations on supercomputers.",
      "commonUses": [
        "Weather/climate models",
        "Computational physics",
        "HPC",
        "Legacy scientific code"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "program hello\n  print *, 'Hello, World!'\nend program hello",
          "explanation": "program/end program block — Fortran programs start and end with explicit program boundaries."
        },
        {
          "title": "Arrays",
          "code": "real :: a(5) = [1.0, 2.0, 3.0, 4.0, 5.0]\nprint *, sum(a)",
          "explanation": "Built-in array operations — Fortran's whole-array syntax lets you multiply, add, and slice without loops."
        },
        {
          "title": "ISO_C_BINDING — call C from Fortran (FFI boundary)",
          "code": "program call_c\n  use iso_c_binding\n  implicit none\n\n  interface\n    ! Declare the C function signature\n    function c_add(a, b) bind(C, name=\"add\")\n      import :: c_int\n      integer(c_int), value :: a, b\n      integer(c_int) :: c_add\n    end function\n  end interface\n\n  print *, \"C says:\", c_add(3, 4)  ! 7\nend program call_c",
          "explanation": "Fortran 2003's iso_c_binding module provides portable interoperability with C. bind(C, name=\"...\") links a Fortran interface to a C function by name. integer(c_int) maps Fortran integers to C's int. This is how modern Fortran calls BLAS/LAPACK, system libraries, and any C code — the standard boundary for polyglot HPC pipelines."
        }
      ],
      "libraries": [
        {
          "name": "LAPACK",
          "url": "https://www.netlib.org/lapack/",
          "type": "Linear algebra"
        },
        {
          "name": "fpm",
          "url": "https://fpm.fortran-lang.org/",
          "type": "Package manager"
        }
      ],
      "docs": [
        {
          "name": "Fortran-lang",
          "url": "https://fortran-lang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "integer :: x = 10\nreal :: y = 3.14",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5) then\n  print *, 'big'\nelse\n  print *, 'small'\nend if",
          "difficulty": "basic"
        },
        "loops": {
          "code": "do i = 1, 5\n  print *, i\nend do",
          "difficulty": "basic"
        },
        "functions": {
          "code": "function add(a, b) result(c)\n  integer, intent(in) :: a, b\n  integer :: c\n  c = a + b\nend function",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiled; highly optimised for numerical array operations.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "! No class system — use modules with derived types\nmodule point_mod\n  type :: Point\n    real :: x, y\n  end type\ncontains\n  subroutine print_point(p)\n    type(Point), intent(in) :: p\n    print *, p%x, p%y\n  end subroutine\nend module",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "character(len=20) :: name\nname = 'Fortran'\nprint *, trim(name)  ! trim trailing blanks",
          "difficulty": "basic"
        },
        "errors": {
          "code": "integer :: ios\nopen(unit=10, file='data.txt', iostat=ios)\nif (ios /= 0) then\n  print *, 'Could not open file'\n  stop 1\nend if",
          "difficulty": "basic"
        },
        "imports": {
          "code": "use iso_fortran_env   ! standard intrinsic module\nuse my_module          ! user-defined module",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "fortran-tip-modules-and-iso-c",
          "title": "Modules and ISO_C_BINDING are the safe boundary",
          "body": "Prefer modules over old COMMON blocks for interfaces. When calling C, use iso_c_binding with explicit kinds — Fortran has no Rust-style unsafe keyword; the risk is silent ABI mismatch and compiler flag differences.",
          "tag": "interop",
          "status": "curated"
        },
        {
          "id": "fortran-tip-reproducible-numerics",
          "title": "Reproducibility is part of correctness",
          "body": "HPC results need the same compiler flags, math libraries, and input decks. Save the tiny case that fails so you can verify fixes after toolchain or BLAS upgrades.",
          "tag": "numerics",
          "status": "curated"
        }
      ],
      "categories": [
        "data",
        "systems"
      ],
      "overview": "The original scientific computing language — still dominant in HPC, weather modelling, and physics simulations. Scientists and engineers running large-scale numerical simulations on supercomputers.",
      "learning_curve": "Moderate for numerical work — array syntax is natural. The fixed-form legacy and archaic I/O conventions are the main hurdles. Modern Fortran (2003+) is much cleaner than FORTRAN 77.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Dominant in HPC, climate modelling, and computational physics. fpm (Fortran Package Manager) is growing. LFortran and gfortran are the main compilers. Interop with C via iso_c_binding is now standard practice.",
      "common_use_cases": [
        "Weather/climate models",
        "Computational physics",
        "HPC",
        "Legacy scientific code"
      ],
      "docs_url": "https://fortran-lang.org/learn/",
      "best_for": [
        "high-performance scientific computing",
        "legacy numerical simulation maintenance",
        "Weather and climate modelling",
        "High-performance numerical simulation and HPC scientific computing"
      ],
      "weak_at": [
        "Modern web services and rapid CRUD application development",
        "Interactive mobile or browser-first user experiences",
        "Teams without Fortran toolchain expertise or HPC cluster access"
      ],
      "official_url": "https://fortran-lang.org/",
      "paradigm": [
        "imperative",
        "procedural",
        "numeric"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static (strong numeric and array typing)",
        "runtime": "Compiled ahead-of-time to native machine code in typical scientific toolchains",
        "memory": "Stack and static storage common; allocatable arrays managed by the runtime",
        "abstraction": "High-level for numerical code; low-level when interfacing with C"
      }
    },
    {
      "id": "cobol",
      "name": "COBOL",
      "color": "#005CA5",
      "description": "A verbose, business-oriented language from 1959 — still processes trillions of dollars in banking transactions daily.",
      "whoItIsFor": "Mainframe developers maintaining banking, insurance, and government systems — still runs the bulk of the world's financial transaction processing.",
      "commonUses": [
        "Banking transactions",
        "Insurance processing",
        "Government systems",
        "Mainframe batch jobs"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "IDENTIFICATION DIVISION.\nPROGRAM-ID. HELLO.\nPROCEDURE DIVISION.\n  DISPLAY 'Hello, World!'.\n  STOP RUN.",
          "explanation": "Four divisions structure a COBOL program."
        },
        {
          "title": "Variables",
          "code": "DATA DIVISION.\nWORKING-STORAGE SECTION.\n01 WS-NAME PIC A(10) VALUE 'Ada'.\n01 WS-AGE  PIC 99 VALUE 36.",
          "explanation": "PIC defines the data picture (type and size)."
        },
        {
          "title": "CALL statement and CICS LINK — interop boundary",
          "code": "       CALL \"SUBPROG\" USING WS-INPUT WS-OUTPUT\n           ON EXCEPTION\n               DISPLAY \"Subprogram failed\"\n           END-CALL\n\n      * CICS interop (mainframe transaction boundary)\n      * EXEC CICS LINK PROGRAM(\"DB2PROG\")\n      *     COMMAREA(WS-COMM-AREA)\n      *     LENGTH(LENGTH OF WS-COMM-AREA)\n      * END-EXEC",
          "explanation": "COBOL's CALL statement invokes a separate program (subprogram) by name — this is its FFI boundary. Data is passed via USING clauses (by reference). On mainframes, EXEC CICS LINK connects programs through the CICS transaction monitor, passing COMMAREA (communication area) buffers. This is how COBOL systems call C, Java (JNI), or other COBOL programs in enterprise pipelines."
        }
      ],
      "libraries": [
        {
          "name": "GnuCOBOL",
          "url": "https://gnucobol.sourceforge.io/",
          "type": "Open-source compiler"
        }
      ],
      "docs": [
        {
          "name": "GnuCOBOL docs",
          "url": "https://gnucobol.sourceforge.io/faq/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "01 WS-X PIC 9(4) VALUE 10.",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "IF WS-X > 5\n  DISPLAY 'big'\nELSE\n  DISPLAY 'small'\nEND-IF.",
          "difficulty": "basic"
        },
        "loops": {
          "code": "PERFORM VARYING I FROM 1 BY 1 UNTIL I > 5\n  DISPLAY I\nEND-PERFORM.",
          "difficulty": "basic"
        },
        "functions": {
          "code": "* COBOL uses paragraphs/sections, not functions in the modern sense",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiled for mainframes; optimised for high-volume batch transaction processing.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "* No class system in traditional COBOL\n* Use COPY for reusable paragraphs and source includes\n* OO COBOL (2002+) has CLASS, but rarely used",
          "difficulty": "basic"
        },
        "strings": {
          "code": "01  WS-NAME      PIC X(20).\n    MOVE 'COBOL' TO WS-NAME\n    DISPLAY WS-NAME",
          "difficulty": "basic"
        },
        "errors": {
          "code": "    OPEN INPUT CUSTOMER-FILE\n    IF FILE-STATUS NOT = '00'\n       DISPLAY 'File open error: ' FILE-STATUS\n       STOP RUN\n    END-IF",
          "difficulty": "basic"
        },
        "imports": {
          "code": "    COPY 'copybook.cpy'.  * include shared data definitions\n    CALL 'CSPGM' USING WS-PARAMS.  * call another program",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "cobol-tip-dialect-and-runtime",
          "title": "Dialect and runtime beat “COBOL” as one language",
          "body": "Enterprise COBOL, Micro Focus, GnuCOBOL, and mainframe dialects disagree on extensions, copybooks, and file organizations. Confirm compiler, runtime, and EBCDIC/ASCII encoding before chasing logic bugs.",
          "tag": "tooling",
          "status": "curated"
        },
        {
          "id": "cobol-tip-pic-and-comp",
          "title": "PIC and COMP define the real data contract",
          "body": "Picture clauses and COMP/COMP-3 storage decide truncation and decimal behaviour. A DISPLAY that “looks right” can still be wrong in binary packed fields — reproduce with the same PIC layout as production.",
          "tag": "data",
          "status": "curated"
        }
      ],
      "categories": [
        "data"
      ],
      "overview": "A verbose, business-oriented language from 1959 — still processes trillions of dollars in banking transactions daily. Mainframe developers maintaining banking, insurance, and government systems — still runs the bulk of the world's financial transaction processing.",
      "learning_curve": "Steep for modern developers — fixed-column formatting, verbose DATA DIVISION syntax, and mainframe-specific concepts (JCL, CICS). Business domain experts often learn it faster than programmers trained on C-family languages.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Powers banking, insurance, and government systems worldwide. GnuCOBOL is the open-source compiler. IBM COBOL on z/OS dominates production. Modernization efforts wrap COBOL in REST APIs rather than rewrite.",
      "common_use_cases": [
        "Banking transactions",
        "Insurance processing",
        "Government systems",
        "Mainframe batch jobs"
      ],
      "docs_url": "https://gnucobol.sourceforge.io/",
      "best_for": [
        "mainframe transaction processing",
        "legacy banking and insurance systems",
        "COBOL-to-modern migration projects",
        "Maintaining mainframe banking, insurance, and payroll batch systems"
      ],
      "weak_at": [
        "Cloud-native microservices greenfield without migration constraints",
        "Startups optimizing for developer hiring velocity and modern stacks",
        "Interactive analytics dashboards without batch window dependencies"
      ],
      "official_url": "https://www.ibm.com/docs/en/cobol",
      "paradigm": [
        "imperative",
        "procedural",
        "business"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static with fixed decimal and record layouts in typical COBOL systems",
        "runtime": "Compiled ahead-of-time for batch and online transaction processing runtimes",
        "memory": "Managed by the COBOL runtime and file/record layouts; not a tracing GC language",
        "abstraction": "Business-data oriented; verbose but precise record handling"
      }
    },
    {
      "id": "matlab",
      "name": "MATLAB",
      "color": "#E16737",
      "description": "A commercial numerical computing environment — matrix operations, visualisation, and engineering toolboxes. Widely used in engineering, signal processing, and control systems.",
      "whoItIsFor": "Engineers, scientists, and students doing signal processing, control systems, and simulations.",
      "commonUses": [
        "Signal processing",
        "Control systems",
        "Image processing",
        "Engineering simulation"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "disp('Hello, World!')",
          "explanation": "disp() displays text or values in the console; fprintf gives more formatting control."
        },
        {
          "title": "Matrix",
          "code": "A = [1 2; 3 4];\nB = A * A;\ndisp(B)",
          "explanation": "Native matrix multiplication with * — MATLAB treats matrices as first-class citizens in the language."
        },
        {
          "title": "Plot",
          "code": "x = 0:0.1:2*pi;\nplot(x, sin(x));\ntitle('Sine Wave');",
          "explanation": "Built-in plotting functions like plot() and surf() create 2D and 3D visualisations instantly."
        },
        {
          "title": "Call a C function via MEX (data boundary)",
          "code": "% MATLAB side: call the MEX function\nresult = mymex_add([1 2 3], [4 5 6]);\n% disp(result) → [5 7 9]\n\n// C side: mymex_add.c\n#include \"mex.h\"\nvoid mexFunction(int nlhs, mxArray *plhs[],\n                 int nrhs, const mxArray *prhs[]) {\n    double *a = mxGetPr(prhs[0]);\n    double *b = mxGetPr(prhs[1]);\n    size_t n = mxGetNumberOfElements(prhs[0]);\n    plhs[0] = mxCreateDoubleMatrix(1, n, mxREAL);\n    double *out = mxGetPr(plhs[0]);\n    for (size_t i = 0; i < n; i++) {\n        out[i] = a[i] + b[i];\n    }\n}",
          "explanation": "MEX functions let MATLAB call C/C++ code directly. mxGetPr() reads a pointer to the double array inside an mxArray; mxCreateDoubleMatrix() allocates the output. Data crosses the MATLAB→C boundary as raw pointers — no serialization needed."
        }
      ],
      "libraries": [
        {
          "name": "MATLAB Toolboxes",
          "url": "https://www.mathworks.com/products.html",
          "type": "Official toolboxes"
        },
        {
          "name": "MATLAB documentation",
          "url": "https://www.mathworks.com/help/matlab/",
          "type": "Official"
        }
      ],
      "docs": [
        {
          "name": "MATLAB docs",
          "url": "https://www.mathworks.com/help/matlab/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "x = 10;\ny = 20;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5\n  disp('big')\nelse\n  disp('small')\nend",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for i = 1:5\n  disp(i)\nend",
          "difficulty": "basic"
        },
        "functions": {
          "code": "function r = add(a, b)\n  r = a + b;\nend",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Interpreted with JIT; vectorised operations are fast, loops less so.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "% MATLAB classes\nclassdef Person\n    properties\n        name\n        age\n    end\n    methods\n        function obj = Person(name, age)\n            obj.name = name;\n            obj.age = age;\n        end\n        function greet(obj)\n            disp(['Hello, I am ' obj.name]);\n        end\n    end\nend\n\n% Inheritance\nclassdef Student < Person\n    properties\n        school\n    end\n    methods\n        function obj = Student(name, age, school)\n            obj@Person(name, age);\n            obj.school = school;\n        end\n    end\nend",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "% MATLAB strings\nname = 'MATLAB';\ngreeting = ['Hello, ' name '!'];  % concatenation\n\n% String methods\nlength(name)            % 6\nupper(name)             % 'MATLAB'\nlower(name)             % 'matlab'\nstrrep(name, 'MAT', 'NEW')  % 'NEWLAB'\nstrfind(name, 'LAB')    % [3]\n\n% String array\nnames = ['Alice'; 'Bob'; 'Carol'];\ncellstr(names)          % Convert to cell array\n\n% sprintf\nmsg = sprintf('Score: %d, Name: %s', 100, 'Alice');",
          "difficulty": "basic"
        },
        "errors": {
          "code": "% MATLAB error handling\ntry\n    result = riskyOperation();\ncatch ME\n    fprintf('Error: %s\\n', ME.message);\n    % ME.identifier, ME.stack\nend\n\n% error function\nif x < 0\n    error('Input must be non-negative');\nend\n% error with identifier\nif isempty(data)\n    error('MyToolbox:EmptyInput', 'Input data is empty');\nend\n\n% assert\nassert(size(A, 1) == size(B, 1), 'Matrix dimensions must match');\n\n% warning (non-fatal)\nwarning('Deprecated API: use newFunction instead');\nwarning('MyToolbox:OldAPI', 'Using deprecated API');",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "% MATLAB imports\n% Add path to search\naddpath('/path/to/functions');\n\n% Import package functions\nimport mypackage.*;\nmyFunction();  % Direct call\n\n% Import specific function\nimport mypackage.utils.myHelper;\nmyHelper();\n\n% Clear imports\nclear import\n\n% Package\n% mypackage/+utils/myFunction.m\n% Call: mypackage.utils.myFunction()\n\n% Namespace via packages\n% Package folders start with +\n% +mypackage/+subpkg/myFunction.m\n\n% Note: MATLAB uses path-based imports,\n% not ES-style file imports.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "matlab-tip-indexing",
          "title": "Indexing is 1-based",
          "body": "The first element of an array is index 1, not 0. Off-by-one bugs are common when porting from C-family languages.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "matlab-tip-matrix",
          "title": "Operators lean toward matrix math",
          "body": "`*` and related operators follow linear-algebra rules for arrays. Element-wise work usually needs the dotted forms (for example `.*`). Check shape and orientation when dimensions disagree.",
          "tag": "common mistake",
          "status": "curated"
        }
      ],
      "categories": [
        "data"
      ],
      "overview": "A commercial numerical computing environment — matrix operations, visualisation, and engineering toolboxes. Widely used in engineering, signal processing, and control systems.",
      "learning_curve": "Very approachable for numeric work — matrix operations are built-in syntax. Toolboxes add domain-specific functions. Programming concepts (classes, packages) come later.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Proprietary and expensive; Octave is the free alternative. Dominant in engineering and academia. Python + NumPy is the main open-source competitor.",
      "common_use_cases": [
        "Signal processing",
        "Control systems",
        "Image processing",
        "Engineering simulation"
      ],
      "docs_url": "https://www.mathworks.com/help/matlab/",
      "best_for": [
        "numerical simulation and modelling",
        "Control system design",
        "signal and image processing research",
        "Control system design, signal processing, and Simulink modeling"
      ],
      "weak_at": [
        "Production web services without expensive license server dependencies",
        "Open-source-first teams avoiding proprietary runtime lock-in",
        "Large collaborative software products outside math-centric domains"
      ],
      "official_url": "https://www.mathworks.com/products/matlab.html",
      "paradigm": [
        "imperative",
        "numeric",
        "matrix"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Interpreted or bytecode-based in common implementations (engines vary)",
        "memory": "Garbage-collected in mainstream implementations",
        "abstraction": "High-level for typical scripting and application use"
      }
    },
    {
      "id": "zig",
      "name": "Zig",
      "color": "#f7a41d",
      "description": "A pragmatic systems language focused on simplicity and predictable behaviour. Think C with fewer foot-guns and a modern build story.",
      "whoItIsFor": "Systems programmers, game/tool authors, and anyone who wants C-level control without macro soup.",
      "commonUses": [
        "Systems tools",
        "Game engines",
        "Libraries",
        "Embedded-friendly code"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "const std = @import(\"std\");\n\npub fn main(init: std.process.Init) !void {\n    try std.Io.File.stdout().writeStreamingAll(init.io, \"Hello\\n\");\n}",
          "explanation": "Zig 0.16 passes a process Init with an I/O interface; stdout writes go through std.Io.File.stdout()."
        },
        {
          "title": "Constants",
          "code": "const x: i32 = 42;\nconst name = \"Ada\";",
          "explanation": "Immutable bindings with optional explicit types."
        },
        {
          "title": "Optional error handling",
          "code": "fn read() !void {\n    const f = try std.fs.cwd().openFile(\"data.txt\", .{});\n    defer f.close();\n}",
          "explanation": "`try` propagates errors; `defer` runs cleanup on scope exit."
        },
        {
          "title": "Structs",
          "code": "const Point = struct {\n    x: f32,\n    y: f32,\n};",
          "explanation": "Structs group fields; often used instead of classes."
        },
        {
          "title": "Export a C-compatible function and call C from Zig (FFI boundary)",
          "code": "// Export a Zig function callable from C\nexport fn zig_add(a: i32, b: i32) i32 {\n    return a + b;\n}\n\n// Call a C function from Zig — no wrapper needed\nconst c = @cImport({\n    @cInclude(\"stdio.h\");\n});\n\npub fn main() void {\n    const result = zig_add(3, 4);\n    _ = c.printf(\"zig_add(3, 4) = %d\\n\", result);\n}",
          "explanation": "Zig's export keyword produces a C-compatible symbol (no name mangling, C calling convention). @cImport parses C headers directly — no bindings file or build step needed. Zig and C share the same memory model, so structs and pointers cross the boundary with zero overhead. This makes Zig ideal as a C replacement in polyglot pipelines."
        }
      ],
      "libraries": [
        {
          "name": "Zig stdlib",
          "url": "https://ziglang.org/documentation/master/std/",
          "type": "Standard library"
        }
      ],
      "docs": [
        {
          "name": "Zig 0.16 Language Reference",
          "url": "https://ziglang.org/documentation/0.16.0/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "const x: i32 = 10;\nvar y: f64 = 3.14;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5) {\n    // ...\n} else {\n    // ...\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "var i: u8 = 0;\nwhile (i < 5) : (i += 1) { }\n\nfor (items) |it| { _ = it; }",
          "difficulty": "basic"
        },
        "functions": {
          "code": "fn add(a: i32, b: i32) i32 {\n    return a + b;\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiled to native code with LLVM; aims for C-like speed and explicit allocation.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "const Point = struct {\n    x: i32,\n    y: i32,\n    pub fn len(self: Point) f32 {\n        return @floatFromInt(self.x * self.x + self.y * self.y);\n    }\n};",
          "difficulty": "basic"
        },
        "strings": {
          "code": "const msg = \"hello\";  // *const [5:0]u8\nconst slice: []const u8 = \"dynamic\";",
          "difficulty": "basic"
        },
        "errors": {
          "code": "const File = std.fs.File;\nconst f = std.fs.cwd().openFile(\"data.txt\", .{}) catch |err| {\n    std.debug.print(\"failed: {}\\n\", .{err});\n    return;\n};",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "const std = @import(\"std\");\nconst mymod = @import(\"mymod.zig\");",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "zig-tip-the-compiler-removes-bug-classes-not-design-mist",
          "title": "The compiler removes bug classes, not design mistakes",
          "body": "Zig catches many memory and error-handling mistakes at compile time, but allocators, comptime, and API boundaries are still your design choices.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "categories": [
        "systems",
        "embedded"
      ],
      "overview": "A pragmatic systems language focused on simplicity and predictable behaviour. Think C with fewer foot-guns and a modern build story.",
      "learning_curve": "Moderate to steep — comptime, explicit allocators, and error unions are different from mainstream languages. Easier than Rust's borrow checker but more demanding than Go's GC world.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Young but growing; zig package manager is built-in. Cross-compilation is first-class. Used in Bun (JS runtime) and as a C/C++ build tool. Ecosystem is small compared to Rust or Go.",
      "common_use_cases": [
        "Systems tools",
        "Game engines",
        "Libraries",
        "Embedded-friendly code"
      ],
      "docs_url": "https://ziglang.org/documentation/0.16.0/",
      "paradigm_primary": "imperative",
      "paradigm": [
        "imperative",
        "structured"
      ],
      "best_for": [
        "C/C++ replacement and build system",
        "embedded systems with no hidden allocation",
        "cross-compilation with first-class support",
        "Systems programming with explicit allocators and comptime metaprogramming"
      ],
      "weak_at": [
        "Mature package ecosystems with thousands of ready-made libraries",
        "GUI-rich applications without substantial third-party widget stacks",
        "Teams needing stable language guarantees before 1.0 milestones"
      ],
      "official_url": "https://ziglang.org/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static with comptime, error unions, and optional types",
        "runtime": "Compiled ahead-of-time to native machine code via LLVM",
        "memory": "Manual by default — explicit allocators; no runtime garbage collector",
        "abstraction": "Low-level systems programming with comptime metaprogramming"
      }
    },
    {
      "id": "nim",
      "name": "Nim",
      "color": "#ffc200",
      "description": "A concise, compiled language with Python-like syntax and metaprogramming macros. Good for scripts that grow into real apps.",
      "whoItIsFor": "Developers who want readable code, speed, and easy C/C++ interop — ideal for game engines, CLI tools, and systems programming with Python-like syntax.",
      "commonUses": [
        "CLI tools",
        "Games",
        "Web backends",
        "Systems scripting"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "echo \"Hello, World!\"",
          "explanation": "Uses echo for stdout — Nim's built-in print procedure outputs with automatic string conversion."
        },
        {
          "title": "Variables",
          "code": "let x = 10\nvar y = 20\ny = 21",
          "explanation": "`let` is immutable; `var` is mutable."
        },
        {
          "title": "Procedures",
          "code": "proc greet(name: string): string =\n  \"Hello \" & name",
          "explanation": "Procedures return the last expression."
        },
        {
          "title": "Iterators",
          "code": "for i in 0..<5:\n  echo i",
          "explanation": "Ranges exclude the upper bound with `..<`."
        },
        {
          "title": "Call a C function via Nim's FFI (boundary)",
          "code": "{.emit: \"\"\"/* C code inlined */\"\"\".}\n\n# Import C functions directly — no wrapper needed\nproc puts(s: cstring): cint {.importc, header: \"<stdio.h>\".}\nproc add(a: cint, b: cint): cint {.importc.}\n\n# Export a Nim function as C-compatible\nproc nim_greet(name: cstring): cint {.exportc, dynlib.} =\n  echo \"Hello, \", $name\n  return 0\n\n# Usage\ndiscard puts(\"Hello from C via Nim\")\necho add(3, 4)",
          "explanation": "Nim compiles to C first, so FFI is seamless — {.importc, header: \"<stdio.h>\".} makes any C function available without a binding layer. {.exportc, dynlib.} exports Nim functions as C symbols for shared libraries. The {.emit.} pragma lets you embed raw C when needed. This zero-overhead boundary is Nim's key polyglot advantage."
        }
      ],
      "libraries": [
        {
          "name": "Nimble",
          "url": "https://github.com/nim-lang/nimble",
          "type": "Package manager"
        },
        {
          "name": "Jester",
          "url": "https://github.com/dom96/jester",
          "type": "Web framework"
        }
      ],
      "docs": [
        {
          "name": "Nim Manual",
          "url": "https://nim-lang.org/docs/manual.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "let x = 10\nvar y = 20",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5:\n  echo \"big\"\nelse:\n  echo \"small\"",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for i in 0..<5:\n  echo i",
          "difficulty": "basic"
        },
        "functions": {
          "code": "proc add(a, b: int): int = a + b",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiles to C; performance is typically close to C with sane defaults.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "type\n  Point = object\n    x, y: int\n  # Reference type\n  Dog = ref object\n    name: string\n    age: int",
          "difficulty": "basic"
        },
        "strings": {
          "code": "let a = \"hello\"        # string\nlet b = r\"raw\\nstring\"  # raw string literal\nlet c = fmt\"x={3 + 4}\" # formatted (import std/strformat)",
          "difficulty": "basic"
        },
        "errors": {
          "code": "proc safeDiv(a, b: int): int {.raises: [DivByZero].} =\n  if b == 0:\n    raise newException(DivByZero, \"division by zero\")\n  return a div b\n\ntry:\n  echo safeDiv(10, 0)\nexcept DivByZero:\n  echo \"caught: \", getCurrentExceptionMsg()",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "import std/strformat  # standard library module\nimport mymodule        # local module\nfrom std/os import getHomeDir  # selective import",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "nim-tip-format-pass11",
          "title": "GC/memory model and backend",
          "body": "Nim results depend on GC mode and C/JS/C++ backend. Pin compile flags before chasing logic bugs.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "categories": [
        "systems",
        "games"
      ],
      "overview": "A concise, compiled language with Python-like syntax and metaprogramming macros. Good for scripts that grow into real apps.",
      "learning_curve": "Moderate — Python-like syntax is inviting, but the macro system, pragmas, and compile-to-C model add depth. Multiple memory management strategies (GC, ARC, ORC) can confuse newcomers.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Nimble is the package manager. Compiles to C/C/JS. Strong for game dev (NimYAML, Nimterop). Small community but dedicated. Interop with C is zero-cost, which is its superpower.",
      "common_use_cases": [
        "CLI tools",
        "Games",
        "Web backends",
        "Systems scripting"
      ],
      "docs_url": "https://nim-lang.org/docs/manual.html",
      "best_for": [
        "systems programming with Python-like syntax",
        "metaprogramming-heavy codebases",
        "embedded and high-performance CLI tools",
        "Metaprogramming-heavy native utilities with Python-like syntax"
      ],
      "weak_at": [
        "Enterprise JVM or .NET shops without native compilation appetite",
        "Hard real-time firmware requiring formally verified subsets",
        "Mass hiring pipelines expecting mainstream language familiarity"
      ],
      "official_url": "https://nim-lang.org/",
      "paradigm": [
        "imperative",
        "metaprogramming",
        "systems"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static with generics and macros",
        "runtime": "Compiled ahead-of-time to native machine code in typical `nim c` workflows",
        "memory": "Garbage-collected, reference-counted, or manual depending on compiler settings and backend"
      }
    },
    {
      "id": "julia",
      "name": "Julia",
      "color": "#9558b2",
      "description": "A high-level language built for numerical and scientific computing, with performance from JIT compilation. Combines Python-like ease with C-like speed for heavy number-crunching.",
      "whoItIsFor": "Scientists, engineers, and data people who outgrow pure Python speed for tight loops.",
      "commonUses": [
        "Numerical computing",
        "ML research",
        "Data pipelines",
        "Physics / simulation"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "println(\"Hello, World!\")",
          "explanation": "Prints with a newline using println() — Julia's standard output function for text."
        },
        {
          "title": "Vectors",
          "code": "v = [1, 2, 3]\npush!(v, 4)",
          "explanation": "1-based indexing by default; `!` warns mutation."
        },
        {
          "title": "Functions",
          "code": "square(x) = x^2\nfunction add(a, b)\n  a + b\nend",
          "explanation": "Short one-line syntax or multi-line block form; Julia supports multiple dispatch on argument types."
        },
        {
          "title": "Broadcasting",
          "code": "xs = [1, 2, 3]\nys = xs .+ 10",
          "explanation": "Dot syntax applies operators element-wise."
        },
        {
          "title": "Call a C function via ccall (FFI boundary)",
          "code": "# Call libc's clock function\nelapsed = ccall(:clock, Int32, ())\n\n# Call a custom C function with arguments\n# Assumes: int add(int a, int b) in libmath.so\nresult = ccall((:add, \"libmath\"), Int32, (Int32, Int32), 3, 4)\nprintln(\"C says 3 + 4 = \", result)\n\n# Pass a Julia array to C (no copy)\narr = [1.0, 2.0, 3.0]\nccall((:sum_array, \"libmath\"), Cdouble,\n      (Ptr{Cdouble}, Csize_t), arr, length(arr))\n\n# Export a Julia function callable from C\n# Base.@ccallable function julia_greet(name::Cstring)::Cint\n#     println(\"Hello, \", unsafe_string(name))\n#     return 0\n# end",
          "explanation": "ccall is Julia's built-in FFI — call any C function by symbol name and library, with Julia types automatically converted at the boundary. Ptr{Cdouble} passes a raw pointer to Julia's array storage (no copy). @ccallable goes the other direction, exporting Julia functions for C callers. This is the data boundary for Julia in polyglot scientific pipelines."
        }
      ],
      "libraries": [
        {
          "name": "Plots.jl",
          "url": "https://github.com/JuliaPlots/Plots.jl",
          "type": "Plotting"
        },
        {
          "name": "Flux.jl",
          "url": "https://fluxml.ai/",
          "type": "ML"
        }
      ],
      "docs": [
        {
          "name": "Julia Documentation",
          "url": "https://docs.julialang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "x = 10\nconst PI = 3.14",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5\n    println(\"big\")\nelse\n    println(\"small\")\nend",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for i in 1:5\n    println(i)\nend",
          "difficulty": "basic"
        },
        "functions": {
          "code": "add(a, b) = a + b",
          "difficulty": "basic"
        },
        "performance": {
          "code": "JIT-compiled (LLVM). First run can be slow; hot loops approach native speed.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "struct Point\n    x::Float64\n    y::Float64\nend\n\n# Mutable struct (heap-allocated)\nmutable struct Counter\n    value::Int\n    Counter(v=0) = new(v)\nend",
          "difficulty": "basic"
        },
        "strings": {
          "code": "s = \"hello\"\ninterpolated = \"x = $(1 + 2)\"  # string interpolation\nraw = raw\"no\\\\escape\"        # raw string\nmulti = \"\"\"line 1\nline 2\"\"\"",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try\n    error(\"something went wrong\")\ncatch e\n    @warn \"caught\" exception=e\nfinally\n    println(\"cleanup\")\nend",
          "difficulty": "basic"
        },
        "imports": {
          "code": "using LinearAlgebra  # bring names into scope\nimport JSON           # qualify as JSON.parse\ninclude(\"helper.jl\")  # source file inclusion",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "julia-tip-format-pass11",
          "title": "Pkg environments and Julia version",
          "body": "Julia reproducibility needs a Project.toml/Manifest and matching Julia minor version. Activate the project before debugging numerics.",
          "tag": "repro",
          "status": "curated"
        }
      ],
      "categories": [
        "data",
        "systems"
      ],
      "overview": "A high-level language built for numerical and scientific computing, with performance from JIT compilation. Combines Python-like ease with C-like speed for heavy number-crunching.",
      "learning_curve": "Moderate for scientists — MATLAB-like syntax for arrays is welcoming, but multiple dispatch, type system, and performance gotchas (type stability, allocations) require deeper study.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Strong in scientific computing and data science. Pkg.jl is the package manager. First-class support for linear algebra and parallelism. Compile latency (time-to-first-plot) is the common pain point.",
      "common_use_cases": [
        "Numerical computing",
        "ML research",
        "Data pipelines",
        "Physics / simulation"
      ],
      "docs_url": "https://docs.julialang.org/",
      "best_for": [
        "high-performance numerical computing",
        "Scientific machine learning",
        "parallel data analysis workflows",
        "Scientific machine learning and differentiable programming research"
      ],
      "weak_at": [
        "Simple shared hosting web apps without compile-time latency",
        "Mobile client applications outside experimental JuliaMobile efforts",
        "Teams standardized on Python notebooks without JIT warmup tolerance"
      ],
      "official_url": "https://julialang.org/",
      "paradigm": [
        "multiple-dispatch",
        "numeric",
        "scientific"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Interpreted or bytecode-based in common implementations (engines vary)",
        "memory": "Garbage-collected in mainstream implementations",
        "abstraction": "High-level for typical scripting and application use"
      }
    },
    {
      "id": "crystal",
      "name": "Crystal",
      "color": "#c8c8d0",
      "description": "Ruby-inspired syntax with static types and LLVM compilation — aiming for friendly code and fast binaries. Feels like Ruby but catches errors at compile time.",
      "whoItIsFor": "Rubyists who want types and speed, or teams wanting readable compiled services — great for web APIs, CLI tools, and background workers.",
      "commonUses": [
        "Web APIs",
        "CLI tools",
        "Automation",
        "Prototypes that ship"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "puts \"Hello, World!\"",
          "explanation": "Similar to Ruby's puts but compiled to native code — static types inferred at compile time."
        },
        {
          "title": "Types",
          "code": "x : Int32 = 10\nname : String = \"Ada\"",
          "explanation": "Explicit types are common in APIs and structs."
        },
        {
          "title": "Blocks",
          "code": "3.times do |i|\n  puts i\nend",
          "explanation": "Blocks are closures passed to methods."
        },
        {
          "title": "Call C via Crystal's lib binding (FFI boundary)",
          "code": "@[Link(\"c\")]\nlib LibC\n  fun puts(s : UInt8*) : Int\n  fun add(a : Int32, b : Int32) : Int\nend\n\n# Call directly — no wrapper needed\nLibC.puts(\"Hello from C via Crystal\")\nresult = LibC.add(3, 4)\nputs result  # 7",
          "explanation": "Crystal's lib declarations bind C functions directly — @[Link] specifies the library, and fun declares the C signature. Crystal compiles to native code via LLVM, so there's zero marshalling overhead at the boundary. This is how Crystal achieves C-speed interop: declare the signature, link the library, call it like a Crystal method."
        }
      ],
      "libraries": [
        {
          "name": "Shards",
          "url": "https://shardbox.org/",
          "type": "Packages"
        },
        {
          "name": "Kemal",
          "url": "https://kemalcr.com/",
          "type": "Web"
        }
      ],
      "docs": [
        {
          "name": "Crystal Reference",
          "url": "https://crystal-lang.org/reference/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "x = 10\ny : Int64 = 20",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5\n  puts \"big\"\nelse\n  puts \"small\"\nend",
          "difficulty": "basic"
        },
        "loops": {
          "code": "5.times { |i| puts i }",
          "difficulty": "basic"
        },
        "functions": {
          "code": "def add(a : Int32, b : Int32)\n  a + b\nend",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiled with LLVM; generally fast for typical server workloads.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "class Point\n  getter x : Int32, y : Int32\n\n  def initialize(@x : Int32, @y : Int32)\n  end\n\n  def to_s\n    \"(#{x}, #{y})\"\n  end\nend",
          "difficulty": "basic"
        },
        "strings": {
          "code": "name = \"Crystal\"\nputs \"Hello, #{name}!\"   # interpolation\nputs 'No interpolation'  # single quotes = literal",
          "difficulty": "basic"
        },
        "errors": {
          "code": "begin\n  risky_operation\nrescue ex : ArgumentError\n  puts \"Error: #{ex.message}\"\nend",
          "difficulty": "basic"
        },
        "imports": {
          "code": "require \"json\"\nrequire \"http/client\"\n# Crystal bundles a standard library; shards add more",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "crystal-tip-ruby-look",
          "title": "Ruby-like syntax, compiled static types",
          "body": "Crystal reads close to Ruby but type-checks at compile time and emits native code. APIs and gems are not drop-in interchangeable — verify Crystal shards and the language reference rather than assuming Ruby behaviour.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "crystal-tip-nil",
          "title": "Nilable types need explicit handling",
          "body": "Union types with `Nil` require checks or flow typing before you call methods that need a real value. Ignoring nilability is a common compile-time failure for Ruby migrants.",
          "tag": "common mistake",
          "status": "curated"
        }
      ],
      "categories": [
        "web"
      ],
      "overview": "Ruby-inspired syntax with static types and LLVM compilation — aiming for friendly code and fast binaries. Feels like Ruby but catches errors at compile time.",
      "learning_curve": "Gentle if you know Ruby — very similar syntax with compile-time type checking. Type annotations and generics are the main additions. Compilation is slow (LLVM backend) but runtime is fast.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Shards is the package manager. Strong for web APIs (Amber, Lucky) and system tooling. Compiles to native binaries. Smaller ecosystem than Ruby but growing. Windows support is in progress.",
      "common_use_cases": [
        "Web APIs",
        "CLI tools",
        "Automation",
        "Prototypes that ship"
      ],
      "docs_url": "https://crystal-lang.org/reference/",
      "best_for": [
        "high-performance Ruby-like web apps",
        "API services with Shards ecosystem",
        "compiled-language performance with readable syntax",
        "Ruby-syntax native binaries with static type inference"
      ],
      "weak_at": [
        "Windows-first enterprises without strong Crystal platform support",
        "Ecosystems demanding mature ORM and cloud SDK breadth",
        "Gradual typing adoption inside large dynamic Ruby monoliths"
      ],
      "official_url": "https://crystal-lang.org/",
      "paradigm": [
        "object-oriented",
        "compiled",
        "ruby-like"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static with type inference",
        "runtime": "Compiled ahead-of-time to native machine code via LLVM",
        "memory": "Garbage-collected at runtime"
      }
    },
    {
      "id": "v",
      "name": "V",
      "color": "#5d87bf",
      "description": "A small, fast-compiling language that feels like a simplified Go/C mix—good for CLI tools and systems experiments.",
      "whoItIsFor": "Developers wanting tiny compile times and C interop — ideal for fast CLI tools, simple web backends, and educational programming projects.",
      "commonUses": [
        "CLI utilities",
        "Scripts compiled to a binary",
        "Cross-platform tools"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "fn main() {\n    println(\"Hello\")\n}",
          "explanation": "Entry point is main — V programs start with fn main(); the default backend uses garbage collection."
        },
        {
          "title": "Variables",
          "code": "x := 10\nmut y := 20\ny = 21",
          "explanation": "`:=` declares; `mut` allows reassignment."
        },
        {
          "title": "For loop",
          "code": "for i in 0 .. 5 {\n    println(i)\n}",
          "explanation": "Exclusive range in V — `0 .. 5` iterates 0 through 4; use `0 ..= 5` only when you need an inclusive upper bound."
        },
        {
          "title": "Call C directly via C. prefix (FFI boundary)",
          "code": "// V can call any C function — no binding file needed\nfn C.puts(s &char) int\nfn C.add(a int, b int) int\n\nfn main() {\n    C.puts(c'Hello from C via V')\n    println(C.add(3, 4))  // 7\n}\n\n// Link flags specified in the module\n#flag -I./include\n#flag -L./lib -lmath",
          "explanation": "V calls C functions with the C. prefix — declare the signature, add #flag for linking, and call. No FFI wrapper, no build step, no marshalling. V compiles to C first, so the boundary is essentially zero-cost. This makes V effective for systems programming and polyglot pipelines."
        }
      ],
      "libraries": [
        {
          "name": "vpm",
          "url": "https://vpm.vlang.io/",
          "type": "Packages"
        },
        {
          "name": "V docs",
          "url": "https://docs.vlang.io/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "V Documentation",
          "url": "https://docs.vlang.io/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "x := 10\nmut y := 20",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5 {\n    println('big')\n} else {\n    println('small')\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for i in 0 .. 4 {\n    println(i)\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "fn add(a int, b int) int {\n    return a + b\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiles quickly to C then native; aims for small binaries.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "struct Point {\n    x int\n    y int\n}\n\nfn (p Point) length() f64 {\n    return math.sqrt(f64(p.x * p.x + p.y * p.y))\n}",
          "difficulty": "basic"
        },
        "strings": {
          "code": "name := 'V language'\nprintln(name)\n// Strings are immutable byte arrays\nprintln(name[0])  // byte value",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Option type for recoverable errors\nresult := os.read_file('data.txt') or { println('File not found') return }\n\n// Result type with explicit error handling\nres := risky_op() or { panic(err) }",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "import os\nimport net.http\n// Local modules\nimport mymodule",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "systems"
      ],
      "overview": "A small, fast-compiling language that feels like a simplified Go/C mix—good for CLI tools and systems experiments. Developers wanting tiny compile times and C interop — ideal for fast CLI tools, simple web backends, and educational programming projects.",
      "learning_curve": "Gentle if you know Go or C — similar syntax with Python-like simplicity. Still evolving (pre-1.0); some features are experimental. Fast compilation.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Young and growing. Vpkg for packages. Compiles to C and JavaScript. Strong for CLI tools and web backends. Small community but active. Some API instability pre-1.0.",
      "common_use_cases": [
        "CLI utilities",
        "Scripts compiled to a binary",
        "Cross-platform tools"
      ],
      "docs_url": "https://docs.vlang.io/",
      "best_for": [
        "Simple systems programming",
        "GUI application prototyping",
        "Small CLI tools and scripts",
        "Simple systems utilities with fast compile times and small binaries"
      ],
      "weak_at": [
        "Production teams requiring battle-tested 1.x language stability",
        "Complex generic metaprogramming beyond V current feature set",
        "Large third-party library ecosystems comparable to Rust or Go"
      ],
      "official_url": "https://vlang.io/",
      "paradigm": [
        "imperative",
        "compiled",
        "simple"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static with limited generics and sum types",
        "runtime": "Compiles to C (or JavaScript) then to native code in typical workflows",
        "memory": "Garbage-collected by default; optional manual modes in some backends",
        "abstraction": "Simple systems-friendly syntax with GC by default"
      }
    },
    {
      "id": "solidity",
      "name": "Solidity",
      "color": "#627eea",
      "description": "The most common language for Ethereum smart contracts — money logic on a shared blockchain computer. Write once, deploy immutably, and trust the EVM to execute it.",
      "whoItIsFor": "Web3 developers building tokens, DeFi protocols, NFTs, and on-chain governance — the dominant language for Ethereum smart contracts.",
      "commonUses": [
        "Smart contracts",
        "Tokens",
        "DAOs",
        "On-chain games"
      ],
      "patterns": [
        {
          "title": "Contract skeleton",
          "code": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Counter {\n    uint256 public count;\n    function inc() external {\n        count += 1;\n    }\n}",
          "explanation": "State lives on-chain; functions can be called externally."
        },
        {
          "title": "Mappings",
          "code": "mapping(address => uint256) public balances;",
          "explanation": "Key-value store in contract storage."
        },
        {
          "title": "External call and calldata boundary (contract interop)",
          "code": "// Call another contract — the EVM boundary\ninterface IReceiver {\n    function processPayment(uint256 amount) external returns (bool);\n}\n\ncontract Caller {\n    function pay(address receiver, uint256 amount) external {\n        // Low-level call with calldata encoding\n        (bool ok, bytes memory data) = receiver.call(\n            abi.encodeWithSignature(\"processPayment(uint256)\", amount)\n        );\n        require(ok, \"External call failed\");\n\n        // Or type-safe call via interface\n        bool result = IReceiver(receiver).processPayment(amount);\n        require(result, \"Payment rejected\");\n    }\n}",
          "explanation": "Solidity's external call is the EVM boundary — contracts communicate via abi.encodeWithSignature which serializes function name and arguments into calldata. The callee's state changes are atomic: if it reverts, the entire transaction reverts. This is how Solidity orchestrates multi-contract (polyglot) pipelines on-chain."
        }
      ],
      "libraries": [
        {
          "name": "OpenZeppelin",
          "url": "https://www.openzeppelin.com/contracts",
          "type": "Security libraries"
        },
        {
          "name": "Hardhat",
          "url": "https://hardhat.org/",
          "type": "Dev environment"
        }
      ],
      "docs": [
        {
          "name": "Solidity docs",
          "url": "https://docs.soliditylang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "uint256 x = 10;\naddress owner = msg.sender;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5) {\n    // ...\n} else {\n    // ...\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for (uint256 i = 0; i < 5; i++) { }",
          "difficulty": "basic"
        },
        "functions": {
          "code": "function add(uint256 a, uint256 b) pure returns (uint256) {\n    return a + b;\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Runs on the EVM; gas cost matters more than raw CPU speed.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "// No classes — use contracts and structs\ncontract Token {\n    struct Holder {\n        address account;\n        uint256 balance;\n    }\n    mapping(address => Holder) public holders;\n}",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "// No native string type in EVM — use bytes or string\n// Strings are UTF-8 encoded byte arrays\nstring public name = \"Solidity\";\nbytes32 public short = bytes32(bytes(\"short\"));  // fixed-size",
          "difficulty": "intermediate"
        },
        "errors": {
          "code": "// require: revert on condition failure\nrequire(balance >= amount, \"Insufficient balance\");\n\n// revert: explicit rollback\nrevert(\"Something went wrong\");\n\n// try/catch for external calls\ntry externalContract.method() {\n    // success\n} catch Error(string memory reason) {\n    // handle revert reason\n}",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "import \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"./LocalContract.sol\";\n// No npm — use package manager or git submodules",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "solidity-tip-compiler-and-reentrancy",
          "title": "Pin solc + EVM; treat reentrancy as default risk",
          "body": "Lock the Solidity compiler and target EVM version in config. External calls can re-enter — prefer checks-effects-interactions, pull payments, and audited patterns over clever one-shot transfers.",
          "tag": "security",
          "status": "curated"
        }
      ],
      "categories": [
        "blockchain"
      ],
      "overview": "The most common language for Ethereum smart contracts — money logic on a shared blockchain computer. Write once, deploy immutably, and trust the EVM to execute it. Web3 developers building tokens, DeFi protocols, NFTs, and on-chain governance — the dominant language for Ethereum smart contracts.\n\nTypical projects include Smart contracts, Tokens, DAOs. Hardhat and Foundry dominate dev workflows; security auditing is essential before mainnet deployment on Ethereum and L2s.",
      "learning_curve": "Steep — the EVM execution model, gas costs, and security pitfalls (reentrancy, overflow) make it harder than typical languages. Solidity syntax itself is C-like and approachable; the environment is the challenge.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Hardhat and Foundry are the dominant dev frameworks. OpenZeppelin provides audited building blocks. Ethereum mainnet and L2s are the deployment targets. Security auditing is essential before mainnet deployment.",
      "common_use_cases": [
        "Smart contracts",
        "Tokens",
        "DAOs",
        "On-chain games"
      ],
      "docs_url": "https://docs.soliditylang.org/",
      "best_for": [
        "smart contract development on Ethereum",
        "decentralised finance protocol authoring",
        "token and NFT standard implementation",
        "Ethereum smart contracts for DeFi protocols and token standards"
      ],
      "weak_at": [
        "General-purpose off-chain application backends without blockchain overhead",
        "Compute-heavy algorithms where gas costs dominate feasibility",
        "Teams needing conventional file I/O and OS APIs outside chain constraints"
      ],
      "official_url": "https://soliditylang.org/",
      "paradigm": [
        "imperative",
        "contract-oriented",
        "EVM"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static in mainstream smart-contract toolchains",
        "runtime": "Executed on the Ethereum Virtual Machine (EVM) and EVM-compatible chains",
        "memory": "Managed by the EVM (gas-metered contract storage; not a general-purpose OS heap)"
      }
    },
    {
      "id": "ocaml",
      "name": "OCaml",
      "color": "#ec6813",
      "description": "A functional-first language with strong types and great pattern matching—used in compilers and formal tooling.",
      "whoItIsFor": "People who like ML-family languages and want industrial-strength modules — used in compiler toolchains, financial systems, and formal verification.",
      "commonUses": [
        "Compilers",
        "Formal methods",
        "Financial tooling",
        "Teaching FP"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "print_endline \"Hello\"",
          "explanation": "Prints a line to stdout via Printf.printf — OCaml's typed printf ensures format-string safety."
        },
        {
          "title": "Let bindings",
          "code": "let x = 10 in\nx + 1",
          "explanation": "let ... in scopes values — OCaml's let bindings are immutable by default and lexically scoped."
        },
        {
          "title": "Pattern match",
          "code": "match lst with\n| [] -> 0\n| h :: t -> h",
          "explanation": "Exhaustive matching on variants and lists."
        },
        {
          "title": "Call a C function via OCaml's FFI (foreign function interface)",
          "code": "(* OCaml side: declare the C function *)\nexternal c_add : int -> int -> int = \"c_add\"\nexternal c_puts : string -> unit = \"c_puts\"\n\nlet () =\n  let result = c_add 3 4 in\n  Printf.printf \"C says: %d\\n\" result\n\n(* C side (compiled as libmath_stubs.c):\n   #include <caml/mlvalues.h>\n   #include <caml/alloc.h>\n   CAMLprim value c_add(value a, value b) {\n     return Val_int(Int_val(a) + Int_val(b));\n   }\n*)",
          "explanation": "OCaml's external declarations map C functions via naming convention — OCaml looks for a C function with the same name. Value constructors (Val_int, Int_val) convert between OCaml and C representations. C stubs are compiled into a shared library that OCaml loads at link time. This is the boundary for OCaml in polyglot systems."
        }
      ],
      "libraries": [
        {
          "name": "opam",
          "url": "https://opam.ocaml.org/",
          "type": "Package manager"
        },
        {
          "name": "Dune",
          "url": "https://dune.build/",
          "type": "Build"
        }
      ],
      "docs": [
        {
          "name": "OCaml manual",
          "url": "https://ocaml.org/docs"
        }
      ],
      "compareData": {
        "variables": {
          "code": "let x = 10\nlet y : int = 20",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5 then \"big\" else \"small\"",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for i = 0 to 4 do\n  ()\ndone",
          "difficulty": "basic"
        },
        "functions": {
          "code": "let add a b = a + b",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Native compilation via OCaml compiler; predictable performance for many workloads.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "let a = \"s\" in\nString.concat \",\" [\"a\";\"b\"]",
          "difficulty": "basic"
        },
        "classes": {
          "code": "type point = { x : int; y : int }",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try failwith \"x\" with Failure m -> print_endline m",
          "difficulty": "basic"
        },
        "imports": {
          "code": "open List\nmodule M = Map.Make(String)",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "ocaml-tip-format-pass11",
          "title": "opam switch isolation",
          "body": "OCaml builds fail when the wrong opam switch is active. Recreate the switch from the lockfile before blaming the code.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/ocaml/",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/ocaml",
          "type": "Practice track"
        }
      ],
      "categories": [
        "functional"
      ],
      "overview": "A functional-first language with strong types and great pattern matching—used in compilers and formal tooling. People who like ML-family languages and want industrial-strength modules — used in compiler toolchains, financial systems, and formal verification.",
      "learning_curve": "Moderate to steep — ML-family type inference, pattern matching, and the module system are powerful but unfamiliar to imperative programmers. Jane Street's real-world use proves it in production.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "opam is the package manager. Used heavily at Jane Street (finance), Tezos (blockchain), and MirageOS (unikernels). Dune is the modern build system. Multicore OCaml (5.0+) adds true parallelism.",
      "common_use_cases": [
        "Compilers",
        "Formal methods",
        "Financial tooling",
        "Teaching FP"
      ],
      "docs_url": "https://ocaml.org/docs",
      "best_for": [
        "compiler and formal verification tooling",
        "financial trading system domain logic",
        "type-safe systems with strong inference",
        "Compiler tooling, static analysis, and theorem-prover adjacent projects"
      ],
      "weak_at": [
        "Mainstream CRUD web shops without FP hiring pipelines",
        "Windows GUI products outside limited OCaml native UI bindings",
        "Dynamic REPL-first data science workflows expecting NumPy ecosystems"
      ],
      "official_url": "https://ocaml.org/",
      "paradigm": [
        "functional",
        "imperative",
        "static"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static (often with type inference)",
        "runtime": "Compiled to native code or bytecode; implementation and runtime vary by compiler",
        "memory": "Garbage-collected in most mainstream compilers"
      }
    },
    {
      "id": "fsharp",
      "name": "F#",
      "color": "#378bba",
      "description": "A functional-first .NET language — great for data scripts, domain modelling, and safe concurrent workflows. Also supports OO when you need it.",
      "whoItIsFor": "Teams on .NET who want expressive FP with full interop to C# libraries — strong for data pipelines, web APIs, and domain modeling.",
      "commonUses": [
        "Data processing",
        "Web (Giraffe/Saturn)",
        "Financial models",
        "Tooling"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "printfn \"Hello\"",
          "explanation": "Prints with newline via printfn; F# pipelines this into concise, readable data transformations."
        },
        {
          "title": "Records",
          "code": "type Person = { Name: string; Age: int }\nlet u = { Name = \"Ada\"; Age = 36 }",
          "explanation": "Immutable records by default — lightweight named tuples that compare by value, not reference."
        },
        {
          "title": "Pipelines",
          "code": "[1..5]\n|> List.map (fun x -> x * 2)\n|> List.sum",
          "explanation": "Forward pipe chains transformations."
        },
        {
          "title": "Call native C via P/Invoke and interop with .NET (FFI boundary)",
          "code": "// F# can call C via the same P/Invoke mechanism as C#\nopen System.Runtime.InteropServices\n\nmodule Native =\n    [<DllImport(\"libc.so.6\", EntryPoint = \"puts\")>]\n    extern int puts(string s)\n\n    // Use .NET libraries directly\n    let json = System.Text.Json.JsonSerializer.Serialize {| name = \"F#\"; version = 8 |}\n    printfn \"JSON: %s\" json\n\n// Call the C function\nNative.puts(\"Hello from C via F#\")",
          "explanation": "F# uses the same P/Invoke mechanism as other .NET languages for calling C libraries. The `extern` declaration maps the C signature, and the `DllImport` value here names a Linux `libc` example — actual library names vary by OS and deployment. F# can consume many .NET libraries and usually interoperate well with C# code, but framework assumptions, packaging, and target runtimes still matter at the boundary."
        }
      ],
      "libraries": [
        {
          "name": "FSharp.Data",
          "url": "https://fsprojects.github.io/FSharp.Data/",
          "type": "Data access"
        },
        {
          "name": "Giraffe",
          "url": "https://github.com/giraffe-fsharp/Giraffe",
          "type": "Web"
        }
      ],
      "docs": [
        {
          "name": "F# docs",
          "url": "https://learn.microsoft.com/dotnet/fsharp/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "let x = 10\nlet mutable y = 20\ny <- 21",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5 then \"big\" else \"small\"",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for i in 1 .. 5 do\n    printfn \"%i\" i",
          "difficulty": "basic"
        },
        "functions": {
          "code": "let add a b = a + b",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Runs on .NET; many workloads land in the same ballpark as C#, but JIT warmup, allocations, libraries, and numeric/native hotspots still shape real performance.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "let a = \"s\"\nlet b = $\"tpl {1+1}\"",
          "difficulty": "basic"
        },
        "classes": {
          "code": "type Point = { X: int; Y: int }",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try\n  failwith \"x\"\nwith | ex -> printfn \"%s\" ex.Message",
          "difficulty": "basic"
        },
        "imports": {
          "code": "open System\nopen System.IO",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "fsharp-tip-immutability",
          "title": "Immutability is the default habit",
          "body": "Bindings with `let` are immutable by default. Prefer transforming data with expressions and pipelines; reach for `mutable` only when you have a clear local reason.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "fsharp-tip-option",
          "title": "Model missing values with Option",
          "body": "`Option` (`Some`/`None`) is the usual way to represent absence. Pattern-match or use Option modules instead of null for domain data when you control the types.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/fsharp/",
      "practiceLinks": [
        {
          "name": "Exercism",
          "url": "https://exercism.org/tracks/fsharp",
          "type": "Practice track"
        }
      ],
      "categories": [
        "functional",
        "web",
        "data"
      ],
      "overview": "A functional-first .NET language — great for data scripts, domain modelling, and safe concurrent workflows. Also supports OO when you need it.",
      "learning_curve": "Moderate — functional-first but multi-paradigm. Easier than Haskell for OOP developers; the F# REPL and type inference help. Interop with C# is seamless.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "NuGet for packages. Strong in finance, data science, and web (Giraffe, Saturn). .NET ecosystem is a huge advantage. Smaller community than C# but very active.",
      "common_use_cases": [
        "Data processing",
        "Web (Giraffe/Saturn)",
        "Financial models",
        "Tooling"
      ],
      "docs_url": "https://learn.microsoft.com/dotnet/fsharp/",
      "best_for": [
        ".NET functional-first programming",
        "data-centric financial modelling",
        "type-safe web services on .NET",
        "Data-oriented .NET services with concise pipeline-oriented syntax"
      ],
      "weak_at": [
        "Cross-platform mobile UI without Xamarin or MAUI involvement",
        "Teams standardized on C# with heavy OOP inheritance hierarchies",
        "Browser-only front ends without Fable or Bolero compilation steps"
      ],
      "official_url": "https://fsharp.org/",
      "paradigm": [
        "functional",
        "object-oriented",
        ".NET"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static",
        "runtime": ".NET runtime (JIT or ahead-of-time depending on deployment)",
        "memory": "Garbage-collected",
        "abstraction": "High-level"
      }
    },
    {
      "id": "erlang",
      "name": "Erlang",
      "color": "#a90533",
      "description": "A BEAM language with roots in telecom: tiny isolated processes, message passing, and OTP supervision patterns — those tools help you design for failure, but they do not replace capacity planning, deployments, or bug-free code.",
      "whoItIsFor": "Backend engineers on OTP/BEAM who want soft-real-time messaging and isolation primitives — teams still own outages, backpressure, and data correctness.",
      "commonUses": [
        "Telecom",
        "Messaging infrastructure",
        "OTP services",
        "Distributed systems"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "io:format(\"Hello~n\", []).",
          "explanation": "io:format/2 prints formatted text — the ~n control sequence adds a newline."
        },
        {
          "title": "Atoms & tuples",
          "code": "{ok, Value} = {ok, 42}.",
          "explanation": "Pattern match tuples; atoms are lightweight constants."
        },
        {
          "title": "Spawn process",
          "code": "Pid = spawn(fun() -> io:format(\"hi~n\", []) end).",
          "explanation": "Lightweight concurrency primitive — spawn creates an Erlang process that shares no memory."
        },
        {
          "title": "Call a C function via a NIF (Native Implemented Function)",
          "code": "%% Erlang side: load the NIF\n-module(math_nif).\n-export([add/2]).\n-nifs([add/2]).\n-on_load(init/0).\n\ninit() ->\n    erlang:load_nif(\"./math_nif\", 0).\n\nadd(_A, _B) ->\n    erlang:nif_error(\"NIF not loaded\").\n\n%% C side (math_nif.c)\n%% #include <erl_nif.h>\n%% static ERL_NIF_TERM add(ErlNifEnv* env, int argc,\n%%     const ERL_NIF_TERM argv[]) {\n%%   int a, b;\n%%   enif_get_int(env, argv[0], &a);\n%%   enif_get_int(env, argv[1], &b);\n%%   return enif_make_int(env, a + b);\n%% }\n%% static ErlNifFunc nif_funcs[] = {{\"add\", 2, add}};\n%% ERL_NIF_INIT(math_nif, nif_funcs, NULL, NULL, NULL, NULL);",
          "explanation": "NIFs let Erlang call C for hot paths. The module loads the `.so`/`.dylib` on `-on_load`; C uses `erl_nif.h` to marshal types. NIFs run on the runtime’s scheduler threads — long or buggy native code can block scheduling or crash the VM, so treat them as a sharp edge, not a free speed boost."
        }
      ],
      "libraries": [
        {
          "name": "OTP",
          "url": "https://www.erlang.org/doc/design_principles/des_princ.html",
          "type": "Framework"
        },
        {
          "name": "Rebar3",
          "url": "https://rebar3.org/",
          "type": "Build"
        }
      ],
      "docs": [
        {
          "name": "Erlang docs",
          "url": "https://www.erlang.org/doc/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "X = 10.\nY = 20.",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if X > 5 -> big; true -> small end.",
          "difficulty": "basic"
        },
        "loops": {
          "code": "lists:foreach(fun(I) -> io:format(\"~p~n\", [I]) end, lists:seq(1,5)).",
          "difficulty": "basic"
        },
        "functions": {
          "code": "add(A, B) -> A + B.",
          "difficulty": "basic"
        },
        "performance": {
          "code": "BEAM VM tuned for concurrency and latency, not raw number crunching.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "A = <<\"binary\">>.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "-record(point, {x, y}).",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try 1/0 catch error:badarith -> ok end.",
          "difficulty": "basic"
        },
        "imports": {
          "code": "-import(lists, [map/2]).",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "erl-tip-immutable",
          "title": "Data is immutable; processes hold state",
          "body": "You do not mutate variables in place. To “update” state, a process typically receives a message, computes a new value, and continues with that value in the next recursion or loop.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "erl-tip-let-it-crash",
          "title": "Prefer supervision over silent recovery",
          "body": "OTP culture often isolates failures in processes and restarts them under a supervisor instead of catching every error locally. That only works if you design clear process boundaries and restart strategies.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "quickTourUrl": "https://learnxinyminutes.com/docs/erlang/",
      "categories": [
        "functional",
        "web"
      ],
      "overview": "A BEAM language with roots in telecom: tiny isolated processes, message passing, and OTP supervision patterns — those tools help you design for failure, but they do not replace capacity planning, deployments, or bug-free code.",
      "learning_curve": "Steep — functional, concurrent, no shared state, and the OTP framework are very different from mainstream languages. Fault-tolerance patterns are powerful but demand new thinking; they improve isolation, not eliminate outages by decree.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Strong heritage in telecom (e.g. Ericsson) and messaging systems; RabbitMQ and many stacks touch BEAM ecosystems. Rebar3 is the common Erlang build tool; Hex.pm hosts packages used from Rebar3 and from Elixir/Mix — not an Erlang-exclusive package story. OTP documents supervision; NIFs and ports are the usual native boundaries.",
      "common_use_cases": [
        "Telecom",
        "Messaging infrastructure",
        "OTP services",
        "Distributed systems"
      ],
      "docs_url": "https://www.erlang.org/doc/",
      "best_for": [
        "telecom-grade concurrent systems",
        "soft real-time messaging infrastructure",
        "fault-tolerant distributed databases",
        "Telecom-grade fault-tolerant switches and messaging switches on OTP"
      ],
      "weak_at": [
        "CPU-bound numeric kernels without NIF offload to C or Rust",
        "Single-binary CLI tools where BEAM startup overhead feels heavy",
        "Windows desktop products outside WSL or cross-platform Erlang ports"
      ],
      "official_url": "https://www.erlang.org/",
      "paradigm": [
        "functional",
        "concurrent",
        "actor-model"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic with optional typespecs and Dialyzer static analysis (not gradual typing by default)",
        "runtime": "BEAM virtual machine (Erlang/OTP ecosystem)",
        "memory": "Garbage-collected per process on the BEAM"
      }
    },
    {
      "id": "gleam",
      "name": "Gleam",
      "color": "#ffaff3",
      "description": "A friendly language for the BEAM (Erlang VM) with static types — Erlang reliability with clearer errors. No nulls, no exceptions, just Result types and pattern matching.",
      "whoItIsFor": "Teams wanting BEAM ecosystem reliability with ML-style type safety — ideal for building fault-tolerant, concurrent services on Erlang/OTP.",
      "commonUses": [
        "Web services on BEAM",
        "Reliable backends",
        "Interop with Erlang/Elixir"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "import gleam/io\n\npub fn main() {\n  io.println(\"Hello\")\n}",
          "explanation": "Modules group functions; a main entry point is the conventional starting function."
        },
        {
          "title": "Results",
          "code": "import gleam/result\n\nfn safe_div(a, b) {\n  case b {\n    0 -> Error(Nil)\n    _ -> Ok(a / b)\n  }\n}",
          "explanation": "Explicit Result instead of exceptions."
        },
        {
          "title": "Erlang/BEAM interop — calling Erlang from Gleam",
          "code": "// Gleam compiles to Erlang bytecode — Erlang interop is first-class\n// Use @external to declare Erlang functions Gleam can call\n@external(erlang, \"math\", \"sqrt\")\npub fn square_root(x: Float) -> Float\n\n// Call any Erlang module directly\npub fn erlang_now() -> Int {\n  erlang.system_time(erlang.Millisecond)\n}\n\n// The @external attribute is Gleam's FFI boundary:\n// it maps a Gleam function signature to an Erlang module+function.\n// This lets Gleam call any Erlang/OTP function or C NIF\n// already available on the BEAM.",
          "explanation": "Gleam's boundary is the BEAM VM — it compiles to Erlang bytecode and interoperates via @external declarations. @external(erlang, \"module\", \"function\") maps a Gleam function to an Erlang MFA (module, function, arity). This gives Gleam access to the entire OTP ecosystem, including NIFs written in C. Gleam does not require users to write NIFs themselves; it delegates to Erlang's existing NIF infrastructure."
        }
      ],
      "libraries": [
        {
          "name": "Hex packages",
          "url": "https://hex.pm/",
          "type": "Ecosystem"
        },
        {
          "name": "Gleam tour",
          "url": "https://tour.gleam.run/",
          "type": "Tutorial"
        }
      ],
      "docs": [
        {
          "name": "Gleam language tour",
          "url": "https://gleam.run/documentation/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "let x = 10\nlet y = 20",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "case x > 5 {\n  True -> \"big\"\n  False -> \"small\"\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Often recursion or list functions instead of classic for-loops",
          "difficulty": "basic"
        },
        "functions": {
          "code": "fn add(a: Int, b: Int) -> Int {\n  a + b\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Runs on BEAM or JavaScript target; prioritizes safety and concurrency.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "import gleam/float\n\n// No classes — use custom types and records\ntype Point {\n  Point(x: Float, y: Float)\n}\n\nfn length(p: Point) -> Float {\n  float.square_root(p.x *. p.x +. p.y *. p.y)\n}",
          "difficulty": "basic"
        },
        "strings": {
          "code": "let greeting = \"Hello, Gleam!\"\nio.println(greeting)\n// Strings are UTF-8 binaries on the BEAM",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Result type — no exceptions\ncase risky_operation() {\n  Ok(value) -> io.println(\"Success: \" <> value)\n  Error(reason) -> io.println(\"Failed\")\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "import gleam/io\nimport gleam/string\n// Third-party via hex: gleam add gleam_http",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "gleam-tip-result",
          "title": "Errors are values (`Result`)",
          "body": "Fallible operations typically return `Result`. Handle `Ok`/`Error` explicitly (or with `use` / helpers) rather than expecting exceptions for ordinary failure paths.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "gleam-tip-targets",
          "title": "Erlang and JavaScript targets differ",
          "body": "Gleam can compile to BEAM or JavaScript. Stick to the standard library and documented interop for your chosen target; do not assume every BEAM library is available on JS or vice versa.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "categories": [
        "functional"
      ],
      "overview": "A friendly language for the BEAM (Erlang VM) with static types — Erlang reliability with clearer errors. No nulls, no exceptions, just Result types and pattern matching.",
      "learning_curve": "Gentle if you know Rust or ML — familiar type syntax, no macros. The BEAM concurrency model and OTP supervision are the main new concepts. Gleam is simpler than Elixir for newcomers to the BEAM.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Hex.pm for packages (Gleam and Erlang). Compiles to Erlang and JavaScript. Growing community. Strong type safety on the BEAM — fills the niche Elixir doesn't (static types). Still young but production-ready for web backends.",
      "common_use_cases": [
        "Web services on BEAM",
        "Reliable backends",
        "Interop with Erlang/Elixir"
      ],
      "docs_url": "https://gleam.run/documentation/",
      "best_for": [
        "type-safe functional code on the BEAM",
        "safe concurrent service development",
        "Elixir-alternative with rigorous type system",
        "Type-safe BEAM development with friendly error messages and pipelines"
      ],
      "weak_at": [
        "Native mobile UI without JavaScript compilation targets",
        "Legacy OTP systems requiring drop-in Erlang module compatibility only",
        "Ecosystems needing mature package counts comparable to Elixir Hex"
      ],
      "official_url": "https://gleam.run/",
      "paradigm": [
        "functional",
        "typed",
        "BEAM"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static (checked at compile time)",
        "runtime": "Compiles to Erlang bytecode on BEAM or to JavaScript depending on target",
        "memory": "Garbage-collected per process on BEAM; inherits JS engine when targeting JavaScript"
      }
    },
    {
      "id": "ada",
      "name": "Ada",
      "color": "#02f88c",
      "description": "A strongly typed language designed for safety-critical software — avionics, defence, and rail. Its compiler catches more bugs than most before you even run the code.",
      "whoItIsFor": "Engineers where correctness and certification matter more than hype — used in aerospace, defense, rail, and safety-critical real-time systems.",
      "commonUses": [
        "Avionics",
        "Defence systems",
        "Rail signalling",
        "High-integrity embedded"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "with Ada.Text_IO; use Ada.Text_IO;\nprocedure Hello is\nbegin\n  Put_Line (\"Hello\");\nend Hello;",
          "explanation": "Procedures are the common entry point; Ada's strong typing and contracts start protecting you from day one."
        },
        {
          "title": "Types",
          "code": "type Count is range 0 .. 1_000;",
          "explanation": "Ranges catch overflow mistakes at compile/runtime."
        },
        {
          "title": "Import C convention — Ada/C interop boundary",
          "code": "-- Ada's Interface.C provides the standard C interop boundary\nwith Interfaces.C; use Interfaces.C;\n\nfunction C_Add (A : int; B : int) return int\n   with Import => True,\n        Convention => C,\n        External_Name => \"add\";\n\n-- Usage\nResult : int := C_Add (3, 4);  -- calls C add() directly",
          "explanation": "Ada's Import convention with Convention => C declares a C function that Ada can call directly. Interfaces.C maps Ada types to C types (int, chars_ptr, etc.). This is the standard boundary for Ada in polyglot systems — it's how safety-critical Ada code calls C libraries, OS interfaces, and vice versa. Ada also supports Export to make Ada functions callable from C."
        },
        {
          "title": "Tasking — Ada's built-in concurrency model",
          "code": "-- Ada has first-class concurrent tasks (no library needed)\ntask type Worker is\n   entry Process (Data : in Integer; Result : out Integer);\nend Worker;\n\ntask body Worker is\nbegin\n   accept Process (Data : in Integer; Result : out Integer) do\n      Result := Data * 2;\n   end Process;\nend Worker;\n\n-- Rendezvous: caller blocks until task accepts the entry",
          "explanation": "Ada's tasking model provides built-in concurrency via rendezvous — a synchronous communication pattern where the caller and task meet at an entry point. No external library or runtime needed. This is how Ada handles concurrent safety-critical systems without the risks of shared-memory threading."
        }
      ],
      "libraries": [
        {
          "name": "AdaCore docs",
          "url": "https://docs.adacore.com/",
          "type": "Tooling"
        },
        {
          "name": "SPARK",
          "url": "https://www.adacore.com/about-spark",
          "type": "Proof / subset"
        }
      ],
      "docs": [
        {
          "name": "Ada Reference Manual",
          "url": "http://www.ada-auth.org/standards/ada22.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "X : Integer := 10;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if X > 5 then\n   -- ...\nelse\n   -- ...\nend if;",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for I in 1 .. 5 loop\n   null;\nend loop;",
          "difficulty": "basic"
        },
        "functions": {
          "code": "function Add (A, B : Integer) return Integer is\nbegin\n   return A + B;\nend Add;",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiled; emphasis on predictable real-time behaviour over micro-benchmarks.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "-- No class system — use tagged types (Ada 95+)\ntype Point is tagged record\n   X, Y : Float;\nend record;\n\nprocedure Print (P : Point'Class);",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "Greeting : String := \"Hello, Ada!\";\nAda.Text_IO.Put_Line (Greeting);",
          "difficulty": "basic"
        },
        "errors": {
          "code": "declare\nbegin\n   Risky_Operation;\nexception\n   when Constraint_Error =>\n      Ada.Text_IO.Put_Line (\"Constraint violated\");\nend;",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "with Ada.Text_IO;  use Ada.Text_IO;\nwith Ada.Strings.Fixed;",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "ada-tip-format-pass11",
          "title": "Runtime checks and compiler mode",
          "body": "Ada semantics depend on check suppression and compiler mode. Keep checks on until you have measured need to disable them.",
          "tag": "safety",
          "status": "curated"
        }
      ],
      "categories": [
        "systems"
      ],
      "overview": "A strongly typed language designed for safety-critical software — avionics, defence, and rail. Its compiler catches more bugs than most before you even run the code. Engineers where correctness and certification matter more than hype — used in aerospace, defense, rail, and safety-critical real-time systems.\n\nTypical projects include Avionics, Defence systems, Rail signalling. GNAT and SPARK support certification-heavy work in aerospace, rail, and defence where Ada remains mandated.",
      "learning_curve": "Steep — verbose syntax, strict type checking, and the tasking model demand discipline. The rigour is the point: Ada is designed for safety-critical systems where errors are unacceptable. Rewarding for mission-critical software.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Dominant in aerospace (DoD mandate), rail, and nuclear. GNAT is the primary compiler (GPL and commercial editions). Alire is the package manager. SPARK (formal verification subset) is Ada's killer feature for safety-critical code.",
      "common_use_cases": [
        "Avionics",
        "Defence systems",
        "Rail signalling",
        "High-integrity embedded"
      ],
      "docs_url": "https://learn.adacore.com/",
      "best_for": [
        "safety-critical aviation and defence systems",
        "Real-time embedded control",
        "formal-verification-adjacent development",
        "Avionics, rail, and medical firmware with DO-178C style rigor"
      ],
      "weak_at": [
        "Rapid web product iteration with dynamic language ergonomics",
        "Startups optimizing for mainstream hiring over certification tooling",
        "Scripting glue between CLI tools on developer laptops"
      ],
      "official_url": "https://www.adacore.com/about-ada",
      "paradigm": [
        "imperative",
        "strongly-typed",
        "safety"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static (strong typing with range and subtype checks in Ada)",
        "runtime": "Compiled ahead-of-time to native machine code (GNAT and other Ada compilers)",
        "memory": "Manual stack/heap control; Ravenscar and SPARK profiles add stricter allocation rules",
        "abstraction": "High-level syntax with low-level control when needed"
      }
    },
    {
      "id": "prolog",
      "name": "Prolog",
      "color": "#74283c",
      "description": "A logic programming language — you describe relations and query them; the engine searches for proofs. Ideal for expert systems, symbolic AI, and rule-based reasoning.",
      "whoItIsFor": "People solving search, rules, NLP prototypes, or academic AI exercises — excels at symbolic reasoning, knowledge bases, and constraint problems.",
      "commonUses": [
        "Rule engines",
        "Search problems",
        "Symbolic AI teaching",
        "DSL experiments"
      ],
      "patterns": [
        {
          "title": "Facts & rules",
          "code": "parent(ada, byron).\nancestor(X, Y) :- parent(X, Y).\nancestor(X, Y) :- parent(X, Z), ancestor(Z, Y).",
          "explanation": "Recursive rules define relations; the Prolog engine unifies variables and backtracks through solutions."
        },
        {
          "title": "Query",
          "code": "?- ancestor(ada, X).",
          "explanation": "The interpreter searches for bindings."
        },
        {
          "title": "Foreign Language Interface — C interop (varies by implementation)",
          "code": "% SWI-Prolog C interface — the most widely used FLI\n% Prolog side: declare a foreign predicate\n:- use_foreign_library(foreign(math_helpers)).\n\n% In C (math_helpers.c):\n% #include <SWI-Prolog.h>\n% foreign_t pl_add(term_t a_term, term_t b_term, term_t r_term) {\n%   int a, b;\n%   PL_get_integer(a_term, &a);\n%   PL_get_integer(b_term, &b);\n%   return PL_unify_integer(r_term, a + b);\n% }\n% install_t install_math_helpers(void) {\n%   PL_register_foreign(\"add\", 3, pl_add, 0);\n% }\n\n% Note: FLI varies by Prolog implementation.\n% SWI uses PL_register_foreign; SICStus usesSP_foreign_buffer.",
          "explanation": "Prolog's foreign language interface (FLI) lets it call C for performance and system access. The mechanism varies by implementation: SWI-Prolog uses PL_register_foreign with term_t handles; SICStus and Ciao have their own APIs. This boundary is how Prolog systems integrate with external code — logic programs call C for I/O, math, and native library access."
        }
      ],
      "libraries": [
        {
          "name": "SWI-Prolog",
          "url": "https://www.swi-prolog.org/",
          "type": "Implementation"
        },
        {
          "name": "CLP",
          "url": "https://www.swi-prolog.org/pldoc/man?section=clp",
          "type": "Constraints"
        }
      ],
      "docs": [
        {
          "name": "SWI-Prolog manual",
          "url": "https://www.swi-prolog.org/pldoc/doc_for?object=manual"
        }
      ],
      "compareData": {
        "variables": {
          "code": "% Logic variables appear via unification in clauses",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "% Use multiple clauses or -> (if-then-else) extensions",
          "difficulty": "basic"
        },
        "loops": {
          "code": "% Recursion and backtracking replace imperative loops",
          "difficulty": "basic"
        },
        "functions": {
          "code": "add(A, B, C) :- C is A + B.",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Can explode on large search spaces; great when the problem fits logic style.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "% No class system — Prolog uses terms and predicates\n% Structured data via compound terms:\npoint(3.0, 4.0)",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "greeting('Hello, Prolog!').\n% Atoms use single quotes; double quotes produce character code lists\nformat('~w~n', [greeting]).",
          "difficulty": "basic"
        },
        "errors": {
          "code": "% Prolog has no exception syntax in classic form\n% SWI-Prolog: catch/3 and throw/1\ncatch(risky_goal(X), E, (write('Error: '), writeln(E), fail)).",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": ":- use_module(library(lists)).\n:- use_module(library(strings)).\n% Consult files: [my_module].",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "prolog-tip-unification",
          "title": "Think in relations, not assignments",
          "body": "Prolog succeeds or fails by unifying goals against a knowledge base. If you write imperative loops in your head, you will fight the language — start from facts, rules, and what must be true."
        },
        {
          "id": "prolog-tip-cuts",
          "title": "Cuts change what “failure” means",
          "body": "The cut (!) commits to choices and prunes backtracking. Use it deliberately for green cuts; red cuts that alter meaning are a common source of hard-to-debug logic."
        }
      ],
      "categories": [
        "academic"
      ],
      "overview": "A logic programming language — you describe relations and query them; the engine searches for proofs. Ideal for expert systems, symbolic AI, and rule-based reasoning. People solving search, rules, NLP prototypes, or academic AI exercises — excels at symbolic reasoning, knowledge bases, and constraint problems.\n\nTypical projects include Rule engines, Search problems, Symbolic AI teaching. SWI-Prolog is the dominant open-source implementation; unification and backtracking demand a different mental model than imperative code.",
      "learning_curve": "Steep — declarative logic programming requires a completely different mental model. Unification, backtracking, and the cut operator are unfamiliar to imperative programmers. Rewarding for symbolic AI and constraint problems.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "SWI-Prolog is the dominant open-source implementation. Used in AI research, natural language processing, and knowledge representation. ISO Prolog standard exists but implementations vary. Smaller community than mainstream languages but deeply influential in logic programming.",
      "common_use_cases": [
        "Rule engines",
        "Search problems",
        "Symbolic AI teaching",
        "DSL experiments"
      ],
      "docs_url": "https://www.swi-prolog.org/pldoc/doc_for?object=manual",
      "best_for": [
        "logic programming and constraint solving",
        "Expert system rule engines",
        "natural language processing research",
        "Expert system rule engines and knowledge-base reasoning"
      ],
      "weak_at": [
        "Imperative UI development with conventional widget event loops",
        "Large teams expecting mainstream OOP patterns and static typing",
        "High-throughput data pipelines without logic programming expertise"
      ],
      "official_url": "https://www.swi-prolog.org/",
      "paradigm": [
        "logic",
        "declarative",
        "relational"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic (optional static checks in some dialects and tooling)",
        "runtime": "Interpreted or compiled to bytecode/native depending on implementation",
        "memory": "Garbage-collected in mainstream implementations"
      }
    },
    {
      "id": "pascal",
      "name": "Pascal",
      "color": "#e3e3e3",
      "description": "A structured teaching language that influenced generations — still seen in Delphi/Object Pascal ecosystems. Clear block structure makes it a gentle first compiled language.",
      "whoItIsFor": "Learners and Delphi developers maintaining typed, readable codebases — still used in education, legacy enterprise apps, and embedded tooling.",
      "commonUses": [
        "Education",
        "Desktop apps (Delphi)",
        "Legacy maintenance",
        "Embedded (some niches)"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "program Hello;\nbegin\n  writeln('Hello');\nend.",
          "explanation": "Programs start with a program header; the begin-end block structure is Pascal's hallmark."
        },
        {
          "title": "Types",
          "code": "var x: integer;\nbegin\n  x := 10;\nend.",
          "explanation": "Variables are declared in var blocks with explicit types; strong typing prevents many errors."
        },
        {
          "title": "External C linking — the Pascal/C boundary",
          "code": "// Free Pascal: link and call C functions directly\nfunction c_add(a: Integer; b: Integer): Integer; cdecl; external 'libmath';\n\n// Usage\nWriteLn('C says: ', c_add(3, 4));  // 7\n\n// Delphi: similar with external directive\n// function c_add(a, b: Integer): Integer; cdecl; external 'math.dll';",
          "explanation": "Pascal's external directive declares a C function that can be called directly. cdecl specifies the C calling convention; external names the shared library. Free Pascal and Delphi both support this. This boundary lets Pascal code call C libraries (system APIs, math libs) — essential for Pascal in polyglot pipelines."
        },
        {
          "title": "Units — Pascal's module system",
          "code": "unit MathUtils;\n\ninterface\n  function Add(A, B: Integer): Integer;\n  function Multiply(A, B: Integer): Integer;\n\nimplementation\n  function Add(A, B: Integer): Integer;\n  begin\n    Result := A + B;\n  end;\n\n  function Multiply(A, B: Integer): Integer;\n  begin\n    Result := A * B;\n  end;\n\nend.",
          "explanation": "Pascal's unit system separates interface (public declarations) from implementation (private code). This is Pascal's answer to modules and namespaces — each unit compiles independently, and the interface section defines what's visible to consumers."
        }
      ],
      "libraries": [
        {
          "name": "Free Pascal",
          "url": "https://www.freepascal.org/",
          "type": "Compiler"
        },
        {
          "name": "Lazarus",
          "url": "https://www.lazarus-ide.org/",
          "type": "IDE / GUI"
        }
      ],
      "docs": [
        {
          "name": "Free Pascal docs",
          "url": "https://www.freepascal.org/docs.var"
        }
      ],
      "compareData": {
        "variables": {
          "code": "var x: integer; y: integer;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5 then\nbegin\nend\nelse\nbegin\nend;",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for i := 1 to 5 do\nbegin\nend;",
          "difficulty": "basic"
        },
        "functions": {
          "code": "function Add(a, b: integer): integer;\nbegin\n  Add := a + b;\nend;",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiled; Delphi/Object Pascal can be very fast for desktop workloads.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "type\n  TPoint = record\n    X, Y: Double;\n  end;\n\n// Free Pascal / Delphi: classes\n  TPointObj = class\n    X, Y: Double;\n    constructor Create(AX, AY: Double);\n  end;",
          "difficulty": "basic"
        },
        "strings": {
          "code": "var\n  Greeting: string;\nbegin\n  Greeting := 'Hello, Pascal!';\n  WriteLn(Greeting);",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try\n  RiskyOperation;\nexcept\n  on E: Exception do\n    WriteLn('Error: ', E.Message);\nend;",
          "difficulty": "basic"
        },
        "imports": {
          "code": "uses\n  SysUtils, Classes, Math;\n// Delphi/FPC units are the module system",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "systems",
        "academic"
      ],
      "overview": "A structured teaching language that influenced generations — still seen in Delphi/Object Pascal ecosystems. Clear block structure makes it a gentle first compiled language.",
      "learning_curve": "Gentle — designed for teaching with readable begin/end syntax and strong typing. Modern Object Pascal (Delphi, Free Pascal) adds OOP but keeps the readable style. Good first language that scales to production.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Delphi (commercial) and Free Pascal/Lazarus (open-source) are the main toolchains. Strong in legacy desktop applications, education (especially in Europe), and embedded systems. Smaller but dedicated community.",
      "common_use_cases": [
        "Education",
        "Desktop apps (Delphi)",
        "Legacy maintenance",
        "Embedded (some niches)"
      ],
      "docs_url": "https://www.freepascal.org/docs.html",
      "best_for": [
        "educational programming instruction",
        "legacy Delphi application maintenance",
        "embedded systems teaching platforms",
        "Teaching structured programming with clear syntax and fast compilation"
      ],
      "weak_at": [
        "Cloud-native microservices expecting npm, pip, or cargo ecosystems",
        "Modern async web frameworks with first-class HTTP/2 support",
        "Mobile-first consumer apps without FireMonkey or Lazarus UI work"
      ],
      "official_url": "https://www.freepascal.org/",
      "paradigm": [
        "imperative",
        "procedural",
        "structured"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static (strong typing in Free Pascal and Delphi dialects)",
        "runtime": "Compiled ahead-of-time to native code or bytecode depending on dialect",
        "memory": "Manual in classic Pascal; Delphi adds reference-counted strings and managed classes",
        "abstraction": "Structured imperative programming from teaching to systems use"
      }
    },
    {
      "id": "groovy",
      "name": "Groovy",
      "color": "#4298b8",
      "description": "A JVM language with scripting ergonomics — dynamic feel with optional typing and great Java interop. Powers Gradle builds and Jenkins pipelines in practice.",
      "whoItIsFor": "Java shops writing Gradle scripts, Spock tests, and glue code quickly — dynamic optionally-typed language with seamless JVM interop.",
      "commonUses": [
        "Gradle builds",
        "Jenkins pipelines",
        "Testing",
        "Rapid JVM scripting"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "println \"Hello\"",
          "explanation": "Optional parentheses feel script-like."
        },
        {
          "title": "Closures",
          "code": "[1,2,3].each { n -> println n }",
          "explanation": "Closures are first-class values in Groovy — pass them as arguments, store them, or call them inline."
        },
        {
          "title": "JVM interop — calling Java directly (Groovy boundary)",
          "code": "// Groovy runs on the JVM — Java interop is zero-overhead\ndef list = new java.util.ArrayList()\nlist.add(\"Hello\")\nlist << \"Groovy\"  // Groovy adds << operator for collections\n\n// Call any Java library\ndef json = new groovy.json.JsonBuilder()\njson name: 'Groovy', version: 4\n\n// @Grab adds dependencies at runtime (Grape)\n@Grab('org.apache.httpcomponents:httpclient:4.5')\nimport org.apache.http.impl.client.HttpClients\ndef client = HttpClients.createDefault()",
          "explanation": "Groovy's boundary is the JVM — it compiles to Java bytecode and calls Java libraries directly with zero marshalling. The << operator and GString interpolation are Groovy conveniences layered on Java's collection and string types. @Grab (Grape) dynamically downloads dependencies at runtime. This seamless JVM boundary is Groovy's key polyglot advantage."
        },
        {
          "title": "Closures and builders — Groovy's DSL-friendly syntax",
          "code": "// Closures (lambda-like)\ndef greet = { name -> println \"Hello, \\${name}!\" }\ngreet('World')\n\n// Builders — Groovy's structured DSL pattern\ndef xml = new groovy.xml.MarkupBuilder()\nxml.html {\n    head { title('CacheSphere') }\n    body { p('Language comparison tool') }\n}",
          "explanation": "Closures are blocks of code treated as values; builders use method-missing to create nested DSL trees — together they make Groovy ideal for domain-specific languages and structured data generation."
        }
      ],
      "libraries": [
        {
          "name": "Gradle",
          "url": "https://gradle.org/",
          "type": "Build tool"
        },
        {
          "name": "Spock",
          "url": "https://spockframework.org/",
          "type": "Testing"
        }
      ],
      "docs": [
        {
          "name": "Groovy documentation",
          "url": "https://groovy-lang.org/documentation.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "def x = 10\nint y = 20",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5) {\n  println 'big'\n} else {\n  println 'small'\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for (i in 0..<5) { println i }",
          "difficulty": "basic"
        },
        "functions": {
          "code": "int add(int a, int b) { a + b }",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Runs on JVM; performance near Java when statically compiled hotspots apply.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "class Point {\n    double x, y\n    double length() { Math.sqrt(x * x + y * y) }\n}\n\ndef p = new Point(x: 3, y: 4)\nprintln p.length()",
          "difficulty": "basic"
        },
        "strings": {
          "code": "def greeting = 'Hello'\ndef name = 'Groovy'\nprintln \"${greeting}, ${name}!\"  // GString interpolation",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try {\n    riskyOperation()\n} catch (Exception e) {\n    println \"Error: ${e.message}\"\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "import java.time.LocalDate\nimport groovy.json.JsonSlurper\n// Grape for dynamic dependencies\n@Grab('org.apache.commons:commons-lang3:3.12')",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "groovy-tip-format-pass11",
          "title": "Groovy vs Java classpath",
          "body": "Groovy surprises often come from the hosting JVM/Gradle classpath, not syntax. Pin the Groovy and Java versions used by the build.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "categories": [
        "web",
        "data"
      ],
      "overview": "A JVM language with scripting ergonomics — dynamic feel with optional typing and great Java interop. Powers Gradle builds and Jenkins pipelines in practice. Java shops writing Gradle scripts, Spock tests, and glue code quickly — dynamic optionally-typed language with seamless JVM interop.\n\nTypical projects include Gradle builds, Jenkins pipelines, Testing. Gradle and Jenkins pipelines keep Groovy in daily use, though new build scripts increasingly favour Kotlin DSL.",
      "learning_curve": "Gentle for Java developers — similar syntax with less boilerplate. Dynamic typing, closures, and the GDK (Groovy Development Kit) methods add convenience. Type checking and static compilation (@CompileStatic) available for performance.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Gradle is the primary use case (build scripts). Grails for web. Apache Groovy is the reference implementation. Grape for dependency fetching. Declining for new projects (Kotlin/Gradle Kotlin DSL is taking over), but massive existing Gradle codebase.",
      "common_use_cases": [
        "Gradle builds",
        "Jenkins pipelines",
        "Testing",
        "Rapid JVM scripting"
      ],
      "docs_url": "https://groovy-lang.org/documentation.html",
      "best_for": [
        "Jenkins pipeline configuration",
        "JVM scripting and glue code",
        "Gradle build file authoring",
        "JVM scripting and Gradle build logic with Java interoperability"
      ],
      "weak_at": [
        "Greenfield services where Kotlin or Java 21 features suffice",
        "Non-JVM platforms without GraalVM native-image operational maturity",
        "Performance-critical kernels better implemented in Rust or C++"
      ],
      "official_url": "https://groovy-lang.org/",
      "paradigm": [
        "object-oriented",
        "scripting",
        "JVM"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Interpreted or bytecode-based in common implementations (engines vary)",
        "memory": "Garbage-collected in mainstream implementations",
        "abstraction": "High-level for typical scripting and application use"
      }
    },
    {
      "id": "powershell",
      "name": "PowerShell",
      "color": "#5391fe",
      "description": "Microsoft's object-pipeline shell: Windows PowerShell grew up on the older Windows/.NET Framework stack, while modern `pwsh` (PowerShell 7+) runs cross-platform on current .NET.",
      "whoItIsFor": "Windows admins, Microsoft-cloud operators, and teams using `pwsh` for automation across Windows, Linux, and macOS — with many legacy admin modules still concentrated on Windows.",
      "commonUses": [
        "Automation",
        "Cloud admin (Azure)",
        "CI glue",
        "Windows management"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "Write-Output \"Hello\"",
          "explanation": "Cmdlet-style output — Write-Output or bare strings send objects down the pipeline."
        },
        {
          "title": "Pipeline",
          "code": "Get-ChildItem | Where-Object Length -gt 1mb | Select-Object Name",
          "explanation": "Objects flow between cmdlets — PowerShell pipes rich .NET objects, not raw text like Unix shells."
        },
        {
          "title": "COM and .NET interop — PowerShell's boundary",
          "code": "# Call .NET directly — PowerShell runs on CLR\n[System.Math]::Sqrt(16)           # 4\n[System.IO.File]::ReadAllText('data.txt')\n\n# COM interop — automate Windows applications\n$excel = New-Object -ComObject Excel.Application\n$excel.Visible = $true\n$workbook = $excel.Workbooks.Add()\n\n# WMI/CIM — query system information\nGet-CimInstance -ClassName Win32_OperatingSystem | Select-Object Caption, Version",
          "explanation": "PowerShell can call many .NET APIs directly and, on Windows, automate COM objects such as Excel. That does not mean every .NET library or automation surface works uniformly: some assemblies assume specific runtimes or GUIs, and `New-Object -ComObject` is Windows-only. In both Windows PowerShell and modern `pwsh`, the pipeline’s distinctive feature is that cmdlets usually pass structured objects rather than plain text."
        },
        {
          "title": "Pipeline — object-based data flow boundary",
          "code": "# Objects flow through the pipeline — not text like Unix shell\nGet-Process |\n    Where-Object { $_.WorkingSet64 -gt 100MB } |\n    Sort-Object WorkingSet64 -Descending |\n    Select-Object Name, @{N='MB';E={[math]::Round($_.WorkingSet64/1MB,1)}} -First 5",
          "explanation": "The pipeline passes .NET objects between cmdlets — Where-Object filters, Sort-Object orders, and Select-Object shapes output without losing type information."
        }
      ],
      "libraries": [
        {
          "name": "PowerShell Gallery",
          "url": "https://www.powershellgallery.com/",
          "type": "Modules"
        },
        {
          "name": "PSDocs",
          "url": "https://learn.microsoft.com/powershell/",
          "type": "Microsoft Learn"
        }
      ],
      "docs": [
        {
          "name": "Microsoft PowerShell docs",
          "url": "https://learn.microsoft.com/powershell/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "$x = 10\n[int]$y = 20",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if ($x -gt 5) { 'big' } else { 'small' }",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for ($i = 0; $i -lt 5; $i++) { $i }",
          "difficulty": "basic"
        },
        "functions": {
          "code": "function Add([int]$a, [int]$b) { return $a + $b }",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Startup has overhead; fine for automation, not microsecond HPC loops.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "# PowerShell 5+ has classes\nclass Point {\n    [double] $X\n    [double] $Y\n    [double] Length() { return [Math]::Sqrt($this.X * $this.X + $this.Y * $this.Y) }\n    Point([double]$x, [double]$y) { $this.X = $x; $this.Y = $y }\n}",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "$greeting = 'Hello'\n$name = 'PowerShell'\nWrite-Host \"${greeting}, ${name}!\"  # double-quoted: interpolation",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try {\n    Risky-Operation\n} catch {\n    Write-Host \"Error: $_\"\n} finally {\n    Write-Host 'Cleanup'\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "# Modules are PowerShell's package system\nImport-Module ActiveDirectory\nInstall-Module -Name Pester -Scope CurrentUser",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "powershell-tip-quote-for-the-shell-you-are-actually-running",
          "title": "Quote for the shell you are actually running",
          "body": "PowerShell tends to punish unquoted expansions, whitespace, and globbing. Assume user input contains spaces, wildcards, and newlines, and test the script with awkward values before trusting it.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "categories": [
        "devops",
        "scripting"
      ],
      "overview": "An object-pipeline shell from Microsoft: Windows PowerShell 5.1 is the long-lived Windows/.NET Framework edition, while PowerShell 7+ (`pwsh`) is the cross-platform line on modern .NET. In both, cmdlets usually pass structured objects rather than plain text.",
      "learning_curve": "Moderate — the pipeline concept and verb-noun cmdlet naming are intuitive. The object pipeline (not text) is a shift from Unix shells. Advanced topics (runspaces, remoting, DSC) add depth. The syntax has quirks (comparison operators: -eq, -ne, -gt).",
      "good_for_teaching": "okay",
      "ecosystem_notes": "PowerShell Gallery is the usual module feed. Windows administration, Azure automation, and Microsoft 365 remain common workloads. PowerShell 7+ (`pwsh`) is cross-platform, but many older modules and docs still assume Windows PowerShell 5.1, COM automation, or other Windows-only APIs. Pester is the common test framework.",
      "common_use_cases": [
        "Automation",
        "Cloud admin (Azure)",
        "CI glue",
        "Windows management"
      ],
      "docs_url": "https://learn.microsoft.com/powershell/scripting/overview",
      "best_for": [
        "Windows system administration",
        "Azure cloud resource management",
        ".NET-based automation and scripting",
        "Windows system administration and Active Directory automation"
      ],
      "weak_at": [
        "POSIX-first Unix shops standardized on bash or zsh exclusively",
        "Browser-based UI products without desktop shell integration needs",
        "Hard real-time embedded firmware outside scripting runtimes"
      ],
      "official_url": "https://learn.microsoft.com/powershell/",
      "paradigm": [
        "imperative",
        "object-oriented",
        "shell"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Commands and text expansion (typically untyped at the shell level)",
        "runtime": "Interpreted by a shell, editor, or automation host",
        "memory": "Managed by the host process running the script"
      }
    },
    {
      "id": "vbnet",
      "name": "VB.NET",
      "color": "#945db7",
      "description": "A .NET language with VB syntax — full access to the CLR alongside C# in the same projects. Verbose but approachable, especially for Windows Forms and legacy enterprise code.",
      "whoItIsFor": "Teams maintaining VB line-of-business apps or preferring verbose readable syntax.",
      "commonUses": [
        "Enterprise LOB apps",
        "WinForms/WPF",
        "ASP.NET WebForms maintenance",
        "Macros"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "Module Program\n  Sub Main()\n    Console.WriteLine(\"Hello\")\n  End Sub\nEnd Module",
          "explanation": "Module entry point style; Sub Main() is where execution begins in a VB console application."
        },
        {
          "title": "If",
          "code": "If x > 5 Then\n  Console.WriteLine(\"big\")\nElse\n  Console.WriteLine(\"small\")\nEnd If",
          "explanation": "Verbose block syntax with End If; VB favours readable keywords over brevity."
        },
        {
          "title": "P/Invoke and .NET interop — VB.NET boundary",
          "code": "' P/Invoke — call native C from VB.NET\nImports System.Runtime.InteropServices\n\nPublic Class Native\n    <DllImport(\"libc.so.6\", EntryPoint:=\"puts\")>\n    Public Shared Function puts(s As String) As Integer\n    End Function\nEnd Class\n\n' Call .NET libraries directly (zero overhead)\nDim json As String = System.Text.Json.JsonSerializer.Serialize(\n    New With {.name = \"VB.NET\", .version = 16})\n\n' Usage\nNative.puts(\"Hello from C via VB.NET\")",
          "explanation": "VB.NET inherits .NET's P/Invoke for C interop and has first-class access to the entire .NET ecosystem. The <DllImport> attribute declares a C function; VB.NET handles marshalling automatically. VB.NET also calls C# libraries seamlessly via the CLR. This dual boundary (C via P/Invoke, .NET via CLR) mirrors F# and C#."
        },
        {
          "title": "LINQ — integrated query in VB.NET",
          "code": "' LINQ: query any collection with SQL-like syntax\nDim scores = {72, 85, 63, 91, 78}\n\nDim passing = From s In scores\n              Where s >= 70\n              Order By s Descending\n              Select s\n\nFor Each s In passing\n    Console.WriteLine(s)\nNext",
          "explanation": "VB.NET's LINQ (Language Integrated Query) lets you query collections, databases, and XML with a SQL-like syntax built into the language. It compiles to extension method calls on IEnumerable or IQueryable. This is VB.NET's data boundary — uniform query across different data sources."
        }
      ],
      "libraries": [
        {
          "name": ".NET API",
          "url": "https://learn.microsoft.com/dotnet/api/",
          "type": "Framework"
        },
        {
          "name": "NuGet",
          "url": "https://www.nuget.org/",
          "type": "Packages"
        }
      ],
      "docs": [
        {
          "name": "VB.NET guide",
          "url": "https://learn.microsoft.com/dotnet/visual-basic/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "Dim x As Integer = 10",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "If x > 5 Then\n' ...\nElse\n' ...\nEnd If",
          "difficulty": "basic"
        },
        "loops": {
          "code": "For i As Integer = 0 To 4\nNext",
          "difficulty": "basic"
        },
        "functions": {
          "code": "Function Add(a As Integer, b As Integer) As Integer\n  Return a + b\nEnd Function",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Same CLR as C#; performance differences are mostly stylistic.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "Public Class Point\n    Public Property X As Double\n    Public Property Y As Double\n    Public Function Length() As Double\n        Return Math.Sqrt(X * X + Y * Y)\n    End Function\n    Public Sub New(x As Double, y As Double)\n        Me.X = x : Me.Y = y\n    End Sub\nEnd Class",
          "difficulty": "basic"
        },
        "strings": {
          "code": "Dim greeting As String = \"Hello\"\nDim name As String = \"VB.NET\"\nConsole.WriteLine($\"{greeting}, {name}!\")  ' String interpolation",
          "difficulty": "basic"
        },
        "errors": {
          "code": "Try\n    RiskyOperation()\nCatch ex As Exception\n    Console.WriteLine($\"Error: {ex.Message}\")\nFinally\n    Console.WriteLine(\"Cleanup\")\nEnd Try",
          "difficulty": "basic"
        },
        "imports": {
          "code": "Imports System.IO\nImports System.Text.Json\n' NuGet packages via project file or CLI",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "web",
        "data"
      ],
      "overview": "A .NET language with VB syntax — full access to the CLR alongside C# in the same projects. Verbose but approachable, especially for Windows Forms and legacy enterprise code. Teams maintaining VB line-of-business apps or preferring verbose readable syntax.\n\nTypical projects include Enterprise LOB apps, WinForms/WPF, ASP.NET WebForms maintenance. NuGet packages are shared with C#, but Microsoft has slowed VB.NET feature development in favour of C#.",
      "learning_curve": "Gentle — verbose, English-like syntax (Dim, If...Then, End If) is approachable for beginners. The .NET ecosystem is the same as C#, so all libraries are available. Advanced VB.NET (LINQ, async) matches C# features.",
      "good_for_teaching": "good",
      "ecosystem_notes": "NuGet for packages. Part of the .NET family alongside C# and F#. Strong in enterprise (legacy ASP.NET Web Forms, Windows Forms). Microsoft has slowed VB.NET feature development — C# is the primary .NET language now. Still maintained and supported.",
      "common_use_cases": [
        "Enterprise LOB apps",
        "WinForms/WPF",
        "ASP.NET WebForms maintenance",
        "Macros"
      ],
      "docs_url": "https://learn.microsoft.com/dotnet/visual-basic/",
      "best_for": [
        "enterprise Windows LOB applications",
        "WinForms and WPF desktop apps",
        "ASP.NET legacy maintenance and migration",
        "Maintaining legacy WinForms and WPF line-of-business desktop apps"
      ],
      "weak_at": [
        "Greenfield cross-platform .NET development where C# is default",
        "Linux server deployments without Mono or .NET Core VB limitations",
        "Modern web SPAs expecting TypeScript-first front-end ecosystems"
      ],
      "official_url": "https://learn.microsoft.com/dotnet/visual-basic/",
      "paradigm": [
        "object-oriented",
        "imperative",
        ".NET"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static",
        "runtime": ".NET runtime (JIT or ahead-of-time depending on deployment)",
        "memory": "Garbage-collected",
        "abstraction": "High-level"
      }
    },
    {
      "id": "d",
      "name": "D",
      "color": "#b03931",
      "description": "A systems language with C++-like power but cleaner metaprogramming and a friendly standard library. The gc-optional model lets you tune performance precisely.",
      "whoItIsFor": "C++ refugees wanting fast compile times and memory-safe patterns (with discipline).",
      "commonUses": [
        "Systems utilities",
        "Games",
        "Scientific tools",
        "Native libraries"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "import std.stdio;\nvoid main() {\n    writeln(\"Hello\");\n}",
          "explanation": "C-like main with D's standard library — writeln from std.stdio replaces printf safely."
        },
        {
          "title": "Ranges",
          "code": "import std.range;\nimport std.algorithm;\nauto xs = [1,2,3].map!(x => x * 2);",
          "explanation": "Composable lazy algorithms that transform data pipelines without allocating intermediate arrays."
        },
        {
          "title": "extern(C) — C ABI interop boundary",
          "code": "// D calls C directly with extern(C) — zero-overhead ABI compatibility\nextern(C) int add(int a, int b);  // declare a C function\n\n// D functions can be exported for C callers\nextern(C) int d_multiply(int a, int b) {\n    return a * b;\n}\n\n// BetterC mode: compile D without the garbage collector or runtime\n// dmd -betterC hello.d",
          "explanation": "D's extern(C) declares C functions that D can call directly — the C ABI is D's primary FFI boundary. D functions marked extern(C) can be called from C with zero overhead. BetterC mode removes the GC and runtime dependency, making D usable as a 'better C' in polyglot pipelines where C ABI compatibility is the standard."
        },
        {
          "title": "Templates and static if — compile-time polymorphism",
          "code": "// D's compile-time templates are a key differentiator\nT max(T)(T a, T b) { return a > b ? a : b; }\n\nwriteln(max(3, 7));        // int\nwriteln(max(3.14, 2.71));  // double\n\n// static if for compile-time branching\nstatic if (is(T == int)) {\n    // int-specific path\n} else {\n    // generic path\n}",
          "explanation": "D's templates and static if enable compile-time polymorphism without runtime overhead. Unlike C++ templates, D's are cleaner with constraint syntax (if T : Numeric). This makes D effective for generic programming and polyglot systems where type-safe abstractions must compile down to efficient machine code."
        }
      ],
      "libraries": [
        {
          "name": "DUB",
          "url": "https://dub.pm/",
          "type": "Package manager"
        },
        {
          "name": "Phobos",
          "url": "https://dlang.org/phobos/",
          "type": "Standard library"
        }
      ],
      "docs": [
        {
          "name": "D Language specification",
          "url": "https://dlang.org/spec/spec.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "int x = 10;\nauto y = 20;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5) { }\nelse { }",
          "difficulty": "basic"
        },
        "loops": {
          "code": "foreach (i; 0..5) { }",
          "difficulty": "basic"
        },
        "functions": {
          "code": "int add(int a, int b) { return a + b; }",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiled native; comparable niche to C++ for many tasks.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "class Point {\n    double x, y;\n    double length() { return sqrt(x*x + y*y); }\n}",
          "difficulty": "basic"
        },
        "strings": {
          "code": "string greeting = \"Hello, D!\";\nwriteln(greeting);  // full string operations",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try {\n    riskyOperation();\n} catch (Exception e) {\n    writeln(\"Error: \", e.msg);\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "import std.stdio;\nimport std.algorithm;\nimport core.stdc.stdlib;  // C interop",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "d-tip-format-pass11",
          "title": "D compiler and edition flags",
          "body": "D code is sensitive to compiler (DMD/LDC/GDC) and language edition flags. Pin the compiler in CI.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "categories": [
        "systems"
      ],
      "overview": "A systems language with C++-like power but cleaner metaprogramming and a friendly standard library. The gc-optional model lets you tune performance precisely. C++ refugees wanting fast compile times and memory-safe patterns (with discipline).\n\nTypical projects include Systems utilities, Games, Scientific tools. DUB and Phobos cover game engines and systems utilities, though the community is smaller than Rust or Go.",
      "learning_curve": "Moderate — C-like syntax with cleaner semantics. The dual standard library (Phobos vs C) and GC vs manual memory management take time to master. BetterC mode eases the transition from C.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "DUB is the package manager. Phobos is the standard library. Used in game engines, compilers, and systems programming. Smaller community than Rust/Go but very active. BetterC mode enables C-replacement use cases.",
      "common_use_cases": [
        "Systems utilities",
        "Games",
        "Scientific tools",
        "Native libraries"
      ],
      "docs_url": "https://dlang.org/spec/spec.html",
      "best_for": [
        "systems programming with garbage collection",
        "high-performance numeric computing",
        "C ABI interop for library development",
        "Systems utilities combining C-like performance with garbage collection"
      ],
      "weak_at": [
        "Mainstream hiring pipelines expecting Rust, Go, or C++ depth",
        "Mobile UI frameworks with polished cross-platform widget kits",
        "Regulated teams mandating memory-safe languages without GC pauses"
      ],
      "official_url": "https://dlang.org/",
      "paradigm": [
        "imperative",
        "object-oriented",
        "metaprogramming"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static with templates and CTFE",
        "runtime": "Compiled ahead-of-time to native machine code (DMD/LDC/GDC)",
        "memory": "Garbage-collected by default; manual and @nogc subsets available"
      }
    },
    {
      "id": "nix",
      "name": "Nix",
      "color": "#5277c3",
      "description": "A purely functional language for describing packages and system configurations — reproducible builds. Nix the language drives Nixpkgs, the largest repo of package definitions.",
      "whoItIsFor": "DevOps and developers who want declarative, reproducible environments and instant rollbacks — essential for managing complex deployment infra.",
      "commonUses": [
        "Reproducible dev shells",
        "NixOS configuration",
        "CI caches",
        "Package definitions"
      ],
      "patterns": [
        {
          "title": "Attribute set",
          "code": "let\n  pkgs = import <nixpkgs> {};\nin\n{\n  hello = pkgs.hello;\n}",
          "explanation": "Expressions return attribute sets describing builds."
        },
        {
          "title": "Function",
          "code": "x: y: x + y",
          "explanation": "Curried functions are idiomatic in Nix; every function takes one argument and returns a new function."
        },
        {
          "title": "Derivation — the Nix build boundary (sandboxed, pure, reproducible)",
          "code": "# A derivation is Nix's data boundary — a sandboxed build recipe\nstdenv.mkDerivation {\n  pname = \"my-package\";\n  version = \"1.0\";\n\n  src = fetchFromGitHub {\n    owner = \"example\";\n    repo = \"my-package\";\n    rev = \"v1.0\";\n    hash = \"sha256-ABC...\";\n  };\n\n  buildInputs = [ pkgs.libevent pkgs.openssl ];\n  nativeBuildInputs = [ pkgs.cmake ];\n\n  configurePhase = \"cmake .\";\n  buildPhase = \"make\";\n  installPhase = \"make install\";\n}",
          "explanation": "Nix's derivation is the polyglot boundary — a sandboxed, pure function that takes inputs (source, dependencies) and produces an output (store path). Derivations run in isolated environments with no network access, ensuring reproducibility. This is how Nix builds C, Rust, Python, and any other language package: every build is a deterministic function of its inputs."
        }
      ],
      "libraries": [
        {
          "name": "nixpkgs",
          "url": "https://github.com/NixOS/nixpkgs",
          "type": "Package set"
        },
        {
          "name": "Home Manager",
          "url": "https://github.com/nix-community/home-manager",
          "type": "User config"
        }
      ],
      "docs": [
        {
          "name": "Nix manual",
          "url": "https://nixos.org/manual/nix/stable/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "let x = 10; in x + 1",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5 then \"big\" else \"small\"",
          "difficulty": "basic"
        },
        "loops": {
          "code": "# Use list functions / recursion instead of mutable loops",
          "difficulty": "basic"
        },
        "functions": {
          "code": "add = a: b: a + b;",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Evaluation is for configuration, not hot paths; build time is the cost.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "# No class system — Nix uses attrsets and let bindings\n# Structured data via attribute sets:\npoint = { x = 3; y = 4; };\nlength = sqrt (point.x * point.x + point.y * point.y);",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "greeting = \"Hello, Nix!\"\nmessage = \"${greeting} from Nix\"  # string interpolation\npath = ./src/main.nix                   # path literal",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# No try/catch — Nix uses builtins.tryEval and abort\nresult = builtins.tryEval (someExpression);\n# Success: { success = true; value = ...; }\n# Failure: { success = false; }\n\n# abort stops evaluation entirely\n# throw \"message\" creates a catchable error",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "# Import other Nix files\npkgs = import <nixpkgs> {};\nmyLib = import ./lib.nix;\n\n# Flake inputs (modern Nix)\ninputs = {\n  nixpkgs.url = \"github:NixOS/nixpkgs\";\n};",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "nix-tip-purity",
          "title": "Purity and pins beat mutable environments",
          "body": "Nix failures are usually impurity, unpinned inputs, or wrong system attributes. Prefer flakes/lock files over ad-hoc nix-env.",
          "tag": "iac",
          "status": "curated"
        }
      ],
      "categories": [
        "devops",
        "config"
      ],
      "overview": "A purely functional language for describing packages and system configurations — reproducible builds. Nix the language drives Nixpkgs, the largest repo of package definitions. DevOps and developers who want declarative, reproducible environments and instant rollbacks — essential for managing complex deployment infra.\n\nTypical projects include Reproducible dev shells, NixOS configuration, CI caches. Nixpkgs offers 100k+ reproducible package definitions, but lazy evaluation and flakes take significant time to master.",
      "learning_curve": "Steep — the lazy evaluation model, NixOS module system, and flake conventions require significant investment. The reward is unparalleled reproducibility and system configuration power. Most users struggle with the functional paradigm before it clicks.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Nixpkgs is the largest package repository (100k+ packages). NixOS is the flagship OS. Flakes are the modern approach. Strong in DevOps, CI/CD, and reproducible research. Community is passionate but small relative to Docker.",
      "common_use_cases": [
        "Reproducible dev shells",
        "NixOS configuration",
        "CI caches",
        "Package definitions"
      ],
      "docs_url": "https://nix.dev/",
      "best_for": [
        "reproducible software builds and environments",
        "declarative system configuration",
        "fully deterministic development shells",
        "Reproducible dev environments and multi-language dependency pinning"
      ],
      "weak_at": [
        "Imperative one-off scripts on machines without Nix installed",
        "Windows-native developer workflows outside WSL Nix installations",
        "Teams unwilling to learn Nix expression language and flake semantics"
      ],
      "official_url": "https://nixos.org/",
      "paradigm": [
        "declarative",
        "functional",
        "configuration"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative configuration or build DSL (not a general-purpose programming language)",
        "runtime": "Evaluated by a host tool (Ansible, Terraform, Make, Nix, etc.) — no standalone VM",
        "memory": "Managed by the host tool running the configuration or build"
      }
    },
    {
      "id": "wasm",
      "name": "WebAssembly",
      "color": "#654ff0",
      "description": "A compact binary format for sandboxed, portable modules — usually produced by compiling C, C++, Rust, and similar languages, with a text (WAT) form for debugging.",
      "whoItIsFor": "Teams porting C/C++/Rust to the web for near-native performance, or building sandboxed plugin VMs and serverless edge functions.",
      "commonUses": [
        "Browser performance hotspots",
        "Plugins",
        "Serverless WASM",
        "Cross-language modules"
      ],
      "patterns": [
        {
          "title": "WAT snippet",
          "code": "(module\n  (func $add (param $a i32) (param $b i32) (result i32)\n    local.get $a\n    local.get $b\n    i32.add)\n)",
          "explanation": "Stack machine: locals then operators."
        },
        {
          "title": "Memory import/export and host function call (boundary)",
          "code": ";; Export a function and shared memory for the host\n(module\n  ;; Import host functions\n  (import \"env\" \"print_i32\" (func $print_i32 (param i32)))\n\n  ;; Export memory so host can read/write data\n  (memory (export \"memory\") 1)\n\n  ;; Export a function the host can call\n  (func (export \"add_and_log\") (param $a i32) (param $b i32)\n    (local $sum i32)\n    (local.set $sum (i32.add (local.get $a) (local.get $b)))\n    ;; Write result to memory offset 0 for host to read\n    (i32.store (i32.const 0) (local.get $sum))\n    ;; Call back into host\n    (call $print_i32 (local.get $sum))\n  )\n)",
          "explanation": "WASM's boundary is defined by imports and exports. The host imports functions (like print_i32) that the module can call. The module exports functions (add_and_log) and memory (memory) that the host can invoke and read. Data flows through shared linear memory — the host writes arguments to a known offset, calls the exported function, and reads results back. This is the core polyglot pattern for WASM."
        },
        {
          "title": "Function and table exports — dynamic dispatch boundary",
          "code": ";; Indirect calls via function tables — the dynamic dispatch boundary\n(module\n  (type $binop (func (param i32 i32) (result i32)))\n\n  (func $add (param i32 i32) (result i32)\n    (i32.add (local.get 0) (local.get 1)))\n  (func $sub (param i32 i32) (result i32)\n    (i32.sub (local.get 0) (local.get 1)))\n\n  ;; Table of function references\n  (table (export \"ops\") 2 funcref)\n  (elem (i32.const 0) $add $sub)\n\n  ;; Call by table index — host selects the operation\n  (func (export \"compute\") (param $op i32) (param $a i32) (param $b i32) (result i32)\n    (call_indirect (type $binop) (local.get $a) (local.get $b) (local.get $op))\n  )\n)",
          "explanation": "WASM tables enable dynamic dispatch across the boundary. The host can insert function references into a table, and call_indirect routes to the right function at runtime. This is how dynamic language runtimes (Python, Ruby) compiled to WASM implement virtual method tables, callbacks, and plugin systems."
        }
      ],
      "libraries": [
        {
          "name": "MDN WASM",
          "url": "https://developer.mozilla.org/docs/WebAssembly",
          "type": "Web docs"
        },
        {
          "name": "WABT",
          "url": "https://github.com/WebAssembly/wabt",
          "type": "Toolkit"
        }
      ],
      "docs": [
        {
          "name": "WebAssembly spec",
          "url": "https://webassembly.github.io/spec/core/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "(local $x i32)\ni32.const 10\nlocal.set $x",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": ";; use br_if / if result blocks",
          "difficulty": "basic"
        },
        "loops": {
          "code": "loop $l ... br $l",
          "difficulty": "basic"
        },
        "functions": {
          "code": "(func $name (param i32) (result i32) ...)",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Near-native when JIT/AOT compiled; sandboxed and startup-friendly.",
          "difficulty": "basic"
        },
        "classes": {
          "code": ";; No class system — use structs for data\n;; (struct $point (field $x f64) (field $y f64))\n;; Wasm GC proposal adds structs (not yet universal)",
          "difficulty": "N/A"
        },
        "strings": {
          "code": ";; No string type — pass bytes in linear memory\n;; Host encodes as UTF-8 into shared memory\n;; Module reads/writes byte offsets, not strings",
          "difficulty": "N/A"
        },
        "errors": {
          "code": ";; No exception handling in MVP Wasm\n;; Stack unwinding: try/catch in Wasm exception proposal\n;; (try\n;;   (do (call $might_trap))\n;;   (catch $tag (local.get 0))\n;; )",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": ";; Import functions from the host\n(import \"env\" \"log\" (func $log (param i32)))\n;; Import memory from the host\n(import \"env\" \"memory\" (memory 1))",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "wasm-tip-memory-and-abi",
          "title": "Linear memory and host ABI are the real boundary",
          "body": "WASM modules share linear memory with the host; pointer widths, alignment, and string encodings must match the glue (JS, WASI, or custom imports). Prefer explicit exports over ad-hoc memory poking.",
          "tag": "interop",
          "status": "curated"
        }
      ],
      "categories": [
        "systems",
        "web"
      ],
      "overview": "A compact binary format for sandboxed, portable modules. Typical workflow: compile from another language (Rust, C, C++, and others), load in a browser or WASM runtime, and exchange data through imports/exports and linear memory — WAT exists mainly for inspection and tooling.",
      "learning_curve": "Moderate to steep — WAT (WebAssembly Text) is readable but low-level. Understanding the linear memory model, value types (i32, f64 only), and the import/export boundary is essential. Most developers compile from Rust/C/C++ rather than hand-writing WAT.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Browser-native (Chrome, Firefox, Safari, Edge). wgpu and wasmtime are leading runtimes. WASI provides system access outside browsers. Growing use in edge computing, serverless, and plugin systems. The WebAssembly Component Model is one path toward richer polyglot interfaces—support and tooling still vary by runtime.",
      "common_use_cases": [
        "Browser performance hotspots",
        "Plugins",
        "Serverless WASM",
        "Cross-language modules"
      ],
      "docs_url": "https://webassembly.github.io/spec/core/",
      "best_for": [
        "browser-based compute-intensive workloads",
        "portable sandboxed execution environment",
        "Server-side plugin sandboxing",
        "Browser and server-side plugin sandboxes with near-native speed"
      ],
      "weak_at": [
        "Direct hardware driver development without host runtime cooperation",
        "Simple CRUD apps where WASM toolchain complexity adds no value",
        "Legacy mainframe batch without WASM runtime support on target hosts"
      ],
      "official_url": "https://webassembly.org/",
      "paradigm": [
        "stack-based",
        "portable",
        "sandboxed"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Low-level typed modules (types describe imports, exports, and linear memory)",
        "runtime": "Sandboxed binary modules executed by a WebAssembly host (browser, Wasmtime, and others)",
        "memory": "Linear memory managed inside the module; host boundaries are explicit"
      }
    },
    {
      "id": "graphql",
      "name": "GraphQL",
      "color": "#e10098",
      "description": "A schema and query language for APIs—clients request a field selection in one operation; a server implements resolvers and execution behind that contract.",
      "whoItIsFor": "API and product engineers (including web and mobile clients) who want typed, client-shaped responses and are ready to design resolvers, limits, and caching—not a drop-in replacement for every REST pain point.",
      "commonUses": [
        "Product APIs",
        "BFF layers",
        "Mobile apps",
        "Federated graphs"
      ],
      "patterns": [
        {
          "title": "Query",
          "code": "query {\n  user(id: 1) {\n    name\n    email\n  }\n}",
          "explanation": "For fields the server resolves, the response shape follows the query; missing data or resolver errors can still yield nulls and an errors list."
        },
        {
          "title": "Mutation",
          "code": "mutation {\n  createPost(title: \"Hi\") {\n    id\n  }\n}",
          "explanation": "Writes are explicit mutations — GraphQL separates reads (queries) from writes (mutations)."
        },
        {
          "title": "Resolver boundary — bridging schema to data sources",
          "code": "# GraphQL schema defines the API surface\ntype Query {\n  user(id: ID!): User\n}\n\ntype User {\n  id: ID!\n  name: String\n  posts: [Post]\n}\n\n# Resolvers bridge the schema to real data sources:\n# const resolvers = {\n#   Query: {\n#     user: (_, { id }) => db.users.findById(id),     # SQL\n#   },\n#   User: {\n#     posts: (user) => fetch(\"/api/posts?userId=\" + user.id),  # REST\n#   },\n# };\n#\n# One schema can fan out to multiple backends via resolvers (with latency and N+1 tradeoffs).",
          "explanation": "The spec defines the schema and operation shape; resolver functions in your server implementation load data from databases, HTTP services, gRPC, or other sources. One operation can trigger several backend calls—useful, but it creates N+1 fan-out, latency, and authorization footguns unless you batch, cache, and enforce query cost/depth limits. Federation and stitching are optional composition patterns, not something the core language solves by itself."
        }
      ],
      "libraries": [
        {
          "name": "Apollo",
          "url": "https://www.apollographql.com/",
          "type": "Client / server"
        },
        {
          "name": "GraphQL.js",
          "url": "https://graphql-js.org/",
          "type": "Reference implementation"
        }
      ],
      "docs": [
        {
          "name": "GraphQL learn",
          "url": "https://graphql.org/learn/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# GraphQL is schema + operations, not variables in the C sense",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# Business logic lives in resolvers on the server",
          "difficulty": "basic"
        },
        "loops": {
          "code": "# Lists modeled as [Item] fields; iteration is client-side",
          "difficulty": "basic"
        },
        "functions": {
          "code": "type Query { add(a: Int!, b: Int!): Int }",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Depends on resolver/data-loader design; N+1 fan-out is the classic pitfall. Caching and payload size still need deliberate design.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "# No class system — GraphQL uses types (object, input, interface)\ntype Query {\n  user(id: ID!): User\n}\ntype User {\n  id: ID!\n  name: String\n  email: String\n}",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# Strings in GraphQL are a scalar type (String)\n# String fields return UTF-8 text\nquery {\n  user(id: 1) {\n    name  # returns a String\n  }\n}",
          "difficulty": "N/A"
        },
        "errors": {
          "code": "# GraphQL errors appear in the response alongside data\n# Partial success: some fields resolve, others error\nquery {\n  user(id: 999) {\n    name  # might resolve to null with error\n  }\n}\n# Response: { \"data\": { \"user\": null }, \"errors\": [{ \"message\": \"Not found\" }] }",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "# GraphQL has a schema definition language, not imports\n# Schema stitching / federation combines schemas:\nextend type Query {\n  # from another service\n}",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "data",
        "query",
        "api"
      ],
      "overview": "GraphQL defines a typed schema and operations (queries, mutations, subscriptions); implementations run on ordinary servers you operate. The contract helps clients request a field selection in one round trip, but resolvers still decide what data is loaded—so over-fetching, authorization, and slow joins remain engineering problems. Deep queries need limits, cost analysis, and monitoring; HTTP caching semantics differ from typical REST GETs.",
      "learning_curve": "Moderate — SDL and query syntax are compact. Most depth comes from resolvers, batching, caching, authz, and protecting the graph from expensive queries. Federation and schema stitching are advanced composition topics with real operational overhead.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Apollo (client/server), Relay, and graphql-js are widely used reference points; production servers exist for many languages. Public “who uses GraphQL” lists age quickly—verify current product docs. Federation/stitching can split a graph across services but adds governance and runtime complexity. GraphiQL and IDE plugins are common for exploration.",
      "common_use_cases": [
        "Product APIs",
        "BFF layers",
        "Mobile apps",
        "Federated graphs"
      ],
      "docs_url": "https://graphql.org/learn/",
      "best_for": [
        "flexible API query language design",
        "batching and reducing over-fetching in APIs",
        "client-driven data fetching patterns",
        "Flexible client-driven APIs reducing over-fetching in mobile apps"
      ],
      "weak_at": [
        "Simple static file or CDN-only sites without dynamic query needs",
        "Report-heavy OLAP workloads better served by SQL aggregations",
        "Teams needing mature caching without DataLoader-style batching discipline"
      ],
      "official_url": "https://graphql.org/",
      "paradigm": [
        "declarative",
        "query",
        "schema-driven"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative query or policy notation (schema- or engine-driven)",
        "runtime": "Executed by a database, API server, or policy engine (product-specific)",
        "memory": "Managed by the host system running the query or policy"
      }
    },
    {
      "id": "carbon",
      "name": "Carbon",
      "color": "#111111",
      "description": "Google's experimental successor to C++ — familiar syntax with modern safety and interop. Designed to incrementally migrate large C++ codebases toward safer patterns.",
      "whoItIsFor": "C++ teams exploring a migration path with better defaults — designed for gradual adoption and interoperability with existing C++ codebases.",
      "commonUses": [
        "C++ interop",
        "Systems programming",
        "Performance-critical code"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "fn Main() -> i32 {\n  Print(\"Hello\");\n  return 0;\n}",
          "explanation": "Entry point returns an integer; Carbon's Main function signature mirrors C++ conventions."
        },
        {
          "title": "C++ interop — Carbon's primary design boundary",
          "code": "// Carbon is designed for seamless C++ interop\n// Call C++ from Carbon:\nimport Cpp library \"cmath\";\nfn Sqrt(x: f64) -> f64 { return Cpp.cmath.sqrt(x); }\n\n// Carbon types can be used in C++ via the interop layer\n// Carbon migrates C++ incrementally — no full rewrite needed",
          "explanation": "Carbon's primary boundary is C++ interop — it's designed as a C++ successor that can interoperate with existing C++ codebases without a full rewrite. Carbon types map to C++ types and vice versa. This is Carbon's key differentiator: it doesn't compete with C++, it extends it incrementally."
        },
        {
          "title": "Package and namespace — Carbon's module system",
          "code": "// Carbon packages are the unit of distribution\npackage MyMath api;\n\nlibrary Implementations;\n\nfn Add(a: i32, b: i32) -> i32 {\n  return a + b;\n}",
          "explanation": "Carbon's package/library system replaces C++ headers and includes. Packages define API surfaces; libraries contain implementations. This eliminates C++'s header inclusion model and provides a cleaner module boundary for polyglot systems."
        }
      ],
      "libraries": [
        {
          "name": "Carbon repo",
          "url": "https://github.com/carbon-language/carbon-lang",
          "type": "Source"
        }
      ],
      "docs": [
        {
          "name": "Carbon GitHub",
          "url": "https://github.com/carbon-language/carbon-lang"
        }
      ],
      "compareData": {
        "variables": {
          "code": "var x: i32 = 10;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5) { }",
          "difficulty": "basic"
        },
        "loops": {
          "code": "while (x > 0) { x -= 1; }",
          "difficulty": "basic"
        },
        "functions": {
          "code": "fn Add(a: i32, b: i32) -> i32 { return a + b; }",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Experimental; targets C++-class native speed.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "class Point {\n  var x: f64;\n  var y: f64;\n  fn Length[self: Self]() -> f64 {\n    return sqrt(self.x * self.x + self.y * self.y);\n  }\n}",
          "difficulty": "basic"
        },
        "strings": {
          "code": "var greeting: String = \"Hello, Carbon!\";\nPrint(greeting);",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Carbon has no exceptions (as of 2024)\n// Uses Option and Result types for error handling\nvar result: Result(i32) = RiskyOp();\nif result.IsOk() {\n  Print(result.Value());\n}",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "import Math;\npackage MyPackage api;",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "carbon-tip-format-pass11",
          "title": "Experimental language — expect churn",
          "body": "Carbon is experimental. Treat examples as illustrative; do not assume production stability or package ecosystems.",
          "tag": "status",
          "status": "curated"
        }
      ],
      "categories": [
        "systems"
      ],
      "overview": "Google's experimental successor to C++ — familiar syntax with modern safety and interop. Designed to incrementally migrate large C++ codebases toward safer patterns. C++ teams exploring a migration path with better defaults — designed for gradual adoption and interoperability with existing C++ codebases.\n\nTypical projects include C++ interop, Systems programming, Performance-critical code. Pre-release explorer phase — not production-ready yet.",
      "learning_curve": "Unknown — Carbon is pre-release (explorer phase). Developers with C++ experience will find it familiar. The explicit generics and type system are cleaner than C++ but still evolving.",
      "good_for_teaching": "N/A",
      "ecosystem_notes": "Pre-release. Google-backed, led by Chandler Carruth (LLVM/Clang). Toolchain based on LLVM. No package manager yet. Community is early adopters and C++ experts. Not production-ready.",
      "common_use_cases": [
        "C++ interop",
        "Systems programming",
        "Performance-critical code"
      ],
      "docs_url": "https://github.com/carbon-language/carbon-lang/blob/trunk/docs/design/README.md",
      "best_for": [
        "C++ interoperability and gradual migration",
        "performance-critical systems programming",
        "safe low-level application development",
        "Experimenting with C++ successor syntax while interoping with existing code"
      ],
      "weak_at": [
        "Production systems requiring stable language and ABI guarantees today",
        "Greenfield products where Rust or modern C++ already meet needs",
        "Teams without bandwidth to track experimental toolchain churn"
      ],
      "official_url": "https://github.com/carbon-language/carbon-lang",
      "paradigm": [
        "imperative",
        "systems",
        "experimental"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static (experimental C++-successor language)",
        "runtime": "Compiled ahead-of-time via LLVM in experimental toolchains",
        "memory": "Manual/RAII-oriented like C++; no garbage collector in the core model",
        "abstraction": "Systems-level with modern syntax experiments"
      }
    },
    {
      "id": "odin",
      "name": "Odin",
      "color": "#3882d6",
      "description": "A hand-crafted systems language for high-performance software — no hidden control flow. Designed as a modern C alternative with explicit allocation and SIMD-friendly data layout.",
      "whoItIsFor": "Game developers and systems programmers who want clarity over abstraction — an alternative to C for real-time graphics, audio, and tooling.",
      "commonUses": [
        "Game engines",
        "Tools",
        "Systems utilities"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "package main\nimport \"core:fmt\"\nmain :: proc() {\n  fmt.println(\"Hello\")\n}",
          "explanation": "Uses :: for declarations; the Odin entry point is straightforward without hidden initialization."
        },
        {
          "title": "foreign block — Odin's C interop boundary",
          "code": "// Odin imports C declarations directly via foreign blocks\nforeign import libc \"system:c\"\n\nforeign libc {\n    @export printf, puts\n}\n\nforeign libc {\n    printf :: proc(c: cstring, ...) -> c.int ---\n    puts :: proc(c: cstring) -> c.int ---\n}\n\n// Usage\nputs(\"Hello from C via Odin\")",
          "explanation": "Odin's foreign block declares C functions that can be called directly — similar to Zig's @cImport but uses explicit foreign import declarations. The --- terminator marks a foreign procedure (no body). Odin's contextual type system and zero-cost C interop make it effective for systems programming in polyglot pipelines."
        },
        {
          "title": "Context system — Odin's implicit parameter passing",
          "code": "// Odin's context system passes allocators, loggers, and config implicitly\nimport \"core:fmt\"\n\nmain :: proc() {\n    context.allocator = new:allocator()\n    // All allocations in this scope use the custom allocator\n    data := make([dynamic]int)\n    append(&data, 1, 2, 3)\n    fmt.println(data)\n    delete(data)\n}",
          "explanation": "Odin's context system passes allocators, loggers, and other configuration implicitly through the calling chain. This avoids global state while keeping APIs clean. In polyglot pipelines, context enables per-request allocation tracking and custom memory strategies."
        }
      ],
      "libraries": [
        {
          "name": "Odin docs",
          "url": "https://odin-lang.org/docs/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Odin language",
          "url": "https://odin-lang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "x : int = 10",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5 { }",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for i in 0..<5 { }",
          "difficulty": "basic"
        },
        "functions": {
          "code": "add :: proc(a, b: int) -> int { return a + b }",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiled to native; targets game-dev performance.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "// No classes — Odin uses structs and procedures\nPoint :: struct {\n    x: f64,\n    y: f64,\n}\n\nlength :: proc(p: Point) -> f64 {\n    return math.sqrt(p.x * p.x + p.y * p.y)\n}",
          "difficulty": "basic"
        },
        "strings": {
          "code": "greeting: string = \"Hello, Odin!\"\nfmt.println(greeting)",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Multiple return values for error handling\nresult, ok := risky_operation()\nif !ok {\n    fmt.println(\"Operation failed\")\n}\n\n// Or use os.ErrorCode\nfile, err := os.open(\"data.txt\")\nif err != nil {\n    fmt.println(\"Error:\", err)\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "import \"core:fmt\"\nimport \"core:math\"\nimport rl \"vendor:raylib\"  // aliased",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "odin-tip-the-compiler-removes-bug-classes-not-design-mist",
          "title": "The compiler removes bug classes, not design mistakes",
          "body": "Odin makes ownership and lifetime rules explicit, which catches dangling references and race-prone patterns early. That still leaves you responsible for data flow, API boundaries, and the shape of your abstractions.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "categories": [
        "systems"
      ],
      "overview": "A hand-crafted systems language for high-performance software — no hidden control flow. Designed as a modern C alternative with explicit allocation and SIMD-friendly data layout. Game developers and systems programmers who want clarity over abstraction — an alternative to C for real-time graphics, audio, and tooling.\n\nTypical projects include Game engines, Tools, Systems utilities. Still pre-1.0 but stable for early adopters in gamedev.",
      "learning_curve": "Moderate if you know Go or C — similar syntax with more explicit typing. The context system and multiple return values are the main additions. Still pre-1.0 but stable for early adopters.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Growing package collection via Odin's built-in package system. Strong in game development (GingerBill, the creator, is in gamedev). Compiles via LLVM. Smaller community than Zig but very active.",
      "common_use_cases": [
        "Game engines",
        "Tools",
        "Systems utilities"
      ],
      "docs_url": "https://odin-lang.org/docs/",
      "best_for": [
        "game engine and toolchain development",
        "systems utilities with minimal dependencies",
        "high-performance native applications",
        "Game engine tooling and data-oriented design with explicit context APIs"
      ],
      "weak_at": [
        "Enterprise web backends expecting ORM-rich framework ecosystems",
        "Mobile consumer apps without custom UI engine investment",
        "Regulated environments mandating formally verified language subsets"
      ],
      "official_url": "https://odin-lang.org/",
      "paradigm": [
        "imperative",
        "systems",
        "data-oriented"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static with explicit memory and type rules",
        "runtime": "Compiled ahead-of-time to native machine code (LLVM backend)",
        "memory": "Manual — explicit allocators and context-based memory; no GC in the core model",
        "abstraction": "Low-level systems programming with pragmatic syntax"
      }
    },
    {
      "id": "mojo",
      "name": "Mojo",
      "color": "#ff5f1f",
      "description": "A Python-superset language from Modular that compiles to native code for AI/ML workloads. Adds ownership, structs, and vectorisation while keeping Python syntax familiar.",
      "whoItIsFor": "Python developers who need C-level speed for ML and numerical work — compiles Python-like syntax with systems-level control for acceleration.",
      "commonUses": [
        "AI/ML",
        "High-performance Python",
        "SIMD / GPU compute"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "fn main():\n    print(\"Hello\")",
          "explanation": "Python-like syntax that compiles to native — def fn() works, but fn is the faster compiled form."
        },
        {
          "title": "Python interop boundary — Mojo's seamless Python access",
          "code": "# Mojo can import and call any Python library directly\nfrom python import Python\n\n# Use numpy from Mojo\nlet np = Python.import_module(\"numpy\")\nlet arr = np.array([1, 2, 3, 4, 5])\nprint(arr.mean())  # 3.0\n\n# Use Python's standard library\nlet os = Python.import_module(\"os\")\nprint(os.getcwd())",
          "explanation": "Mojo's primary boundary is Python interop — it can import and call any Python module directly with from python import. This gives Mojo instant access to the entire Python ecosystem (NumPy, PyTorch, pandas) while compiling to native code for performance. Mojo is a Python superset with systems-level control."
        },
        {
          "title": "fn vs def — ownership and borrowing in Mojo",
          "code": "# def: Python-compatible, dynamic dispatch\ndef greet(name: String):\n    print(\"Hello, \" + name)\n\n# fn: strict, ownership-aware, no implicit copies\nfn add(a: Int, b: Int) -> Int:\n    return a + b\n\n# owned: transfer ownership\nfn take_ownership(owned data: DynamicVector[Int]):\n    # data is moved, not copied\n    pass",
          "explanation": "Mojo distinguishes def (Python-compatible, dynamic) from fn (strict, ownership-aware). fn uses Rust-like ownership semantics — owned transfers ownership, inout passes by reference. This dual boundary lets Mojo interoperate with Python while providing systems-level memory control."
        }
      ],
      "libraries": [
        {
          "name": "Modular docs",
          "url": "https://docs.modular.com/mojo/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Mojo docs",
          "url": "https://docs.modular.com/mojo/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "var x: Int = 10\nlet y = 20",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if x > 5:\n    pass",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for i in range(5):\n    pass",
          "difficulty": "basic"
        },
        "functions": {
          "code": "fn add(a: Int, b: Int) -> Int:\n    return a + b",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiled; targets MLIR for massive speedups over CPython.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "@value\nstruct Point:\n    var x: Float64\n    var y: Float64\n\n    fn length(self) -> Float64:\n        return sqrt(self.x * self.x + self.y * self.y)",
          "difficulty": "basic"
        },
        "strings": {
          "code": "var greeting: String = \"Hello, Mojo!\"\nprint(greeting)",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# Mojo uses Result and Optional for error handling\n# (similar to Rust, but with Python syntax)\ntry:\n    risky_operation()\nexcept:\n    print(\"Error occurred\")",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "from python import Python\nfrom python.os import getpid\n\n# Mojo's own modules\nimport math\nimport tensor",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "mojo-tip-python-adjacent",
          "title": "Python-adjacent, not a full CPython replacement",
          "body": "Mojo aims for familiar Python-like syntax with systems performance goals, but the language and toolchain are still evolving. Confirm current interoperability and standard-library coverage in Modular’s docs before porting large Python codebases.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "mojo-tip-verify-version",
          "title": "Pin docs to your toolchain version",
          "body": "Syntax and packaging details have moved quickly. Prefer the official docs matching the SDK or nightly you installed rather than blog posts from earlier previews.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "categories": [
        "systems",
        "ai"
      ],
      "overview": "A Python-superset language from Modular that compiles to native code for AI/ML workloads. Adds ownership, structs, and vectorisation while keeping Python syntax familiar. Python developers who need C-level speed for ML and numerical work — compiles Python-like syntax with systems-level control for acceleration.\n\nTypical projects include AI/ML, High-performance Python, SIMD / GPU compute. Still in early access and pre-1.0 with rapidly evolving syntax.",
      "learning_curve": "Moderate if you know Python — familiar syntax with new concepts (fn vs def, ownership, var/let). The ownership model is simpler than Rust. Still evolving rapidly (pre-1.0).",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Developed by Modular (Chris Lattner, LLVM/Swift creator). Still in early access. Python ecosystem is immediately available. Growing native library collection. Targeting AI/ML and systems programming.",
      "common_use_cases": [
        "AI/ML",
        "High-performance Python",
        "SIMD / GPU compute"
      ],
      "docs_url": "https://docs.modular.com/mojo/",
      "best_for": [
        "Python-compatible high-performance systems programming",
        "MLIR-optimised numerical computing",
        "AI kernel and accelerator development",
        "Accelerating Python numerical kernels with SIMD and ownership semantics"
      ],
      "weak_at": [
        "General web development unrelated to numerical or AI workloads",
        "Teams standardized on Rust or C++ without Python ML context",
        "Production deployments before Modular platform maturity stabilizes"
      ],
      "official_url": "https://www.modular.com/mojo",
      "paradigm": [
        "imperative",
        "python-compatible",
        "systems"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static (Python-superset with systems types and ownership)",
        "runtime": "Compiled via MLIR/LLVM to native code or Python extension modules",
        "memory": "Manual/ownership-aware in `@value` code; Python interop uses the Python GC for Python objects"
      }
    },
    {
      "id": "forth",
      "name": "Forth",
      "color": "#c94c4c",
      "description": "A stack-based language with extreme minimalism — you define words that manipulate a data stack. Powers embedded systems and astronomical instrument firmware.",
      "whoItIsFor": "Embedded engineers and boot loader authors — minimal runtime, extreme simplicity, and direct hardware control for small and constrained devices.",
      "commonUses": [
        "Embedded firmware",
        "Boot loaders",
        "Interactive systems"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": ": hello  .\" Hello\" ;\nhello",
          "explanation": "Defines a word that prints a string with .\" and calls it — classic Forth hello output."
        },
        {
          "title": "Stack math",
          "code": "3 4 + .",
          "explanation": "Pushes 3 and 4 onto the stack, + pops both and pushes 7, then . prints. Pure stack manipulation."
        },
        {
          "title": "FFI words — calling C from Forth (boundary)",
          "code": "\\ Gforth: open a shared library and call C functions\nrequire gforth.fs\n\ns\" libm.so.6\" open-lib throw constant libm\nlibm s\" sqrt\" 1 f: f1 libc-funcall f: sqrt-func\n\n\\ Call it\n2.0 sqrt-func f.   \\ prints 1.41421356237",
          "explanation": "Forth's FFI boundary uses open-lib to load shared libraries and libc-funcall to invoke C functions. Each foreign function is wrapped as a Forth word. This is how Forth systems access system libraries and integrate with C code in polyglot environments."
        }
      ],
      "libraries": [
        {
          "name": "Gforth",
          "url": "https://gforth.org/",
          "type": "Implementation"
        }
      ],
      "docs": [
        {
          "name": "Forth standard",
          "url": "https://forth-standard.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "VARIABLE x  10 x !",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": ": check  x @ 5 > IF .\" big\" THEN ;",
          "difficulty": "basic"
        },
        "loops": {
          "code": ": count  5 0 DO I . LOOP ;",
          "difficulty": "basic"
        },
        "functions": {
          "code": ": add  + ;",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Tiny footprint; runs on bare metal.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "\\ No class system — Forth uses defining words and vocabularies\n: POINT CREATE ( x y -- ) F, F, ;\n: .POINT ( addr -- ) DUP F@ . F@ . ;",
          "difficulty": "N/A"
        },
        "strings": {
          "code": ": GREETING S\" Hello, Forth!\" ;\nGREETING TYPE CR",
          "difficulty": "basic"
        },
        "errors": {
          "code": "\\ Forth uses THROW/CATCH for error handling\n: RISKY ( -- ) -1 THROW ;\n: TRY-RISKY ( -- ) ['] RISKY CATCH IF .\" Error caught!\" CR THEN ;",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "\\ Forth uses INCLUDE or REQUIRE to load files\nINCLUDE my-words.4th\nREQUIRE math.4th",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "forth-tip-stack",
          "title": "The stack discipline is the program",
          "body": "Factor words so stack effects are obvious. Different Forths disagree on word sets — pin the Forth dialect, not a language-wide package manager.",
          "tag": "stack",
          "status": "curated"
        }
      ],
      "categories": [
        "esoteric"
      ],
      "overview": "A stack-based language with extreme minimalism — you define words that manipulate a data stack. Powers embedded systems and astronomical instrument firmware. Embedded engineers and boot loader authors — minimal runtime, extreme simplicity, and direct hardware control for small and constrained devices.\n\nTypical projects include Embedded firmware, Boot loaders, Interactive systems.",
      "learning_curve": "Very steep — RPN notation, stack manipulation, and the metaprogramming model (defining words) are alien to most developers. Rewarding for embedded systems and real-time control where Forth excels.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Gforth is the standard open-source implementation. Used in embedded systems, aerospace (Philae lander), and boot firmware. Tiny footprint — can run on microcontrollers with <1KB RAM. Very small but dedicated community.",
      "common_use_cases": [
        "Embedded firmware",
        "Boot loaders",
        "Interactive systems"
      ],
      "docs_url": "https://forth-standard.org/",
      "best_for": [
        "embedded firmware and boot loaders",
        "Interactive low-level systems",
        "resource-constrained real-time control",
        "Interactive low-level firmware on resource-constrained microcontrollers"
      ],
      "weak_at": [
        "Large collaborative codebases with conventional module boundaries",
        "Rich IDE autocomplete ecosystems expecting mainstream languages",
        "Web-first products without bespoke Forth-to-JS compilation bridges"
      ],
      "official_url": "https://www.forth.com/",
      "paradigm": [
        "stack-based",
        "concatenative",
        "extensible"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Untyped at the word level (stack effects are conventional, not checked by the language)",
        "runtime": "Interpreted or compiled to native code depending on the Forth implementation",
        "memory": "Manual via the parameter stack and dictionary; no garbage collector in classic Forths",
        "abstraction": "Extremely low-level concatenative programming"
      }
    },
    {
      "id": "tcl",
      "name": "Tcl",
      "color": "#e4631a",
      "description": "Tool Command Language — everything is a string, and commands are just words. Great for glue scripting, prototyping, and embedding as an extension language in larger apps.",
      "whoItIsFor": "Automation engineers, EDA tool users, and Tk GUI builders — the scripting glue for electronic design, testing frameworks, and legacy CAD tools.",
      "commonUses": [
        "EDA scripting",
        "Tk GUIs",
        "Test harnesses",
        "Embedded scripting"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "puts \"Hello\"",
          "explanation": "Writes text to standard output using puts — the smallest Tcl Hello World."
        },
        {
          "title": "Proc",
          "code": "proc add {a b} { expr {$a + $b} }\nputs [add 3 4]",
          "explanation": "Defines a named procedure with proc; arguments are positional by default in Tcl's word-based syntax."
        },
        {
          "title": "C API and Tk — Tcl's extension boundary",
          "code": "/* Tcl C API — extend Tcl with native commands */\n#include <tcl.h>\nstatic int AddCmd(ClientData c, Tcl_Interp *interp,\n                  int argc, char *argv[]) {\n    int a = atoi(argv[1]);\n    int b = atoi(argv[2]);\n    char result[32];\n    sprintf(result, \"%d\", a + b);\n    Tcl_SetResult(interp, result, TCL_VOLATILE);\n    return TCL_OK;\n}\n\n/* Register the command */\nTcl_CreateCommand(interp, \"add\", AddCmd, NULL, NULL);",
          "explanation": "Defines a named procedure with proc; arguments are positional by default in Tcl's word-based syntax."
        }
      ],
      "libraries": [
        {
          "name": "Tcl wiki",
          "url": "https://wiki.tcl-lang.org/",
          "type": "Community"
        }
      ],
      "docs": [
        {
          "name": "Tcl manual",
          "url": "https://www.tcl.tk/man/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "set x 10",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if {$x > 5} { puts big } else { puts small }",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for {set i 0} {$i < 5} {incr i} { puts $i }",
          "difficulty": "basic"
        },
        "functions": {
          "code": "proc add {a b} { expr {$a + $b} }",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Interpreted; fast enough for scripting and glue.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "# No class system in classic Tcl\n# TclOO (8.6+) adds classes:\noo::class create Point {\n    variable x y\n    constructor {x_ y_} { set x $x_; set y $y_ }\n    method length {} { expr {sqrt($x*$x + $y*$y)} }\n}",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "set greeting \"Hello, Tcl!\"\nputs $greeting\n# String interpolation with double quotes\nputs \"Result: [expr {3 + 4}]\"",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# Tcl uses catch for error handling\nif {[catch {risky_operation} result]} {\n    puts \"Error: $result\"\n} else {\n    puts \"Success: $result\"\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "package require Tk\npackage require http\n# Tcl modules: tcllib, tcllib",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "devops"
      ],
      "overview": "Tool Command Language — everything is a string, and commands are just words. Great for glue scripting, prototyping, and embedding as an extension language in larger apps.",
      "learning_curve": "Gentle for scripting — the syntax is minimal (set, if, puts). Advanced Tcl (TclOO, C extensions, event loop) adds depth. The quoting rules are the main source of confusion.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Tk is the most visible part of the Tcl ecosystem (wish, tclsh). Tcllib provides utility packages. Used heavily in EDA (electronic design automation), testing (expect), and as an embedded scripting language. Small but mature community.",
      "common_use_cases": [
        "EDA scripting",
        "Tk GUIs",
        "Test harnesses",
        "Embedded scripting"
      ],
      "docs_url": "https://www.tcl-lang.org/doc/",
      "best_for": [
        "EDA tool scripting for chip design",
        "Tk GUI prototyping",
        "test harness and embedded scripting",
        "Tk GUI prototyping and test automation with expect-style tooling"
      ],
      "weak_at": [
        "Cloud-native services expecting container-first deployment patterns",
        "Type-safe enterprise APIs without dynamic stringly-typed interfaces",
        "Mobile applications outside Tk cross-platform widget limitations"
      ],
      "official_url": "https://www.tcl-lang.org/",
      "paradigm": [
        "imperative",
        "scripting",
        "embeddable"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Commands and text expansion (typically untyped at the shell level)",
        "runtime": "Interpreted by a shell, editor, or automation host",
        "memory": "Managed by the host process running the script"
      }
    },
    {
      "id": "smalltalk",
      "name": "Smalltalk",
      "color": "#596706",
      "description": "The original object-oriented language — everything is an object, everything is a message. Its simplicity influenced Ruby, Objective-C, and modern IDE design.",
      "whoItIsFor": "OOP purists, Pharo/Squeak enthusiasts, and live-coding explorers — the language that inspired objects, messaging, and IDE concepts everywhere.",
      "commonUses": [
        "Live coding",
        "Prototyping",
        "Education",
        "Pharo apps"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "Transcript show: 'Hello'.",
          "explanation": "Sends the show: message to Transcript — Smalltalk's way of printing output in the system window."
        },
        {
          "title": "Block",
          "code": "[:x | x * 2] value: 5",
          "explanation": "A closure (block) applied to 5 — blocks are anonymous functions and the core control structure."
        },
        {
          "title": "FFI - calling native code from Smalltalk (varies by implementation)",
          "code": "\" Pharo FFI - call C directly from Smalltalk\nFFILibrary subclass: #LibMath\n    instanceVariableNames: ''\n    package: 'FFI-Examples'.\n\nLibMath >> sqrt: aFloat\n    ^ self ffiCall: #(float sqrt(float aFloat))\n\n\" Usage:\nLibMath new sqrt: 2.0  \"=> 1.41421356237\"\n\n\" Squeak: use NBFFI or OSProcess\n\" VisualWorks: use DLLCC",
          "explanation": "Smalltalk FFI varies by implementation: Pharo uses FFI (ffiCall:), Squeak uses NBFFI or OSProcess, VisualWorks uses DLLCC. Each provides a way to call C functions from the Smalltalk image. This is the polyglot boundary - Smalltalk calling out to native C libraries for performance-critical or system-level operations."
        }
      ],
      "libraries": [
        {
          "name": "Pharo",
          "url": "https://pharo.org/",
          "type": "Modern Smalltalk"
        }
      ],
      "docs": [
        {
          "name": "Pharo docs",
          "url": "https://pharo.org/documentation"
        }
      ],
      "compareData": {
        "variables": {
          "code": "| x |\nx := 10.",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "x > 5 ifTrue: ['big'] ifFalse: ['small']",
          "difficulty": "basic"
        },
        "loops": {
          "code": "1 to: 5 do: [:i | Transcript show: i]",
          "difficulty": "basic"
        },
        "functions": {
          "code": "add: a to: b\n  ^ a + b",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Image-based VM; interactive speed, not HPC.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "\"Everything is an object — classes define objects\"\nObject subclass: #Point\n    instanceVariableNames: 'x y'\n    classVariableNames: ''\n    package: 'Geometry'.\n\npoint := Point new x: 3; y: 4.\npoint length. \"=> 5.0\"",
          "difficulty": "basic"
        },
        "strings": {
          "code": "greeting := 'Hello, Smalltalk!'.\nTranscript show: greeting; cr.",
          "difficulty": "basic"
        },
        "errors": {
          "code": "[riskyOperation] on: Error do: [:ex |\n    Transcript show: 'Error: ', ex messageText; cr\n]",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "\"Smalltalk loads packages via Monticello (Pharo/Squeak)\nor via Metacello configuration\"\n\n\"No import syntax — everything is in the image\"",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "academic"
      ],
      "overview": "The original object-oriented language — everything is an object, everything is a message. Its simplicity influenced Ruby, Objective-C, and modern IDE design. OOP purists, Pharo/Squeak enthusiasts, and live-coding explorers — the language that inspired objects, messaging, and IDE concepts everywhere.\n\nTypical projects include Live coding, Prototyping, Education. Pharo is the dominant modern implementation.",
      "learning_curve": "Moderate for OOP concepts — Smalltalk pioneered objects and messages. The image-based development model (no files, live environment) is the main paradigm shift. Rewarding for understanding pure OOP.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Pharo is the dominant modern implementation. Squeak is the classic educational version. Used in education (Squeak/Etoys) and research. Seaside is the web framework. Small community but deeply influential — patterns from Smalltalk shaped Objective-C, Ruby, and many others.",
      "common_use_cases": [
        "Live coding",
        "Prototyping",
        "Education",
        "Pharo apps"
      ],
      "docs_url": "https://www.gnu.org/software/smalltalk/manual/",
      "best_for": [
        "live coding and exploratory prototyping",
        "Pharo educational and research projects",
        "image-based development workflows",
        "Live-image exploratory OOP with instant object inspection and refactoring"
      ],
      "weak_at": [
        "DevOps pipelines expecting text files and reproducible CLI builds",
        "Large distributed teams on Git-centric PR workflows exclusively",
        "Performance-critical numeric kernels without VM JIT tuning expertise"
      ],
      "official_url": "https://squeak.org/",
      "paradigm": [
        "object-oriented",
        "message-passing",
        "image-based"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Interpreted or bytecode-based in common implementations (engines vary)",
        "memory": "Garbage-collected in mainstream implementations",
        "abstraction": "High-level for typical scripting and application use"
      }
    },
    {
      "id": "scheme",
      "name": "Scheme",
      "color": "#1e4d78",
      "description": "A minimal Lisp dialect focused on clean semantics — tail calls, continuations, and hygiene. Its simplicity makes it an excellent vehicle for learning programming language concepts.",
      "whoItIsFor": "CS students, language researchers, and minimalists who love parentheses — a small, clean Lisp ideal for teaching concepts and building interpreters.",
      "commonUses": [
        "Teaching",
        "Language research",
        "Scripting",
        "DSLs"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "(display \"Hello\")(newline)",
          "explanation": "Uses display (and newline) to print a line from a minimal Scheme program."
        },
        {
          "title": "Lambda",
          "code": "(define add (lambda (a b) (+ a b)))",
          "explanation": "Anonymous function bound to add via define — Scheme's lambda is the fundamental abstraction primitive."
        },
        {
          "title": "FFI — calling C from Scheme (varies by implementation)",
          "code": ";; Guile: dynamic FFI\n(use-modules (system foreign))\n(define libc (dynamic-link))\n(define sqrt-func\n  (pointer->procedure double\n    (dynamic-func \"sqrt\" libc)\n    (list double)))\n\n(sqrt-func 2.0)  ;; => 1.41421356237\n\n;; Racket: ffi/unsafe\n;; (define sqrt (get-ffi-obj \"sqrt\" libc (_double _double -> _double)))\n\n;; Chicken: foreign-lambda\n;; (define sqrt (foreign-lambda double \"sqrt\" double))",
          "explanation": "Scheme FFI varies by implementation: Guile uses (system foreign) with dynamic-link/dynamic-func, Racket uses ffi/unsafe, and Chicken uses foreign-lambda. Each binds C functions to Scheme procedures. This is the polyglot boundary — Scheme calling C for performance and system access. The mechanism depends on which implementation you're running."
        }
      ],
      "libraries": [
        {
          "name": "Racket",
          "url": "https://racket-lang.org/",
          "type": "Scheme descendant"
        }
      ],
      "docs": [
        {
          "name": "R7RS spec",
          "url": "https://small.r7rs.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "(define x 10)",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "(if (> x 5) \"big\" \"small\")",
          "difficulty": "basic"
        },
        "loops": {
          "code": "(do ((i 0 (+ i 1))) ((= i 5)))",
          "difficulty": "basic"
        },
        "functions": {
          "code": "(define (add a b) (+ a b))",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Interpreted or compiled; varies by implementation.",
          "difficulty": "basic"
        },
        "classes": {
          "code": ";; No standard class system — use records or SRFI-9\n(define-record-type point\n  (make-point x y)\n  point?\n  (x point-x)\n  (y point-y))\n\n(define p (make-point 3 4))",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "(define greeting \"Hello, Scheme!\")\n(display greeting)\n;; Strings are immutable in most implementations",
          "difficulty": "basic"
        },
        "errors": {
          "code": ";; R7RS: guard for exception handling\n(guard (exn\n        ((error? exn) (display \"Error caught\")))\n  (risky-operation))",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": ";; R7RS import\n(import (scheme base)\n        (scheme write)\n        (srfi 1))  ;; lists",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "functional",
        "academic"
      ],
      "overview": "A minimal Lisp dialect focused on clean semantics — tail calls, continuations, and hygiene. Its simplicity makes it an excellent vehicle for learning programming language concepts. CS students, language researchers, and minimalists who love parentheses — a small, clean Lisp ideal for teaching concepts and building interpreters.\n\nTypical projects include Teaching, Language research, Scripting.",
      "learning_curve": "Steep for non-Lisp programmers — prefix notation and continuations are unfamiliar. SICP (Structure and Interpretation of Computer Programs) is the canonical teaching text. Minimalist spec (R7RS small) makes the core learnable quickly.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Multiple implementations with separate communities: Guile (GNU), Racket (most feature-rich), Chicken (compiles to C), Chez Scheme (fast compiler). SRFIs provide portable libraries. Strong in education (SICP) and embedded scripting (Guile).",
      "common_use_cases": [
        "Teaching",
        "Language research",
        "Scripting",
        "DSLs"
      ],
      "docs_url": "https://www.scheme.com/tspl4/",
      "best_for": [
        "functional programming education",
        "compiler design and language research",
        "Mini-language DSL prototyping",
        "Programming language courses teaching recursion and lambda calculus"
      ],
      "weak_at": [
        "Enterprise CRUD with ORM ecosystems and static typing mandates",
        "Mobile UI products expecting Swift, Kotlin, or Flutter tooling",
        "Operations teams standardized on bash, Python, or PowerShell scripts"
      ],
      "official_url": "https://www.scheme.org/",
      "paradigm": [
        "functional",
        "lisp",
        "minimal"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic (optional static checks in some dialects and tooling)",
        "runtime": "Interpreted or compiled to bytecode/native depending on implementation",
        "memory": "Garbage-collected in mainstream implementations"
      }
    },
    {
      "id": "racket",
      "name": "Racket",
      "color": "#9f1d20",
      "description": "A Scheme descendant built for language-oriented programming — create your own languages easily. Ships with a rich IDE (DrRacket) and hundreds of teaching languages built in.",
      "whoItIsFor": "Educators, PL researchers, and anyone building DSLs — a Lisp platform with rich macro support, GUI tooling, and academic heritage.",
      "commonUses": [
        "Teaching",
        "DSL creation",
        "Scripting",
        "Web (Racket web-server)"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "#lang racket\n(displayln \"Hello\")",
          "explanation": "#lang declares the language variant; Racket supports many language heads for the same syntax body."
        },
        {
          "title": "FFI boundary - Racket's foreign function interface",
          "code": "; Racket FFI via ffi/unsafe\n(require ffi/unsafe)\n\n(define libm (ffi-lib #f))  ; link to libc/libm\n\n(define sqrt-c\n  (get-ffi-obj 'sqrt libm (_fun _double -> _double)))\n\n(sqrt-c 2.0)  ; => 1.4142135623730951\n\n; Define C struct\n(define-cstruct _point\n  ([x _double]\n   [y _double]))\n\n; Callback from C\n(define my-cb\n  (get-ffi-obj 'callback lib (_fun _int -> _int)))",
          "explanation": "Racket's FFI (ffi/unsafe) is its polyglot boundary. It provides direct C function binding via ffi-lib and get-ffi-obj, C struct definitions via define-cstruct, and even callbacks from C into Racket. The Chez Scheme backend compiles Racket to native code, making FFI calls nearly zero-overhead. This makes Racket effective for systems programming, game development (via Racket's own game engine), and calling C/Rust libraries from high-level code."
        }
      ],
      "libraries": [
        {
          "name": "Racket docs",
          "url": "https://docs.racket-lang.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Racket reference",
          "url": "https://docs.racket-lang.org/reference/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "; Racket variables\n(define x 42)\n(define name \"Racket\")\n\n; Mutable variable\n(define counter (box 0))\n(set-box! counter (add1 (unbox counter)))\n\n; Let bindings\n(let ([a 10] [b 20])\n  (+ a b))\n\n; Parameter (dynamic variable)\n(define current-port (make-parameter 8080))\n(current-port)  ; => 8080",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "; Racket conditionals\n(if (> x 100) \"high\" \"low\")\n\n(cond\n  [(> x 100) \"high\"]\n  [(> x 50)  \"medium\"]\n  [else      \"low\"])\n\n(when (> x 100)\n  (displayln \"High value\"))\n\n(unless (null? lst)\n  (process lst))",
          "difficulty": "basic"
        },
        "loops": {
          "code": "; Racket loops\n(for ([i (in-range 10)])\n  (displayln i))\n\n(for/list ([i (in-range 10)])\n  (* i i))  ; => '(0 1 4 9 16 25 36 49 64 81)\n\n(for/sum ([i (in-range 1 11)])\n  i)  ; => 55\n\n(for/fold ([acc 0])\n          ([i (in-range 1 11)])\n  (+ acc i))  ; => 55\n\n; Named let for recursion\n(let loop ([n 10] [acc 0])\n  (if (zero? n) acc (loop (sub1 n) (+ acc n))))",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "; Racket functions\n(define (add a b)\n  (+ a b))\n\n; Anonymous (lambda)\n(map (lambda (x) (* x x)) '(1 2 3))  ; => '(1 4 9)\n\n; Optional and keyword args\n(define (greet name #:loud [loud? #f])\n  (if loud?\n      (format \"HELLO, ~a!\" name)\n      (format \"Hello, ~a\" name)))\n\n; Multiple return values\n(define (divmod a b)\n  (values (quotient a b) (remainder a b)))",
          "difficulty": "basic"
        },
        "performance": {
          "code": "; Racket performance:\n; 1. JIT compiler (Racket CS / Chez Scheme backend)\n; 2. For-loops compile efficiently (avoid named let for speed)\n; 3. Flfx vectors for numeric code (fx+, fx*, fl+...)\n; 4. Parallelism with futures and places\n; 5. GC is generational, stop-the-world\n; 6. Unsafe operations: fx+, fx- for fixnum arithmetic\n\n(for/fx ([i (in-range n)])\n  (fx+ acc i))  ; fast fixnum addition",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "; Racket classes (racket/class)\n(require racket/class)\n\n(define point%\n  (class object%\n    (init-field [x 0] [y 0])\n    (super-new)\n    (define/public (distance)\n      (sqrt (+ (expt x 2) (expt y 2))))))\n\n(define p (new point% [x 3] [y 4]))\n(send p distance)  ; => 5.0\n\n; Traits and mixins also available\n(require racket/trait)",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "; Racket strings\n(define greeting \"Hello, Racket!\")\n\n; String operations\n(string-append \"Hello\" \", \" \"World\")  ; \"Hello, World\"\n(string-upcase \"hello\")                ; \"HELLO\"\n(string-length \"hello\")                ; 5\n(substring \"Hello, World\" 0 5)          ; \"Hello\"\n\n; Format\n(format \"Value: ~a\" 42)               ; \"Value: 42\"",
          "difficulty": "basic"
        },
        "errors": {
          "code": "; Racket error handling\n(with-handlers ([exn:fail? (lambda (e)\n                              (displayln (exn-message e)))])\n  (risky-operation))\n\n; Raise errors\n(error \"Something went wrong\")\n(raise-argument-error 'my-fn \"positive number\" x)\n\n; Dynamic-wind for cleanup\n(dynamic-wind\n  (lambda () (acquire-resource))\n  (lambda () (do-work))\n  (lambda () (release-resource)))",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "; Racket imports\n(require racket/list)\n(require racket/string)\n(require racket/match)\n\n; From installed packages\n(require json)\n(require net/http-client)\n\n; Selective import\n(require (only-in racket/list first rest))\n\n; Rename on import\n(require (prefix-in list: racket/list))\n(list:first '(1 2 3))\n\n; Module definition\n(module mymod racket\n  (provide my-fn)\n  (define (my-fn x) x))",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "racket-tip-recursion-and-immutability-are-the-defaults-not",
          "title": "Recursion and immutability are the defaults, not the extras",
          "body": "In Racket, the cleanest code usually leans on recursion, pure functions, and immutable data. If you force an imperative style too early, you often make the program harder to reason about than the language intended.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "categories": [
        "functional",
        "academic"
      ],
      "overview": "A Scheme descendant built for language-oriented programming — create your own languages easily. Ships with a rich IDE (DrRacket) and hundreds of teaching languages built in. Educators, PL researchers, and anyone building DSLs — a Lisp platform with rich macro support, GUI tooling, and academic heritage.\n\nTypical projects include Teaching, DSL creation, Scripting. DrRacket and 3000+ PKG packages support education and DSL work.",
      "learning_curve": "Moderate for Lisp beginners — DrRacket IDE and the tutorial docs are excellent. The language is a fullScheme descendant with batteries included. Advanced features (macros, delimited continuations, contracts) add depth. Gentle entry, steep ceiling.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Racket is a descendant of Scheme with batteries included. DrRacket IDE is beginner-friendly. 3000+ packages on PKG. Used in education (How to Design Programs, SICP), research (PLT), and production. Active community. Comprehensive docs.",
      "common_use_cases": [
        "Teaching",
        "DSL creation",
        "Scripting",
        "Web (Racket web-server)"
      ],
      "docs_url": "https://docs.racket-lang.org/",
      "best_for": [
        "language-oriented programming exploration",
        "teaching functional and systems programming",
        "academic language prototyping and research",
        "Language-oriented programming and custom language creation with #lang"
      ],
      "weak_at": [
        "High-throughput production services outside compiled Racket deployment",
        "Teams without interest in parentheses-centric syntax cultures",
        "Browser-only SPAs without JavaScript compilation targets from Racket"
      ],
      "official_url": "https://racket-lang.org/",
      "paradigm": [
        "functional",
        "lisp",
        "language-oriented"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic (optional static checks in some dialects and tooling)",
        "runtime": "Interpreted or compiled to bytecode/native depending on implementation",
        "memory": "Garbage-collected in mainstream implementations"
      }
    },
    {
      "id": "commonlisp",
      "name": "Common Lisp",
      "color": "#3fb68b",
      "description": "A powerful, multi-paradigm Lisp with macros, CLOS, and a rich standard — the industrial Lisp. Favoured in AI research and for building domain-specific languages at scale.",
      "whoItIsFor": "Developers who want maximum expressiveness and runtime flexibility — used in AI research, game scripting, and complex domain-specific applications.",
      "commonUses": [
        "AI research",
        "Symbolic computation",
        "Rapid prototyping",
        "Web (Hunchentoot)"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "(format t \"Hello~%\")",
          "explanation": "format with t prints to stdout — Common Lisp's format directive is as powerful as C's printf and then some."
        },
        {
          "title": "Defun",
          "code": "(defun add (a b) (+ a b))",
          "explanation": "Defines a named function with defun; parameters can be required, optional, keyword, or rest."
        },
        {
          "title": "CFFI boundary - Common Lisp's foreign function interface",
          "code": ";; CFFI: Call C from Common Lisp\n(ql:quickload :cffi)\n(defpackage :myapp (:use :cl :cffi))\n\n;; Define C function binding\n(defcfm (\"sqrt\" c-sqrt) :double\n  (x :double))\n\n;; Call it\n(c-sqrt 2.0d0)  ; => 1.4142135623730951d0\n\n;; Define C struct\n(defcstruct point\n  (x :double)\n  (y :double))\n\n;; Allocate and access foreign memory\n(with-foreign-object (p 'point)\n  (setf (foreign-slot-value p 'point :x) 3.0d0)\n  (setf (foreign-slot-value p 'point :y) 4.0d0))",
          "explanation": "Common Lisp's CFFI (Common Foreign Function Interface) is its polyglot boundary. It provides a standardized way to call C functions, access C structs, manage foreign memory, and load shared libraries. CFFI works across all major CL implementations (SBCL, CCL, ECL, etc.), making it the portable bridge for calling native C libraries, system APIs, and interfacing with other languages through C as a lingua franca."
        }
      ],
      "libraries": [
        {
          "name": "Quicklisp",
          "url": "https://www.quicklisp.org/",
          "type": "Package manager"
        }
      ],
      "docs": [
        {
          "name": "HyperSpec",
          "url": "http://www.lispworks.com/documentation/HyperSpec/Front/"
        }
      ],
      "compareData": {
        "variables": {
          "code": ";; Common Lisp variables\n(defvar *count* 0)          ; dynamic, special\n(defparameter *debug* t)     ; dynamic, reassignable\n(let ((x 10) (y 20))        ; lexical bindings\n  (+ x y))\n\n;; setf for mutation\n(setf *count* (1+ *count*))",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": ";; Common Lisp conditionals\n(if (> x 100)\n    \"high\"\n    \"low\")\n\n;; Multiple branches\n(cond\n  ((> x 100) \"high\")\n  ((> x 50)  \"medium\")\n  (t          \"low\"))\n\n;; when/unless (single-branch)\n(when (> x 100)\n  (format t \"High value: ~a\" x))\n(unless (null list)\n  (process list))",
          "difficulty": "basic"
        },
        "loops": {
          "code": ";; Common Lisp loops\n;; dotimes\n(dotimes (i 10)\n  (print i))\n\n;; dolist\n(dolist (item list)\n  (print item))\n\n;; loop macro (powerful!)\n(loop for i from 1 to 10\n      collect (* i i))\n\n(loop for x in list\n      when (oddp x)\n      maximize x)\n\n;; do\n(do ((i 0 (1+ i)))\n    ((>= i 10))\n  (print i))",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": ";; Common Lisp functions\n(defun add (a b)\n  (+ a b))\n\n;; Lambda\n(funcall (lambda (x) (* x x)) 5)  ; 25\n\n;; Multiple return values\n(floor 10 3)  ; 3, 1\n\n;; Optional and keyword args\n(defun greet (name &optional (title \"Mr\") &key loud)\n  (let ((msg (format nil \"Hello, ~a ~a\" title name)))\n    (if loud (format t \"~a!~%\" msg) msg)))",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": ";; Common Lisp performance:\n;; 1. SBCL compiles to native code (fast)\n;; 2. Declarations unlock compiler optimizations\n;; 3. Type declarations eliminate runtime checks\n;; 4. CLOS dispatch adds overhead vs plain functions\n;; 5. GC pauses vary by implementation\n\n;; Optimized inner loop\n(the fixnum (+ (the fixnum x) (the fixnum y)))\n\n;; Declare types for speed\n(declaim (optimize (speed 3) (safety 0)))",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": ";; Common Lisp: CLOS (Common Lisp Object System)\n(defclass point ()\n  ((x :initarg :x :accessor point-x)\n   (y :initarg :y :accessor point-y)))\n\n(defmethod length ((p point))\n  (sqrt (+ (expt (point-x p) 2)\n           (expt (point-y p) 2))))\n\n;; Multiple dispatch\n(defmethod describe-shape ((c circle))\n  (format t \"Circle of radius ~a\" (radius c)))\n\n;; Make instance\n(setf p (make-instance 'point :x 3 :y 4))",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": ";; Common Lisp strings\n(defvar greeting \"Hello, Common Lisp!\")\n\n;; format (like printf)\n(format nil \"Hello, ~a!\" name)   ; interpolated\n(format t \"Value: ~d\" 42)       ; printed\n\n;; String operations\n(concatenate 'string \"Hello\" \", World\")\n(string-upcase \"hello\")            ; \"HELLO\"\n(search \"World\" greeting)            ; position or NIL",
          "difficulty": "basic"
        },
        "errors": {
          "code": ";; Common Lisp condition system (restarts!)\n(handler-case\n    (risky-operation)\n  (error (c)\n    (format t \"Error: ~a\" c)))\n\n;; With restarts (unique to CL)\n(restart-case\n    (error \"Something went wrong\")\n  (retry () (format t \"Retrying...\") (risky-operation))\n  (use-value (v) v))\n\n;; invoke-restart in handler\n(invoke-restart 'retry)",
          "difficulty": "advanced"
        },
        "imports": {
          "code": ";; Common Lisp packages and imports\n;; Define a package\n(defpackage :myapp\n  (:use :cl :mylib)\n  (:import-from :drakma :http-request)\n  (:export :main :process))\n\n(in-package :myapp)\n\n;; Require/load libraries\n(ql:quickload :drakma)    ; Quicklisp package manager\n(require :asdf)",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "commonlisp-tip-format-pass11",
          "title": "Implementation-specific extensions",
          "body": "Portable Common Lisp stays in the standard; SBCL/CCL extensions are not universal. Isolate implementation-specific code.",
          "tag": "portability",
          "status": "curated"
        }
      ],
      "categories": [
        "functional",
        "academic"
      ],
      "overview": "A powerful, multi-paradigm Lisp with macros, CLOS, and a rich standard — the industrial Lisp. Favoured in AI research and for building domain-specific languages at scale. Developers who want maximum expressiveness and runtime flexibility — used in AI research, game scripting, and complex domain-specific applications.\n\nTypical projects include AI research, Symbolic computation, Rapid prototyping. SBCL and Quicklisp support a dedicated but small community.",
      "learning_curve": "Steep — two paradigms to learn (functional and object/CLOS), deep macro system, and the condition/restart system is unique. The language is powerful but large. Experienced Lispers find it the most capable single language; newcomers find it overwhelming.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "SBCL is the primary implementation (native code compiler). Quicklisp is the package manager (500+ libraries). SLIME/Sly for Emacs integration. Used in AI research, CAD, game development, and finance. Strong ANSI standard. Small but extremely dedicated community.",
      "common_use_cases": [
        "AI research",
        "Symbolic computation",
        "Rapid prototyping",
        "Web (Hunchentoot)"
      ],
      "docs_url": "http://www.lispworks.com/documentation/HyperSpec/Front/",
      "best_for": [
        "AI and symbolic computation research",
        "rapid prototyping with interactive REPL",
        "metaprogramming-heavy application development",
        "Interactive AI and symbolic computing with mature CLOS object system"
      ],
      "weak_at": [
        "Mobile-first products without Common Lisp-to-native UI bridges",
        "DevOps teams expecting containerized immutable artifact deployments",
        "Hiring pipelines optimized for JavaScript or Python familiarity"
      ],
      "official_url": "https://common-lisp.net/",
      "paradigm": [
        "functional",
        "lisp",
        "multi-paradigm"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic (optional static checks in some dialects and tooling)",
        "runtime": "Interpreted or compiled to bytecode/native depending on implementation",
        "memory": "Garbage-collected in mainstream implementations"
      }
    },
    {
      "id": "elm",
      "name": "Elm",
      "color": "#60b5cc",
      "description": "A functional language that compiles to JavaScript — no runtime exceptions, friendly error messages. Its architecture pattern inspired Redux and modern front-end state management.",
      "whoItIsFor": "Frontend developers who want reliability and a guided compiler experience — few uncaught exceptions in pure code (effects/FFI can still fail), enforced architecture, and friendly error messages.",
      "commonUses": [
        "Web UIs",
        "Single-page apps",
        "Prototypes that favor compile-time safety"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "import Html exposing (text)\nmain = text \"Hello\"",
          "explanation": "Minimal Elm program — a module with a main function that renders text in the browser."
        },
        {
          "title": "Ports boundary - Elm's JavaScript interop bridge",
          "code": "-- Elm's only way to communicate with JavaScript is ports\n-- Outgoing port (Elm -> JS)\nport sendToJS : String -> Cmd msg\n\n-- Incoming port (JS -> Elm)\nport receiveFromJS : (String -> msg) -> Sub msg\n\n-- In Main.elm:\nport saveData : String -> Cmd msg\nport loadData : (String -> msg) -> Sub msg\n\n-- In JavaScript:\nvar app = Elm.Main.init({ node: document.getElementById('elm') });\n\n// Subscribe to outgoing port\napp.ports.saveData.subscribe(function(data) {\n    localStorage.setItem('data', data);\n});\n\n// Send to incoming port\napp.ports.loadData.send(localStorage.getItem('data'));",
          "explanation": "Elm's polyglot boundary is the port system: outgoing ports (Elm → JS) send commands, incoming ports (JS → Elm) receive subscriptions. This is Elm's only way to interact with JavaScript — no direct DOM access, no FFI, no escape hatches. The architecture enforces Elm's guarantees: if it compiles, it won't crash at runtime. Ports serialize data through JSON, ensuring type safety at the boundary. This makes Elm the safest language in polyglot web pipelines."
        }
      ],
      "libraries": [
        {
          "name": "Elm packages",
          "url": "https://package.elm-lang.org/",
          "type": "Ecosystem"
        }
      ],
      "docs": [
        {
          "name": "Elm guide",
          "url": "https://guide.elm-lang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "-- Elm variables (immutable by default)\nname : String\nname = \"Elm\"\n\ncount : Int\ncount = 42\n\n-- Let bindings for local scope\nresult =\n    let\n        x = 10\n        y = 20\n    in\n    x + y\n\n-- Type inference\ngreeting = \"Hello, \" ++ name  -- inferred as String",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "-- Elm conditionals\nif count > 100 then\n    \"high\"\nelse if count > 50 then\n    \"medium\"\nelse\n    \"low\"\n\n-- Case expression (exhaustive)\n case status of\n    Active -> \"active\"\n    Inactive -> \"inactive\"\n    Pending msg -> \"pending: \" ++ msg\n\n-- Pattern matching in function args\nisZero 0 = True\nisZero _ = False",
          "difficulty": "basic"
        },
        "loops": {
          "code": "-- Elm has no loops; use recursion and list operations\n-- List.map\nList.map (\\n -> n * 2) [1, 2, 3]  -- [2, 4, 6]\n\n-- List.filter\nList.filter (\\n -> n > 2) [1, 2, 3, 4]  -- [3, 4]\n\n-- List.foldl (left fold)\nList.foldl (\\n acc -> acc + n) 0 [1, 2, 3]  -- 6\n\n-- Recursion (tail-call optimized)\nrepeat : Int -> a -> List a\nrepeat n x =\n    if n <= 0 then\n        []\n    else\n        x :: repeat (n - 1) x",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "-- Elm functions\nadd : Int -> Int -> Int\nadd a b =\n    a + b\n\n-- Partial application\nadd5 : Int -> Int\nadd5 = add 5\n\n-- Anonymous functions\nList.map (\\n -> n * 2) [1, 2, 3]\n\n-- Pattern matching in function args\ntypeLabel : Int -> String\ntypeLabel 0 = \"zero\"\ntypeLabel 1 = \"one\"\ntypeLabel _ = \"other\"",
          "difficulty": "basic"
        },
        "performance": {
          "code": "-- Elm performance:\n-- 1. Compiles to optimized JavaScript\n-- 2. Virtual DOM diffing is efficient\n-- 3. No runtime exceptions in pure Elm code (effects/ports can still fail)\n-- 4. Immutable data structures (structural sharing)\n-- 5. Small Elm runtime bundle\n\n-- Lazy evaluation for expensive views\nHtml.lazy expensiveView model.data",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "-- Elm uses type aliases and custom types, not classes\ntype alias Point =\n    { x : Float, y : Float }\n\nlength : Point -> Float\nlength p = sqrt (p.x * p.x + p.y * p.y)\n\n-- Custom types (sum types / tagged unions)\ntype Status\n    = Active\n    | Inactive\n    | Pending String\n\n-- Pattern matching\nshowStatus : Status -> String\nshowStatus status =\n    case status of\n        Active -> \"active\"\n        Inactive -> \"inactive\"\n        Pending msg -> \"pending: \" ++ msg",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "-- Elm strings\ngreeting : String\ngreeting = \"Hello, Elm!\"\n\n-- Concatenation\nmessage = greeting ++ \" Welcome!\"\n\n-- String functions\nString.toUpper \"hello\"       -- \"HELLO\"\nString.length \"hello\"        -- 5\nString.split \",\" \"a,b,c\"     -- [\"a\", \"b\", \"c\"]\n\n-- No string interpolation -- use ++ concatenation\nmsg = \"Value: \" ++ String.fromInt 42",
          "difficulty": "basic"
        },
        "errors": {
          "code": "-- Elm error handling with Result and Maybe\ntype Result e a\n    = Ok a\n    | Err e\n\ndivide : Float -> Float -> Result String Float\ndivide _ 0 = Err \"Division by zero\"\ndivide x y = Ok (x / y)\n\n-- Pattern match results\ncase divide 10 0 of\n    Ok value -> \"Result: \" ++ String.fromFloat value\n    Err error -> \"Error: \" ++ error\n\n-- Maybe for optional values\nfindUser : Int -> Maybe User\nfindUser id =\n    case Dict.get id users of\n        Just user -> Just user\n        Nothing -> Nothing",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "-- Elm imports\nimport Html exposing (div, text, h1)\nimport Http\nimport Json.Decode as Decode\n\n-- Exposing specific values\nimport Browser exposing (Document)\n\n-- Module definition\nmodule Main exposing (main)\n\n-- Qualified imports\nimport Array\nArray.fromList [1, 2, 3]",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "elm-tip-recursion-and-immutability-are-the-defaults-not",
          "title": "Recursion and immutability are the defaults, not the extras",
          "body": "In Elm, the cleanest code usually leans on recursion, pure functions, and immutable data. If you force an imperative style too early, you often make the program harder to reason about than the language intended.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "categories": [
        "functional",
        "web"
      ],
      "overview": "A functional language that compiles to JavaScript — no runtime exceptions, friendly error messages. Its architecture pattern inspired Redux and modern front-end state management. Frontend developers who want reliability and a guided compiler experience — no runtime exceptions, enforced architecture, and friendly error messages.\n\nTypical projects include Web UIs, Single-page apps, Prototypes with zero runtime errors. Limited JS interop by design since Elm 0.19.",
      "learning_curve": "Moderate — the syntax is clean and ML-like. The main shift is The Elm Architecture (Model-Update-View) and thinking in signals/messages. No runtime exceptions is a huge benefit. The type system is simpler than Haskell's. The hardest part is the port system for JS interop.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Elm 0.19 is the current stable version. Package registry at package.elm-lang.org. elm-format for code style. elm-review for linting. Used in production by NoRedInk, Culture Amp, and others. Notably stable — no breaking changes since 2019. Small but devoted community. Limited JS interop by design.",
      "common_use_cases": [
        "Web UIs",
        "Single-page apps",
        "Prototypes with strong compile-time guarantees"
      ],
      "docs_url": "https://guide.elm-lang.org/",
      "best_for": [
        "Web UIs that benefit from Elm’s strong compile-time guarantees",
        "Single-page applications with enforced architecture boundaries",
        "Functional frontend development with a small, opinionated core"
      ],
      "weak_at": [
        "Full-stack teams needing unified TypeScript across client and server",
        "Native mobile applications outside experimental Elm mobile efforts",
        "Backends requiring rich server ecosystems without Elm-to-JS ports"
      ],
      "official_url": "https://elm-lang.org/",
      "paradigm": [
        "functional",
        "declarative",
        "frontend"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static with Hindley-Milner inference and enforced architecture",
        "runtime": "Compiles to JavaScript; runs in browsers or Node.js after compile",
        "memory": "Garbage-collected (inherits the host JavaScript engine)"
      }
    },
    {
      "id": "purescript",
      "name": "PureScript",
      "color": "#1d222d",
      "description": "A strongly-typed functional language inspired by Haskell that compiles to JavaScript. Its row types and type classes enable safe, composable web application code.",
      "whoItIsFor": "Haskell fans building web frontends or Node backends with type safety — expressive types, row polymorphism, and dead-code elimination out of the box.",
      "commonUses": [
        "Web frontends",
        "Node.js backends",
        "Type-safe scripting"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "module Main where\nimport Effect.Console (log)\nmain = log \"Hello\"",
          "explanation": "Runs a main effect that logs a line — PureScript IO stays explicit and typed."
        },
        {
          "title": "FFI boundary - PureScript's foreign import/export",
          "code": "-- PureScript FFI via foreign import/export\nmodule MyModule where\n\n-- Import a JavaScript function\nforeign import parseJSON :: String -> Either String Json\n\n-- Export a PureScript function to JavaScript\nforeign import data Callback :: Type\n\n-- FFI module (MyModule.js):\n-- exports.parseJSON = function(str) {\n--   try { return { right: JSON.parse(str) }; }\n--   catch(e) { return { left: e.message }; }\n-- };\n\n-- Safe FFI wrapper\ndata Json\nforeign import parseJSONImpl :: String -> Effect Json\n\nparseJSON :: String -> Effect (Either String Json)\nparseJSON s = try (parseJSONImpl s) \\e -> pure (Left (show e))",
          "explanation": "PureScript's FFI is its polyglot boundary: `foreign import` declares JavaScript functions callable from PureScript, and `foreign import data` creates opaque types wrapping JS values. The FFI module (.js file) provides the JavaScript implementation. This allows PureScript to call any JavaScript API, Node.js module, or browser API. The type system ensures that all FFI calls are explicitly typed, preserving safety at the boundary."
        }
      ],
      "libraries": [
        {
          "name": "Pursuit",
          "url": "https://pursuit.purescript.org/",
          "type": "Package search"
        }
      ],
      "docs": [
        {
          "name": "PureScript docs",
          "url": "https://www.purescript.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "-- PureScript variables\nx :: Int\nx = 42\n\nname :: String\nname = \"PureScript\"\n\n-- Type inference\nincremented = x + 1  -- inferred as Int\n\n-- Let bindings\nsum =\n  let\n    a = 10\n    b = 20\n  in\n    a + b",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "-- PureScript conditionals\nif x > 100 then \"high\" else if x > 50 then \"medium\" else \"low\"\n\n-- Pattern matching (exhaustive)\ncase status of\n  Active -> \"active\"\n  Inactive -> \"inactive\"\n  Pending msg -> \"pending: \" <> msg\n\n-- Guards in pattern matching\nclassify n\n  | n > 100 = \"high\"\n  | n > 50  = \"medium\"\n  | otherwise = \"low\"",
          "difficulty": "basic"
        },
        "loops": {
          "code": "-- PureScript has no loops; use recursion and foldable\n-- Array comprehension\nxs = 1 .. 10\n\n-- Map\nmap (\\n -> n * 2) xs\n\n-- Filter\nfilter (\\n -> n > 5) xs\n\n-- Fold\nfoldl (+) 0 xs\n\n-- For_ (traverse for side effects)\nfor_ xs \\n ->\n  logShow n\n\n-- Recursion with tail call\nfactorial 0 = 1\nfactorial n = n * factorial (n - 1)",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "-- PureScript functions\nadd :: Int -> Int -> Int\nadd a b = a + b\n\n-- Partial application\nadd5 :: Int -> Int\nadd5 = add 5\n\n-- Anonymous\nmap (\\n -> n * 2) [1, 2, 3]\n\n-- Row polymorphism\ngreet :: { name :: String | r } -> String\ngreet r = \"Hello, \" <> r.name\n\n-- Type class constrained\nshow :: forall a. Show a => a -> String\nshow = show'",
          "difficulty": "basic"
        },
        "performance": {
          "code": "-- PureScript performance:\n-- 1. Compiles to JavaScript (efficient output)\n-- 2. Runtime is minimal (no RxJS dependency in v0.15+)\n-- 3. Dead code elimination via Purty/Spago\n-- 4. No runtime exceptions (enforced by types)\n-- 5. Tail-call optimization for direct recursion\n-- 6. Strict evaluation (no thunk overhead)\n\n-- For hot paths, FFI to optimized JS is recommended\nforeign import fastCompute :: Int -> Int",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "-- PureScript type classes (not OOP classes)\nclass Show a where\n  show :: a -> String\n\ninstance showInt :: Show Int where\n  show n = showIntImpl n\n\n-- Newtype for deriving\nnewtype Name = Name String\nderive newtype instance showName :: Show Name\n\n-- Type class constraints\nmax :: forall a. Ord a => a -> a -> a\nmax a b = if a >= b then a else b",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "-- PureScript strings\ngreeting :: String\ngreeting = \"Hello, PureScript!\"\n\n-- Concatenation\nmessage = greeting <> \" Welcome!\"\n\n-- String functions\nimport Data.String (toUpper, length, split)\ntoUpper \"hello\"      -- \"HELLO\"\nlength \"hello\"        -- 5\nsplit (Pattern \",\") \"a,b,c\"  -- [\"a\",\"b\",\"c\"]\n\n-- Template literal (via ps-string)\n-- No built-in interpolation; use <> concatenation",
          "difficulty": "basic"
        },
        "errors": {
          "code": "-- PureScript error handling with Either\ndata Either a b = Left a | Right b\n\ndivide :: Int -> Int -> Either String Int\ndivide _ 0 = Left \"Division by zero\"\ndivide x y = Right (x / y)\n\n-- Maybe for optional values\nfindUser :: Int -> Maybe User\nfindUser id = Map.lookup id users\n\n-- MonadError for stack-safe error handling\nrunExceptT :: ExceptT String Effect a -> Effect (Either String a)",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "-- PureScript imports\nimport Data.Array (map, filter)\nimport Data.Maybe (Maybe(..))\nimport Effect (Effect)\n\n-- Qualified import\nimport Data.Map as Map\nMap.lookup \"key\" myMap\n\n-- Module definition\nmodule MyModule where\n\nimport Data.Maybe (Maybe(..))\n\nmyFunction :: Int -> Maybe Int\nmyFunction x = Just (x + 1)",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "purescript-tip-recursion-and-immutability-are-the-defaults-not",
          "title": "Recursion and immutability are the defaults, not the extras",
          "body": "In PureScript, the cleanest code usually leans on recursion, pure functions, and immutable data. If you force an imperative style too early, you often make the program harder to reason about than the language intended.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "purescript-tip-browser-state-and-async-timing-hide-bugs",
          "title": "Browser state and async timing hide bugs",
          "body": "In PureScript, UI bugs often come from stale state, event timing, or a missing await/fetch boundary. Reproduce the issue with one interaction and log the state transition before changing the view code.",
          "tag": "frontend",
          "status": "curated"
        }
      ],
      "categories": [
        "functional",
        "web"
      ],
      "overview": "A strongly-typed functional language inspired by Haskell that compiles to JavaScript. Its row types and type classes enable safe, composable web application code. Haskell fans building web frontends or Node backends with type safety — expressive types, row polymorphism, and dead-code elimination out of the box.\n\nTypical projects include Web frontends, Node.js backends, Type-safe scripting.",
      "learning_curve": "Steep — Haskell-like syntax and concepts (row polymorphism, type classes, effect rows). Requires understanding of functional programming. The PureScript-specific concepts (row types, effect tracking) add complexity. Good for developers coming from Haskell or TypeScript who want stronger guarantees.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "PureScript compiles to JavaScript. Spago is the build tool. Package registry at pursuit.purescript.org. Used in production for web apps, especially where type safety matters. Smaller ecosystem than Haskell or TypeScript. Active community. v0.20+ removed RxJS dependency.",
      "common_use_cases": [
        "Web frontends",
        "Node.js backends",
        "Type-safe scripting"
      ],
      "docs_url": "https://github.com/purescript/documentation",
      "best_for": [
        "type-safe functional web frontends",
        "JavaScript interop with strong guarantees",
        "purely functional full-stack development",
        "Typed functional front ends compiling to JavaScript or WebAssembly"
      ],
      "weak_at": [
        "Rapid prototyping where JavaScript bundle size and compile time matter",
        "Android or iOS native UI without JavaScript host runtimes",
        "Teams allergic to functional programming ceremony and category jargon"
      ],
      "official_url": "https://www.purescript.org/",
      "paradigm": [
        "functional",
        "typed",
        "Haskell-like"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static with type classes and row polymorphism",
        "runtime": "Compiles to JavaScript; runs in browsers or Node.js after compile",
        "memory": "Garbage-collected (inherits the host JavaScript engine)"
      }
    },
    {
      "id": "coffeescript",
      "name": "CoffeeScript",
      "color": "#244776",
      "description": "A terse language that compiles to JavaScript — significant whitespace and arrow functions before ES6. Its ideas live on in modern JS, especially destructuring and fat arrows.",
      "whoItIsFor": "Developers who liked Ruby/Python style before modern JS caught up — largely superseded by ES2015+, but still maintained in legacy codebases.",
      "commonUses": [
        "Legacy web projects",
        "Quick prototyping"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "console.log \"Hello, World!\"",
          "explanation": "Prints a line; parentheses are optional for simple calls."
        },
        {
          "title": "Variables",
          "code": "name = 'Alice'\nage = 30",
          "explanation": "Assign with =; no var/let/const — CoffeeScript predates modern JS block scoping."
        },
        {
          "title": "Functions",
          "code": "square = (x) -> x * x\nconsole.log square 9",
          "explanation": "Thin arrow -> defines a function; last expression is returned."
        },
        {
          "title": "Arrays",
          "code": "fruits = ['apple', 'banana']\nfruits.push 'orange'\nconsole.log fruits",
          "explanation": "Lists use brackets; methods like push work like JavaScript after compile."
        },
        {
          "title": "Loops",
          "code": "console.log i for i in [0..4]",
          "explanation": "for-in over a range inclusive .. — compiles to a JavaScript loop."
        },
        {
          "title": "JS interop boundary - CoffeeScript compiles to JavaScript",
          "code": "# CoffeeScript's boundary is its compilation to JavaScript\n# Every CoffeeScript feature maps to JS output\n\n# Bound methods (fat arrow)\nclass Button\n  constructor: ->\n    @clicked = =>        # compiles to .bind(this)\n      console.log 'clicked'\n\n# JavaScript interop is seamless\n# Call any JS library directly\n$ = require 'jquery'\n$.get '/api/data', (data) ->\n  console.log data\n\n# Module.exports works identically to JS\nmodule.exports = { greet }",
          "explanation": "CoffeeScript's boundary is its compilation target: JavaScript. Every CoffeeScript file compiles to equivalent JS, and interop is seamless — you call JS libraries directly, use Node.js modules, and access browser APIs without any bridging. The fat arrow (=>) compiles to .bind(this), and classes compile to prototype chains. This makes CoffeeScript a thin syntax layer over JavaScript with zero FFI cost."
        }
      ],
      "libraries": [
        {
          "name": "CoffeeScript site",
          "url": "https://coffeescript.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "CoffeeScript docs",
          "url": "https://coffeescript.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# CoffeeScript variables\nmessage = \"Hello, CoffeeScript!\"\ncount = 42\npi = 3.14159\nactive = true\n\n# No type declarations\n# Destructuring\n{first, last} = user\n[a, b, rest...] = [1, 2, 3, 4, 5]",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# CoffeeScript conditionals\nif count > 100\n  console.log \"high\"\nelse if count > 50\n  console.log \"medium\"\nelse\n  console.log \"low\"\n\n# Postfix if/unless\nconsole.log \"big\" if count > 100\nconsole.log \"not zero\" unless count is 0\n\n# Switch\nswitch day\n  when 'Mon' then work()\n  when 'Sat', 'Sun' then rest()\n  else work()",
          "difficulty": "basic"
        },
        "loops": {
          "code": "# CoffeeScript loops\n# for..of (object)\nfor key, value of obj\n  console.log key, value\n\n# for..in (array)\nfor item in items\n  console.log item\n\n# Comprehensions\nsquared = (x * x for x in [1..10] when x % 2 is 0)\n\n# while\nwhile count > 0\n  count--",
          "difficulty": "basic"
        },
        "functions": {
          "code": "# CoffeeScript functions (thin arrow)\ngreet = (name) -> \"Hello, #{name}\"\n\n# Fat arrow (bound function)\nclass Counter\n  constructor: ->\n    @count = 0\n  increment: =>\n    @count++\n\n# Default arguments\nadd = (a, b = 1) -> a + b\n\n# Splats (rest args)\nsum = (first, rest...) ->\n  first + rest.reduce((a, b) -> a + b)",
          "difficulty": "basic"
        },
        "performance": {
          "code": "# CoffeeScript performance:\n# 1. Compiles 1:1 to JavaScript\n# 2. No runtime overhead vs equivalent JS\n# 3. Generated JS is readable and debuggable\n# 4. Source maps available for debugging\n# 5. Class sugar adds prototype chain overhead\n# 6. Fat arrow (=>) binds per instance (memory)\n\n# Tight loop: use while, not comprehension\nwhile n-- > 0\n  process(n)",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "# CoffeeScript classes (JS prototype sugar)\nclass Point\n  constructor: (@x, @y) ->\n\n  length: ->\n    Math.sqrt(@x * @x + @y * @y)\n\n  @origin: -> new Point(0, 0)\n\np = new Point(3, 4)\nconsole.log p.length()  # 5",
          "difficulty": "basic"
        },
        "strings": {
          "code": "# CoffeeScript strings\nname = \"World\"\ngreeting = \"Hello, #{name}!\"    # interpolation\nraw = 'No interpolation here'\n\n# Multiline\nhtml = \"\"\"\n  <div>\n    #{content}\n  </div>\n  \"\"\"\n\n# String methods\n'hello'.toUpperCase()  # 'HELLO'\n'hello'.split('')       # ['h','e','l','l','o']",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# CoffeeScript error handling\ntry\n  result = riskyOperation()\ncatch error\n  console.error \"Error: #{error.message}\"\nfinally\n  cleanup()\n\n# Existential operator (null-safe)\nuser?.name         # undefined if user is null\nuser?.getName?()  # undefined if method missing\n\nzip = user?.address?.zip  # deep null-safe",
          "difficulty": "basic"
        },
        "imports": {
          "code": "# CoffeeScript uses Node.js module system\n# require (CommonJS)\nfs = require 'fs'\npath = require 'path'\n\n# Destructured import\n{readFile, writeFile} = require 'fs'\n\n# export\nmodule.exports = class Point\n  constructor: (@x, @y) ->\n\n# Named export\nexports.add = (a, b) -> a + b",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "coffeescript-tip-whitespace-is-syntax-not-style",
          "title": "Whitespace is syntax, not style",
          "body": "CoffeeScript uses indentation or whitespace to mark structure, so align blocks consistently and let the editor show invisible characters. One stray space can change meaning, especially when copying snippets between files or chat tools.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "coffeescript-tip-use-the-formatter-before-you-debug-the-logic",
          "title": "Use the formatter before you debug the logic",
          "body": "If the code looks wrong in CoffeeScript, run the formatter or linter first. Many apparent syntax bugs are really block-shape problems caused by mixed tabs, inconsistent indentation, or copy-pasted examples.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "categories": [
        "web"
      ],
      "overview": "A terse language that compiles to JavaScript — significant whitespace and arrow functions before ES6. Its ideas live on in modern JS, especially destructuring and fat arrows.",
      "learning_curve": "Gentle for JavaScript developers — the syntax is a cleaned-up JS with significant whitespace. The main learning curve is remembering what compiles to what. Comprehensions, existential operator (?), and fat arrow are the key additions.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Compiles to JavaScript; runs anywhere JS runs. Used for Atom editor plugins, Hubot, and legacy web projects. Largely superseded by TypeScript and modern JS (ES6+). Source maps help debugging. Small but dedicated community. De facto frozen at CoffeeScript 2.",
      "common_use_cases": [
        "Legacy web projects",
        "Quick prototyping"
      ],
      "docs_url": "https://coffeescript.org/",
      "best_for": [
        "legacy JavaScript project maintenance",
        "quick prototyping with concise syntax",
        "existing CoffeeScript codebase preservation",
        "Legacy JavaScript codebases still maintaining CoffeeScript sources"
      ],
      "weak_at": [
        "Greenfield projects where modern TypeScript tooling is available",
        "Browser apps needing first-class ECMAScript module tree-shaking",
        "Hiring pipelines expecting plain JavaScript or TypeScript fluency"
      ],
      "official_url": "https://coffeescript.org/",
      "paradigm": [
        "imperative",
        "transpiled",
        "ruby-like"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Varies by dialect; commonly compiles to JavaScript",
        "runtime": "Runs on JavaScript engines after compile",
        "memory": "Garbage-collected (inherits the host JavaScript engine)"
      }
    },
    {
      "id": "reasonml",
      "name": "ReasonML",
      "color": "#dd4b39",
      "description": "An OCaml-syntax alternative that compiles to JavaScript via BuckleScript/ReScript. Familiar C-style braces with OCaml's type safety beneath the surface.",
      "whoItIsFor": "OCaml developers targeting the web, or React devs wanting ML types — compiles to JS with familiar curly-brace syntax and strong type inference.",
      "commonUses": [
        "React UIs",
        "Type-safe web apps"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "Js.log(\"Hello\");",
          "explanation": "Js.log prints to the JavaScript console when compiled with Melange/BuckleScript — ReasonML’s JS interop logging helper."
        },
        {
          "title": "bs.obj / extern FFI boundary - ReasonML's JavaScript bridge",
          "code": "/* ReasonML FFI to JavaScript (Melange compiler)\n   Note: ReasonML/Melange toolchains vary.\n   ReasonML uses Melange (BuckleScript fork) for JS output.\n   ReScript forked in 2020 with its own compiler.\n   Check your toolchain when writing FFI bindings. */\n\n/* Bind to JS function */\n[@bs.val] external alert: string => unit = \"alert\";\n\n/* Bind to JS module */\n[@bs.module \"path\"] external join: array(string) => string = \"join\";\n\n/* Bind to JS object method */\n[@bs.send] external map: (array('a), 'a => 'b) => array('b) = \"map\";\n\n/* Create JS object */\nlet obj = Js.Dict.fromList([\n  (\"name\", Js.Json.string(\"Alice\")),\n  (\"age\", Js.Json.number(30.0)),\n]);",
          "explanation": "ReasonML's polyglot boundary is its FFI to JavaScript, using BuckleScript/Melange attributes (@bs.val, @bs.module, @bs.send, @bs.new). These compile to direct JavaScript calls with zero overhead. The variant-based type system maps cleanly to JS: option maps to nullable, result maps to try/catch, and records map to JS objects. Note: ReasonML and ReScript share BuckleScript heritage but have diverged; agents should check which compiler (Melange vs ReScript) is in use to avoid dead-syntax pitfalls."
        }
      ],
      "libraries": [
        {
          "name": "ReScript",
          "url": "https://rescript-lang.org/",
          "type": "Successor"
        }
      ],
      "docs": [
        {
          "name": "ReasonML docs",
          "url": "https://reasonml.github.io/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "/* ReasonML variables */\nlet x = 42;\nlet name = \"ReasonML\";\n\n/* Type inference */\nlet result = x + 1;  /* inferred as int */\n\n/* Mutable reference */\nlet counter = ref(0);\ncounter := !counter + 1;\n\n/* Destructuring */\nlet (a, b) = (10, 20);",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "/* ReasonML conditionals */\nif (x > 100) {\n  \"high\";\n} else if (x > 50) {\n  \"medium\";\n} else {\n  \"low\";\n};\n\n/* Pattern matching (exhaustive) */\nswitch (status) {\n| Active => \"active\"\n| Inactive => \"inactive\"\n| Pending(msg) => \"pending: \" ++ msg\n};",
          "difficulty": "basic"
        },
        "loops": {
          "code": "/* ReasonML loops (via recursion and Belt.Array) */\n/* For loop (imperative, compiles to JS for) */\nfor (i in 0 to 9) {\n  Js.log(i);\n};\n\n/* Map */\nBelt.Array.map([|1, 2, 3|], x => x * 2);\n\n/* Filter */\nBelt.Array.filter([|1, 2, 3, 4|], x => x > 2);\n\n/* Fold */\nBelt.Array.reduce([|1, 2, 3|], 0, (acc, x) => acc + x);\n\n/* While */\nwhile (condition) {\n  doSomething();\n};",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "/* ReasonML functions */\nlet add = (a, b) => a + b;\n\n/* Type annotation */\nlet add = (a: int, b: int): int => a + b;\n\n/* Labeled arguments */\nlet greet = (~name, ~greeting=\"Hello\") =>\n  greeting ++ \", \" ++ name;\n\ngreet(~name=\"World\");\n\n/* Recursive */\nlet rec factorial = (n) =>\n  n <= 0 ? 1 : n * factorial(n - 1);",
          "difficulty": "basic"
        },
        "performance": {
          "code": "/* ReasonML performance:\n   1. Compiles to JavaScript via Melange (formerly BuckleScript)\n   2. Dead code elimination removes unused code\n   3. Curried functions compile efficiently (no wrapper overhead)\n   4. Pattern matching compiles to JS switch/lookup tables\n   5. Variants compile to compact JS representations\n   6. Belt standard library is optimized for JS output\n\n   Note: ReasonML toolchains vary. Melange is the current\n   compiler (BuckleScript fork). ReScript forked in 2020\n   with its own compiler. Check your toolchain. */",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "/* ReasonML uses modules and records, not classes */\ntype person = {\n  name: string,\n  age: int,\n};\n\nlet create = (name, age) => {name, age};\nlet greet = (p) => \"Hello, \" ++ p.name;\n\n/* Module system (similar to classes) */\nmodule Person = {\n  type t = person;\n  let create = (name, age) => {name, age};\n  let greet = (p) => \"Hello, \" ++ p.name;\n};",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "/* ReasonML strings */\nlet greeting = \"Hello, ReasonML!\";\n\n/* Concatenation */\nlet message = greeting ++ \" Welcome!\";\n\n/* String functions */\nJs.String.toUpperCase(\"hello\");  /* \"HELLO\" */\nJs.String.length(\"hello\");       /* 5 */\n\n/* Character access */\nJs.String.charAt(0, \"hello\");   /* 'h' */\n\n/* Note: ReasonML strings compile to JS strings */",
          "difficulty": "basic"
        },
        "errors": {
          "code": "/* ReasonML error handling with Result and Option */\ntype result('a, 'e) =\n  | Ok('a)\n  | Error('e);\n\nlet divide = (a, b) =>\n  b === 0 ? Error(\"Division by zero\") : Ok(a / b);\n\n/* Option for nullable values */\nlet findUser = (id) =>\n  switch (Belt.Array.getBy(users, u => u.id === id)) {\n  | Some(user) => user\n  | None => {name: \"Unknown\", id: 0}\n  };\n\n/* Exception (Js.Exception) for JS interop */\nJs.Exception.catchAny(() => riskyOperation());",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "/* ReasonML imports */\n/* Import a module */\nlet map = Belt.Array.map;\n\n/* Open a module (like import all) */\nopen Belt.Array;\n\n/* Import JS module */\n[@bs.module \"react\"] external React: module React = \"\"\"\"\";\n\n/* Module definition */\nmodule MyModule = {\n  type t = int;\n  let create = x => x;\n};",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "functional",
        "web"
      ],
      "overview": "An OCaml-syntax alternative that compiles to JavaScript via BuckleScript/ReScript. Familiar C-style braces with OCaml's type safety beneath the surface. OCaml developers targeting the web, or React devs wanting ML types — compiles to JS with familiar curly-brace syntax and strong type inference.\n\nTypical projects include React UIs, Type-safe web apps. Community has shrunk since ReScript forked in 2020.",
      "learning_curve": "Moderate for developers with OCaml or Haskell background — the syntax is OCaml-like. JavaScript developers need to learn variant types, pattern matching, and the module system. Toolchain confusion (ReasonML/Melange vs ReScript) adds friction.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "ReasonML compiles to JavaScript via Melange (formerly BuckleScript). The ecosystem overlaps with OCaml's. Used at Facebook (Messenger). Community has shrunk since ReScript forked in 2020. For new projects, consider ReScript instead. ReasonML still works but is in maintenance mode. Smaller package ecosystem than TypeScript.",
      "common_use_cases": [
        "React UIs",
        "Type-safe web apps"
      ],
      "docs_url": "https://reasonml.github.io/docs/en/overview",
      "best_for": [
        "type-safe React frontend development",
        "cross-compilation to JavaScript",
        "migrating JavaScript to a typed language",
        "Type-safe React front ends via ReasonML and ReScript lineage tooling"
      ],
      "weak_at": [
        "Server backends without JavaScript compilation targets configured",
        "Native mobile UI outside experimental Reason native backends",
        "Teams standardized on TypeScript without Reason/ReScript toolchain appetite"
      ],
      "official_url": "https://reasonml.github.io/",
      "paradigm": [
        "functional",
        "typed",
        "JavaScript"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Varies by dialect; commonly compiles to JavaScript",
        "runtime": "Runs on JavaScript engines after compile",
        "memory": "Garbage-collected (inherits the host JavaScript engine)"
      }
    },
    {
      "id": "rescript",
      "name": "ReScript",
      "color": "#e6484f",
      "description": "A robustly typed language that compiles to efficient, readable JavaScript — successor to BuckleScript. Its pattern matching and variant types catch bugs before runtime.",
      "whoItIsFor": "JS/TS developers wanting sound types without TypeScript's escape hatches — fast compiler, dead-code elimination, and React-friendly output.",
      "commonUses": [
        "React apps",
        "Node backends",
        "Type-safe JS interop"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "Js.log(\"Hello\")",
          "explanation": "Uses Js.log from ReScript’s JavaScript interop to print a line in the browser or Node."
        },
        {
          "title": "@module extern FFI boundary - ReScript's JavaScript bridge",
          "code": "// ReScript FFI to JavaScript\n// Bind to JS function\n@val external alert: string => unit = \"alert\"\n\n// Bind to JS module method\n@module(\"path\") external join: array<string> => string = \"join\"\n\n// Bind to JS object method\n@send external map: (array<'a>, 'a => 'b) => array<'b> = \"map\"\n\n// Bind to JS constructor\n@new external promise: unit => promise<unit> = \"Promise\"\n\n// Create JS object from record\nlet config: Js.t<{..}> = {\n  \"name\": Js.Json.string(\"Alice\"),\n  \"version\": Js.Json.number(1.0),\n}",
          "explanation": "ReScript's polyglot boundary is its FFI system using @val, @module, @send, and @new extern declarations. These compile to direct JavaScript calls with zero overhead — no marshaling, no wrappers. ReScript variants map cleanly to JS (option→nullable, result→try/catch, records→objects). This makes ReScript the most JS-interop-friendly typed language: the output is readable JS, and binding to any JS API takes a single extern declaration."
        }
      ],
      "libraries": [
        {
          "name": "ReScript docs",
          "url": "https://rescript-lang.org/docs/manual/latest/introduction",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "ReScript site",
          "url": "https://rescript-lang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// ReScript variables\nlet x = 42\nlet name = \"ReScript\"\n\n// Type inference\nlet result = x + 1  // inferred as int\n\n// Mutable binding\nlet counter = ref(0)\ncounter := counter.contents + 1\n\n// Destructuring\nlet (a, b) = (10, 20)",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// ReScript conditionals\nif x > 100 {\n  \"high\"\n} else if x > 50 {\n  \"medium\"\n} else {\n  \"low\"\n}\n\n// Pattern matching (exhaustive)\nswitch status {\n| Active => \"active\"\n| Inactive => \"inactive\"\n| Pending(msg) => \"pending: \" ++ msg\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// ReScript loops\n// For loop (compiles to JS for)\nfor (i in 0 to 9) {\n  Js.log(i)\n}\n\n// Map\nBelt.Array.map([1, 2, 3], x => x * 2)\n\n// Filter\nBelt.Array.filter([1, 2, 3, 4], x => x > 2)\n\n// Reduce\nBelt.Array.reduce([1, 2, 3], 0, (acc, x) => acc + x)\n\n// While\nwhile (condition) {\n  doSomething()\n}",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "// ReScript functions\nlet add = (a, b) => a + b\n\n// Type annotation\nlet add = (a: int, b: int): int => a + b\n\n// Labeled arguments\nlet greet = (~name, ~greeting=\"Hello\") =>\n  greeting ++ \", \" ++ name\n\ngreet(~name=\"World\")\n\n// Recursive\nlet rec factorial = n =>\n  n <= 0 ? 1 : n * factorial(n - 1)",
          "difficulty": "basic"
        },
        "performance": {
          "code": "// ReScript performance:\n// 1. Compiles to clean, readable JavaScript\n// 2. No runtime overhead (no RxJS dependency)\n// 3. Dead code elimination built in\n// 4. Pattern matching compiles to efficient JS\n// 5. Curried functions optimize automatically\n// 6. Belt stdlib is tree-shakeable\n\n// For hot paths, use Belt.Array for raw performance\nBelt.Array.map(arr, x => x * 2)",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "// ReScript uses records and modules, not classes\ntype person = {\n  name: string,\n  age: int,\n}\n\nlet create = (name, age) => {name, age}\nlet greet = p => \"Hello, \" ++ p.name\n\n// Module system\nmodule Person = {\n  type t = person\n  let create = (name, age) => {name, age}\n  let greet = p => \"Hello, \" ++ p.name\n}",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "// ReScript strings\nlet greeting = \"Hello, ReScript!\"\n\n// Concatenation\nlet message = greeting ++ \" Welcome!\"\n\n// String functions\nJs.String.toUpperCase(\"hello\")  // \"HELLO\"\nJs.String.length(\"hello\")       // 5\n\n// No string interpolation; use ++\nlet msg = \"Value: \" ++ Js.Int.toString(42)",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// ReScript error handling with Result and Option\ntype result<'a, 'e> =\n  | Ok<'a>('a)\n  | Error<'e>('e)\n\nlet divide = (a, b) =>\n  b === 0 ? Error(\"Division by zero\") : Ok(a / b)\n\n// Option for nullable values\nlet findUser = id => {\n  switch (Belt.Array.getBy(users, u => u.id === id)) {\n  | Some(user) => user\n  | None => {name: \"Unknown\", id: 0}\n  }\n}\n\n// Try-catch for JS interop\ntry {\n  riskyOperation()\n} catch {\n  | Js.Exn.Error(e) => handleError(e)\n}",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// ReScript imports\n// Import from JS\n@module(\"react\") external React: React.module = \"react\"\n\n// Import ReScript module\nlet map = Belt.Array.map\n\n// Open module\nopen Belt.Array\n\n// Module definition\nmodule MyModule = {\n  type t = int\n  let create = x => x\n}",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "rescript-tip-recursion-and-immutability-are-the-defaults-not",
          "title": "Recursion and immutability are the defaults, not the extras",
          "body": "In ReScript, the cleanest code usually leans on recursion, pure functions, and immutable data. If you force an imperative style too early, you often make the program harder to reason about than the language intended.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "rescript-tip-browser-state-and-async-timing-hide-bugs",
          "title": "Browser state and async timing hide bugs",
          "body": "In ReScript, UI bugs often come from stale state, event timing, or a missing await/fetch boundary. Reproduce the issue with one interaction and log the state transition before changing the view code.",
          "tag": "frontend",
          "status": "curated"
        }
      ],
      "categories": [
        "functional",
        "web"
      ],
      "overview": "A robustly typed language that compiles to efficient, readable JavaScript — successor to BuckleScript. Its pattern matching and variant types catch bugs before runtime.",
      "learning_curve": "Moderate — the syntax is JavaScript-like but with OCaml semantics underneath. Pattern matching, variants, and the module system require adjustment. The JS interop is excellent and low-friction. Easier than PureScript, harder than TypeScript.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "ReScript is the successor to BuckleScript (forked from ReasonML in 2020). Compiles to clean, readable JavaScript. No runtime dependency. Used at Facebook, Vercel, and smaller companies. Active development. Smaller ecosystem than TypeScript but growing. Belt stdlib included. Best-in-class JS interop for a typed language.",
      "common_use_cases": [
        "React apps",
        "Node backends",
        "Type-safe JS interop"
      ],
      "docs_url": "https://rescript-lang.org/docs/manual/latest/introduction",
      "best_for": [
        "type-safe React application development",
        "JavaScript interop without a runtime",
        "migrating JavaScript to a typed language",
        "Performance-sensitive React components with ReScript sound type system"
      ],
      "weak_at": [
        "Python or Ruby backends without ReScript full-stack story",
        "Legacy Angular or Vue codebases without ReScript framework bindings",
        "Teams needing largest npm ecosystem without compilation step friction"
      ],
      "official_url": "https://rescript-lang.org/",
      "paradigm": [
        "functional",
        "typed",
        "JavaScript"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Varies by dialect; commonly compiles to JavaScript",
        "runtime": "Runs on JavaScript engines after compile",
        "memory": "Garbage-collected (inherits the host JavaScript engine)"
      }
    },
    {
      "id": "hack",
      "name": "Hack",
      "color": "#375eab",
      "description": "Facebook's gradually-typed PHP — adds generics, async, and type checking to the PHP ecosystem. Runs HHVM for high-throughput web serving at Facebook scale.",
      "whoItIsFor": "Teams on HHVM wanting type safety in large PHP codebases — gradual typing, async, and built-in static analysis for massive web services.",
      "commonUses": [
        "Web backends (Meta)",
        "Large-scale PHP migration"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "<<__EntryPoint>>\nfunction main(): void {\n  echo \"Hello\\n\";\n}",
          "explanation": "Typed entry point with <<__EntryPoint>>; Hack's type checker validates your code before runtime."
        },
        {
          "title": "XHP / HHVM FFI boundary - Hack's polyglot bridge",
          "code": "// Hack's polyglot boundary is twofold:\n// 1. XHP for type-safe HTML rendering\n// 2. HHVM FFI for calling C/C++ extensions\n\n// XHP (type-safe HTML)\nfunction render(string $name): :div {\n  return\n    <div>\n      <h1>Hello, {$name}</h1>\n    </div>;\n}\n\n// HHVM FFI (call C/C++)\n// In .hni file:\n//   function fast_hash(string $data): int;\n//   ___HHVM_FFI_DEFINE(\"fast_hash\");\n\n// PHP interop (seamless)\n$pdo = new PDO('mysql:host=localhost', $user, $pass);",
          "explanation": "Hack's polyglot boundary is twofold: (1) XHP, which provides type-safe HTML rendering — every HTML tag is a Hack class, preventing XSS and ensuring well-formed output; and (2) HHVM FFI, which allows calling C/C++ extensions directly from Hack code for performance-critical paths. Hack also has seamless PHP interop — any PHP library can be called directly. This makes Hack uniquely positioned for web-scale applications with type safety and C-level performance where needed."
        }
      ],
      "libraries": [
        {
          "name": "Hack docs",
          "url": "https://docs.hhvm.com/hack/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Hack language documentation",
          "url": "https://docs.hhvm.com/hack/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// Hack variables\n$name = \"Hack\";\n$age = 42;\n$active = true;\n\n// Type annotations\nint $count = 10;\nstring $message = \"Hello\";\n\n// Nullable types\n?int $maybe = null;\n\n// Shapes (record-like)\nshape('id', 'name') $user = shape('id' => 1, 'name' => 'Alice');",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// Hack conditionals\nif ($count > 100) {\n  echo \"high\";\n} else if ($count > 50) {\n  echo \"medium\";\n} else {\n  echo \"low\";\n}\n\n// Ternary\n$result = $count > 100 ? \"high\" : \"low\";\n\n// Switch\nswitch ($status) {\n  case Status::ACTIVE: echo \"active\"; break;\n  case Status::INACTIVE: echo \"inactive\"; break;\n  default: echo \"unknown\"; break;\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Hack loops\n// For loop\nfor ($i = 0; $i < 10; $i++) {\n  echo $i;\n}\n\n// While\nwhile ($count > 0) {\n  $count--;\n}\n\n// Foreach\nforeach ($items as $item) {\n  echo $item;\n}\n\n// Map (Hack collections)\n$result = Vec\\map($items, $x ==> $x * 2);\n\n// Filter\n$filtered = Vec\\filter($items, $x ==> $x > 5);",
          "difficulty": "basic"
        },
        "functions": {
          "code": "// Hack functions\nfunction add(int $a, int $b): int {\n  return $a + $b;\n}\n\n// Arrow functions (lambdas)\n$double = $x ==> $x * 2;\n\n// Type annotations\nfunction greet(string $name): string {\n  return \"Hello, \" . $name;\n}\n\n// Generics\nfunction first<T>(vec<T> $v): ?T {\n  return Vec\\first($v);\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "// Hack performance:\n// 1. HHVM JIT compiler provides PHP-level+ speed\n// 2. Hack strict mode enables type verification at runtime\n// 3. Async/Await for non-blocking I/O (Facebook-scale)\n// 4. Collections (vec, map, set) are value types (COW)\n// 5. XHP for type-safe HTML rendering\n// 6. Hack code runs ~2-5x faster than PHP on HHVM\n\n// Async function for concurrent I/O\nasync function fetchData(): Awaitable<string> {\n  return await \\HH\\ApiClient::fetch('/api/data');\n}",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "// Hack classes\nclass Point {\n  public function __construct(\n    private float $x,\n    private float $y,\n  ) {}\n\n  public function distance(): float {\n    return sqrt($this->x * $this->x + $this->y * $this->y);\n  }\n}\n\n$p = new Point(3.0, 4.0);\necho $p->distance();  // 5.0\n\n// Traits\ntrait HasName {\n  public function getName(): string {\n    return $this->name;\n  }\n}",
          "difficulty": "basic"
        },
        "strings": {
          "code": "// Hack strings\n$name = \"Hack\";\n$greeting = \"Hello, \" . $name . \"!\";  // concatenation with .\n\n// String functions\nStr\\length(\"hello\");      // 5\nStr\\uppercase(\"hello\");  // \"HELLO\"\nStr\\slice(\"hello\", 0, 3); // \"hel\"\n\n// Heredoc\n$msg = <<<HACK\nHello, $name!\nHACK;\n\n// XHP (type-safe HTML)\n$elem = <h1>Hello, {$name}</h1>;",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Hack error handling\n// Option type for nullable\nfunction findUser(int $id): ?User {\n  return $id > 0 ? new User($id) : null;\n}\n\n// Result type\nfunction safeDivide(int $a, int $b): Result<int, string> {\n  return $b === 0\n    ? new Failure(\"Division by zero\")\n    : new Success($a / $b);\n}\n\n// Exceptions\ntry {\n  riskyOperation();\n} catch (Exception $e) {\n  echo $e->getMessage();\n}",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// Hack imports (namespaces and use)\nnamespace My\\App;\n\nuse My\\Lib\\User;\nuse My\\Lib\\{Database, Logger};\n\n// Type alias\nuse type My\\Lib\\UserType;\n\n// Autoloading via HHVM\n// Files must declare namespace at the top\n// Types are resolved automatically by HHVM autoloader",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "web"
      ],
      "overview": "Facebook's gradually-typed PHP — adds generics, async, and type checking to the PHP ecosystem. Runs HHVM for high-throughput web serving at Facebook scale. Teams on HHVM wanting type safety in large PHP codebases — gradual typing, async, and built-in static analysis for massive web services.\n\nTypical projects include Web backends (Meta), Large-scale PHP migration. Runs exclusively on HHVM; used at Meta scale.",
      "learning_curve": "Moderate for PHP developers — the syntax is familiar but adds type annotations, generics, async, and XHP. The Hack type system is stricter than PHP's. HHVM-specific features (async, collections, FFI) require learning. Steeper than PHP, gentler than Haskell.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Hack runs exclusively on HHVM (HipHop Virtual Machine). Used at Facebook/Meta for their entire PHP codebase. Strong type system with inference. XHP for type-safe HTML. Composer for package management. Small ecosystem outside Meta. Excellent for large-scale web applications. Documentation is comprehensive.",
      "common_use_cases": [
        "Web backends (Meta)",
        "Large-scale PHP migration"
      ],
      "docs_url": "https://docs.hhvm.com/hack/",
      "best_for": [
        "large-scale PHP backend maintenance",
        "Meta-originated gradual typing migration",
        "Hack/HHVM-based web application development",
        "Large-scale PHP codebases migrating toward Hack gradual typing"
      ],
      "weak_at": [
        "Shared hosting environments without HHVM runtime availability",
        "Greenfield PHP 8 projects where vanilla PHP tooling suffices",
        "Cross-platform mobile or desktop apps outside HHVM server context"
      ],
      "official_url": "https://hacklang.org/",
      "paradigm": [
        "object-oriented",
        "typed",
        "PHP-like"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Gradual static typing with Hack type checker (strict modes available)",
        "runtime": "Runs on HHVM (HipHop Virtual Machine), not the JVM",
        "memory": "Garbage-collected on HHVM",
        "abstraction": "High-level web/backend language with PHP interoperability"
      }
    },
    {
      "id": "abap",
      "name": "ABAP",
      "color": "#e8a912",
      "description": "SAP's proprietary language for business application programming — runs inside SAP systems. Powers the back-office logic behind most of the world's enterprise resource planning.",
      "whoItIsFor": "SAP consultants and enterprise developers building ERP customisations — the primary language for extending SAP business logic and reports.",
      "commonUses": [
        "SAP ERP",
        "Business logic",
        "Reports",
        "Fiori extensions"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "WRITE: 'Hello'.",
          "explanation": "Outputs text in an SAP report using WRITE — ABAP's equivalent of a console print inside a report program."
        },
        {
          "title": "RFC/BAPI boundary - SAP external integration",
          "code": "* ABAP exposes business logic via RFC (Remote Function Call)\n* and BAPI (Business Application Programming Interface)\n\nCALL FUNCTION 'BAPI_FLIGHT_GETLIST'\n  EXPORTING\n    airline    = 'AA'\n    destination = 'SFO'\n  TABLES\n    flight_list = lt_flights.\n\n* External systems call RFC via SAP connector libraries\n* (JCo for Java, NCo for .NET, PyRFC for Python)\n* This is the polyglot boundary: SAP <-> external world",
          "explanation": "ABAP's primary boundary is RFC (Remote Function Call) and BAPIs, which expose SAP business logic to external systems. JCo (Java), NCo (.NET), and PyRFC (Python) provide connector libraries. In polyglot pipelines, RFC is how data moves in and out of SAP — the enterprise boundary that every SAP integration crosses."
        }
      ],
      "libraries": [
        {
          "name": "SAP docs",
          "url": "https://help.sap.com/docs/",
          "type": "SAP Help"
        }
      ],
      "docs": [
        {
          "name": "ABAP keyword docs",
          "url": "https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm"
        }
      ],
      "compareData": {
        "variables": {
          "code": "DATA x TYPE i VALUE 10.",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "IF x > 5.\n  WRITE 'big'.\nENDIF.",
          "difficulty": "basic"
        },
        "loops": {
          "code": "DO 5 TIMES.\n  WRITE sy-index.\nENDDO.",
          "difficulty": "basic"
        },
        "functions": {
          "code": "FORM add USING a TYPE i b TYPE i CHANGING c TYPE i.\n  c = a + b.\nENDFORM.",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Runs on SAP NetWeaver; optimised for database-heavy ERP.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "CLASS zcl_point DEFINITION.\n  PUBLIC SECTION.\n    DATA: x TYPE f,\n          y TYPE f.\n    METHODS: length RETURNING VALUE(r) TYPE f.\nENDCLASS.\n\nCLASS zcl_point IMPLEMENTATION.\n  METHOD length.\n    r = sqrt( x * x + y * y ).\n  ENDMETHOD.\nENDCLASS.",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "DATA(greeting) = |Hello, ABAP!|.\nWRITE: / greeting.\n\" String templates with |...|\nDATA(msg) = |Value: { lv_value }|.",
          "difficulty": "basic"
        },
        "errors": {
          "code": "TRY.\n    lv_result = risky_operation( ).\n  CATCH cx_root INTO DATA(lx_error).\n    WRITE: / 'Error:', lx_error->get_text( ).\nENDTRY.",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "\" ABAP uses program-level declarations, not imports\n\" Objects are referenced via class names\nDATA: lo_point TYPE REF TO zcl_point.\nCREATE OBJECT lo_point.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "abap-tip-transport",
          "title": "Transports and system landscape matter",
          "body": "ABAP bugs often track transport order, client, and SAP release — not FFI “unsafe blocks”. Reproduce on the same system level.",
          "tag": "enterprise",
          "status": "curated"
        }
      ],
      "categories": [
        "data"
      ],
      "overview": "SAP's proprietary language for business application programming — runs inside SAP systems. Powers the back-office logic behind most of the world's enterprise resource planning. SAP consultants and enterprise developers building ERP customisations — the primary language for extending SAP business logic and reports.\n\nTypical projects include SAP ERP, Business logic, Reports. Exclusive to SAP systems with a large enterprise footprint.",
      "learning_curve": "Steep for non-SAP developers — the ABAP ecosystem is deeply intertwined with SAP. The language itself is straightforward (imperative with OO), but the SAP platform (transactions, tables, CDS views) is the real learning mountain. ABAP on HANA and ABAP Cloud add modern paradigms.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Exclusive to SAP. SE80/SE24 are the development workbenches. ABAP Cloud (Steampunk) enables development on SAP BTP without on-premise. Massive enterprise footprint — most Fortune 500 run SAP. Community is large but SAP-internal.",
      "common_use_cases": [
        "SAP ERP",
        "Business logic",
        "Reports",
        "Fiori extensions"
      ],
      "docs_url": "https://help.sap.com/docs/abap-cloud",
      "best_for": [
        "SAP ERP customisation and extensions",
        "enterprise business logic on SAP",
        "SAP Fiori and reporting development",
        "SAP ERP customization, reports, and business logic inside S/4HANA"
      ],
      "weak_at": [
        "Non-SAP cloud-native microservices without ABAP runtime licensing",
        "Open-source-first startups without SAP landscape investments",
        "Mobile games or consumer apps outside enterprise resource planning"
      ],
      "official_url": "https://www.sap.com/products/technology-platform/abap.html",
      "paradigm": [
        "imperative",
        "enterprise",
        "report-oriented"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static or keyword-driven depending on the product (varies widely)",
        "runtime": "Runs on vendor runtimes, report engines, or application servers",
        "memory": "Managed by the host product or runtime"
      }
    },
    {
      "id": "apex",
      "name": "Apex",
      "color": "#1797c0",
      "description": "Salesforce's Java-like language for writing triggers, controllers, and business logic on the platform. Runs in a multitenant cloud with governor limits on every operation.",
      "whoItIsFor": "Salesforce developers building CRM customisations, triggers, and integrations — runs on the Lightning platform with governor limits and SOQL.",
      "commonUses": [
        "Salesforce triggers",
        "Lightning controllers",
        "CRM automation"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "System.debug('Hello');",
          "explanation": "Prints to the debug log via System.debug — Apex output goes to logs, not a terminal."
        },
        {
          "title": "Salesforce API boundary - @RemoteAction and REST",
          "code": "// Apex boundary: exposing Salesforce data to external systems\n\n// Visualforce @RemoteAction (JavaScript callable)\nglobal class MyController {\n    @RemoteAction\n    global static List<Account> getAccounts() {\n        return [SELECT Id, Name FROM Account LIMIT 10];\n    }\n}\n\n// REST API endpoint\n@RestResource(urlMapping='/accounts/*')\nglobal class AccountResource {\n    @HttpGet\n    global static void getAccounts() {\n        RestContext.response.statusCode = 200;\n        RestContext.response.responseBody =\n            Blob.valueOf(JSON.serialize(\n                [SELECT Id, Name FROM Account]\n            ));\n    }\n}",
          "explanation": "Apex's primary boundary is the Salesforce API: @RemoteAction exposes methods callable from JavaScript in Visualforce pages, and @RestResource creates REST endpoints. Salesforce also provides SOAP and Bulk APIs for external integration. In polyglot pipelines, Apex is the gateway to Salesforce data — it runs inside the platform, enforcing governor limits, and exposes business logic through APIs that external services consume."
        }
      ],
      "libraries": [
        {
          "name": "Apex docs",
          "url": "https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Apex reference",
          "url": "https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "Integer x = 10;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5) { System.debug('big'); }",
          "difficulty": "basic"
        },
        "loops": {
          "code": "for (Integer i = 0; i < 5; i++) { }",
          "difficulty": "basic"
        },
        "functions": {
          "code": "public static Integer add(Integer a, Integer b) { return a + b; }",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Runs on Salesforce multi-tenant cloud; governor limits apply.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "public class Point {\n    public Double x { get; set; }\n    public Double y { get; set; }\n\n    public Double length() {\n        return Math.sqrt(x * x + y * y);\n    }\n}",
          "difficulty": "basic"
        },
        "strings": {
          "code": "String greeting = 'Hello, Apex!';\nSystem.debug(greeting);\n// String interpolation via String.format\nString msg = String.format('Value: {0}', new List<Object>{val});",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try {\n    riskyOperation();\n} catch (DmlException e) {\n    System.debug('Error: ' + e.getMessage());\n} catch (Exception e) {\n    System.debug('Generic error: ' + e.getMessage());\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "// Apex doesn't have import statements\n// Classes are accessible by name within the same namespace\n// Standard library classes are always available\n// Custom classes reference each other by name\n\n// Database operations use built-in methods\nList<Account> accounts = [SELECT Id, Name FROM Account];",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "web",
        "data"
      ],
      "overview": "Salesforce's Java-like language for writing triggers, controllers, and business logic on the platform. Runs in a multitenant cloud with governor limits on every operation.",
      "learning_curve": "Moderate for Java developers — Apex syntax is familiar. The Salesforce platform (governor limits, SOQL, metadata API) is the real challenge. Governor limits restrict what you can do per transaction (100 SOQL queries, 150 DML operations, etc.).",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Exclusive to Salesforce. Developed in Developer Console, VS Code with Salesforce Extension Pack, or IDE extensions. Salesforce CLI (sfdx) for deployment. Massive enterprise footprint. AppExchange provides pre-built packages. Strong community and trailhead.training.",
      "common_use_cases": [
        "Salesforce triggers",
        "Lightning controllers",
        "CRM automation"
      ],
      "docs_url": "https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/",
      "best_for": [
        "Salesforce trigger and automation development",
        "Lightning web component controllers",
        "CRM customisation and data workflows",
        "Salesforce platform automation with triggers, batches, and REST callouts"
      ],
      "weak_at": [
        "General-purpose servers outside Force.com runtime and governor limits",
        "Open-source infrastructure without Salesforce licensing dependencies",
        "Compute-heavy offline applications without platform API connectivity"
      ],
      "official_url": "https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/",
      "paradigm": [
        "object-oriented",
        "declarative",
        "platform"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static or keyword-driven depending on the product (varies widely)",
        "runtime": "Runs on vendor runtimes, report engines, or application servers",
        "memory": "Managed by the host product or runtime"
      }
    },
    {
      "id": "sas",
      "name": "SAS",
      "color": "#b9bc0c",
      "description": "A statistical programming suite dominant in pharma, insurance, and government analytics. Data steps and procs form the two pillars of every SAS program.",
      "whoItIsFor": "Statisticians and analysts in regulated industries — especially pharma, banking, and government where validated statistical reporting is required.",
      "commonUses": [
        "Clinical trials",
        "Insurance analytics",
        "Government reporting"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "data _null_;\n  put 'Hello';\nrun;",
          "explanation": "DATA step with PUT writes to the SAS log — the simplest way to confirm code is running."
        },
        {
          "title": "DATA step and PROC PRINT",
          "code": "data work.sample;\n  input name $ score;\ndatalines;\nAda 92\nBen 88\n;\nrun;\n\nproc print data=work.sample;\nrun;",
          "explanation": "The DATA step builds a table; DATALINES feeds inline rows; PROC steps analyse or print."
        },
        {
          "title": "PROC MEANS summary",
          "code": "proc means data=sashelp.class;\n  var height weight;\nrun;",
          "explanation": "PROC MEANS computes summary statistics for numeric columns."
        },
        {
          "title": "PROC SQL / DS2 boundary - SAS's polyglot bridge",
          "code": "/* SAS's polyglot boundary is twofold:\n   1. PROC SQL for SQL-based data manipulation\n   2. DS2 for advanced programming inside SAS\n   3. PYTHON integration for Python code */\n\n/* PROC SQL: SQL inside SAS */\nproc sql;\n  create table result as\n  select a.name, b.salary\n  from work.employees a\n  inner join work.salaries b\n  on a.id = b.id\n  where b.salary > 50000;\nquit;\n\n/* PROC PYTHON: call Python from SAS */\nproc python;\n  submit;\nimport pandas as pd\ndf = sd.get('work.data')\nresult = df.groupby('category').mean()\nsd.put('result', result)\n  endsubmit;\nrun;",
          "explanation": "SAS's polyglot boundary is its ability to switch paradigms: PROC SQL lets SAS programmers use SQL directly for data manipulation, DS2 provides object-oriented programming within SAS, and PROC PYTHON (SAS 9.4M6+) allows calling Python code from SAS data steps. This makes SAS a multi-paradigm platform where data flows between DATA steps, SQL queries, and Python scripts seamlessly."
        }
      ],
      "libraries": [
        {
          "name": "SAS docs",
          "url": "https://documentation.sas.com/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "SAS documentation",
          "url": "https://documentation.sas.com/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "/* SAS variables */\ndata work.example;\n  /* Automatic variables */\n  name = 'Alice';\n  age = 30;\n  active = 1;\n\n  /* Numeric and character types */\n  length city $20;  /* character, max 20 chars */\n  city = 'New York';\n\n  /* Macro variables */\n  %let myvar = 42;\n  &myvar  /* resolves to 42 */\nrun;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "/* SAS conditionals */\ndata work.result;\n  set work.example;\n  \n  /* IF/THEN/ELSE */\n  if age > 65 then category = 'Senior';\n  else if age > 30 then category = 'Middle';\n  else category = 'Young';\n\n  /* SELECT (like switch) */\n  select(status);\n    when('A') label = 'Active';\n    when('I') label = 'Inactive';\n    otherwise label = 'Unknown';\n  end;\nrun;",
          "difficulty": "basic"
        },
        "loops": {
          "code": "/* SAS loops */\n/* DO loop (iterative) */\ndata work.squares;\n  do i = 1 to 10;\n    square = i * i;\n    output;\n  end;\nrun;\n\n/* DO WHILE */\ndata work.loop;\n  x = 0;\n  do while(x < 100);\n    x = x + 10;\n    output;\n  end;\nrun;\n\n/* DO OVER (array iteration) */\ndata work.norm;\n  array vals{*} v1-v10;\n  do over vals;\n    vals = vals / 100;\n  end;\nrun;",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "/* SAS functions */\n/* Statistical functions */\nmean_val = mean(of v1-v10);\nstd_val = std(of v1-v10);\nmax_val = max(of v1-v10);\n\n/* Character functions */\nupcase_name = upcase(name);\nsubstr_name = substr(name, 1, 3);\n\n/* Date functions */\ntoday_var = today();\nyear_var = year(today());\n\n/* Custom functions via PROC FCMP */\nproc fcmp;\n  function add(a, b);\n    return(a + b);\n  endsub;\nrun;",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "/* SAS performance:\n   1. PROC steps are optimized C routines\n   2. DATA step processes one obs at a time (row-wise)\n   3. WHERE clause pushes filtering to I/O layer\n   4. Indexes speed up WHERE/JOIN operations\n   5. PROC SQL can be faster for set operations\n   6. Compress option reduces I/O for large datasets\n   7. CAS (Cloud Analytics Services) for distributed */\n\nproc datasets lib=work nolist;  /* fast metadata */\nproc sort data=big; by id;       /* creates index */",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "/* SAS has limited OOP features.\n   Modern SAS supports:\n   - PROC FCMP for custom functions (like methods)\n   - PROC OBJECT for OOP (experimental)\n   - SAS/AF for frame-based OOP (legacy)\n\n   Most SAS code is procedural.\n   Limited/optional OOP features exist in\n   modern SAS (PROC FCMP packages), but\n   the dominant paradigm is DATA step + PROC. */",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "/* SAS strings */\nname = 'Alice';\n\n/* Concatenation */\nfull = catx(' ', first, last);  /* 'Alice Smith' */\n\n/* String functions */\nupcase_name = upcase('alice');     /* 'ALICE' */\nsubstr_name = substr('Hello', 1, 3); /* 'Hel' */\nlength_name = length('Alice');    /* 5 */\ncompress_name = compress('A B C'); /* 'ABC' */\n\n/* Character to numeric */\nnum = input('42', 8.);",
          "difficulty": "basic"
        },
        "errors": {
          "code": "/* SAS error handling */\n/* Automatic error handling */\ndata work.clean;\n  set work.raw;\n  /* _ERROR_ automatic variable */\n  if _ERROR_ then delete;\nrun;\n\n/* TRY/CATCH in DS2 (modern SAS) */\nproc ds2;\n  data work.result;\n    method run();\n      declare double result;\n      try:\n        result = 1 / 0;\n      catch division_by_zero:\n        result = .;\n      end;\n    endmethod;\n  enddata;\nrun;\n\n/* Macro error handling */\n%macro safe_div(a, b);\n  %if &b = 0 %then %do;\n    %put ERROR: Division by zero;\n    %return;\n  %end;\n  %sysevalf(&a / &b);\n%mend;",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "/* SAS imports */\n/* Include external SAS code */\n%include '/path/to/code.sas';\n\n/* Libname (data library reference) */\nlibname mydata '/path/to/data';\n\n/* ODBC connection */\nlibname sqldata odbc dsn='mydb' user='me' password='xxx';\n\n/* PROC IMPORT for external files */\nproc import datafile='/path/to/data.csv'\n  out=work.mydata\n  dbms=csv\n  replace;\nrun;\n\n/* Macro variables from external source */\n%let path = /shared/data;",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "sas-tip-session",
          "title": "Session state and licensed runtime",
          "body": "SAS results depend on session options, library assignments, and licensed procedures. Save the exact log and libnames for reproduction.",
          "tag": "stats",
          "status": "curated"
        }
      ],
      "categories": [
        "data"
      ],
      "overview": "A statistical programming suite dominant in pharma, insurance, and government analytics. Data steps and procs form the two pillars of every SAS program. Statisticians and analysts in regulated industries — especially pharma, banking, and government where validated statistical reporting is required.\n\nTypical projects include Clinical trials, Insurance analytics, Government reporting. SAS Institute tooling dominates pharma and banking analytics, though enterprise licensing costs are a real constraint.",
      "learning_curve": "Steep for programmers — SAS has its own paradigm (DATA step + PROC) that doesn't map cleanly to other languages. Macro language adds complexity. However, for analysts familiar with statistics, it's approachable. The learning curve is more about SAS culture than syntax.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "SAS is the dominant tool in enterprise statistics and regulated industries (pharma, banking). SAS Institute provides comprehensive support. Large enterprise ecosystem. PROC steps cover everything from basic stats to machine learning. Expensive licensing. SAS University Edition is free for learning. Industry-specific solutions (SAS Viya for cloud).",
      "common_use_cases": [
        "Clinical trials",
        "Insurance analytics",
        "Government reporting"
      ],
      "docs_url": "https://documentation.sas.com/",
      "best_for": [
        "clinical trial data analysis and reporting",
        "Insurance actuarial modelling",
        "regulated-industry statistical computing",
        "Insurance actuarial modeling and regulated clinical trial reporting"
      ],
      "weak_at": [
        "Modern cloud data stacks standardized on Python, R, or Spark",
        "Startups avoiding proprietary licensing and vendor lock-in costs",
        "Real-time streaming analytics outside SAS Event Stream Processing"
      ],
      "official_url": "https://www.sas.com/",
      "paradigm": [
        "procedural",
        "statistical",
        "data-step"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static or keyword-driven depending on the product (varies widely)",
        "runtime": "Runs on vendor runtimes, report engines, or application servers",
        "memory": "Managed by the host product or runtime"
      }
    },
    {
      "id": "stata",
      "name": "Stata",
      "color": "#1a5276",
      "description": "A statistical software package with its own command language — popular in economics and social science. Do-files let you reproduce any analysis from raw data to publication tables.",
      "whoItIsFor": "Economists and social scientists doing panel data work — streamlined for survey analysis, causal inference, and reproducible statistical research.",
      "commonUses": [
        "Econometrics",
        "Survey analysis",
        "Public health research"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "display \"Hello\"",
          "explanation": "Prints to the results window using display — Stata's equivalent of a print statement."
        },
        {
          "title": "Load and summarise",
          "code": "sysuse auto, clear\ntabulate foreign\nsummarize mpg price",
          "explanation": "`sysuse` loads sample data; `tabulate` counts categories; `summarize` shows numeric stats."
        },
        {
          "title": "Regression",
          "code": "regress mpg weight foreign",
          "explanation": "Linear regression of `mpg` on predictors; coefficients appear in the output table."
        },
        {
          "title": "C plugin / Python boundary - Stata's polyglot bridge",
          "code": "* Stata's polyglot boundary is twofold:\n* 1. C plugins via the Stata Plugin Interface (SPI)\n* 2. Python integration (Stata 16+)\n\n* Python integration\npython:\nimport numpy as np\nimport pandas as pd\ndf = pd.DataFrame({'x': [1,2,3], 'y': [4,5,6]})\nresult = np.corrcoef(df['x'], df['y'])[0,1]\nend\n\n* C plugin (via SPI)\n* 1. Write C code that uses Stata SPI functions\n* 2. Compile as .plugin file\n* 3. Call from Stata:\nplugin call myplugin varlist, arg1 arg2\n\n* R integration (via rscript command)\nrscript:\nlibrary(tidyverse)\ndata <- read.csv('data.csv')\nresult <- lm(y ~ x, data=data)\nend",
          "explanation": "Stata's polyglot boundary is its plugin system: C plugins via the Stata Plugin Interface (SPI) allow calling compiled C code for performance-critical operations, while Python integration (Stata 16+) enables calling Python directly from Stata code with bidirectional data flow. R integration is also available. This makes Stata a hub for statistical computing that can delegate to C for speed, Python for ML, or R for specialized statistical methods."
        }
      ],
      "libraries": [
        {
          "name": "Stata docs",
          "url": "https://www.stata.com/support/",
          "type": "Manuals"
        }
      ],
      "docs": [
        {
          "name": "Stata manual",
          "url": "https://www.stata.com/support/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "* Stata variables\nlocal name \"Alice\"\nglobal path \"/data/projects\"\n\n* Dataset variables (columns)\ngenerate age = 30\ngenerate income = 50000\n\n* Scalars\nscalar pi = 3.14159\n\n* Macros\nlocal count: word count `=list'\ndisplay `count'",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "* Stata conditionals\nif age > 65 {\n    display \"Senior\"\n}\nelse if age > 30 {\n    display \"Middle\"\n}\nelse {\n    display \"Young\"\n}\n\n* Conditional generate\ngenerate category = cond(age > 65, \"Senior\", \"Young\")\n\n* if with commands (one-line)\nsummarize income if age > 30\n\ntabulate region if income > 50000",
          "difficulty": "basic"
        },
        "loops": {
          "code": "* Stata loops\n* forvalues (numeric)\nforvalues i = 1/10 {\n    display `i'\n}\n\n* foreach (list)\nforeach var in age income education {\n    summarize `var'\n}\n\n* while\nlocal i = 1\nwhile `i' <= 10 {\n    display `i'\n    local i = `i' + 1\n}\n\n* Loop over variable list\nforeach v of varlist _all {\n    display \"`v': \" r(N)\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "* Stata functions (commands and functions)\n* Statistical functions\nsummarize income, detail\nregress y x1 x2 x3\n\n* String functions\nupper(\"alice\")        /* \"ALICE\" */\nsubstr(\"Hello\", 1, 3)  /* \"Hel\" */\nlength(\"Alice\")        /* 5 */\n\n* Mathematical functions\nlog(100)\nsqrt(144)\n\n* egen (extended generate)\ngen mean_inc = mean(income)\negen group_id = group(region agegroup)",
          "difficulty": "basic"
        },
        "performance": {
          "code": "* Stata performance:\n* 1. Uses RAM efficiently (memory-resident data)\n* 2. Stata/MP: multi-core parallelization\n* 3. preserve/restore for temporary modifications\n* 4. Use inlist() and inrange() for fast filters\n* 5. Avoid loops when commands are vectorized\n* 6. Sort data once, then use sorted operations\n* 7. frames (Stata 16+) for multiple datasets\n\n* Fast: vectorized\nsummarize income if age > 30\nregress y x1 x2, vce(robust)",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "* Stata has limited OOP features.\n* Modern Stata (16+) supports frames for\n*   multi-dataset contexts, but not OOP.\n* The dominant paradigm is command-based:\n*   command varlist, options\n* Programs (ado files) serve as reusable\n*   functions rather than classes.\n* Limited/optional OOP features exist in\n*   Mata (Stata's matrix language), which\n*   supports class definitions.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "* Stata strings\ndisplay \"Hello, Stata!\"\n\n* String functions\nlocal name = upper(\"alice\")      * \"ALICE\"\nlocal sub = substr(\"Hello\", 1, 3) * \"Hel\"\nlocal len = strlen(\"Alice\")       * 5\n\n* String concatenation\nlocal full = \"Hello\" + \", \" + \"World\"\n\n* Regex matching\nlocal match = regexm(\"test123\", \"[0-9]+\")  * 1",
          "difficulty": "basic"
        },
        "errors": {
          "code": "* Stata error handling\n* capture suppresses errors\ncapture noisily summarize nonexistent_var\nif _rc {\n    display \"Variable not found\"\n}\n\n* assert for data validation\nassert age >= 0 & age < 150\n\n* confirm variable exists\nconfirm variable income\n\n* Error in programs\nprogram define myprog\n    syntax varlist\n    if \"`varlist'\" == \"\" {\n        display as error \"No variables specified\"\n        exit 198\n    }\nend",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "* Stata imports\n* Load dataset\nuse \"mydata.dta\", clear\n\n* Import from other formats\nimport delimited \"data.csv\", clear\nimport excel \"data.xlsx\", firstrow clear\n\n* Install and use packages (SSC)\nssc install estout\nssc install ftools\n\n* Run ado files\nrun \"myprogram.do\"\n\ndo \"analysis.do\"",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "stata-tip-version",
          "title": "version and do-file reproducibility",
          "body": "Pin `version`, seed, and dataset path. Stata’s reproducibility is session/do-file discipline, not a language package manager.",
          "tag": "stats",
          "status": "curated"
        }
      ],
      "categories": [
        "data"
      ],
      "overview": "A statistical software package with its own command language — popular in economics and social science. Do-files let you reproduce any analysis from raw data to publication tables.",
      "learning_curve": "Moderate for statisticians — the command syntax is intuitive for data analysis. The macro language and Mata add complexity. Programming ado files requires understanding Stata's unique scoping. Easier than R for basic analysis, harder for advanced programming.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Stata is the dominant tool in economics, epidemiology, and social sciences. Comprehensive statistical coverage. SSC (Statistical Software Components) provides 3000+ user-written packages. Proprietary and expensive. Stata/MP for multicore. Stata 18 is current. Excellent documentation. Active Statalist community.",
      "common_use_cases": [
        "Econometrics",
        "Survey analysis",
        "Public health research"
      ],
      "docs_url": "https://www.stata.com/features/documentation/",
      "best_for": [
        "econometric panel data analysis",
        "Public health survey research",
        "social science statistical modelling",
        "Econometrics, public health surveys, and panel data regression analysis"
      ],
      "weak_at": [
        "Interactive web dashboards without StatConnect or export pipelines",
        "Open-source ML pipelines standardized on Python scikit-learn stacks",
        "Mobile data collection apps outside Stata data management tooling"
      ],
      "official_url": "https://www.stata.com/",
      "paradigm": [
        "imperative",
        "statistical",
        "command-driven"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static or keyword-driven depending on the product (varies widely)",
        "runtime": "Runs on vendor runtimes, report engines, or application servers",
        "memory": "Managed by the host product or runtime"
      }
    },
    {
      "id": "spss",
      "name": "SPSS Syntax",
      "color": "#cc0000",
      "description": "IBM's statistical analysis language — point-and-click or syntax-driven data analysis. Dominant in social sciences, health research, and survey analytics.",
      "whoItIsFor": "Social scientists and market researchers using IBM SPSS — point-and-click analysis with scripting for survey data and statistical reporting.",
      "commonUses": [
        "Survey analysis",
        "Market research",
        "Academic statistics"
      ],
      "patterns": [
        {
          "title": "Frequencies",
          "code": "FREQUENCIES VARIABLES=age\n  /STATISTICS=MEAN STDDEV.",
          "explanation": "Descriptive stats on age via FREQUENCIES — one of SPSS's core exploratory data procedures."
        },
        {
          "title": "GET DATA and FREQUENCIES",
          "code": "GET FILE='survey.sav'.\nFREQUENCIES VARIABLES=region.\nDESCRIPTIVES VARIABLES=age score.",
          "explanation": "Load a `.sav` file, then run frequency tables and descriptive stats on chosen variables."
        },
        {
          "title": "CROSSTABS",
          "code": "CROSSTABS /TABLES=gender BY outcome /CELLS=COUNT ROW.",
          "explanation": "Cross-tabulation with optional row percentages — common for survey analysis."
        },
        {
          "title": "Python/R extension boundary - SPSS's polyglot bridge",
          "code": "* SPSS's polyglot boundary is its Python and R integration\n\n* Python integration (most common)\nBEGIN PROGRAM PYTHON.\nimport spss\nimport spssdata\n\n# Get SPSS data as DataFrame\ndf = spssdata.Spssdata().fetchall()\n\n# Process with Python\nimport pandas as pd\nresult = df.groupby('region').mean()\n\n# Send result back to SPSS\nspss.Submit('COMPUTE new_var = 1.')\nEND PROGRAM.\n\n* R integration\nBEGIN PROGRAM R.\ndata <- spssdata.GetData()\nresult <- t.test(data$income, data$age)\nprint(result)\nEND PROGRAM.",
          "explanation": "SPSS's polyglot boundary is its Python and R integration. BEGIN PROGRAM PYTHON/R blocks allow SPSS users to call Python or R code directly from SPSS syntax, with bidirectional data flow via the spss and spssdata Python modules. This is how SPSS extends beyond its built-in statistics: Python for ML (scikit-learn, TensorFlow), R for specialized statistical methods, and C via Python ctypes. The boundary makes SPSS a hub that delegates to more capable languages."
        }
      ],
      "libraries": [
        {
          "name": "IBM SPSS docs",
          "url": "https://www.ibm.com/docs/en/spss-statistics",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "SPSS syntax reference",
          "url": "https://www.ibm.com/docs/en/spss-statistics"
        }
      ],
      "compareData": {
        "variables": {
          "code": "* SPSS variables\n* Variable definition in Data Editor\n* Types: Numeric, String, Date\n\n* COMPUTE creates/modifies variables\nCOMPUTE income_log = LN(income).\nCOMPUTE age_group = TRUNC(age / 10).\n\n* String variables\nSTRING city (A20).\nCOMPUTE city = 'New York'.\n\n* Variable labels\nVARIABLE LABELS income 'Annual Income'.\nVALUE LABELS gender 1 'Male' 2 'Female'.",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "* SPSS conditionals\n* IF statement\nIF (age > 65) category = 'Senior'.\nIF (age > 30 & age <= 65) category = 'Middle'.\nIF (age <= 30) category = 'Young'.\n\n* DO IF for multiple commands\nDO IF (income > 50000).\n  COMPUTE tax_rate = 0.30.\nELSE IF (income > 30000).\n  COMPUTE tax_rate = 0.20.\nELSE.\n  COMPUTE tax_rate = 0.10.\nEND IF.\n\n* SELECT IF for case filtering\nSELECT IF (age > 18).",
          "difficulty": "basic"
        },
        "loops": {
          "code": "* SPSS loops\n* LOOP for data transformation\nLOOP #i = 1 TO 10.\n  COMPUTE var#i = #i * 2.\nEND LOOP.\n\n* DO REPEAT for multiple variables\nDO REPEAT v = v1 TO v10.\n  COMPUTE v = v * 100.\nEND REPEAT.\n\n* VECTOR for indexed access\nVECTOR vars(10).\nLOOP #i = 1 TO 10.\n  COMPUTE vars(#i) = #i ** 2.\nEND LOOP.\n\n* No traditional while/for loops in SPSS syntax\n* Use Python integration for complex iteration",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "* SPSS functions\n* Statistical functions\nCOMPUTE mean_val = MEAN(v1 TO v10).\nCOMPUTE std_val = SD(v1 TO v10).\n\n* String functions\nCOMPUTE upper_name = UPCASE(name).\nCOMPUTE sub = SUBSTR(name, 1, 3).\nCOMPUTE len = LENGTH(name).\n\n* Mathematical functions\nCOMPUTE log_income = LN(income).\nCOMPUTE root = SQRT(value).\n\n* Date functions\nCOMPUTE age = DATEDIFF(today(), birthdate, 'years').",
          "difficulty": "basic"
        },
        "performance": {
          "code": "* SPSS performance:\n* 1. Data is memory-resident (like Stata)\n* 2. Use TEMPORARY for filtered operations\n* 3. AGGREGATE is faster than LOOP\n* 4. Use FILTER instead of SELECT IF for temporary\n* 5. Python integration for heavy computation\n* 6. SPSS Server for large datasets\n* 7. Cache results with PRESERVE/RESTORE\n\n* Fast: aggregated computation\nAGGREGATE OUTFILE=* MODE=ADDVARIABLES\n  /BREAK=group\n  /mean_income=MEAN(income).",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "* SPSS has no class/OOP system.\n* The paradigm is command-based:\n*   COMMAND variables, /OPTIONS.\n* Reusable code is via syntax files (.sps)\n* and custom dialogs (extension bundles).\n* Python integration provides OOP access\n* to SPSS data via the spss module.\n* Limited/optional OOP features exist only\n* through Python/R integration.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "* SPSS strings\nSTRING name (A20).\nCOMPUTE name = 'Alice'.\n\n* String functions\nCOMPUTE upper = UPCASE(name).       * 'ALICE'\nCOMPUTE lower = LOWCASE(name).        * 'alice'\nCOMPUTE sub = SUBSTR(name, 1, 3).     * 'Ali'\nCOMPUTE len = LENGTH(name).            * 5\n\n* Concatenation\nCOMPUTE full = CONCAT(first, ' ', last).\n\n* CHAR.INDEX for search\nCOMPUTE pos = CHAR.INDEX(name, 'li').  * 2",
          "difficulty": "basic"
        },
        "errors": {
          "code": "* SPSS error handling\n* SPSS stops on errors by default\n* Use SET ERRORS=NO to continue\nSET ERRORS=NO.\n\n* Check for missing values\nIF (MISSING(income)) income = 0.\n\n* Use NMISS for multiple missing checks\nCOMPUTE has_missing = NMISS(v1 TO v10) > 0.\n\n* Python try/catch for robust error handling\nBEGIN PROGRAM PYTHON.\ntry:\n    # SPSS Python integration\n    spss.Submit('DESCRIPTIVES income.')\nexcept Exception as e:\n    print(f'Error: {e}')\nEND PROGRAM.",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "* SPSS imports\n* Load data file\nGET FILE='/path/to/data.sav'.\n\n* Import from other formats\nGET DATA /TYPE=XLSX /FILE='/path/to/data.xlsx'.\nGET DATA /TYPE=CSV /FILE='/path/to/data.csv'.\n\n* Database connection\nGET DATA /TYPE=ODBC /CONNECT='DSN=mydb' /SQL='SELECT * FROM table'.\n\n* Extension bundles (via Extensions menu)\n* Python integration\nBEGIN PROGRAM PYTHON.\nimport spss\nspss.Submit('DESCRIPTIVES ALL.')\nEND PROGRAM.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "spss-tip-syntax",
          "title": "Syntax files beat GUI clicks for correctness",
          "body": "Export SPSS syntax and pin the data file. GUI-only workflows are not reproducible across machines.",
          "tag": "stats",
          "status": "curated"
        }
      ],
      "categories": [
        "data"
      ],
      "overview": "IBM's statistical analysis language — point-and-click or syntax-driven data analysis. Dominant in social sciences, health research, and survey analytics. Social scientists and market researchers using IBM SPSS — point-and-click analysis with scripting for survey data and statistical reporting.\n\nTypical projects include Survey analysis, Market research, Academic statistics. IBM SPSS combines point-and-click workflows with syntax, and Extension Hub plus Python/R integration extend what the GUI alone can do.",
      "learning_curve": "Gentle for beginners — GUI-driven analysis with point-and-click. SPSS Syntax is simpler than R or Stata. Advanced programming requires Python/R integration. The macro language is limited. Good for teaching introductory statistics.",
      "good_for_teaching": "good",
      "ecosystem_notes": "SPSS is widely used in social sciences, healthcare, and market research. IBM SPSS Statistics is proprietary and expensive. Extension Hub provides 200+ extensions. Python and R integration extend capabilities. GUI + syntax dual interface. Current version: SPSS 29. Strong academic licensing.",
      "common_use_cases": [
        "Survey analysis",
        "Market research",
        "Academic statistics"
      ],
      "docs_url": "https://www.ibm.com/docs/en/spss-statistics",
      "best_for": [
        "survey data analysis and market research",
        "academic statistical reporting",
        "social science data management",
        "Survey analysis and crosstab reporting in social science departments"
      ],
      "weak_at": [
        "Programmable ETL at scale better handled by Python or SQL engines",
        "Modern DevOps pipelines without SPSS batch syntax automation culture",
        "Real-time product analytics outside SPSS batch-oriented model"
      ],
      "official_url": "https://www.ibm.com/products/spss-statistics",
      "paradigm": [
        "procedural",
        "statistical",
        "GUI-driven"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static or keyword-driven depending on the product (varies widely)",
        "runtime": "Runs on vendor runtimes, report engines, or application servers",
        "memory": "Managed by the host product or runtime"
      }
    },
    {
      "id": "octave",
      "name": "GNU Octave",
      "color": "#0790c0",
      "description": "A free MATLAB-compatible language for numerical computation — runs most MATLAB scripts. Its GNU licensing makes it accessible for teaching and research without commercial seat costs.",
      "whoItIsFor": "Students and researchers who need MATLAB compatibility without the licence cost.",
      "commonUses": [
        "Numerical computing",
        "Signal processing",
        "Teaching",
        "Prototyping"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "disp('Hello')",
          "explanation": "Uses disp to show a string in the Octave REPL or a script run from the CLI."
        },
        {
          "title": "Matrix",
          "code": "A = [1 2; 3 4];\nA * A",
          "explanation": "Matrix multiplication with * — Octave, like MATLAB, treats matrices as first-class primitives."
        },
        {
          "title": "MEX/LDLADD boundary - Octave's native code bridge",
          "code": "% Octave's polyglot boundary is twofold:\n% 1. MEX files for calling C/C++/Fortran\n% 2. Dynamic linking (LDLADD) for built-in extensions\n\n% MEX file example (C code, saved as myfun.c):\n% #include <octave/oct.h>\n% DEFUN_DLD (myfun, args, , \"My function\")\n% {\n%   Matrix x = args(0).matrix_value();\n%   // ... C code ...\n%   return octave_value(result);\n% }\n\n% Compile and call from Octave:\nmkoctfile myfun.c\nresult = myfun(x)\n\n% Python integration\npy.list([1, 2, 3])\npy.exec(\"import numpy as np\")",
          "explanation": "Octave's polyglot boundary is MEX files: C/C++/Fortran functions that compile to .mex or .oct files callable from Octave. This is how performance-critical numerical code bridges into Octave — the same MEX interface used by MATLAB. Octave also supports dynamic linking (LDLADD) for built-in extensions and Python integration (since Octave 8+). This makes Octave compatible with MATLAB's C extension ecosystem while being open-source."
        }
      ],
      "libraries": [
        {
          "name": "Octave docs",
          "url": "https://octave.org/doc/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "GNU Octave manual",
          "url": "https://octave.org/doc/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "% Octave variables\nx = 42;\nname = \"Octave\";\n\n% Matrices\nA = [1 2 3; 4 5 6; 7 8 9];\nv = [1, 2, 3];  % row vector\n\n% Cell arrays\nc = {\"hello\", 42, [1 2 3]};\n\n% Structs\ns.name = \"Alice\";\ns.age = 30;\n\n% Global\nglobal CONFIG_PATH = \"/etc/config\";",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "% Octave conditionals\nif x > 100\n  disp(\"high\")\nelseif x > 50\n  disp(\"medium\")\nelse\n  disp(\"low\")\nendif\n\n% Vectorized conditional\nresult = (x > 50) * 100 + (x <= 50) * 50;\n\n% switch\nswitch (status)\n  case \"active\"\n    disp(\"Active\");\n  case \"inactive\"\n    disp(\"Inactive\");\n  otherwise\n    disp(\"Unknown\");\nendswitch",
          "difficulty": "basic"
        },
        "loops": {
          "code": "% Octave loops\n% for loop\nfor i = 1:10\n  disp(i)\nendfor\n\n% while loop\ni = 0;\nwhile (i < 10)\n  i++;\nendwhile\n\n% Vectorized (preferred over loops)\nx = 1:10;\ny = x .^ 2;  % element-wise square\n\n% cellfun for cell arrays\nnames = {\"Alice\", \"Bob\", \"Carol\"};\nlens = cellfun(@length, names);  % [5, 3, 5]",
          "difficulty": "basic"
        },
        "functions": {
          "code": "% Octave functions\nfunction result = add(a, b)\n  result = a + b;\nendfunction\n\n% Multiple return values\nfunction [mean, std] = stats(x)\n  mean = mean(x);  % built-in\n  std = std(x);\nendfunction\n\n% Anonymous functions\nsquare = @(x) x .^ 2;\nsquare(5)  % 25\n\n% Variable arguments\nfunction result = myfun(varargin)\n  disp(varargin{1});\nendfunction",
          "difficulty": "basic"
        },
        "performance": {
          "code": "% Octave performance:\n% 1. Vectorize instead of loops (10-100x speedup)\n% 2. Preallocate arrays\n% 3. Use built-in functions (C-implemented)\n% 4. JIT compilation available (experimental)\n% 5. Sparse matrices for large sparse problems\n% 6. Package managers: MPI for parallel\n\n% Fast: vectorized\nx = linspace(0, 2*pi, 1e6);\ny = sin(x);  % vectorized, fast\n\n% Slow: loop\ny = zeros(size(x));\nfor i = 1:length(x)\n  y(i) = sin(x(i));  % loop, slow\nendfor",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "% Octave classdef (OOP, similar to MATLAB)\nclassdef Point\n  properties\n    x = 0;\n    y = 0;\n  endproperties\n\n  methods\n    function obj = Point(x, y)\n      obj.x = x;\n      obj.y = y;\n    endfunction\n\n    function d = length(obj)\n      d = sqrt(obj.x^2 + obj.y^2);\n    endfunction\n  endmethods\nendclassdef\n\np = Point(3, 4);\ndisp(p.length());  % 5",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "% Octave strings\ngreeting = \"Hello, Octave!\";\n\n% String concatenation\nmsg = [\"Hello, \" name \"!\"];\n\n% String functions\nupper(\"hello\")       % \"HELLO\"\nstrlen(\"hello\")      % 5\nsubstr(\"Hello\", 1, 3) % \"Hel\" (1-indexed!)\n\n% sprintf for formatting\nsprintf(\"Value: %d\", 42)\n\n% String comparison\nstrcmp(\"hello\", \"hello\")  % 1",
          "difficulty": "basic"
        },
        "errors": {
          "code": "% Octave error handling\ntry\n  result = risky_operation();\ncatch err\n  fprintf('Error: %s\\n', err.message);\n  result = NaN;\nend_try_catch\n\n% Raise errors\nerror(\"Something went wrong\");\n\n% Warnings\nwarning(\"Potential issue\");\n\n% Assert\nassert(x > 0, \"x must be positive\");",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "% Octave imports\n% Add to path\naddpath(\"/path/to/functions\");\n\n% Load package\npkg load signal\npkg load statistics\n\n% Source file\nsource(\"myfunctions.m\");\n\n% Import specific functions\n% (Octave doesn't have import like MATLAB)\n% Use addpath + function names\n\n% Install package\npkg install -forge signal",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "octave-tip-format-pass11",
          "title": "Octave vs MATLAB compatibility",
          "body": "Octave aims for MATLAB compatibility but packages and toolboxes diverge. Test numeric code on the engine you will ship.",
          "tag": "repro",
          "status": "curated"
        }
      ],
      "categories": [
        "data"
      ],
      "overview": "A free MATLAB-compatible language for numerical computation — runs most MATLAB scripts. Its GNU licensing makes it accessible for teaching and research without commercial seat costs. Students and researchers who need MATLAB compatibility without the licence cost.\n\nTypical projects include Numerical computing, Signal processing, Teaching. GNU Octave runs most MATLAB scripts without commercial seat costs, though the package ecosystem remains smaller than MATLAB's.",
      "learning_curve": "Gentle for MATLAB users — nearly identical syntax. For newcomers, matrix-oriented thinking takes adjustment. The help system and documentation are comprehensive. Easier than R for basic numerical work.",
      "good_for_teaching": "good",
      "ecosystem_notes": "GNU Octave is the open-source MATLAB alternative. Compatible with most MATLAB syntax. Octave Forge provides packages (signal, image, statistics, etc.). Used in education and research. No Simulink equivalent. Active development. Smaller ecosystem than MATLAB but growing.",
      "common_use_cases": [
        "Numerical computing",
        "Signal processing",
        "Teaching",
        "Prototyping"
      ],
      "docs_url": "https://docs.octave.org/latest/",
      "best_for": [
        "numerical computing and prototyping",
        "signal processing algorithm development",
        "MATLAB-compatible open-source computation",
        "MATLAB-compatible numerical prototyping without commercial license fees"
      ],
      "weak_at": [
        "Production web APIs expecting sub-millisecond request latencies",
        "Simulink-style graphical modeling without Octave block diagram tooling",
        "Enterprise support contracts requiring vendor-backed MATLAB subscriptions"
      ],
      "official_url": "https://octave.org/",
      "paradigm": [
        "imperative",
        "numeric",
        "MATLAB-compatible"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Interpreted or bytecode-based in common implementations (engines vary)",
        "memory": "Garbage-collected in mainstream implementations",
        "abstraction": "High-level for typical scripting and application use"
      }
    },
    {
      "id": "wolfram",
      "name": "Wolfram Language",
      "color": "#dd1100",
      "description": "The language behind Mathematica — symbolic computation, knowledge base, and notebook-driven. Everything is an expression; pattern matching and rewrite rules drive evaluation.",
      "whoItIsFor": "Scientists, mathematicians, and Wolfram|Alpha power users — symbolic computation, notebook workflows, and massive built-in curated knowledge.",
      "commonUses": [
        "Symbolic math",
        "Data science",
        "Visualisation",
        "Knowledge computing"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "Print[\"Hello\"]",
          "explanation": "Evaluates Print in the Wolfram Language to emit a line of text from a notebook or script."
        },
        {
          "title": "Symbolic",
          "code": "Integrate[x^2, x]",
          "explanation": "Symbolic integration with Integrate — Wolfram Language manipulates expressions, not just numbers."
        },
        {
          "title": "Lists and mapping",
          "code": "Square /@ {1, 2, 3, 4}",
          "explanation": "`/@` maps a function over a list — here squares each element."
        },
        {
          "title": "LibraryLink / C bridge - Wolfram's native code boundary",
          "code": "(* Wolfram native-code boundary: LibraryLink and ForeignFunction *)\n\n(* Load a compiled library *)\nlib = LibraryLoad[\"/path/to/mylib\"];\n\n(* Call via LibraryFunctionLoad *)\nsqrtFunc = LibraryFunctionLoad[lib, \"sqrt\", {Real}, Real];\nsqrtFunc[2.0]\n\n(* Direct foreign function (Wolfram 13.2+) *)\nff = ForeignFunctionLoad[\"/usr/lib/libm.dylib\", \"sqrt\", {Real} -> Real];\nff[2.0]\n\n(* Compile Wolfram to C for hot paths *)\ncf = Compile[{{x, _Real}}, Sin[x] + Cos[x]];",
          "explanation": "LibraryFunctionLoad and ForeignFunctionLoad are the primary bridges to compiled C/C++ libraries; Compile[] targets numeric hot paths."
        }
      ],
      "libraries": [
        {
          "name": "Wolfram docs",
          "url": "https://reference.wolfram.com/language/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Wolfram Language ref",
          "url": "https://reference.wolfram.com/language/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "(* Wolfram Language variables *)\nx = 42\nname = \"Wolfram\"\n\n(* Immediate assignment *)\nSet[x, 42]  (* same as x = 42 *)\n\n(* Delayed assignment *)\nSetDelayed[y, x + 1]  (* same as y := x + 1 *)\n\n(* List (array) *)\nmyList = {1, 2, 3, 4, 5}\n\n(* Association (dict) *)\nmyAssoc = <|\"name\" -> \"Alice\", \"age\" -> 30|>",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "(* Wolfram Language conditionals *)\nIf[x > 100, \"high\", \"low\"]\n\n(* Multiple branches *)\nWhich[\n  x > 100, \"high\",\n  x > 50, \"medium\",\n  True, \"low\"\n]\n\n(* Piecewise (mathematical) *)\nPiecewise[{{x^2, x > 0}, {-x^2, x <= 0}}]\n\n(* Pattern matching conditions *)\ncases = {1, 2, 3, 4, 5};\nSelect[cases, # > 3 &]  (* {4, 5} *)",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "(* Wolfram Language loops (functional preferred) *)\n(* Map *)\nMap[#^2 &, {1, 2, 3, 4}]  (* {1, 4, 9, 16} *)\n\n(* Table (list comprehension) *)\nTable[i^2, {i, 1, 10}]  (* {1, 4, 9, 16, 25, 36, 49, 64, 81, 100} *)\n\n(* Fold *)\nFold[Plus, 0, {1, 2, 3, 4, 5}]  (* 15 *)\n\n(* For loop (imperative, discouraged) *)\nFor[i = 1, i <= 10, i++, Print[i]]\n\n(* Do (imperative) *)\nDo[Print[i], {i, 1, 10}]",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "(* Wolfram Language functions *)\nf[x_] := x^2\nf[5]  (* 25 *)\n\n(* Pure functions *)\n(#^2 &) /@ {1, 2, 3}  (* {1, 4, 9} *)\n\n(* Multiple patterns *)\ng[0] := 0\ng[x_] := 1/x\n\n(* Options *)\nh[x_, opts___Rule] := {x, opts}\nh[5, Verbose -> True]\n\n(* Apply *)\nPlus @@ {1, 2, 3}  (* 6 *)",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "(* Wolfram Language performance:\n   1. Built-in functions are C-optimized\n   2. Listable attributes enable auto-vectorization\n   3. Compile[] for numerical hot paths\n   4. ParallelMap/ParallelTable for multi-core\n   5. PackedArrays for numeric data\n   6. TimeConstrained for timeout\n   7. Symbolic evaluation can be slow *)\n\n(* Fast: vectorized built-in *)\nresult = Sin[N[Range[0, 2 Pi, 0.001]]];\n\n(* Compiled function *)\ncf = Compile[{x}, x^2 + Sin[x]];",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "(* Wolfram Language uses symbols and patterns, not classes *)\n(* Struct-like behavior via Association *)\nmakePerson[name_, age_] := <|\"name\" -> name, \"age\" -> age|>\n\nperson = makePerson[\"Alice\", 30]\nperson[\"name\"]  (* \"Alice\" *)\n\n(* Pattern-based dispatch (like overloading) *)\narea[Circle[r_]] := Pi * r^2\narea[Rectangle[w_, h_]] := w * h\n\narea[Circle[5]]       (* 78.54 *)\narea[Rectangle[3, 4]] (* 12 *)",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "(* Wolfram Language strings *)\ngreeting = \"Hello, Wolfram!\"\n\n(* String functions *)\nStringJoin[\"Hello\", \", \", \"World\"]  (* \"Hello, World\" *)\nStringToUpper[\"hello\"]               (* \"HELLO\" *)\nStringLength[\"hello\"]                (* 5 *)\nStringTake[\"Hello\", 3]               (* \"Hel\" *)\n\n(* String patterns *)\nStringCases[\"Hello, World!\", LetterCharacter]\n\n(* String template *)\nTemplateApply[\"Hello, `1`!\", {\"Alice\"}]",
          "difficulty": "basic"
        },
        "errors": {
          "code": "(* Wolfram Language error handling *)\n(* Check for failure *)\nresult = Quiet[1/0]\n(* Returns ComplexInfinity *)\n\n(* Catch *)\nCatch[\n  If[x < 0, Throw[\"Negative\"]];\n  Sqrt[x]\n]\n\n(* CheckHead *)\nCheck[\n  Integrate[f[x], {x, 0, 1}],\n  $Failed,\n  Integrate::conv\n]\n\n(* FailureQ *)\nresult = FailureQ[1/0]  (* True *)",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "(* Wolfram Language imports *)\n(* Get from Wolfram Library *)\nNeeds[\"Notation`\"]\n\n(* Import data *)\ndata = Import[\"data.csv\"]\nimg = Import[\"image.png\"]\n\n(* Package definition *)\nBeginPackage[\"MyPackage`\"]\nMyFunction::usage = \"MyFunction[x] does something.\"\nBegin[\"`Private`\"]\nMyFunction[x_] := x^2\nEnd[]\nEndPackage[]\n\n(* PacletInfo for distribution *)",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "wolfram-tip-format-pass11",
          "title": "Kernel version and package context",
          "body": "Wolfram Language results depend on kernel version and `$ContextPath`. Save a minimal notebook that reproduces the issue.",
          "tag": "repro",
          "status": "curated"
        }
      ],
      "categories": [
        "data"
      ],
      "overview": "The language behind Mathematica — symbolic computation, knowledge base, and notebook-driven. Everything is an expression; pattern matching and rewrite rules drive evaluation. Scientists, mathematicians, and Wolfram|Alpha power users — symbolic computation, notebook workflows, and massive built-in curated knowledge.\n\nTypical projects include Symbolic math, Data science, Visualisation. 6000+ built-in functions and Mathematica notebooks cover deep math work, though Wolfram Language is proprietary and expensive.",
      "learning_curve": "Very steep — the language is fundamentally different from most programming languages. Pattern matching, symbolic computation, and the 'everything is an expression' paradigm require significant rethinking. The documentation is excellent but vast. Rewarding for mathematical computing.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Wolfram Language (Mathematica) is proprietary. Wolfram Cloud for deployment. 6000+ built-in functions. Wolfram Alpha for natural language queries. Used in physics, math, engineering, and data science. Extremely comprehensive but expensive. Wolfram Notebook interface is unique. Small but expert community.",
      "common_use_cases": [
        "Symbolic math",
        "Data science",
        "Visualisation",
        "Knowledge computing"
      ],
      "docs_url": "https://reference.wolfram.com/language/",
      "best_for": [
        "symbolic mathematics and formula manipulation",
        "data science with natural language input",
        "interactive knowledge-based computing",
        "Symbolic mathematics, Wolfram Alpha-style knowledge computation"
      ],
      "weak_at": [
        "Cost-sensitive startups avoiding Wolfram Engine licensing models",
        "Conventional CRUD web apps without Wolfram Cloud deployment intent",
        "Teams needing plain-text Git-friendly source without notebook centrism"
      ],
      "official_url": "https://www.wolfram.com/language/",
      "paradigm": [
        "symbolic",
        "functional",
        "knowledge-based"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Interpreted or bytecode-based in common implementations (engines vary)",
        "memory": "Garbage-collected in mainstream implementations",
        "abstraction": "High-level for typical scripting and application use"
      }
    },
    {
      "id": "awk",
      "name": "AWK",
      "color": "#c8c8c8",
      "description": "A pattern-scanning language for text processing — one-liners that transform columnar data. Awk programs are pattern-action pairs that fire per line of input.",
      "whoItIsFor": "Unix users processing logs, CSVs, and text streams — the original one-liner data-munging tool, still essential for shell pipelines and reports.",
      "commonUses": [
        "Log analysis",
        "Text transformation",
        "One-liner data extraction"
      ],
      "patterns": [
        {
          "title": "Print column",
          "code": "awk '{print $1}' file.txt",
          "explanation": "Prints the first column ($1) from each line — awk's default field splitting makes this trivial."
        },
        {
          "title": "Sum",
          "code": "awk '{s+=$1} END{print s}' nums.txt",
          "explanation": "Accumulates the first numeric field across records — a classic awk one-liner for column totals."
        },
        {
          "title": "Pattern with regex",
          "code": "awk '/ERROR/ { print $0 }' app.log",
          "explanation": "Only lines matching the regex are printed — handy for filtering logs."
        },
        {
          "title": "Pipe/field/record boundary - awk in Unix pipelines",
          "code": "# awk's boundary is the Unix pipe: it reads records (lines)\n# from stdin, splits into fields, transforms, outputs\n\n# Field/record processing\nawk -F: '{print $1, $3}' /etc/passwd\n\n# Filter and transform in pipeline\ncat access.log | awk '$9 == 404 {count[$7]++}\n    END {for (url in count) print count[url], url}' | sort -rn | head\n\n# awk as polyglot glue between processes\n# process1 | awk 'transform' | process2",
          "explanation": "awk's boundary is the Unix pipeline: it reads text records from stdin, splits them into fields by a delimiter, transforms them, and writes to stdout. This makes awk the original polyglot glue: process1 | awk 'transform' | process2. awk's field splitting ($1, $2, $NF), pattern-action model, and associative arrays make it uniquely effective at the pipe/field/record boundary where text streams are the universal data format."
        }
      ],
      "libraries": [
        {
          "name": "GNU AWK manual",
          "url": "https://www.gnu.org/software/gawk/manual/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "GAWK manual",
          "url": "https://www.gnu.org/software/gawk/manual/"
        }
      ],
      "compareData": {
        "classes": {
          "code": "# No class system -- awk uses associative arrays and functions\n# Structured data via arrays:\npoint[\"x\"] = 3\npoint[\"y\"] = 4\nlength = sqrt(point[\"x\"]^2 + point[\"y\"]^2)",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "{ print toupper($0) }   # print each line uppercase\n\n# String concatenation (no operator, just juxtaposition)\ngreeting = \"Hello, \" name \"!\"\nprint greeting\n\n# String functions: substr, index, split, sub, gsub\nsub(/old/, \"new\", $0)",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# awk has no try/catch -- use exit status and conditional logic\n# GNU awk (gawk) has BEGIN/END error handling\n\n!ok { print \"Error: \" errmsg | \"cat >&2\"; exit 1 }\n\n# gawk: ERRNO variable for I/O errors\nif (ERRNO != \"\") { print ERRNO > \"/dev/stderr\" }",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "# awk includes files with -f or @include (gawk)\n# No package system -- each script is self-contained\n\n@include \"math.awk\"\n\n# Using shell commands via pipe\nprint \"data\" | \"sort\"",
          "difficulty": "basic"
        },
        "variables": {
          "code": "# awk variables: no declaration, auto-typed\nx = 42           # number\nname = \"Alice\"   # string\narr[\"key\"] = 10  # associative array\n\n# Built-in variables\n# NR: record number, NF: field count\n# FS: field separator, RS: record separator\n# FILENAME: current input file\n\n{ print NR \": \" $0 }  # NR is record number",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# awk conditionals\n{\n    if ($3 > 100) {\n        print $1, \"high\"\n    } else if ($3 > 50) {\n        print $1, \"medium\"\n    } else {\n        print $1, \"low\"\n    }\n}\n\n# Pattern-action is also conditional\n$3 > 100 { print $1, \"high\" }",
          "difficulty": "basic"
        },
        "loops": {
          "code": "# awk loops\n# for loop (C-style)\nfor (i = 1; i <= NF; i++) {\n    print $i\n}\n\n# while loop\n{\n    i = 1\n    while (i <= NF) {\n        print $i\n        i++\n    }\n}\n\n# Loop over associative array\nfor (key in count) {\n    print key, count[key]\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "# awk user-defined functions\nfunction max(a, b) {\n    return a > b ? a : b\n}\n\nfunction length_of_record(    i, n) {\n    n = 0\n    for (i = 1; i <= NF; i++)\n        n += length($i)\n    return n\n}\n\n# Local variables go after extra parameters\nfunction strip(s,    result) {\n    gsub(/^[ \\t]+|[ \\t]+$/, \"\", s)\n    return s\n}",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "# awk performance tips:\n# 1. mawk is 2-5x faster than gawk for simple tasks\n# 2. Avoid regex where substring works\n# 3. Print to stdout, not per-field concatenation\n# 4. Use associative arrays for grouping (O(1) lookup)\n# 5. gawk -M for arbitrary precision is slower\n# 6. Pipe to sort externally: print | \"sort -rn\"\n\n# Fast: associative array grouping\n{ count[$1]++ }\nEND { for (k in count) print count[k], k }",
          "difficulty": "intermediate"
        }
      },
      "tips": [
        {
          "id": "awk-tip-format-pass11",
          "title": "awk flavors disagree",
          "body": "POSIX awk, gawk, and nawk differ on regex and empty fields. Prefer gawk explicitly when you need its extensions.",
          "tag": "portability",
          "status": "curated"
        }
      ],
      "categories": [
        "devops"
      ],
      "overview": "A pattern-scanning language for text processing — one-liners that transform columnar data. Awk programs are pattern-action pairs that fire per line of input. Unix users processing logs, CSVs, and text streams — the original one-liner data-munging tool, still essential for shell pipelines and reports.\n\nTypical projects include Log analysis, Text transformation, One-liner data extraction. gawk extends classic awk on every Unix system — scripts stay self-contained with no package manager needed.",
      "learning_curve": "Gentle for one-liners — the pattern-action model is intuitive. Mastering associative arrays, user-defined functions, and gawk extensions takes more effort. The real power comes from combining awk with other Unix tools in pipelines.",
      "good_for_teaching": "good",
      "ecosystem_notes": "gawk (GNU awk) is the dominant implementation with extensions. mawk is faster for simple tasks. Every Unix system has awk. Used for log processing, text transformation, and data extraction. No package manager — scripts are self-contained. Classic tool with a 40+ year history.",
      "common_use_cases": [
        "Log analysis",
        "Text transformation",
        "One-liner data extraction"
      ],
      "docs_url": "https://www.gnu.org/software/gawk/manual/",
      "best_for": [
        "log file parsing and text extraction",
        "command-line data summarisation",
        "one-liner field-based text processing",
        "Column-oriented log parsing and one-pass report generation on Unix"
      ],
      "weak_at": [
        "Complex object-oriented applications with rich module hierarchies",
        "Cross-platform Windows workflows without Gawk or WSL availability",
        "Stateful network services better implemented in Go or Python"
      ],
      "official_url": "https://www.gnu.org/software/gawk/",
      "paradigm": [
        "pattern-action",
        "text-processing",
        "imperative"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic (untyped fields and variables; pattern-action records)",
        "runtime": "Interpreted by an AWK implementation (mawk, gawk, nawk, etc.) per input record",
        "memory": "Managed by the AWK interpreter for the duration of the program",
        "abstraction": "Specialized text and columnar record processing"
      }
    },
    {
      "id": "sed",
      "name": "sed",
      "color": "#a0a0a0",
      "description": "The stream editor — transforms text line by line using pattern-based substitution commands. Essential in pipelines, shell scripts, and any workflow that needs bulk text transformation.",
      "whoItIsFor": "Shell scripters and Unix power users doing find-and-replace at scale — ideal for batch text transforms, config templating, and log sanitization.",
      "commonUses": [
        "Text substitution",
        "Pipeline filtering",
        "Config file patching"
      ],
      "patterns": [
        {
          "title": "Replace",
          "code": "sed 's/old/new/g' file.txt",
          "explanation": "Global substitution with s/pattern/replacement/g — sed's bread and butter for text transforms."
        },
        {
          "title": "Substitute on each line",
          "code": "sed 's/old/new/g' file.txt",
          "explanation": "Replaces every `old` with `new` on each line; `g` means all occurrences per line."
        },
        {
          "title": "Print a line range",
          "code": "sed -n '10,20p' file.txt",
          "explanation": "`-n` suppresses default print; `10,20p` prints only lines 10–20."
        },
        {
          "title": "Pipe/transform boundary - sed's Unix pipeline integration",
          "code": "# sed's polyglot boundary is the Unix pipeline:\n# it reads from stdin and writes to stdout,\n# enabling composition with any tool.\n\n# Chain sed with other tools\ncat access.log | sed '/ERROR/p' | sort | uniq -c\n\n# sed reads file directly\nsed -n '/^ERROR/,/^$/p' logfile.txt\n\n# sed output feeds into Python\nsed 's/,/\\t/g' data.csv | python3 analyze.py\n\n# In-place editing (write back to file)\nsed -i.bak 's/old/new/g' config.txt",
          "explanation": "sed's polyglot boundary is the Unix pipeline: it reads from stdin and writes to stdout, enabling composition with any CLI tool (awk, grep, sort, Python, etc.). The -f flag reads sed commands from a file, and -r/-E enables extended regex. sed transforms text streams at the boundary between pipeline stages, making it the universal text-processing glue in Unix systems."
        }
      ],
      "libraries": [
        {
          "name": "GNU sed manual",
          "url": "https://www.gnu.org/software/sed/manual/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "sed manual",
          "url": "https://www.gnu.org/software/sed/manual/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# sed variables (hold space & pattern space)\n# Hold space is sed's 'variable' storage\n# Pattern space is the current line\n\n# Store in hold space\nh    # copy pattern space to hold space\nH    # append pattern space to hold space\n\n# Retrieve from hold space\ng    # copy hold space to pattern space\nG    # append hold space to pattern space\nx    # swap pattern and hold spaces\n\n# Label for branching\n:label\n# No named variables like shell; use hold space",
          "difficulty": "intermediate"
        },
        "conditionals": {
          "code": "# sed conditionals (addresses & branches)\n# Address-based conditions\n/pattern/d          # delete lines matching pattern\n/pattern/p          # print lines matching pattern\n1,10s/old/new/g     # substitute only lines 1-10\n\n# Branch-based conditionals\n/pattern/b label    # branch to label if pattern matches\nt label              # branch to label if last substitution succeeded\nT label              # branch if last substitution failed\n\n# Negation\n/pattern/!d         # delete lines NOT matching pattern",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "# sed loops (branch labels)\n:loop\ns/,/,/g\nt loop    # if substitution succeeded, branch to :loop\n\n# Reverse words on a line\n:rev\ns/\\(.*\\) \\(.*\\)/\\2 \\1/\nt rev\n\n# Process until no more changes\n:again\ns/  / /g\nb again",
          "difficulty": "advanced"
        },
        "functions": {
          "code": "# sed has no user-defined functions.\n// sed is a stream editor with built-in commands:\n// s (substitute), d (delete), p (print),\n// y (transliterate), a (append), i (insert),\n// c (change), r (read file), w (write file).\n// Complex logic is achieved via addresses,\n// hold space, and branch labels.\n// Think of sed commands as a pipeline,\n// not function calls.",
          "difficulty": "N/A"
        },
        "performance": {
          "code": "# sed performance:\n# 1. Stream processing: one line at a time (low memory)\n# 2. Compiled regex on each invocation\n# 3. Buffer size limits (hold space)\n# 4. No parallel processing\n# 5. For large files, sed is often faster than awk/perl\n#    because it does less per line\n#\n# For complex processing, use awk or perl instead.\n# sed excels at simple, fast transformations.",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "sed has no class/OOP system.\nsed is a declarative stream editor;\neach line is processed by a sequence\nof commands, not by object methods.\nNo concept of classes, instances, or inheritance.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# sed string operations\n# Substitute (the core operation)\ns/old/new/g          # replace all occurrences\ns/old/new/2          # replace 2nd occurrence\ns/old/new/i          # case-insensitive\n\n# Transliterate (like tr)\ny/abc/xyz/           # a->x, b->y, c->z\n\n# Back-references\ns/\\(.*\\):\\(.*\\)/\\2:\\1/  # swap before/after colon\n\n# Common patterns\ns/[ \\t]*$//          # trim trailing whitespace\ns/^/    /            # indent line",
          "difficulty": "intermediate"
        },
        "errors": {
          "code": "# sed error handling\n# sed silently continues on most errors\n# Common issues:\n# - Unmatched / delimiter: sed reports and skips\n# - Invalid address: sed warns and continues\n# - No match: sed simply doesn't substitute\n\n# Detecting failures\n# Exit code reflects errors:\n# 0 = success, 1 = error, 2 = command-line error\nsed 's/pattern/replacement/' file.txt || echo 'sed failed'\n\n# -n suppresses auto-print; p prints only matches\nsed -n '/pattern/p' file.txt",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "sed has no native import/include system.\nUse shell concatenation or multiple -e flags:\n\n# Multiple scripts\necho 'hello' | sed -e 's/h/H/' -e 's/o/O/'\n\n# Read commands from file\nsed -f commands.sed input.txt\n\n# Read file contents into stream\nsed '/marker/r insert.txt' input.txt\n\n# Shell pipeline composition\ncat file.txt | sed 's/old/new/' | sort",
          "difficulty": "N/A"
        }
      },
      "tips": [
        {
          "id": "sed-tip-format-pass11",
          "title": "BSD vs GNU sed",
          "body": "macOS/BSD sed and GNU sed disagree on `-i` and extended regex. Write to a temp file or detect the sed flavor.",
          "tag": "portability",
          "status": "curated"
        }
      ],
      "categories": [
        "devops"
      ],
      "overview": "The stream editor — transforms text line by line using pattern-based substitution commands. Essential in pipelines, shell scripts, and any workflow that needs bulk text transformation. Shell scripters and Unix power users doing find-and-replace at scale — ideal for batch text transforms, config templating, and log sanitization.\n\nTypical projects include Text substitution, Pipeline filtering, Config file patching.",
      "learning_curve": "Moderate for simple substitutions (s/old/new/g). Steep for advanced sed programming (hold space, branching, multi-line patterns). The terse syntax is hard to read. Most developers only learn basic substitution; few master the full programming model.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "GNU sed and BSD sed differ in extensions. GNU sed is standard on Linux; BSD sed on macOS. Widely available on all Unix systems. Essential for shell scripting and text processing. Often paired with grep and awk in pipelines.",
      "common_use_cases": [
        "Text substitution",
        "Pipeline filtering",
        "Config file patching"
      ],
      "docs_url": "https://www.gnu.org/software/sed/manual/",
      "best_for": [
        "stream-based text substitution",
        "automated config file patching",
        "pipeline text filtering and transformation",
        "Non-interactive stream edits in shell pipelines and Makefile rules"
      ],
      "weak_at": [
        "Structured data transformation better handled by jq or Python",
        "Readable maintainable business logic spanning thousands of lines",
        "Binary file manipulation outside sed line-oriented text model"
      ],
      "official_url": "https://www.gnu.org/software/sed/",
      "paradigm": [
        "stream-editing",
        "regex",
        "imperative"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Commands and text expansion (typically untyped at the shell level)",
        "runtime": "Interpreted by a shell, editor, or automation host",
        "memory": "Managed by the host process running the script"
      }
    },
    {
      "id": "make",
      "name": "Make",
      "color": "#6d8086",
      "description": "A build automation tool with its own declarative language — targets, prerequisites, and recipes. The original build system that inspired dozens of successors across every platform.",
      "whoItIsFor": "C/C++ developers and anyone automating build steps with Makefiles — the classic dependency resolver still underlying most C/C++ project builds.",
      "commonUses": [
        "Build systems",
        "Task automation",
        "CI pipelines"
      ],
      "patterns": [
        {
          "title": "Rule",
          "code": "build:\n\tgcc -o app main.c",
          "explanation": "Tab-indented recipe lines under a target-prerequisite declaration — make's core build rule pattern."
        },
        {
          "title": "Variables and prerequisites",
          "code": "CC = gcc\nCFLAGS = -Wall\n\napp: main.o util.o\n\t$(CC) $(CFLAGS) -o app main.o util.o",
          "explanation": "Targets depend on files to the right of `:`; recipes start with a tab."
        },
        {
          "title": "Pattern rule",
          "code": "%.o: %.c\n\t$(CC) $(CFLAGS) -c $<",
          "explanation": "Builds any `.o` from the matching `.c`; `$<` is the first prerequisite."
        },
        {
          "title": "Dependency graph / shell boundary - Make's polyglot bridge",
          "code": "# Make's polyglot boundary is the dependency graph\n# connecting source files to build outputs via shell commands.\n\n# Compile C to object files\n%.o: %.c\n\t$(CC) $(CFLAGS) -c $< -o $@\n\n# Link objects to binary\n$(TARGET): $(OBJS)\n\t$(CC) -o $@ $^ $(LDFLAGS)\n\n# Generate dependencies automatically\n%.d: %.c\n\t@$(CC) -MM $(CFLAGS) $< > $@\n\n# Call other tools from Make\nproto:\n\tprotoc --python_out=. messages.proto\n\ndocker:\n\tdocker build -t myapp .",
          "explanation": "Make's polyglot boundary is its dependency graph connecting source files to build outputs via shell commands. Each recipe line is a shell command, so Make can orchestrate any toolchain (C compiler, Python protoc, Docker, etc.). The -MM flag generates C header dependencies, while $(shell) embeds shell output into Make variables. This makes Make the universal build glue that bridges all compiler toolchains."
        }
      ],
      "libraries": [
        {
          "name": "GNU Make manual",
          "url": "https://www.gnu.org/software/make/manual/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "GNU Make docs",
          "url": "https://www.gnu.org/software/make/manual/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# Make variables\nCC = gcc\nCFLAGS = -Wall -O2\nTARGET = myapp\n\n# Automatic variables\n# $@ = target, $< = first prerequisite, $^ = all prerequisites\n$(TARGET): main.o utils.o\n\t$(CC) $(CFLAGS) -o $@ $^\n\n# Expansion (= vs :=)\nLAZY = $(OTHER)     # deferred expansion\nEAGER := $(OTHER)   # immediate expansion\n\n# Conditional assignment\nOPTFLAG ?= -O2       # set only if not already defined\n\n# Command substitution\nFILES := $(shell ls *.c)",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# Make conditionals\nifeq ($(DEBUG),1)\n  CFLAGS += -g -DDEBUG\nelse\n  CFLAGS += -O2\nendif\n\n# ifneq, ifdef, ifndef\nifneq ($(OS),Windows)\n  EXE =\nelse\n  EXE = .exe\nendif\n\nifdef VERBOSE\n  Q =\nelse\n  Q = @\nendif\n\n# Shell conditionals inside recipes\ncheck:\n\t@if [ -f config.h ]; then echo \"OK\"; fi",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "# Make loops (foreach and wildcard patterns)\n# foreach: iterate over a list\nDIRS := src lib tests\nPHONY_DIRS := $(addprefix clean-,$(DIRS))\n\n$(foreach dir,$(DIRS),$(eval include $(dir)/rules.mk))\n\n# Pattern rules (implicit loop over matches)\n%.o: %.c\n\t$(CC) $(CFLAGS) -c $< -o $@\n\n# Generate files with call/foreach\nSRCS := $(wildcard src/*.c)\nOBJS := $(patsubst src/%.c,build/%.o,$(SRCS))\n\n# Recursive make\n$(TARGETS):\n\t$(MAKE) -C $@",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "# Make built-in functions\n# String manipulation\n$(subst from,to,text)          # substitute\n$(patsubst %.c,%.o,src/*.c)    # pattern substitute\n$(strip text)                  # remove whitespace\n$(filter pattern,text)         # keep matching\n$(filter-out pattern,text)     # remove matching\n$(sort list)                   # sort + deduplicate\n$(word n,text)                  # nth word\n$(words text)                   # word count\n\n# File system\n$(wildcard *.c)                # glob files\n$(dir src/main.c)             # src/\n$(notdir src/main.c)          # main.c\n$(basename src/main.c)         # src/main\n$(suffix src/main.c)           # .c\n\n# Call user-defined functions\ndefine greeting\nHello, $(1)!\nendef\n$(call greeting,World)",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "# Make performance:\n# 1. Only rebuilds changed targets (dependency graph)\n# 2. Parallel builds with -j flag\n# 3. Pattern rules avoid duplication\n# 4. .PHONY targets always rebuild\n# 5. Order-only prerequisites\n# 6. VPATH for source search paths\n\n# Parallel build\nmake -j4 all    # 4 parallel jobs\n\n# Avoid rebuilding\n%.o: %.c | build-dir\n\t$(CC) -c $< -o $@",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "Make has no class/OOP system.\nMake targets and prerequisites form a\ndependency graph, not an object hierarchy.\nReusability comes from pattern rules,\ninclude files, and user-defined functions\n(via define/endef + call).",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# Make string manipulation\n# subst: simple substitution\n$(subst .c,.o,src/main.c)       # src/main.o\n\n# patsubst: pattern substitution\n$(patsubst %.c,%.o,$(SRCS))     # .c -> .o\n\n# wildcard: glob\n$(wildcard src/*.c)              # list of .c files\n\n# strip: remove extra whitespace\n$(strip  a  b  c  )              # a b c\n\n# word operations\n$(word 1,a b c)                 # a\n$(words hello world)             # 2\n\n# shell command\n$(shell date +%Y)                # 2026\n\n# filtering\n$(filter %.o,$(OBJS))            # only .o files",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# Make error handling\n# Make stops on command failure by default\n# Exit code != 0 = error\n\n# Ignore errors with -\n-clean:\n\trm -f *.o\n\n# .DELETE_ON_ERROR: delete target if recipe fails\n.DELETE_ON_ERROR:\n\n# Check variables\nifndef CC\n  $(error CC is not defined)\nendif\n\n# Warning\n$(warning Building $(TARGET))\n\n# Force continue\nmake -k     # keep going after errors",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "# Make imports (include)\n# Include other makefiles\ninclude config.mk\n-include local.mk   # optional (no error if missing)\n\n# Include all .mk files in a directory\ninclude $(wildcard rules/*.mk)\n\n# Recursive make (sub-make)\nsubsystem:\n\t$(MAKE) -C subsystem all\n\n# Export variables to sub-makes\nexport CFLAGS\nexport CC\n\n# Makefile name conventions\n# GNUmakefile, makefile, Makefile (in priority order)",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "make-tip-phony",
          "title": "Phony targets and dependency graphs",
          "body": "Incorrect prerequisites and missing .PHONY cause stale builds. Prefer explicit graphs over clever one-liner recipes.",
          "tag": "build",
          "status": "curated"
        }
      ],
      "categories": [
        "devops",
        "build"
      ],
      "overview": "A build automation tool with its own declarative language — targets, prerequisites, and recipes. The original build system that inspired dozens of successors across every platform. C/C++ developers and anyone automating build steps with Makefiles — the classic dependency resolver still underlying most C/C++ project builds.\n\nTypical projects include Build systems, Task automation, CI pipelines.",
      "learning_curve": "Moderate for simple Makefiles. Steep for advanced features (pattern rules, automatic variables, order-only prerequisites, recursive make). The syntax is terse and error-prone (tabs vs spaces). Modern alternatives (CMake, Bazel) are easier but Make remains ubiquitous.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "GNU Make is the standard on Linux. BSD Make differs in extensions. CMake generates Makefiles. Make is ubiquitous but has competition from Ninja, Bazel, and Meson. Essential for C/C++ projects. Many projects use autotools (autoconf/automake) which generate Makefiles.",
      "common_use_cases": [
        "Build systems",
        "Task automation",
        "CI pipelines"
      ],
      "docs_url": "https://www.gnu.org/software/make/manual/",
      "best_for": [
        "build system orchestration for compiled projects",
        "multi-step task automation pipelines",
        "dependency tracking for reproducible builds",
        "Native code build orchestration with incremental compilation graphs"
      ],
      "weak_at": [
        "Complex cloud infrastructure provisioning without Makefile ergonomics",
        "Windows-centric teams standardized on MSBuild or Visual Studio exclusively",
        "Dynamic language projects where npm or cargo subsume build needs"
      ],
      "official_url": "https://www.gnu.org/software/make/",
      "paradigm": [
        "declarative",
        "build",
        "dependency-driven"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative configuration or build DSL (not a general-purpose programming language)",
        "runtime": "Evaluated by a host tool (Ansible, Terraform, Make, Nix, etc.) — no standalone VM",
        "memory": "Managed by the host tool running the configuration or build"
      }
    },
    {
      "id": "cmake",
      "name": "CMake",
      "color": "#064f8c",
      "description": "A cross-platform build-system generator — writes Makefiles, Ninja files, or IDE projects from one script. The de facto standard for C++ projects that need to build everywhere.",
      "whoItIsFor": "C/C++ teams needing portable builds across Linux, macOS, and Windows — generates native project files and manages cross-platform dependencies.",
      "commonUses": [
        "C/C++ builds",
        "Cross-platform projects",
        "Package management (vcpkg/Conan)"
      ],
      "patterns": [
        {
          "title": "Minimum",
          "code": "cmake_minimum_required(VERSION 3.20)\nproject(Hello)\nadd_executable(hello main.cpp)",
          "explanation": "Minimal CMakeLists.txt with cmake_minimum_required — the first line of every CMake project."
        },
        {
          "title": "Minimum project and executable",
          "code": "cmake_minimum_required(VERSION 3.20)\nproject(demo C)\nadd_executable(app main.c util.c)",
          "explanation": "Minimal CMakeLists.txt with cmake_minimum_required — the first line of every CMake project."
        },
        {
          "title": "Target link library",
          "code": "find_package(Threads REQUIRED)\ntarget_link_libraries(app PRIVATE Threads::Threads)",
          "explanation": "Uses CMake packages and links them to a target with visibility control."
        },
        {
          "title": "execute_process - CMake's subprocess boundary",
          "code": "# CMake's boundary with the OS is execute_process\n# It runs external commands during configure time\n\nexecute_process(\n  COMMAND git describe --tags --always\n  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}\n  OUTPUT_VARIABLE GIT_VERSION\n  OUTPUT_STRIP_TRAILING_WHITESPACE\n)\n\nmessage(STATUS \"Building version: ${GIT_VERSION}\")\n\n# Also: add_custom_command for build-time execution\nadd_custom_command(\n  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.cpp\n  COMMAND protoc --cpp_out=${CMAKE_CURRENT_BINARY_DIR} ${PROTO_FILE}\n  DEPENDS ${PROTO_FILE}\n)",
          "explanation": "CMake's boundary with the external world is execute_process (configure-time) and add_custom_command (build-time). execute_process runs external programs during configuration and captures their output. add_custom_command defines build rules that invoke external tools (protoc, flex, bison, code generators). This is how CMake bridges to protoc, code generators, and any tool in the build pipeline — CMake orchestrates polyglot build systems."
        }
      ],
      "libraries": [
        {
          "name": "CMake docs",
          "url": "https://cmake.org/documentation/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "CMake reference",
          "url": "https://cmake.org/cmake/help/latest/"
        }
      ],
      "compareData": {
        "classes": {
          "code": "# No class system -- CMake uses functions and macros\n# Structured data via targets and properties\nadd_library(mylib STATIC src/lib.cpp)\ntarget_include_directories(mylib PUBLIC include/)\ntarget_compile_features(mylib PUBLIC cxx_std_17)",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# CMake has extensive string commands\nset(greeting \"Hello, CMake!\")\nmessage(STATUS ${greeting})\n\n# String operations\nstring(TOUPPER ${greeting} upper)\nstring(REPLACE \"Hello\" \"Hi\" modified ${greeting})\n\n# Generator expressions for conditional strings\n$<$<CONFIG:Debug>:DEBUG_MODE>",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# CMake uses if()/message(FATAL_ERROR) for error handling\nif(NOT EXISTS \"${CMAKE_SOURCE_DIR}/CMakeLists.txt\")\n  message(FATAL_ERROR \"Missing CMakeLists.txt\")\nendif()\n\n# cmake_policy for version compatibility\ncmake_policy(SET CMP0048 NEW)",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "# CMake uses add_subdirectory and find_package\nfind_package(Boost REQUIRED COMPONENTS filesystem)\nfind_package(OpenSSL REQUIRED)\n\nadd_subdirectory(libs/mylib)\n\n# FetchContent for external projects (modern)\ninclude(FetchContent)\nFetchContent_Declare(googletest GIT_REPOSITORY ...)",
          "difficulty": "basic"
        },
        "variables": {
          "code": "# CMake variables\nset(SOURCE_FILES main.cpp util.cpp)\nset(PROJECT_NAME \"MyApp\")\n\n# Cache variables (persist across runs)\nset(BUILD_TYPE \"Release\" CACHE STRING \"Build type\")\n\n# Environment variables\n$ENV{HOME}\n\n# Generator expressions (build-time evaluation)\n$<$<CONFIG:Debug>:DEBUG_MODE>\n$<TARGET_FILE:myapp>",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# CMake conditionals\nif(BUILD_TESTS)\n    add_subdirectory(tests)\nendif()\n\nif(CMAKE_BUILD_TYPE STREQUAL \"Debug\")\n    target_compile_definitions(myapp PRIVATE DEBUG_MODE)\nelseif(CMAKE_BUILD_TYPE STREQUAL \"Release\")\n    target_compile_options(myapp PRIVATE -O3)\nendif()\n\n# Check platform\nif(WIN32)\n    message(\"Windows build\")\nelseif(APPLE)\n    message(\"macOS build\")\nelse()\n    message(\"Linux build\")\nendif()",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "# CMake loops\nforeach(file IN LISTS SOURCE_FILES)\n    message(\"Processing: ${file}\")\nendforeach()\n\n# Loop over range\nforeach(i RANGE 1 10)\n    message(\"Item ${i}\")\nendforeach()\n\n# Loop over files\nfile(GLOB HEADERS include/*.h)\nforeach(header ${HEADERS})\n    message(\"Header: ${header}\")\nendforeach()\n\n# while loop (rare in CMake)\nset(counter 0)\nwhile(counter LESS 10)\n    math(EXPR counter \"${counter} + 1\")\nendwhile()",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "# CMake functions and macros\nfunction(add_my_library name)\n    add_library(${name} STATIC ${ARGN})\n    target_include_directories(${name} PUBLIC include/)\n    target_compile_features(${name} PUBLIC cxx_std_17)\nendfunction()\n\n# Call it\nadd_my_library(mylib src/lib.cpp src/util.cpp)\n\n# Macro (no new scope -- modifies caller variables)\nmacro(set_version major minor)\n    set(PROJECT_VERSION \"${major}.${minor}\")\nendmacro()",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "# CMake performance:\n# 1. configure step is the main cost (runs CMakeLists.txt)\n# 2. Use target-based design (modern CMake)\n# 3. Avoid file(GLOB) -- breaks incremental builds\n# 4. Use --parallel flag for parallel build\n# 5. Ninja generator is faster than Makefiles\n# 6. ccache integration: -DCMAKE_CXX_COMPILER_LAUNCHER=ccache\n\n# Parallel build\ncmake --build . --parallel 8",
          "difficulty": "intermediate"
        }
      },
      "tips": [
        {
          "id": "cmake-tip-targets",
          "title": "Modern targets beat global variables",
          "body": "Prefer target_* commands and exported configs. Generator expressions and toolchain files matter more than shell portability tips.",
          "tag": "build",
          "status": "curated"
        }
      ],
      "categories": [
        "devops",
        "build"
      ],
      "overview": "A cross-platform build-system generator — writes Makefiles, Ninja files, or IDE projects from one script. The de facto standard for C++ projects that need to build everywhere.",
      "learning_curve": "Steep — CMake's syntax and scoping rules are notoriously confusing. Target-based modern CMake (3.x) is cleaner than old-style directory-based CMake. Generator expressions add complexity. The reward is cross-platform builds for C/C++/Fortran projects.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "The de facto standard build system for C/C++. vcpkg, Conan, and Hunter provide package management. CMake Presets (3.19+) simplify configuration. Used by KDE, LLVM, ROS, and thousands of projects. Kitware maintains CMake. Large and mature community.",
      "common_use_cases": [
        "C/C++ builds",
        "Cross-platform projects",
        "Package management (vcpkg/Conan)"
      ],
      "docs_url": "https://cmake.org/documentation/",
      "best_for": [
        "cross-platform C++ build configuration",
        "complex dependency-managed builds",
        "multi-target build system generation",
        "Cross-platform C/C++ project generation for Ninja, Make, and VS"
      ],
      "weak_at": [
        "Simple single-file scripts where direct compiler invocation suffices",
        "Teams allergic to CMake DSL debugging and generator expression complexity",
        "Pure interpreted language repos without native compilation steps"
      ],
      "official_url": "https://cmake.org/",
      "paradigm": [
        "declarative",
        "meta-build",
        "cross-platform"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative configuration or build DSL (not a general-purpose programming language)",
        "runtime": "Evaluated by a host tool (Ansible, Terraform, Make, Nix, etc.) — no standalone VM",
        "memory": "Managed by the host tool running the configuration or build"
      }
    },
    {
      "id": "vimscript",
      "name": "Vim script",
      "color": "#019833",
      "description": "The scripting language inside Vim — configure, extend, and automate the editor. Every .vimrc is Vimscript; plugins use it to add commands, mappings, and autocommands.",
      "whoItIsFor": "Vim power users writing plugins, custom mappings, and editor automation — the scripting layer for tailoring Vim/Neovim to your workflow.",
      "commonUses": [
        "Vim plugins",
        "Editor configuration",
        "Text automation"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": ":echo \"Hello\"",
          "explanation": "Prints in the Vim command line via echo — the simplest way to display feedback in Vimscript."
        },
        {
          "title": "Function and map",
          "code": "function! TrimWhitespace()\n  %s/\\s\\+$//e\nendfunction\nnnoremap <leader>t :call TrimWhitespace()<CR>",
          "explanation": "Defines a function and binds it to a leader key in normal mode."
        },
        {
          "title": "Buffer-local option",
          "code": "autocmd FileType yaml setlocal shiftwidth=2 expandtab",
          "explanation": "Sets indentation when editing YAML files."
        },
        {
          "title": "Vim API / Python boundary - VimScript's polyglot bridge",
          "code": "\" VimScript's polyglot boundary is twofold:\n\" 1. The Vim API (buffer, window, tab commands)\n\" 2. Python/Lua/Ruby embedded interpreters\n\n\" Vim API (buffer manipulation)\nfunction! s:TrimWhitespace()\n  let l:save = winsaveview()\n  keeppatterns %s/\\s\\+$//e\n  call winrestview(l:save)\nendfunction\n\n\" Python integration\npython3 << EOF\nimport vim\nbuf = vim.current.buffer\nbuf.append('Added by Python')\nfor line in buf[:]:\n    if 'TODO' in line:\n        print(f'TODO: {line}')\nEOF\n\n\" Lua integration (Neovim)\nlua << EOF\nvim.api.nvim_buf_set_lines(0, 0, -1, false, {'Added by Lua'})\nEOF",
          "explanation": "VimScript's polyglot boundary is twofold: (1) the Vim API for buffer/window/tab manipulation (the primary way VimScript controls Vim), and (2) embedded Python/Lua/Ruby interpreters via :python3, :lua, :ruby commands. Neovim takes this further with first-class Lua support for configuration and plugins. This makes VimScript a coordination language that delegates heavy computation to Python/Lua while handling editor control flow natively."
        }
      ],
      "libraries": [
        {
          "name": "Vim help",
          "url": "https://vimhelp.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Vim script reference",
          "url": "https://vimhelp.org/usr_41.txt.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "\" VimScript variables\nlet x = 42\nlet name = 'VimScript'\n\n\" Variable scopes\nlet g:global_var = 'global'    \" global\nlet s:script_var = 'script'    \" script-local\nlet l:local_var = 'local'     \" function-local\nlet b:buf_var = 'buffer'      \" buffer-local\nlet w:win_var = 'window'      \" window-local\nlet t:tab_var = 'tab'         \" tab-local\nlet v:count = 0              \" vim internal\n\n\" String interpolation\nlet msg = printf('Hello, %s!', name)",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "\" VimScript conditionals\nif x > 100\n  echo 'high'\nelseif x > 50\n  echo 'medium'\nelse\n  echo 'low'\nendif\n\n\" Ternary\nlet result = x > 50 ? 'high' : 'low'\n\n\" Pattern match\nif str =~# '^Error'\n  echo 'error line'\nendif\n\n\" exists() for feature detection\nif exists(':LspInfo')\n  LspInfo\nendif",
          "difficulty": "basic"
        },
        "loops": {
          "code": "\" VimScript loops\n\" For loop\nfor i in range(10)\n  echo i\nendfor\n\n\" For with list\nfor file in glob('*.txt', 0, 1)\n  echo file\nendfor\n\n\" While loop\nlet i = 0\nwhile i < 10\n  let i += 1\nendwhile\n\n\" Loop over lines\nfor line in readfile('data.txt')\n  echo line\nendfor\n\n\" Break\nfor item in items\n  if item ==# 'stop'\n    break\n  endif\nendfor",
          "difficulty": "basic"
        },
        "functions": {
          "code": "\" VimScript functions\nfunction! s:Greet(name) abort\n  return 'Hello, ' . a:name\nendfunction\n\n\" Call\necho s:Greet('World')\n\n\" Lambda\nlet Double = {x -> x * 2}\necho Double(5)  \" 10\n\n\" Variable arguments\nfunction! s:Sum(...)\n  let total = 0\n  for n in a:000\n    let total += n\n  endfor\n  return total\nendfunction",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "\" VimScript performance:\n\" 1. Avoid :exe in tight loops\n\" 2. Use list operations over line-by-line\n\" 3. :def functions compile to Vim9 bytecode\n\" 4. profile command for profiling\n\" 5. Redraw only when needed\n\" 6. Use autoload for lazy loading\n\n\" Vim9 compiled function\ndef MyFast(l: list<number>): number\n  return l->reduce((acc, v) => acc + v, 0)\nenddef",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "\" VimScript dicts (closest to classes)\nlet animal = #{\n  \\ 'name': 'Dog',\n  \\ 'sound': 'Woof',\n  \\ 'speak': function('s:Speak'),\n  \\ }\n\nfunction! s:Speak(this) abort\n  return a:this.sound\nendfunction\n\necho animal.speak(animal)\n\n\" Vim9 classes (Neovim/Vim 9+)\nclass Point\n  this.x: number = 0\n  this.y: number = 0\n  def new(x: number, y: number)\n    this.x = x\n    this.y = y\n  enddef\nendclass",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "\" VimScript strings\nlet greeting = 'Hello, VimScript!'\n\n\" Concatenation\nlet msg = 'Hello' . ' ' . 'World'\n\n\" String functions\necho toupper('hello')      \" HELLO\necho strlen('hello')       \" 5\necho strpart('hello', 0, 3) \" hel\necho substitute('hello', 'l', 'L', 'g')  \" heLLo\n\n\" printf for formatting\nlet info = printf('Name: %s, Age: %d', 'Alice', 30)\n\n\" Split/join\nlet parts = split('a,b,c', ',')  \" ['a', 'b', 'c']\nlet joined = join(parts, '-')       \" a-b-c",
          "difficulty": "basic"
        },
        "errors": {
          "code": "\" VimScript error handling\ntry\n  call s:risky()\ncatch /^Vim\\(\\a\\+\\):E/  \" catch Vim errors\n  echo 'Error: ' . v:exception\nfinally\n  call s:cleanup()\nendtry\n\n\" Manual error checking\nif !exists('g:my_config')\n  echoerr 'Config not found'\nendif\n\n\" Abort on error\nfunction! s:SafeDiv(a, b) abort\n  if a:b == 0\n    throw 'Division by zero'\n  endif\n  return a:a / a:b\nendfunction",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "\" VimScript imports\n\" Source a file\nsource ~/.vimrc\nruntime plugin/myplugin.vim\n\n\" Autoload (lazy loading)\n\" In autoload/myplugin.vim:\nfunction! myplugin#Greet(name)\n  return 'Hello, ' . a:name\nendfunction\n\n\" Call autoload function\necho myplugin#Greet('World')\n\n\" Vim9 import (Neovim/Vim 9+)\nimport './myutils.vim' as utils\necho utils.Hello()",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "vimscript-tip-format-pass11",
          "title": "Vim vs Neovim dialect",
          "body": "Vimscript portability breaks between Vim and Neovim APIs. State the editor and version for any config tip.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "categories": [
        "editor",
        "devops"
      ],
      "overview": "The scripting language inside Vim — configure, extend, and automate the editor. Every .vimrc is Vimscript; plugins use it to add commands, mappings, and autocommands. Vim power users writing plugins, custom mappings, and editor automation — the scripting layer for tailoring Vim/Neovim to your workflow.\n\nTypical projects include Vim plugins, Editor configuration, Text automation. Neovim increasingly favours Lua over Vimscript for new plugins.",
      "learning_curve": "Gentle for basic vimrc configuration. Moderate for plugin writing (autocmds, mappings, functions). Steep for advanced features (dict functions, Vim9 script, compatibility concerns between Vim and Neovim). The 'ex command as programming language' paradigm is unique.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "VimScript powers Vim/Neovim plugins. vim-plug and packer.nvim are package managers. Vim 9.0 introduced Vim9 script (typed, compiled). Neovim favors Lua over VimScript. 15000+ Vim plugins on vim.org. Essential for editor customization but niche as a general language.",
      "common_use_cases": [
        "Vim plugins",
        "Editor configuration",
        "Text automation"
      ],
      "docs_url": "https://vimhelp.org/",
      "best_for": [
        "Vim plugin and extension development",
        "editor configuration customisation",
        "text editing automation in Vim",
        "Vim and Neovim plugin authoring with autoload and mapping patterns"
      ],
      "weak_at": [
        "General application backends outside editor host process context",
        "Cross-platform GUI apps without terminal emulator dependencies",
        "Teams standardized on VS Code extension APIs exclusively"
      ],
      "official_url": "https://www.vim.org/",
      "paradigm": [
        "imperative",
        "scripting",
        "editor-embedded"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Commands and text expansion (typically untyped at the shell level)",
        "runtime": "Interpreted by a shell, editor, or automation host",
        "memory": "Managed by the host process running the script"
      }
    },
    {
      "id": "emacs-lisp",
      "name": "Emacs Lisp",
      "color": "#7f5ab6",
      "description": "The Lisp dialect that powers GNU Emacs — configure and extend the editor with full Lisp. Every Emacs configuration file is Elisp; packages extend the editor into an IDE and beyond.",
      "whoItIsFor": "Emacs users writing packages, configs, and org-mode workflows — the extension language powering Emacs' editor-as-operating-system ecosystem.",
      "commonUses": [
        "Emacs configuration",
        "Editor plugins",
        "Org-mode automation"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "(message \"Hello\")",
          "explanation": "Displays in the minibuffer via message — Emacs's primary feedback channel for interactive commands."
        },
        {
          "title": "Defun and interactive command",
          "code": "(defun my-insert-date ()\n  \"Insert today's date at point.\"\n  (interactive)\n  (insert (format-time-string \"%Y-%m-%d\")))",
          "explanation": "`interactive` makes the function callable via M-x or a key binding."
        },
        {
          "title": "Hook example",
          "code": "(add-hook 'prog-mode-hook (lambda () (display-line-numbers-mode 1)))",
          "explanation": "Runs code whenever a programming major mode starts — here enables line numbers."
        },
        {
          "title": "Dynamic module boundary - Emacs Lisp's native code bridge",
          "code": ";; Emacs 25+ dynamic modules (C/Rust shared libraries)\n;; Load a .so/.dylib module\n(module-load \"~/my-module.so\")\n\n;; Module C code provides Emacs-callable functions\n;; Example: a Rust module for performance-critical code\n;;\n;; [dependencies]\n;; emacs-module = \"0.19\"\n;;\n;; The module exports functions callable from Elisp:\n;; (my-fast-search pattern buffer)\n\n;; Traditional FFI:\n;; process-file-shell-command for external programs\n(shell-command-to-string \"ls -la\")\n\n;; call-process for synchronous external commands\n(call-process \"git\" nil t nil \"status\")",
          "explanation": "Emacs Lisp's primary polyglot boundary is dynamic modules (Emacs 25+): shared libraries (.so/.dylib) written in C or Rust that expose Emacs-callable functions via the emacs-module.h API. This is how performance-critical code (tree-sitter, json parsing, regex engines) bridges into Emacs. The older boundaries are shell commands (shell-command-to-string, call-process) and process I/O (make-process). This makes Emacs Lisp the glue between editing and system automation."
        }
      ],
      "libraries": [
        {
          "name": "Emacs manual",
          "url": "https://www.gnu.org/software/emacs/manual/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Emacs Lisp reference",
          "url": "https://www.gnu.org/software/emacs/manual/html_node/elisp/"
        }
      ],
      "compareData": {
        "variables": {
          "code": ";; Emacs Lisp variables\n(defvar my-mode nil \"Mode variable\")\n(defvar-local my-buffer-var nil)  ; buffer-local\n(setq my-count 0)                  ; set value\n(let ((x 10) (y 20))              ; local binding\n  (+ x y))\n\n;; Custom variables (user-configurable)\n(defcustom my-font-size 14\n  \"Default font size\"\n  :type 'integer\n  :group 'my-group)",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": ";; Emacs Lisp conditionals\n(if (> count 100)\n    \"high\"\n  \"low\")\n\n;; when/unless (preferred for side effects)\n(when (buffer-modified-p)\n  (save-buffer))\n\n(unless (file-exists-p path)\n  (make-directory path t))\n\n;; cond\n(cond\n ((> count 100) \"high\")\n ((> count 50) \"medium\")\n (t \"low\"))",
          "difficulty": "basic"
        },
        "loops": {
          "code": ";; Emacs Lisp loops\n(dolist (item '(1 2 3))\n  (message \"Item: %d\" item))\n\n(dotimes (i 10)\n  (message \"Iteration %d\" i))\n\n;; while\n(while (> count 0)\n  (setq count (1- count)))\n\n;; dolist with result\n(dolist (x '(1 2 3) total)\n  (setq total (+ total x)))\n\n;; mapc (iterate for side effects)\n(mapc (lambda (x) (message \"%s\" x)) '(a b c))",
          "difficulty": "basic"
        },
        "functions": {
          "code": ";; Emacs Lisp functions\n(defun greet (name)\n  (format \"Hello, %s\" name))\n\n;; Interactive functions (M-x callable)\n(defun my-greet (name)\n  \"Greet the user.\"\n  (interactive \"sYour name: \")\n  (message \"Hello, %s\" name))\n\n;; Lambda\n(mapcar (lambda (x) (* x x)) '(1 2 3))  ; (1 4 9)\n\n;; Optional and rest args\n(defun my-list (&rest args)\n  args)",
          "difficulty": "basic"
        },
        "performance": {
          "code": ";; Emacs Lisp performance:\n;; 1. Byte-compiled Elisp is 3-10x faster than interpreted\n;; 2. Avoid tight loops in Elisp; use builtins instead\n;; 3. Buffer operations are optimized C primitives\n;; 4. Garbage collection thresholds (gc-cons-threshold)\n;; 5. Large files: use font-lock-mode optimizations\n;; 6. Native compilation (gccemacs/Emacs 28+) is 2-5x faster\n\n;; Byte-compile a file\n(byte-compile-file \"my-mode.el\")",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": ";; Emacs Lisp uses EIEIO (Object system for Emacs Lisp)\n(defclass my-point ()\n  ((x :initarg :x :type number :initform 0)\n   (y :initarg :y :type number :initform 0)))\n\n(cl-defmethod my-length ((p my-point))\n  (sqrt (+ (expt (oref p x) 2)\n           (expt (oref p y) 2))))\n\n;; Create instance\n(setq pt (make-instance 'my-point :x 3 :y 4))\n(my-length pt)  ; => 5.0",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": ";; Emacs Lisp strings\n(setq greeting \"Hello, Emacs Lisp!\")\n\n;; String functions\n(concat \"Hello\" \", \" \"World\")  ; \"Hello, World\"\n(format \"Value: %d\" 42)           ; \"Value: 42\"\n(string-upcase \"hello\")           ; \"HELLO\"\n(substring \"Hello, World\" 0 5)    ; \"Hello\"\n\n;; String interpolation via format\n(format \"Point: (%d, %d)\" x y)",
          "difficulty": "basic"
        },
        "errors": {
          "code": ";; Emacs Lisp error handling\n(condition-case err\n    (risky-operation)\n  (error (message \"Error: %s\" (error-message-string err))))\n\n;; unwind-protect (like try/finally)\n(unwind-protect\n    (progn\n      (message \"Working...\")\n      (risky-operation))\n  (cleanup-function))\n\n;; signal errors\n(error \"Something went wrong\")\n(user-error \"Please fix %s\" name)",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": ";; Emacs Lisp imports (require)\n(require 'cl-lib)          ; Common Lisp extensions\n(require 'json)            ; JSON parser\n(require 'seq)             ; Sequence functions\n\n;; autoload (lazy load)\n(autoload 'my-function \"my-package\")\n\n;; use-package (modern package management)\n(use-package magit\n  :ensure t\n  :bind ((\"C-x g\" . magit-status)))\n\n;; load-file for specific files\n(load-file \"~/.emacs.d/my-config.el\")",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "emacs-lisp-tip-format-pass11",
          "title": "Emacs version and package set",
          "body": "Emacs Lisp behaviour depends on Emacs major version and installed packages. Reproduce with `emacs -Q` plus the minimal repro.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "categories": [
        "devops"
      ],
      "overview": "The Lisp dialect that powers GNU Emacs — configure and extend the editor with full Lisp. Every Emacs configuration file is Elisp; packages extend the editor into an IDE and beyond. Emacs users writing packages, configs, and org-mode workflows — the extension language powering Emacs' editor-as-operating-system ecosystem.\n\nTypical projects include Emacs configuration, Editor plugins, Org-mode automation. MELPA offers 5000+ packages inside Emacs itself.",
      "learning_curve": "Gentle for basic customization — many users learn just enough for .emacs configs. Advanced Emacs Lisp (advice, EIEIO, byte-compilation, dynamic modules) is steep. The API surface is enormous (thousands of built-in functions). Documentation is excellent (C-h f, C-h v).",
      "good_for_teaching": "good",
      "ecosystem_notes": "Emacs is the development environment and runtime. MELPA provides 5000+ packages. Built-in package manager (package.el). use-package for declarative config. Native compilation (Emacs 28+) for speed. Used for text editing, org-mode, magit, and as an application platform. Very large community.",
      "common_use_cases": [
        "Emacs configuration",
        "Editor plugins",
        "Org-mode automation"
      ],
      "docs_url": "https://www.gnu.org/software/emacs/manual/html_node/elisp/",
      "best_for": [
        "Emacs configuration and package development",
        "Org-mode workflow automation",
        "extensible text editing with Lisp",
        "Emacs customization, major modes, and Org-mode workflow automation"
      ],
      "weak_at": [
        "Mobile or web-first products outside Emacs display system assumptions",
        "Teams without Emacs culture or willingness to learn elisp conventions",
        "Hard real-time embedded systems outside editor scripting runtimes"
      ],
      "official_url": "https://www.gnu.org/software/emacs/manual/html_node/elisp/",
      "paradigm": [
        "functional",
        "lisp",
        "editor-embedded"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic (optional lexical binding and type hints in modern Emacs)",
        "runtime": "Interpreted by GNU Emacs (byte-compiled `.elc` for faster load)",
        "memory": "Garbage-collected by the Emacs Lisp runtime",
        "abstraction": "High-level editor extension and automation language"
      }
    },
    {
      "id": "applescript",
      "name": "AppleScript",
      "color": "#101f1f",
      "description": "Apple's English-like scripting language for automating macOS applications. Control Finder, Safari, Mail, and any app that exposes a scripting dictionary.",
      "whoItIsFor": "Mac users automating Finder, Mail, and other apps without writing Swift — ideal for workflow shortcuts, batch file ops, and app integration glue.",
      "commonUses": [
        "macOS automation",
        "App scripting",
        "Workflow glue"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "display dialog \"Hello\"",
          "explanation": "Shows a dialog box with display dialog — AppleScript's primary way to interact with the user."
        },
        {
          "title": "Tell application",
          "code": "tell application \"Finder\"\n  set theFolder to folder \"Documents\" of home\n  open theFolder\nend tell",
          "explanation": "Sends Apple events to a macOS app — here opens a folder in Finder."
        },
        {
          "title": "Dialog",
          "code": "display dialog \"Continue?\" buttons {\"Cancel\", \"OK\"} default button \"OK\"",
          "explanation": "Shows a modal dialog and returns which button the user pressed."
        },
        {
          "title": "Apple Event / OSA boundary - macOS inter-process communication",
          "code": "-- AppleScript's boundary is Apple Events (OSA - Open Scripting Architecture)\n-- It sends messages to applications via their scripting dictionaries\n\ntell application \"Safari\"\n    activate\n    open location \"https://cachesphere.com\"\nend tell\n\n-- Accessing shell commands\ndo shell script \"curl -s https://api.example.com/data\"\n\n-- Calling Objective-C via AppleScriptObjC\nuse framework \"Foundation\"\nset urlString to current application's NSString's stringWithString:\"https://example.com\"\nset theURL to current application's NSURL's URLWithString:urlString",
          "explanation": "AppleScript's boundary is the Apple Event system, macOS's inter-process communication mechanism. The 'tell application' command sends Apple Events to target apps via their scripting dictionaries. do shell script bridges to Unix commands. AppleScriptObjC bridges to Objective-C frameworks via 'use framework'. This makes AppleScript the glue language for macOS polyglot automation — connecting GUI apps, shell scripts, and native frameworks."
        }
      ],
      "libraries": [
        {
          "name": "AppleScript guide",
          "url": "https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "AppleScript language guide",
          "url": "https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/"
        }
      ],
      "compareData": {
        "classes": {
          "code": "-- No class system -- AppleScript uses records and script objects\nscript Point\n    property x : 0\n    property y : 0\n    to length()\n        return sqrt(x * x + y * y)\n    end length\nend script",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "set greeting to \"Hello, AppleScript!\"\ndisplay dialog greeting\n-- String concatenation\nset msg to greeting & \" How are you?\"",
          "difficulty": "basic"
        },
        "errors": {
          "code": "try\n    set result to riskyOperation()\non error errMsg number errNum\n    display dialog \"Error \" & errNum & \": \" & errMsg\nend try",
          "difficulty": "basic"
        },
        "imports": {
          "code": "-- AppleScript uses 'use' for framework access\nuse framework \"Foundation\"\nuse framework \"AppKit\"\nuse scripting additions\n\n-- Scripting Addition commands are built-in\ntell application \"Finder\"\n    -- commands here\nend tell",
          "difficulty": "basic"
        },
        "variables": {
          "code": "-- AppleScript variables\nset greeting to \"Hello, AppleScript!\"\nset message to \"World\"\n\n-- No explicit type declarations\nset theNumber to 42\nset theList to {1, 2, 3}\nset theRecord to {name:\"Alice\", age:30}",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "-- AppleScript conditionals\nif theNumber > 10 then\n    display dialog \"Big number\"\nelse if theNumber > 5 then\n    display dialog \"Medium\"\nelse\n    display dialog \"Small\"\nend if\n\n-- Considering (app-specific conditions)\ntell application \"Finder\"\n    if exists file \"test.txt\" then\n        -- file exists\n    end if\nend tell",
          "difficulty": "basic"
        },
        "loops": {
          "code": "-- AppleScript loops\nrepeat with i from 1 to 10\n    -- counted loop\nend repeat\n\nrepeat while x < 100\n    -- conditional loop\nend repeat\n\nrepeat 5 times\n    -- fixed count\nend repeat\n\n-- Loop through list\nset fileList to every file of desktop\nrepeat with f in fileList\n    display dialog (name of f)\nend repeat",
          "difficulty": "basic"
        },
        "functions": {
          "code": "-- AppleScript handlers (functions)\non greet(name)\n    return \"Hello, \" & name\nend greet\n\nset msg to greet(\"World\")\n\n-- Handler with labeled parameters\non calculateArea given width:w, height:h\n    return w * h\nend calculateArea\n\n-- Script objects as closures\nscript Counter\n    property count : 0\n    on increment()\n        set count to count + 1\n        return count\n    end increment\nend script",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "-- AppleScript performance considerations:\n-- 1. Slow over Apple Event bridge (OSA overhead)\n-- 2. \"tell application\" blocks add IPC cost\n-- 3. Batch operations: 'every file of' vs loop\n-- 4. do shell script for heavy computation\n-- 5. AppleScriptObjC bridges to fast ObjC frameworks\n\n-- Fast: batch query\ntell application \"Finder\"\n    set names to name of every file of desktop\nend tell\n\n-- Slow: loop query\nrepeat with f in fileList\n    set n to name of f -- IPC per iteration\nend repeat",
          "difficulty": "intermediate"
        }
      },
      "tips": [
        {
          "id": "applescript-tip-app-dictionary",
          "title": "App dictionaries define the language",
          "body": "AppleScript portability is per-app scripting definitions. Target a specific app version; “one distro” tips miss the point.",
          "tag": "automation",
          "status": "curated"
        }
      ],
      "categories": [
        "devops"
      ],
      "overview": "Apple's English-like scripting language for automating macOS applications. Control Finder, Safari, Mail, and any app that exposes a scripting dictionary. Mac users automating Finder, Mail, and other apps without writing Swift — ideal for workflow shortcuts, batch file ops, and app integration glue.\n\nTypical projects include macOS automation, App scripting, Workflow glue. Exclusive to macOS with Script Editor built in.",
      "learning_curve": "Gentle for simple automation — the English-like syntax is readable. Advanced AppleScript (AppleScriptObjC, script libraries, Objective-C bridging) is harder. The real challenge is discovering each app's scripting dictionary and dealing with app-specific quirks.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Exclusive to macOS. Script Editor is the built-in IDE. Automator wraps AppleScript for non-programmers. Used for macOS automation, QA testing, and app integration. Script Debugger is the third-party IDE. Small but dedicated community. JXA (JavaScript for Automation) is an alternative syntax.",
      "common_use_cases": [
        "macOS automation",
        "App scripting",
        "Workflow glue"
      ],
      "docs_url": "https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/",
      "best_for": [
        "MacOS application automation",
        "cross-app scripting on Apple platforms",
        "Apple Event-driven workflow orchestration",
        "macOS application automation controlling Finder, Mail, and Script Editor"
      ],
      "weak_at": [
        "Cross-platform server automation on Linux or Windows hosts",
        "Headless CI pipelines without macOS GUI session availability",
        "Large teams requiring version-controlled TypeScript automation instead"
      ],
      "official_url": "https://developer.apple.com/library/archive/documentation/AppleScript/",
      "paradigm": [
        "imperative",
        "English-like",
        "automation"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Commands and text expansion (typically untyped at the shell level)",
        "runtime": "Interpreted by a shell, editor, or automation host",
        "memory": "Managed by the host process running the script"
      }
    },
    {
      "id": "xml",
      "name": "XML",
      "color": "#f80",
      "description": "Extensible Markup Language — a verbose, self-describing data format used everywhere from configs to SOAP. Schemas and namespaces add structure; XPath and XSLT add query and transform.",
      "whoItIsFor": "Enterprise developers, data exchange architects, and config file authors — still foundational for SOAP, SVG, office documents, and many schemas.",
      "commonUses": [
        "Data interchange",
        "Configuration files",
        "SOAP APIs",
        "Office documents"
      ],
      "patterns": [
        {
          "title": "Element",
          "code": "<person>\n  <name>Ada</name>\n</person>",
          "explanation": "Self-describing tree structure where every piece of data sits in a named, nested element."
        },
        {
          "title": "Attributes and text",
          "code": "<item id=\"42\" inStock=\"true\">Hammer</item>",
          "explanation": "Attributes live in the start tag; text content sits between tags."
        },
        {
          "title": "Namespaces (typical pattern)",
          "code": "<root xmlns=\"http://example.com/ns\">\n  <child>value</child>\n</root>",
          "explanation": "Default namespace applies to unprefixed elements; tools use URIs as identifiers."
        },
        {
          "title": "DOM/XSLT transformation boundary - XML's polyglot bridge",
          "code": "<!-- XML's polyglot boundary is transformation: -->\n<!-- XSLT transforms XML to XML/HTML/text -->\n<xsl:stylesheet version=\"1.0\"\n  xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n  <xsl:template match=\"/\">\n    <html><body>\n      <xsl:for-each select=\"//product\">\n        <p><xsl:value-of select=\"name\"/></p>\n      </xsl:for-each>\n    </body></html>\n  </xsl:template>\n</xsl:stylesheet>\n\n<!-- XML Schema validates structure -->\n<!-- SOAP/REST APIs bridge XML to code -->\n<!-- JAXB/C# XmlSerializer bridge XML to objects -->",
          "explanation": "XML's polyglot boundary is transformation: XSLT converts XML to HTML, text, or other XML; XML Schema validates structure across systems; SOAP and REST APIs bridge XML to any programming language via parsers (DOM, SAX, StAX). JAXB (Java) and XmlSerializer (.NET) automatically convert between XML and objects, making XML a universal data interchange format that bridges all programming ecosystems."
        }
      ],
      "libraries": [
        {
          "name": "W3C XML",
          "url": "https://www.w3.org/XML/",
          "type": "Spec"
        }
      ],
      "docs": [
        {
          "name": "XML specification",
          "url": "https://www.w3.org/TR/xml/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "<!-- XML has no variables in the programming sense.\n     XML attributes and element content are data,\n     not mutable variables.\n     XSLT adds variable support (xsl:variable),\n     but core XML is a static markup format. -->",
          "difficulty": "N/A"
        },
        "conditionals": {
          "code": "<!-- XML has no conditionals.\n     XSLT provides xsl:if and xsl:choose:\n     <xsl:if test=\"price > 100\">expensive</xsl:if>\n     <xsl:choose>\n       <xsl:when test=\"price > 100\">high</xsl:when>\n       <xsl:otherwise>low</xsl:otherwise>\n     </xsl:choose>\n     But core XML is static markup. -->",
          "difficulty": "N/A"
        },
        "loops": {
          "code": "<!-- XML has no loops.\n     XSLT provides xsl:for-each:\n     <xsl:for-each select=\"//item\">\n       <xsl:value-of select=\"name\"/>\n     </xsl:for-each>\n     But core XML is static markup. -->",
          "difficulty": "N/A"
        },
        "functions": {
          "code": "<!-- XML has no user-defined functions.\n     XSLT provides xsl:template (named templates)\n     and xsl:function (in XSLT 2.0+), but core\n     XML is a data format, not a programming language. -->",
          "difficulty": "N/A"
        },
        "performance": {
          "code": "<!-- XML performance:\n     1. DOM parsing loads entire document into memory\n     2. SAX parsing is stream-based (lower memory)\n     3. StAX is pull-based (Java)\n     4. XPath/XQuery evaluation can be slow on large documents\n     5. XML is verbose; JSON is more compact\n     6. Compression (EXI, Fast Infoset) addresses verbosity -->",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "<!-- XML has no class/OOP system.\n     XML Schema (XSD) defines types and complex types,\n     but these are schema definitions, not OOP classes.\n     XSLT/XQuery are functional, not OOP. -->",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "<!-- XML strings (character data and attributes) -->\n<product id=\"P001\">\n  <name>XML Editor Pro</name>\n  <description>Special chars: & < ></description>\n  <![CDATA[\n    Raw text with <special> chars\n    No escaping needed here\n  ]]>\n</product>\n\n<!-- XPath string functions -->\n<!-- concat($a, $b), contains($s, $sub), substring($s, $pos, $len) -->",
          "difficulty": "basic"
        },
        "errors": {
          "code": "<!-- XML error handling:\n     1. Well-formedness errors (unclosed tags) stop parsing\n     2. Validation errors (XSD/DTD violations) reported\n     3. XSLT xsl:message for runtime errors\n     4. XQuery try/catch for error handling\n     5. XML parsers report line/column for errors -->\n\n<!-- DTD validation -->\n<!DOCTYPE root [\n  <!ELEMENT root (child*)>\n  <!ELEMENT child (#PCDATA)>\n]>\n\n<!-- XSD validation via schemaLocation -->\n<root xsi:schemaLocation=\"http://example.com schema.xsd\">",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "<!-- XML imports (XInclude, DTD, XSLT) -->\n<!-- XInclude for composing documents -->\n<document>\n  <xi:include href=\"chapter1.xml\"/>\n  <xi:include href=\"chapter2.xml\"/>\n</document>\n\n<!-- DTD external entity -->\n<!DOCTYPE root [\n  <!ENTITY % common SYSTEM \"common.ent\">\n  %common;\n]>\n\n<!-- XSLT include/import -->\n<xsl:include href=\"common.xslt\"/>\n<xsl:import href=\"layout.xslt\"/>",
          "difficulty": "intermediate"
        }
      },
      "tips": [
        {
          "id": "xml-tip-xxe-and-namespaces",
          "title": "Disable XXE; treat namespaces as identity",
          "body": "Untrusted XML needs entity expansion and external entity resolution disabled. Namespace URIs identify vocabularies — prefix renames do not change meaning, and mixed default namespaces are a common integration bug.",
          "tag": "security",
          "status": "curated"
        }
      ],
      "categories": [
        "markup",
        "data"
      ],
      "overview": "Extensible Markup Language — a verbose, self-describing data format used everywhere from configs to SOAP. Schemas and namespaces add structure; XPath and XSLT add query and transform.",
      "learning_curve": "Gentle for basic markup. Moderate for XSD schema authoring. Steep for XSLT/XQuery. The XML ecosystem is vast (namespaces, XPath, XSLT, XSD, XQuery, XInclude) and each sub-language has its own learning curve.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "XML is ubiquitous in enterprise (SOAP, SVG, MathML, XHTML, Atom, RSS). XSD/DTD for validation. XSLT for transformation. XPath/XQuery for querying. Parser libraries in every language. Verbose compared to JSON/YAML. Still dominant in config (Maven, Spring, Android layouts).",
      "common_use_cases": [
        "Data interchange",
        "Configuration files",
        "SOAP APIs",
        "Office documents"
      ],
      "docs_url": "https://www.w3.org/TR/xml/",
      "best_for": [
        "legacy enterprise data interchange",
        "Document markup with schemas",
        "RSS feeds and Microsoft Office formats",
        "Document markup with schemas for publishing and enterprise interchange"
      ],
      "weak_at": [
        "Human-readable config where YAML or TOML reduce verbosity",
        "High-throughput JSON APIs without XML parsing overhead",
        "Browser-first SPAs without XML transformation pipeline needs"
      ],
      "official_url": "https://www.w3.org/XML/",
      "paradigm": [
        "markup",
        "hierarchical",
        "declarative"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Markup or data format (not a general-purpose programming language)",
        "runtime": "Parsed and validated by tools, pipelines, or hosts — no single standard VM",
        "memory": "Not an executable program on its own; hosts manage storage and memory"
      }
    },
    {
      "id": "json",
      "name": "JSON",
      "color": "#292929",
      "description": "JavaScript Object Notation — a ubiquitous text format for structured data in APIs and configs (validation is a separate concern, e.g. JSON Schema).",
      "whoItIsFor": "Developers, testers, and tooling authors who exchange structured data between systems.",
      "commonUses": [
        "API payloads",
        "Config files",
        "Data storage",
        "Package manifests"
      ],
      "patterns": [
        {
          "title": "Object",
          "code": "{\n  \"name\": \"Ada\",\n  \"age\": 36\n}",
          "explanation": "A JSON object maps string keys to values — the usual container for structured API payloads."
        },
        {
          "title": "Array and mixed types",
          "code": "[\n  \"alpha\",\n  42,\n  true,\n  null,\n  { \"nested\": 1 }\n]",
          "explanation": "JSON arrays are ordered; values can be strings, numbers, booleans, null, objects, or other arrays."
        },
        {
          "title": "Escaping in strings",
          "code": "{ \"path\": \"C:\\\\Users\\\\Ada\\\\file.txt\", \"quote\": \"She said \\\"hi\\\"\" }",
          "explanation": "Backslashes and double quotes inside strings must be escaped with \\."
        },
        {
          "title": "Schema validation boundary - JSON's polyglot bridge",
          "code": "// JSON's polyglot boundary is schema validation\n// and data interchange across all languages.\n\n// JSON Schema validates structure\n{\n  \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"name\": { \"type\": \"string\" },\n    \"age\": { \"type\": \"integer\", \"minimum\": 0 }\n  },\n  \"required\": [\"name\"]\n}\n\n// Every language can parse/generate JSON\n// Python:  data = json.loads(text)\n// Java:    Data obj = mapper.readValue(text, Data.class)\n// Go:      json.Unmarshal(bytes, &obj)\n// Rust:    let obj: Data = serde_json::from_str(text)?;",
          "explanation": "JSON's polyglot boundary is its role as a near-universal data interchange format: essentially all mainstream stacks can parse and generate JSON, which is why it is the default for many web APIs. JSON Schema adds structure validation across language boundaries. The boundary is not FFI but serialization: JSON bridges systems by converting in-memory structures to text another runtime can reconstruct—always within the limits of each language's types and parsers."
        }
      ],
      "libraries": [
        {
          "name": "JSON.org",
          "url": "https://www.json.org/",
          "type": "Spec"
        }
      ],
      "docs": [
        {
          "name": "JSON specification",
          "url": "https://www.json.org/json-en.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// JSON has no variables.\n// JSON is a static data format, not a programming language.\n// Values are immutable data; there are no\n// assignments, rebindings, or state changes.\n// See json.org for the full specification.",
          "difficulty": "N/A"
        },
        "conditionals": {
          "code": "// JSON has no conditionals.\n// JSON is a data format, not a programming language.\n// Conditional logic belongs to the application\n// that reads and processes JSON, not to JSON itself.",
          "difficulty": "N/A"
        },
        "loops": {
          "code": "// JSON has no loops.\n// JSON arrays represent ordered collections,\n// but iteration is done by the consuming\n// application, not by JSON itself.",
          "difficulty": "N/A"
        },
        "functions": {
          "code": "// JSON has no functions.\n// JSON is a data interchange format.\n// Values can be: string, number, boolean,\n// null, object, or array.\n// No executable code or function definitions.",
          "difficulty": "N/A"
        },
        "performance": {
          "code": "// JSON performance (high level):\n// Parsing/serialization speed and memory use depend on runtime, payload size, and whether you validate (e.g. JSON Schema).\n// Very large documents may need streaming or chunked processing.\n// Binary formats (MessagePack, CBOR) can be smaller or faster for some workloads.",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "// JSON has no class/OOP system.\n// JSON objects are key-value maps, not class instances.\n// Class/prototype mapping is done by the consuming\n// application (e.g., JSON Schema, Jackson annotations).",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "// JSON strings\n{\n  \"name\": \"JSON\",\n  \"description\": \"A lightweight data format\",\n  \"quote\": \"He said \\\"hello\\\"\",\n  \"unicode\": \"\\u0048\\u0065\\u006C\\u006C\\u006F\",\n  \"multiline\": \"Line 1\\nLine 2\",\n  \"path\": \"C:\\\\Users\\\\doc\"\n}\n\n// Strings must be double-quoted\n// Escape sequences: \\n \\t \\\" \\\\ \\uXXXX",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// JSON has no error handling.\n// Errors occur during parsing:\n// - Invalid syntax (trailing commas, single quotes)\n// - Duplicate keys (RFC 7159 allows but discourages)\n// - Encoding issues (must be UTF-8)\n//\n// Application code handles errors:\ntry {\n  const data = JSON.parse(text);\n} catch (e) {\n  console.error('Invalid JSON:', e.message);\n}",
          "difficulty": "N/A"
        },
        "imports": {
          "code": "// JSON has no native import/include system.\n// JSON is a standalone data format.\n//\n// JSON Schema $ref enables schema composition,\n// but this is schema-level, not runtime module import:\n// {\n//   \"$ref\": \"https://example.com/schemas/address.json\"\n// }\n//\n// Applications compose JSON by loading files\n// (fetch, fs.readFile) and merging at the app level.",
          "difficulty": "N/A"
        }
      },
      "tips": [
        {
          "id": "json-tip-schema-and-dup-keys",
          "title": "Schema and duplicate keys decide correctness",
          "body": "JSON has no comments and duplicate keys are implementation-defined. Validate with a schema (JSON Schema, OpenAPI) and reject unknown fields when the contract matters.",
          "tag": "data",
          "status": "curated"
        }
      ],
      "categories": [
        "data",
        "markup"
      ],
      "overview": "JavaScript Object Notation — structured text for APIs and configs. The format itself does not enforce schemas; pair it with JSON Schema or your API's contract tests when you need guarantees.",
      "learning_curve": "Gentle — JSON is a simple data format that most developers learn in minutes. JSON Schema adds moderate complexity. The format is intentionally minimal: 6 value types (string, number, boolean, null, object, array).",
      "good_for_teaching": "good",
      "ecosystem_notes": "JSON is the default text interchange format for many web APIs. RFC 8259 is the specification. JSON Schema for validation. Parsers exist for essentially all widely used languages. JSON5 adds comments and trailing commas. JSONC is JSON with comments (VS Code). MessagePack/CBOR are binary alternatives.",
      "common_use_cases": [
        "API payloads",
        "Config files",
        "Data storage",
        "Package manifests"
      ],
      "docs_url": "https://www.rfc-editor.org/rfc/rfc8259.html",
      "best_for": [
        "API request and response payloads",
        "application configuration files",
        "cross-language data exchange format",
        "REST API payloads and configuration files across language boundaries"
      ],
      "weak_at": [
        "Binary-efficient serialization where protobuf or msgpack win on wire size",
        "Document markup with mixed content better expressed in XML or HTML",
        "Comments-in-config workflows without JSONC or JSON5 conventions"
      ],
      "official_url": "https://www.json.org/",
      "paradigm": [
        "data-interchange",
        "declarative",
        "text"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Markup or data format (not a general-purpose programming language)",
        "runtime": "Parsed and validated by tools, pipelines, or hosts — no single standard VM",
        "memory": "Not an executable program on its own; hosts manage storage and memory"
      }
    },
    {
      "id": "yaml",
      "name": "YAML",
      "color": "#cb171e",
      "description": "YAML Ain't Markup Language — a human-friendly data serialisation format used in configs and CI. Indentation-based nesting makes it readable but also whitespace-sensitive and easy to break.",
      "whoItIsFor": "DevOps engineers and Kubernetes users writing CI pipelines — human-readable config with anchoring, but watch out for implicit typing pitfalls.",
      "commonUses": [
        "CI/CD configs",
        "Kubernetes manifests",
        "Docker Compose",
        "Ansible playbooks"
      ],
      "patterns": [
        {
          "title": "Map",
          "code": "name: Ada\nage: 36",
          "explanation": "Indentation-based key-value structure — YAML's core building block for nested data."
        },
        {
          "title": "List and nested mapping",
          "code": "stack:\n  - name: app\n    port: 8080\n  - name: db\n    port: 5432",
          "explanation": "Sequences use leading `-`; indentation groups keys under each item."
        },
        {
          "title": "Multi-line string",
          "code": "readme: |\n  Line one\n  Line two\n  Line three",
          "explanation": "The `|` block scalar keeps newlines; useful for embedded text or scripts."
        },
        {
          "title": "Anchor/alias + app composition boundary - YAML's polyglot bridge",
          "code": "# YAML's polyglot boundary is anchor/alias for\n# data reuse and app-level composition.\n\n# Anchors and aliases (within-document reuse)\ndefaults: &defaults\n  image: myapp:latest\n  replicas: 3\n\nproduction:\n  <<: *defaults\n  replicas: 5\n\n# App-level composition (Docker Compose)\nservices:\n  web:\n    extends:\n      file: common.yml\n      service: webapp\n\n# Kubernetes Kustomize (multi-file composition)\n# kustomization.yaml:\n# resources:\n#   - deployment.yaml\n#   - service.yaml",
          "explanation": "YAML's polyglot boundary is anchor/alias for within-document data reuse and application-level composition for cross-file merging. Docker Compose extends, Ansible include_tasks, Kubernetes kustomize, and Helm templates all layer their own composition mechanisms on top of YAML's static data. This makes YAML a universal config glue that bridges infrastructure, CI/CD, and application configuration across all programming ecosystems."
        }
      ],
      "libraries": [
        {
          "name": "YAML spec",
          "url": "https://yaml.org/spec/",
          "type": "Spec"
        }
      ],
      "docs": [
        {
          "name": "YAML specification",
          "url": "https://yaml.org/spec/1.2.2/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# YAML has no mutable variables.\n# YAML anchors (&name) and aliases (*name)\n# provide reuse, not variable assignment.\n\ndefaults: &defaults\n  timeout: 30\n  retries: 3\n\nproduction:\n  <<: *defaults\n  timeout: 60    # override anchor value",
          "difficulty": "N/A"
        },
        "conditionals": {
          "code": "# YAML has no conditionals.\n# YAML is a data serialization format,\n# not a programming language.\n# Conditional logic belongs to the\n# application that reads YAML, not to YAML itself.\n#\n# Some tools layer conditionals on top:\n# - Ansible: when: expr\n# - Helm: {{ if }}\n# But these are not YAML itself.",
          "difficulty": "N/A"
        },
        "loops": {
          "code": "# YAML has no loops.\n# YAML sequences represent ordered lists,\n# but iteration is done by the consuming\n# application, not by YAML itself.\n#\n# Some tools layer loops on top:\n# - Ansible: loop: '{{ items }}'\n# - Helm: {{ range .Items }}\n# But these are not YAML itself.",
          "difficulty": "N/A"
        },
        "functions": {
          "code": "# YAML has no functions.\n# YAML is a data serialization format.\n# Values can be: string, number, boolean,\n# null, sequence, or mapping.\n# No executable code or function definitions.\n# Anchors/aliases provide reuse, not computation.",
          "difficulty": "N/A"
        },
        "performance": {
          "code": "# YAML performance:\n# 1. Parsing is slower than JSON (complexer grammar)\n# 2. No streaming parser (must load full document)\n# 3. Large files can be slow to parse\n# 4. YAML specs are complex (1.2 has 80+ page spec)\n# 5. Security: !tag allows arbitrary code in some parsers\n# 6. Use JSON for high-throughput APIs\n# 7. Use YAML for human-readable config",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "# YAML has no class/OOP system.\n# YAML mappings are key-value pairs,\n# not class instances.\n# Merge keys (<<:) provide a form of\n# inheritance from anchors, but this\n# is data merging, not OOP.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# YAML strings\nplain_string: hello world       # unquoted\nquoted_string: \"Hello, World!\"    # double-quoted\nsingle_quoted: 'Hello, World!'   # single-quoted\nblock_string: |\n  This is a multi-line\n  block string (literal)\nfolded_string: >\n  This is a folded\n  string that becomes one line\n\n# Escape sequences in double-quoted strings\nescaped: \"Line 1\\nLine 2\\tTabbed\"",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# YAML has no error handling.\n# YAML parsers report:\n# - Indentation errors (most common)\n# - Tab vs spaces mixing\n# - Duplicate keys\n# - Invalid escape sequences\n# - Unresolved aliases\n#\n# Application code handles errors:\ntry:\n    with open('config.yaml') as f:\n        data = yaml.safe_load(f)\nexcept yaml.YAMLError as e:\n    print(f'YAML error: {e}')",
          "difficulty": "N/A"
        },
        "imports": {
          "code": "# YAML has no native include/import.\n# Anchors and aliases provide reuse within\n# a single document, not across files.\n#\n# Composition is file-merge at the app level:\n# - Docker Compose: extends, yaml_files\n# - Ansible: include_tasks, import_playbook\n# - Kubernetes: kustomize patches\n# - Helm: {{ include }} templates\n#\n# Some tools support !include tags:\n# base: !include base.yaml",
          "difficulty": "N/A"
        }
      },
      "tips": [
        {
          "id": "yaml-tip-indent-unquoted",
          "title": "Indentation and implicit types bite",
          "body": "YAML uses indentation for structure — mixing tabs and spaces, or indenting list items inconsistently, produces hard-to-spot parse errors. Unquoted scalars can also be auto-converted (for example `yes`, `no`, or hex-looking strings) depending on the parser and YAML version. Quote values when they must stay strings, and validate manifests with your real toolchain — Kubernetes and CI parsers are stricter than \"looks fine in an editor.\"",
          "tag": "intermediate",
          "status": "curated"
        }
      ],
      "categories": [
        "data",
        "devops"
      ],
      "overview": "YAML Ain't Markup Language — a human-friendly data serialisation format used in configs and CI. Indentation-based nesting makes it readable but also whitespace-sensitive and easy to break. DevOps engineers and Kubernetes users writing CI pipelines — human-readable config with anchoring, but watch out for implicit typing pitfalls.\n\nTypical projects include CI/CD configs, Kubernetes manifests, Docker Compose. Use safe_load where available — !tag directives can execute code in some parsers.",
      "learning_curve": "Gentle for basic key-value config. Moderate for multi-document, anchors/aliases, and complex types. Steep for edge cases (implicit types, indentation rules, 1.1 vs 1.2 spec differences). The 'YAML is simple' myth breaks down on edge cases.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "YAML is the dominant config format for Kubernetes, CI/CD (GitHub Actions, GitLab CI), Docker Compose, Ansible, and many more. PyYAML, js-yaml, SnakeYAML are major parsers. YAML 1.2 is the current spec. Security risk: !tag directives can execute code in some parsers (use safe_load).",
      "common_use_cases": [
        "CI/CD configs",
        "Kubernetes manifests",
        "Docker Compose",
        "Ansible playbooks"
      ],
      "docs_url": "https://yaml.org/spec/1.2.2/",
      "best_for": [
        "Kubernetes resource definitions",
        "CI/CD pipeline configuration",
        "infrastructure as code manifest authoring",
        "Kubernetes manifests and Helm charts defining cluster desired state"
      ],
      "weak_at": [
        "Strictly typed configuration without surprise type coercion footguns",
        "Large teams needing non-ambiguous config without YAML merge key quirks",
        "Performance-critical parsers processing megabytes per request"
      ],
      "official_url": "https://yaml.org/",
      "paradigm": [
        "declarative",
        "configuration",
        "human-readable"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Markup or data format (not a general-purpose programming language)",
        "runtime": "Parsed and validated by tools, pipelines, or hosts — no single standard VM",
        "memory": "Not an executable program on its own; hosts manage storage and memory"
      }
    },
    {
      "id": "toml",
      "name": "TOML",
      "color": "#9c4221",
      "description": "Tom's Obvious Minimal Language — a config file format that's easy to read and write. Flat tables and explicit types avoid YAML's ambiguity; used by Cargo, PEP 517, and others.",
      "whoItIsFor": "Rust (Cargo.toml), Python (pyproject.toml), and Go developers — clear, minimal config format that avoids YAML's ambiguity and nesting issues.",
      "commonUses": [
        "Cargo configs",
        "pyproject.toml",
        "Application settings"
      ],
      "patterns": [
        {
          "title": "Table",
          "code": "[server]\nhost = \"localhost\"\nport = 8080",
          "explanation": "Section-based config with [table] headers — TOML groups key-value pairs under named sections."
        },
        {
          "title": "Dotted keys and inline table",
          "code": "server.host = \"0.0.0.0\"\nserver.port = 8080\n\npoint = { x = 10, y = 20 }",
          "explanation": "Dotted keys group settings; inline tables use `{ key = value }` syntax."
        },
        {
          "title": "Array of tables",
          "code": "[[products]]\nname = \"Hammer\"\nsku = 738594937\n\n[[products]]\nname = \"Nail\"\nsku = 284758393",
          "explanation": "`[[name]]` starts a new element in an array of tables — common in Cargo-style manifests."
        },
        {
          "title": "Config merge boundary - TOML's polyglot bridge",
          "code": "# TOML's polyglot boundary is config merging\n# at the application level.\n\n# Cargo.toml (Rust) merges with .cargo/config.toml\n[package]\nname = \"myapp\"\nversion = \"0.1.0\"\n\n[dependencies]\nserde = { version = \"1.0\", features = [\"derive\"] }\n\n# Python pyproject.toml merges with user config\n[tool.pytest]\ntestpaths = [\"tests\"]\n\n# Application-level merge (not native TOML)\n# config = default_config | user_config | env_config\n# This merging is done by the application,\n# not by TOML itself.",
          "explanation": "TOML's polyglot boundary is config merging at the application level. TOML itself has no include/import mechanism (by design), so applications layer their own composition: Cargo (Rust) merges workspace and package configs, Python's pip reads pyproject.toml, and the Go viper library merges TOML with env vars and flags. This makes TOML a clean, deterministic config format that bridges build systems, package managers, and application configuration across ecosystems."
        }
      ],
      "libraries": [
        {
          "name": "TOML spec",
          "url": "https://toml.io/",
          "type": "Spec"
        }
      ],
      "docs": [
        {
          "name": "TOML specification",
          "url": "https://toml.io/en/v1.0.0"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# TOML variables\n[database]\nhost = \"localhost\"\nport = 5432\nenabled = true\n\n# String interpolation is NOT supported\n# Values are static data, not computed\n\n# Inline tables\npoint = { x = 1, y = 2 }\n\n# Arrays\nports = [8000, 8001, 8002]",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# TOML has no conditionals.\n# TOML is a static configuration format.\n# All values are determined at parse time.\n# Conditional logic belongs to the\n# application that reads TOML, not to TOML itself.",
          "difficulty": "N/A"
        },
        "loops": {
          "code": "# TOML has no loops.\n# TOML arrays and array of tables\n# represent ordered collections, but\n# iteration is done by the consuming\n# application, not by TOML itself.\n\n# Array of tables (not a loop)\n[[servers]]\nname = \"alpha\"\nip = \"10.0.0.1\"\n\n[[servers]]\nname = \"beta\"\nip = \"10.0.0.2\"",
          "difficulty": "N/A"
        },
        "functions": {
          "code": "# TOML has no functions.\n# TOML is a static configuration format.\n# Values can be: string, integer, float,\n# boolean, datetime, array, or table.\n# No computation or function definitions.",
          "difficulty": "N/A"
        },
        "performance": {
          "code": "# TOML performance:\n# 1. Parsing is simpler than YAML (no indentation rules)\n# 2. TOML parsers are available in most languages\n# 3. No streaming parser (must load full document)\n# 4. Smaller than equivalent YAML for most configs\n# 5. Faster to parse than YAML due to simpler grammar\n# 6. Used by Rust (Cargo), Python (pip), Go projects",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "# TOML has no class/OOP system.\n# TOML tables are key-value mappings,\n# not class instances.\n# Nested tables provide hierarchy:\n# [owner]\n#   [owner.details]\n# But this is data nesting, not OOP.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# TOML strings\ntitle = \"TOML Example\"\n\n# Multi-line strings\ndescription = \"\"\"\nThis is a multi-line\nstring in TOML.\"\"\"\n\n# Literal strings (no escaping)\npath = 'C:\\Users\\doc\\file.txt'\n\n# Multi-line literal strings\nregex = '''\\d{4}-\\d{2}-\\d{2}'''\n\n# Datetime strings\ndob = 1979-05-27T07:32:00Z\nbirthday = 1979-05-27",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# TOML has no error handling.\n# TOML parsers report:\n# - Duplicate keys (error)\n# - Invalid types (error)\n# - Malformed datetime (error)\n# - Mixed types in arrays (error)\n#\n# Application code handles errors:\ntry:\n    with open('config.toml') as f:\n        data = tomllib.load(f)\nexcept tomllib.TOMLDecodeError as e:\n    print(f'TOML error: {e}')",
          "difficulty": "N/A"
        },
        "imports": {
          "code": "# TOML has no native include/import system.\n# TOML is a single-document format.\n# Composition is file-merge at the app level.\n# For example:\n# - Python: tomllib + dict.update()\n# - Rust: config crate merges multiple TOML files\n# - Go: viper library merges config sources\n#\n# TOML's design explicitly rejects includes\n# to keep parsing simple and deterministic.",
          "difficulty": "N/A"
        }
      },
      "tips": [
        {
          "id": "toml-tip-tables-and-types",
          "title": "Table headers and typed literals matter",
          "body": "TOML’s tables/arrays-of-tables and datetime/number literals are easy to mis-nest. Prefer a parser that surfaces type errors over stringly config.",
          "tag": "data",
          "status": "curated"
        }
      ],
      "categories": [
        "data",
        "config"
      ],
      "overview": "Tom's Obvious Minimal Language — a config file format that's easy to read and write. Flat tables and explicit types avoid YAML's ambiguity; used by Cargo, PEP 517, and others. Rust (Cargo.toml), Python (pyproject.toml), and Go developers — clear, minimal config format that avoids YAML's ambiguity and nesting issues.\n\nTypical projects include Cargo configs, pyproject.toml, Application settings.",
      "learning_curve": "Gentle — TOML is simpler than YAML (no indentation rules, no implicit types). Key-value pairs with sections. Easy to learn for config authoring. The 1.0 spec is well-defined. Only quirk: array of tables syntax [[...]].",
      "good_for_teaching": "good",
      "ecosystem_notes": "TOML is used by Cargo (Rust), pip (Python), and many Go projects. Strong parser support across languages. TOML 1.0 is the current spec. Simpler and less error-prone than YAML for config. No standard schema format yet (unlike JSON Schema).",
      "common_use_cases": [
        "Cargo configs",
        "pyproject.toml",
        "Application settings"
      ],
      "docs_url": "https://toml.io/en/",
      "best_for": [
        "configuration files for Rust tooling",
        "Cargo and pyproject.toml project metadata",
        "precise typed configuration formats",
        "Rust Cargo manifests and Python pyproject.toml project metadata"
      ],
      "weak_at": [
        "Deeply nested Kubernetes-scale documents with hundreds of keys",
        "Schema ecosystems requiring JSON Schema tooling exclusively",
        "Legacy XML enterprise buses without TOML parser availability"
      ],
      "official_url": "https://toml.io/",
      "paradigm": [
        "declarative",
        "configuration",
        "explicit"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Markup or data format (not a general-purpose programming language)",
        "runtime": "Parsed and validated by tools, pipelines, or hosts — no single standard VM",
        "memory": "Not an executable program on its own; hosts manage storage and memory"
      }
    },
    {
      "id": "markdown",
      "name": "Markdown",
      "color": "#083fa1",
      "description": "A lightweight plain-text authoring format (markup) — widely used for READMEs and docs. Not a general-purpose programming language; parsers and extensions (CommonMark, GFM, tool dialects) decide what features exist.",
      "whoItIsFor": "Anyone writing documentation, README files, or notes in plain text — knowing your renderer’s dialect still matters.",
      "commonUses": [
        "Documentation",
        "README files",
        "Blog posts",
        "Notes"
      ],
      "patterns": [
        {
          "title": "Heading",
          "code": "# Title\n## Subtitle\nParagraph text.",
          "explanation": "Hash-based headings — # is H1, ## is H2, etc. The backbone of document structure."
        },
        {
          "title": "Headings and emphasis",
          "code": "## Section\n\n**bold** and *italic* and `inline code`.",
          "explanation": "Hash-based headings — # is H1, ## is H2, etc. The backbone of document structure."
        },
        {
          "title": "List and link",
          "code": "- first\n- second\n\n[Read docs](https://example.com)",
          "explanation": "Unordered lists use `-`, `*`, or `+`; links use `[text](url)`."
        },
        {
          "title": "HTML rendering boundary - Markdown's polyglot bridge",
          "code": "<!-- Markdown's polyglot boundary is HTML rendering. -->\n<!-- Markdown converts to HTML, which integrates -->\n<!-- with any web technology. -->\n\n## Standard Markdown → HTML\n\nThis **bold** text renders as:\n<p>This <strong>bold</strong> text</p>\n\n## HTML passthrough (embed any HTML)\n\n<div class=\"alert alert-warning\">\n  <strong>Note:</strong> HTML works inside Markdown.\n  <button onclick=\"alert('Hello')\">Click me</button>\n</div>\n\n## Code blocks (embed any language)\n\n```python\ndef hello():\n    print(\"Markdown bridges to Python\")\n```",
          "explanation": "Markdown's polyglot boundary is HTML rendering: Markdown converts to HTML, which integrates with typical web stacks. HTML passthrough can embed HTML/CSS/JS where your toolchain allows it. Code blocks carry source text for other languages; execution is outside Markdown. Static site generators (Hugo, Jekyll, Docusaurus) add templates on top. MDX mixes in components where configured. That makes Markdown practical documentation glue between plain text and the web—always with renderer-specific limits and dialect differences."
        }
      ],
      "libraries": [
        {
          "name": "CommonMark",
          "url": "https://commonmark.org/",
          "type": "Spec"
        }
      ],
      "docs": [
        {
          "name": "Markdown guide",
          "url": "https://www.markdownguide.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "<!-- Markdown has no variables. -->\n<!-- Markdown is a plain text markup format. -->\n<!-- Values are static text content. -->\n<!-- Some extensions add variables: -->\n<!-- - Jekyll: {{ page.title }} -->\n<!-- - Hugo: {{ .Title }} -->\n<!-- - Docusaurus: {frontmatter} -->\n<!-- But these are tool-specific, not Markdown itself. -->",
          "difficulty": "N/A"
        },
        "conditionals": {
          "code": "<!-- Markdown has no conditionals. -->\n<!-- Markdown is a static markup format. -->\n<!-- Some tools add conditionals: -->\n<!-- - Jekyll: {% if page.draft %} -->\n<!-- - Hugo: {{ if .Params.draft }} -->\n<!-- - But these are template engines, not Markdown. -->",
          "difficulty": "N/A"
        },
        "loops": {
          "code": "<!-- Markdown has no loops. -->\n<!-- Markdown is a static markup format. -->\n<!-- Some tools add loops: -->\n<!-- - Jekyll: {% for post in site.posts %} -->\n<!-- - Hugo: {{ range .Pages }} -->\n<!-- - But these are template engines, not Markdown. -->",
          "difficulty": "N/A"
        },
        "functions": {
          "code": "<!-- Markdown has no functions. -->\n<!-- Markdown is a static text-to-HTML format. -->\n<!-- It converts plain text markup to HTML. -->\n<!-- No computation, no function calls. -->",
          "difficulty": "N/A"
        },
        "performance": {
          "code": "<!-- Markdown performance: -->\n<!-- 1. Parsing is fast (regex-based) -->\n<!-- 2. CommonMark spec normalizes rendering -->\n<!-- 3. Extensions (GFM, MDX) add overhead -->\n<!-- 4. Large documents render quickly -->\n<!-- 5. Static site generators (Hugo, 11ty) pre-render -->\n<!-- 6. MDX (React in Markdown) adds JSX compile time -->",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "<!-- Markdown has no class/OOP system. -->\n<!-- Markdown produces HTML elements, not classes. -->\n<!-- CSS classes can be added via: -->\n<!-- - HTML passthrough: <div class=\"alert\"> -->\n<!-- - Kramdown: {: .alert } -->\n<!-- - But these are extensions, not core Markdown. -->",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "<!-- Markdown strings (inline text) -->\n# Heading\n\nParagraph with **bold**, *italic*, `code`,\nand [links](https://example.com).\n\nInline code: `x = 42`\n\nEscapes: \\*not italic\\*\n\n---\n\n> Blockquote text\n\n![Image alt](image.png)",
          "difficulty": "basic"
        },
        "errors": {
          "code": "<!-- Markdown has no error handling. -->\n<!-- Markdown is forgiving: unrecognized syntax -->\n<!-- is rendered as plain text. -->\n<!-- -->\n<!-- Linting tools catch issues: -->\n<!-- - markdownlint: style violations -->\n<!-- - alex: inclusive language -->\n<!-- - write-good: prose suggestions -->\n<!-- - link-check: broken links -->",
          "difficulty": "N/A"
        },
        "imports": {
          "code": "<!-- Markdown has no import system. -->\n<!-- Composition is tool-specific: -->\n<!-- - Jekyll: {% include nav.html %} -->\n<!-- - Hugo: {{ partial \"nav.html\" }} -->\n<!-- - Docusaurus: import CodeBlock from '@site/...' -->\n<!-- - MDX: import Component from './Comp' -->\n<!-- -->\n<!-- Standard Markdown is a single-document format. -->\n<!-- Frontmatter (YAML header) provides metadata. -->",
          "difficulty": "N/A"
        }
      },
      "tips": [
        {
          "id": "markdown-tip-dialect-not-universal",
          "title": "Dialect beats “universal Markdown”",
          "body": "CommonMark, GitHub Flavored Markdown, and tool dialects disagree on tables, autolinks, and HTML passthrough. Pin the renderer (GFM, MDX, static-site engine) before blaming the authoring syntax.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "categories": [
        "markup",
        "docs"
      ],
      "overview": "A lightweight plain-text authoring format for structured docs — common for READMEs and static pages. Treat it as markup + tooling, not a programming language: behaviour (loops, imports) comes from template engines or site generators, not from core Markdown itself.",
      "learning_curve": "Very gentle — Markdown is one of the simplest markup formats. Most developers learn it in under an hour. Extended Markdown (GFM, MDX, MathJax) adds moderate complexity. The forgiving parser means errors just produce plain text.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Markdown is the usual plain-text choice for developer docs, but dialects differ: GitHub Flavored Markdown (GFM) is common on GitHub; other tools target CommonMark or their own rules. Ecosystem: CommonMark, markdownlint, Pandoc (conversion), MDX (components where supported). Typical homes include GitHub, wikis, Jupyter, notebooks, and editors—feature sets are not identical everywhere.",
      "common_use_cases": [
        "Documentation",
        "README files",
        "Blog posts",
        "Notes"
      ],
      "docs_url": "https://www.markdownguide.org/",
      "best_for": [
        "technical documentation authoring",
        "README and project wiki writing",
        "static site and blog content creation",
        "README files, docs sites, and developer communication on GitHub"
      ],
      "weak_at": [
        "Complex layout documents needing precise WYSIWYG pagination control",
        "Structured data interchange without companion schema validation",
        "Interactive applications requiring executable logic in documents"
      ],
      "official_url": "https://commonmark.org/",
      "paradigm": [
        "markup",
        "lightweight",
        "prose-first"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Markup or data format (not a general-purpose programming language)",
        "runtime": "Parsed and validated by tools, pipelines, or hosts — no single standard VM",
        "memory": "Not an executable program on its own; hosts manage storage and memory"
      }
    },
    {
      "id": "latex",
      "name": "LaTeX",
      "color": "#008080",
      "description": "A typesetting system for producing beautiful documents — the standard for academic papers. Write structured content; LaTeX handles layout, cross-references, and bibliography formatting.",
      "whoItIsFor": "Academics, researchers, and anyone writing papers with math — the gold standard for typesetting theses, journals, and conference proceedings.",
      "commonUses": [
        "Academic papers",
        "Theses",
        "Books",
        "Math-heavy documents"
      ],
      "patterns": [
        {
          "title": "Document",
          "code": "\\documentclass{article}\n\\begin{document}\nHello\n\\end{document}",
          "explanation": "Minimal LaTeX document with documentclass, begin/end document — the shell for any paper or report."
        },
        {
          "title": "Minimal document",
          "code": "\\documentclass{article}\n\\begin{document}\nHello, \\LaTeX.\n\\end{document}",
          "explanation": "Choose a document class, then wrap visible content between `\\begin{document}` and `\\end{document}`."
        },
        {
          "title": "Inline and display math",
          "code": "Einstein: $E=mc^2$. Also\n\\[\n  \\int_0^1 x^2\\,dx = \\frac{1}{3}\n\\]",
          "explanation": "Single `$...$` is inline math; `\\[...\\]` sets display (unnumbered) equations."
        },
        {
          "title": "PDF compilation / Bibtex boundary - LaTeX's polyglot bridge",
          "code": "% LaTeX's polyglot boundary is its compilation pipeline:\n% .tex → LaTeX engine → .pdf\n% with BibTeX/Biber for references.\n\n% Include external graphics\n\\includegraphics[width=\\textwidth]{figure.png}\n\n% Embed other languages\n\\begin{lstlisting}[language=Python]\ndef hello():\n    print(\"LaTeX bridges to Python\")\n\\end{lstlisting}\n\n% Bibliography (BibTeX bridge)\n\\cite{knuth1984}\n% references.bib:\n% @article{knuth1984, author={Knuth}, ...}\n\n% TikZ (embedded graphics language)\n\\begin{tikzpicture}\n  \\draw (0,0) circle (1cm);\n  \\node at (0,0) {Hello};\n\\end{tikzpicture}",
          "explanation": "LaTeX's polyglot boundary is its compilation pipeline: .tex source files are compiled by pdfLaTeX/LuaLaTeX/XeLaTeX into PDF, with BibTeX/Biber for reference management. The listings package embeds any programming language's source code. TikZ/pgf creates vector graphics inline. \\includegraphics bridges to external images. LuaLaTeX embeds Lua for programmatic document generation. This makes LaTeX the universal document preparation bridge that connects text, math, code, graphics, and bibliography data."
        }
      ],
      "libraries": [
        {
          "name": "CTAN",
          "url": "https://ctan.org/",
          "type": "Packages"
        }
      ],
      "docs": [
        {
          "name": "LaTeX project",
          "url": "https://www.latex-project.org/help/documentation/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "% LaTeX variables (counters and commands)\n% Counters\n\\newcounter{sectionnum}\n\\setcounter{sectionnum}{5}\n\\stepcounter{sectionnum}  % now 6\n\n% Command definitions (like variables)\n\\newcommand{\\myvar}{Hello, LaTeX!}\n\\myvar  % produces: Hello, LaTeX!\n\n% Lengths (dimension variables)\n\\newlength{\\mywidth}\n\\setlength{\\mywidth}{3cm}\n\n% Package options as variables\n\\def\\papertype{a4}\n\\def\\fontsize{12pt}",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "% LaTeX conditionals\n% IfTeX commands\n\\ifnum\\value{page}>1\n  \\typeout{Multi-page document}\n\\fi\n\n\\ifdim\\mywidth>5cm\n  \\typeout{Wide}\n\\fi\n\n% Boolean tests\n\\newif\\ifdraft\n\\drafttrue\n\\ifdraft\n  \\typeout{Draft mode}\n\\else\n  \\typeout{Final mode}\n\\fi\n\n% ifthen package\n\\ifthenelse{\\equal{#1}{a}}{Option A}{Other}",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "% LaTeX loops\n% foreach (etoolbox)\n\\foreach \\x in {1,...,5} {\n  \\section{Section \\x}\n}\n\n% whiledo\n\\newcounter{count}\n\\whiledo{\\value{count}<10}{\n  \\stepcounter{count}\n}\n\n% Map over lists (etoolbox)\n\\forcsvlist{\\dosomething}{a,b,c}\n\n% pgffor (TikZ)\n\\foreach \\i in {1,...,10} {\n  \\node at (\\i,0) {\\i};\n}",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "% LaTeX functions (commands)\n% New command (0 arguments)\n\\newcommand{\\greeting}{Hello, World!}\n\n% New command (with arguments)\n\\newcommand{\\hello}[1]{Hello, #1!}\n\\hello{LaTeX}  % produces: Hello, LaTeX!\n\n% Optional argument\n\\newcommand{\\helloopt}[2][World]{Hello, #1! #2}\n\n% Renew command\n\\renewcommand{\\emph}[1]{\\textbf{#1}}\n\n% Environment (like a block function)\n\\newenvironment{myquote}{\\begin{quote}\\itshape}{\\end{quote}}",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "% LaTeX performance:\n% 1. Compilation is slow (multi-pass for references)\n% 2. BibTeX/Biber for bibliographies (separate pass)\n% 3. TikZ/pgfplots add significant compile time\n% 4. Large documents benefit from \\includeonly\n% 5. \\externalize for TikZ caching\n% 6. LuaLaTeX is faster than pdfLaTeX for some docs\n% 7. Precompiled headers (mylatexformat)\n\n% Speed up: compile only changed chapters\n\\includeonly{chapter2,chapter3}",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "% LaTeX has no class/OOP system in the programming sense.\n% \\documentclass selects a document template,\n% not an OOP class.\n% Reusability comes from packages (\\usepackage)\n% and class files (.cls), which define\n% document structure and styling, not OOP behavior.\n\n\\documentclass{article}  % template, not OOP\n\\documentclass{book}     % different template",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "% LaTeX strings\n\\def\\myname{LaTeX}\nHello, \\myname!  % produces: Hello, LaTeX!\n\n% String operations (etoolbox)\n\\ifdefstring{\\myvar}{test}{Match}{No match}\n\\ifdefempty{\\myvar}{Empty}{Not empty}\n\n% Concatenation\n\\def\\fullname{\\firstname\\ \\lastname}\n\n% Verbatim (raw text)\n\\verb|\\textbf{not bold}|\n\\begin{verbatim}\n  Raw text with \\special chars\n\\end{verbatim}\n\n% Special characters\n\\% \\& \\$ \\# \\_ \\{ \\}",
          "difficulty": "basic"
        },
        "errors": {
          "code": "% LaTeX error handling\n% LaTeX stops on errors by default\n% Common error types:\n%   ! Undefined control sequence\n%   ! Missing $ inserted\n%   ! Too many }'s\n%   ! File not found\n\n% Continue past errors\n\\let\\errorend=\\end  % never do this in production\n\n% Try to continue\n\\begin{document}\n% If error, press 's' to skip or 'x' to exit\n\n% Log warnings\n\\typeout{Warning: custom message}\n\\PackageWarning{mypkg}{Possible issue}\n\n% Assertions\n\\ifnum\\value{page}>1000\n  \\PackageError{mypkg}{Too many pages}{Reduce content.}\n\\fi",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "% LaTeX imports\n% Package loading\n\\usepackage{amsmath}      % math\n\\usepackage{graphicx}     % images\n\\usepackage{hyperref}     % links\n\n% Input files\n\\input{preamble}          % insert file contents\n\\include{chapter1}       % like input but starts new page\n\n% Bibliography\n\\bibliographystyle{plain}\n\\bibliography{references}\n\n% Conditional loading\n\\IfFileExists{local.tex}{\\input{local}}{}\n\n% Require packages (preamble only)\n\\RequirePackage{etoolbox}",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "latex-tip-engine",
          "title": "Engine and package set define the language",
          "body": "pdfLaTeX vs XeLaTeX/LuaLaTeX and package versions decide font/encoding behaviour. Pin a TeX distribution, not an npm-style lockfile metaphor.",
          "tag": "markup",
          "status": "curated"
        }
      ],
      "categories": [
        "markup",
        "docs"
      ],
      "overview": "A typesetting system for producing beautiful documents — the standard for academic papers. Write structured content; LaTeX handles layout, cross-references, and bibliography formatting. Academics, researchers, and anyone writing papers with math — the gold standard for typesetting theses, journals, and conference proceedings.\n\nTypical projects include Academic papers, Theses, Books. CTAN's 6000+ packages and Overleaf ease academic publishing, though LaTeX error messages and macros take patience to learn.",
      "learning_curve": "Steep — LaTeX is a typesetting system, not a programming language. The macro system is Turing-complete but counter-intuitive. Error messages are famously cryptic. However, template-based usage (article, beamer) is approachable. Overleaf makes it more accessible.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "LaTeX is the standard for academic publishing (math, physics, CS). CTAN provides 6000+ packages. Overleaf is the dominant online editor. BibTeX/Biber for references. TikZ for diagrams. Beamer for presentations. LuaLaTeX adds scripting. Essential for anyone writing research papers.",
      "common_use_cases": [
        "Academic papers",
        "Theses",
        "Books",
        "Math-heavy documents"
      ],
      "docs_url": "https://www.latex-project.org/help/documentation/",
      "best_for": [
        "academic paper and thesis typesetting",
        "mathematical document preparation",
        "bibliography and citation management",
        "Academic papers, theses, and journal submissions with BibTeX bibliographies"
      ],
      "weak_at": [
        "Rapid WYSIWYG marketing collateral without compilation pipelines",
        "Web-first documentation without PDF export requirements",
        "Collaborative editing workflows expecting Google Docs-style real-time sync"
      ],
      "official_url": "https://www.latex-project.org/",
      "paradigm": [
        "markup",
        "typesetting",
        "declarative"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Markup or data format (not a general-purpose programming language)",
        "runtime": "Parsed and validated by tools, pipelines, or hosts — no single standard VM",
        "memory": "Not an executable program on its own; hosts manage storage and memory"
      }
    },
    {
      "id": "sass",
      "name": "Sass/SCSS",
      "color": "#cf649a",
      "description": "A CSS preprocessor with variables, nesting, and mixins — compiles to plain CSS. Lets you write DRY, maintainable stylesheets that scale across projects and components.",
      "whoItIsFor": "Frontend developers who want DRY, maintainable stylesheets — variables, nesting, mixins, and partials keep complex CSS organized and scalable.",
      "commonUses": [
        "Web styling",
        "Design systems",
        "Theme generation"
      ],
      "patterns": [
        {
          "title": "Variable",
          "code": "$primary: #6d5cff;\n.btn { color: $primary; }",
          "explanation": "Sass variables store tokens like colors and lengths so stylesheets stay DRY and consistent."
        },
        {
          "title": "Nesting",
          "code": ".card {\n  padding: 1rem;\n  h2 { font-size: 1.25rem; }\n  &:hover { box-shadow: 0 2px 8px #0002; }\n}",
          "explanation": "Nested rules mirror HTML structure; `&` refers to the parent selector."
        },
        {
          "title": "Mixin",
          "code": "@mixin flex-center {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n.wrap { @include flex-center; }",
          "explanation": "Mixins bundle declarations you reuse with `@include`."
        },
        {
          "title": "CSS compilation boundary - Sass's polyglot bridge",
          "code": "// Sass's polyglot boundary is CSS compilation:\n// .scss → .css at build time.\n\n// Sass generates CSS that any browser understands\n.btn\n  background: $primary\n  &:hover\n    background: darken($primary, 10%)\n  &--primary\n    @extend %button-base\n\n// Compiles to:\n// .btn { background: #3498db; }\n// .btn:hover { background: #2980b9; }\n// .btn--primary { padding: 8px 16px; ... }\n\n// Integration with build tools\n// webpack: sass-loader\n// Vite: built-in Sass support\n// Rails: asset pipeline\n// PostCSS: postcss-scss plugin",
          "explanation": "Sass's polyglot boundary is CSS compilation: .scss/.sass source files compile to .css at build time, producing standard CSS that any browser or CSS consumer understands. This bridges Sass's programming features (variables, mixins, functions, loops) to the static CSS output. Build tools (webpack, Vite, Rails) integrate Sass compilation into the asset pipeline, making Sass the universal CSS preprocessor that bridges programming concepts to stylesheet output."
        }
      ],
      "libraries": [
        {
          "name": "Sass docs",
          "url": "https://sass-lang.com/documentation/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Sass documentation",
          "url": "https://sass-lang.com/documentation/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// Sass variables\n$primary: #3498db\n$font-size: 16px\n$spacing: 1rem\n\n// Use variables\n.button\n  background: $primary\n  font-size: $font-size\n  padding: $spacing\n\n// Default values\n$border-radius: 4px !default\n\n// Variable interpolation\n#{$property}: $value\n\n// Maps (structured variables)\n$colors: (\"primary\": #3498db, \"danger\": #e74c3c)",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// Sass conditionals\n@if $theme == dark\n  .bg\n    background: #333\n@else if $theme == light\n  .bg\n    background: #fff\n@else\n  .bg\n    background: #eee\n\n// Ternary\n$color: if($dark, #fff, #333)\n\n// Map-based conditions\n@each $name, $color in $colors\n  .text-#{$name}\n    color: $color",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "// Sass loops\n// @for\n@for $i from 1 through 5\n  .col-#{$i}\n    width: percentage($i / 12)\n\n// @each\n@each $size in (sm, md, lg)\n  .text-#{$size}\n    font-size: map-get($font-sizes, $size)\n\n// @while\n$i: 1\n@while $i <= 5\n  .mt-#{$i}\n    margin-top: #{$i * 8}px\n  $i: $i + 1",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "// Sass functions\n@function calculate-rem($px)\n  @return ($px / 16) * 1rem\n\n// Use function\n.title\n  font-size: calculate-rem(24px)\n\n// Built-in functions\nlighten($color, 10%)\ndarken($color, 10%)\nmap-get($map, $key)\nstr-length($string)\nnth($list, $n)\n\n// Function with default parameter\n@function spacing($multiplier: 1)\n  @return $multiplier * $base-spacing",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "// Sass performance:\n// 1. Compiled at build time (no runtime cost)\n// 2. Dart Sass is the primary implementation\n// 3. @use modules improve compilation speed\n// 4. Large @extend chains can bloat output\n// 5. Use @use over @import (deprecated)\n// 6. Source maps for debugging\n\n// Prefer composition over @extend\n.card\n  padding: $spacing\n\n.card-special\n  @extend .card  // can bloat\n  // Better: @include or @use",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "// Sass has no OOP classes.\n// Reusability comes from:\n// - @mixin (reusable style blocks)\n// - %placeholder (extended-only selectors)\n// - @use modules (namespaced imports)\n// - Functions (@function)\n// These are NOT classes in the OOP sense.\n// Use mixins and placeholders for shared styles.\n\n@mixin flex-center\n  display: flex\n  align-items: center\n  justify-content: center\n\n%button-base\n  padding: 8px 16px\n  border: none\n  cursor: pointer",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "// Sass strings\n$name: \"Sass\"\n$greeting: \"Hello, \" + $name  // interpolation alternative\n\n// String functions\nstr-length($name)        // 4\nto-upper-case($name)     // \"SASS\"\nto-lower-case($name)      // \"sass\"\nstr-index($name, \"s\")    // 1 (1-indexed)\nstr-insert(\"Ss\", \"as\", 2) // \"Sass\"\nstr-slice($name, 1, 3)   // \"Sas\"\n\n// Interpolation\n#{$property}: #{$value}\n.selector-#{$name}\n  content: \"#{$name}\"",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Sass error handling\n// @error stops compilation\n@mixin theme($mode)\n  @if $mode != light and $mode != dark\n    @error \"Invalid theme: #{$mode}. Use light or dark.\"\n  @content\n\n// @warn continues compilation\n@warn \"Deprecated: use @use instead of @import\"\n\n// @debug for development\n@debug \"Current value: #{$variable}\"\n\n// Try/catch not available\n// Sass compilation either succeeds or fails\n// Runtime CSS errors handled by browser",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// Sass imports\n// @use (modern, namespaced)\n@use 'base' as base\n@use 'components/buttons' as btn\n\n.button\n  color: base.$primary\n  @include btn.hover-style\n\n// @forward (re-export)\n@forward 'colors'\n@forward 'typography'\n\n// @import (deprecated, use @use)\n@import 'base'\n\n// Partials (files starting with _)\n// _colors.scss is imported as 'colors'",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "sass-tip-modules",
          "title": "Use the module system, not @import forever",
          "body": "@use/@forward replace legacy @import. Load-order and namespacing bugs dominate Sass issues.",
          "tag": "css",
          "status": "curated"
        }
      ],
      "categories": [
        "web",
        "css"
      ],
      "overview": "A CSS preprocessor with variables, nesting, and mixins — compiles to plain CSS. Lets you write DRY, maintainable stylesheets that scale across projects and components. Frontend developers who want DRY, maintainable stylesheets — variables, nesting, mixins, and partials keep complex CSS organized and scalable.\n\nTypical projects include Web styling, Design systems, Theme generation. Dart Sass is the primary implementation; LibSass is deprecated.",
      "learning_curve": "Gentle — SCSS syntax is a superset of CSS, so CSS knowledge transfers directly. Sass indented syntax has a steeper learning curve. Advanced features (maps, functions, @extend vs @mixin) add moderate complexity. Dart Sass is the modern implementation.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Sass is the most popular CSS preprocessor. Dart Sass is the primary implementation (LibSass deprecated). Used in Rails, React, Vue, Angular projects. Sass Modules (@use) replaced @import. Complementary to PostCSS and CSS-in-JS. Wide adoption in design systems.",
      "common_use_cases": [
        "Web styling",
        "Design systems",
        "Theme generation"
      ],
      "docs_url": "https://sass-lang.com/documentation/",
      "best_for": [
        "maintainable large-scale CSS architecture",
        "design system variable and mixin libraries",
        "DRY stylesheet authoring with nesting",
        "Large CSS codebases using variables, nesting, and mixin reuse"
      ],
      "weak_at": [
        "Greenfield projects where native CSS nesting and variables suffice",
        "Runtime theming without a Sass compilation build step",
        "Back-end teams without Node-based front-end toolchain familiarity"
      ],
      "official_url": "https://sass-lang.com/",
      "paradigm": [
        "declarative",
        "stylesheet",
        "meta"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Markup or data format (not a general-purpose programming language)",
        "runtime": "Parsed and validated by tools, pipelines, or hosts — no single standard VM",
        "memory": "Not an executable program on its own; hosts manage storage and memory"
      }
    },
    {
      "id": "less",
      "name": "Less",
      "color": "#1d365d",
      "description": "A CSS preprocessor with variables and mixins — similar goals to Sass with JS-based tooling. Runs in-browser or via Node; favours simplicity over Sass's more powerful feature set.",
      "whoItIsFor": "Frontend developers in projects already using Less (e.g., older Bootstrap) — variables, mixins, and math operations for maintainable CSS at scale.",
      "commonUses": [
        "Web styling",
        "Bootstrap themes"
      ],
      "patterns": [
        {
          "title": "Variable",
          "code": "@primary: #6d5cff;\n.btn { color: @primary; }",
          "explanation": "At-sign variables for colours, sizes, and values — Less's mechanism for DRY stylesheets."
        },
        {
          "title": "Variables",
          "code": "@brand: #2a6;\n.button { background: @brand; color: contrast(@brand); }",
          "explanation": "At-sign variables for colours, sizes, and values — Less's mechanism for DRY stylesheets."
        },
        {
          "title": "Nested rules",
          "code": "nav {\n  ul { margin: 0; }\n  a { text-decoration: none; &:hover { text-decoration: underline; } }\n}",
          "explanation": "LESS nests like Sass; `&` is the parent selector in hover states."
        },
        {
          "title": "CSS compilation boundary - Less's polyglot bridge",
          "code": "// Less's polyglot boundary is CSS compilation:\n// .less → .css at build time.\n// Less generates standard CSS that any browser understands.\n\n.button {\n  background: @primary;\n  &:hover {\n    background: darken(@primary, 10%);\n  }\n  &--primary {\n    &:extend(.button);\n    }\n}\n\n// Compiles to standard CSS:\n// .button { background: #3498db; }\n// .button:hover { background: #2980b9; }\n// .button--primary { background: #3498db; }\n\n// Integration with build tools\n// webpack: less-loader\n// Vite: built-in Less support\n// Less CLI: lessc input.less output.css",
          "explanation": "Less's polyglot boundary is CSS compilation: .less source files compile to .css at build time, producing standard CSS that any browser understands. This bridges Less's programming features (variables, mixins, guards, functions) to the static CSS output. Build tools (webpack, Vite, Less CLI) integrate Less compilation into the asset pipeline, making Less a CSS preprocessor that bridges programming concepts to stylesheet output."
        }
      ],
      "libraries": [
        {
          "name": "Less docs",
          "url": "https://lesscss.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Less documentation",
          "url": "https://lesscss.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// Less variables\n@primary: #3498db;\n@font-size: 16px;\n@spacing: 1rem;\n\n// Use variables\n.button {\n  background: @primary;\n  font-size: @font-size;\n  padding: @spacing;\n}\n\n// Default values\n@border-radius: 4px; // overridden if already defined\n\n// Variable interpolation\n@prop: color;\n@{prop}: #333;\n\n// Maps (Less 3.5+)\n@colors: {\n  primary: #3498db;\n  danger: #e74c3c;\n}",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// Less conditionals\n// Guarded mixins (common pattern)\n.button(@theme) when (@theme = dark) {\n  background: #333;\n  color: #fff;\n}\n.button(@theme) when (@theme = light) {\n  background: #fff;\n  color: #333;\n}\n.button(dark);  // outputs dark variant\n\n// CSS custom properties with conditions\n// (Less compiles at build time; runtime conditions\n// are handled by CSS custom properties)",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "// Less loops (recursive mixins)\n// Generate utility classes\n.generate-spacing(@i) when (@i > 0) {\n  .mt-@{i} { margin-top: (@i * 8px); }\n  .mb-@{i} { margin-bottom: (@i * 8px); }\n  .generate-spacing((@i - 1));\n}\n.generate-spacing(5);\n\n// Using range with each (Less 3.9+)\neach(@colors, {\n  .text-@{key} {\n    color: @value;\n  }\n})",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "// Less functions (mixin guards + built-in)\n// Built-in functions\nlighten(@primary, 10%)\ndarken(@primary, 10%)\nfadeout(@primary, 50%)\nround(2.5px)   // 3px\nceil(2.1px)    // 3px\n\n// Mixin as function (returns value)\n.calc-rem(@px) {\n  @result: (@px / 16) * 1rem;\n}\n\n// Use mixin function\n.title {\n  .calc-rem(24px);\n  font-size: @result;\n}",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "// Less performance:\n// 1. Compiled at build time (no runtime cost)\n// 2. Less.js is the reference implementation\n// 3. @import inline vs reference for smaller output\n// 4. Deep mixin nesting can bloat output\n// 5. Source maps for debugging\n// 6. Consider switching to Dart Sass for\n//    better performance and features",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "// Less has no OOP classes.\n// Reusability comes from:\n// - Mixins (reusable style blocks)\n// - Parametric mixins (mixin functions)\n// - Extend (selector merging, like Sass %placeholder)\n// - Variables and maps\n// These are NOT classes in the OOP sense.\n// Use mixins and extend for shared styles.\n\n.border-radius(@radius: 4px) {\n  border-radius: @radius;\n}\n\n.button {\n  .border-radius(8px);\n}",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "// Less strings\n@name: \"Less\";\n@greeting: ~\"Hello, @{name}!\";  // escaped string\n\n// String functions\ncolor: data-uri('image/png', 'icon.png'); // inline\n// escape(@string)\n// e(@string)  // escape\n// %(@format, @args...)  // format\n\n// Interpolation\n.selector-@{name} {\n  content: @{name};\n}\n\n// String concatenation\n@base: \"/assets\";\n@full: \"@{base}/images/logo.png\";",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Less error handling\n// Less stops on errors by default\n// Common errors:\n// - Undefined variable\n// - Missing closing brace\n// - Circular mixin calls\n\n// @strict-imports flag\n// strictMath: true requires parens for math\n\n// @error directive (Less 3.13+)\n.mixin(@value) when not(isnumber(@value)) {\n  // Would need guard, not @error\n}\n\n// Runtime CSS errors handled by browser\n// Less compilation either succeeds or fails",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// Less imports\n// @import (modern, recommended)\n@import 'base';        // process and include\n@import (reference) 'components/buttons'; // include but don't output\n@import (inline) 'legacy.css';  // include raw CSS\n@import (optional) 'local';     // no error if missing\n\n// @import options\n// @import (once) 'theme';      // include only once\n// @import (multiple) 'theme';  // include every time\n\n// Note: Less uses @import, not @use\n// (Less has not adopted a module system like Sass)",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "less-tip-compile-target",
          "title": "Pin the Less compiler and CSS target",
          "body": "Less is a compile-to-CSS dialect. Plugin and compiler version mismatches beat “shell portability” tips.",
          "tag": "css",
          "status": "curated"
        }
      ],
      "categories": [
        "web",
        "css"
      ],
      "overview": "A CSS preprocessor with variables and mixins — similar goals to Sass with JS-based tooling. Runs in-browser or via Node; favours simplicity over Sass's more powerful feature set. Frontend developers in projects already using Less (e.g., older Bootstrap) — variables, mixins, and math operations for maintainable CSS at scale.\n\nTypical projects include Web styling, Bootstrap themes. Sass has largely eclipsed Less in new projects.",
      "learning_curve": "Gentle — Less syntax is close to CSS, making it easy to learn incrementally. The main differences are variables (@), mixins, and guards. Advanced features (parametric mixins, detached rulesets, merge) add moderate complexity. Less has fewer features than Sass but a gentler learning curve.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Less was the first major CSS preprocessor (2009). Used by Bootstrap 3-4, Semantic UI, and many enterprise projects. Less.js is the reference implementation. Sass has largely eclipsed Less in new projects. Less's simpler feature set makes it easier to learn but less powerful than Sass.",
      "common_use_cases": [
        "Web styling",
        "Bootstrap themes"
      ],
      "docs_url": "https://lesscss.org/",
      "best_for": [
        "flexible CSS preprocessing with variables",
        "Bootstrap theme customisation",
        "client-side style sheet organisation",
        "Bootstrap-era theme customization with Less variables and mixins"
      ],
      "weak_at": [
        "Modern Vite or esbuild pipelines standardized on Sass or PostCSS",
        "Design systems requiring first-class CSS module integration today",
        "Server-side rendering stacks without Less compiler dependencies"
      ],
      "official_url": "https://lesscss.org/",
      "paradigm": [
        "declarative",
        "stylesheet",
        "meta"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Markup or data format (not a general-purpose programming language)",
        "runtime": "Parsed and validated by tools, pipelines, or hosts — no single standard VM",
        "memory": "Not an executable program on its own; hosts manage storage and memory"
      }
    },
    {
      "id": "handlebars",
      "name": "Handlebars",
      "color": "#f0772b",
      "description": "A logic-less templating language — mustache-style {{ }} placeholders with helpers. Compile templates once, render many times with different data contexts.",
      "whoItIsFor": "Web developers rendering server-side HTML or email templates — logic-less templates with helpers, partials, and safe HTML escaping built in.",
      "commonUses": [
        "Email templates",
        "Server-side rendering",
        "Static site generation"
      ],
      "patterns": [
        {
          "title": "Template",
          "code": "<h1>{{title}}</h1>\n{{#each items}}<li>{{this}}</li>{{/each}}",
          "explanation": "Iteration with {{#each}} over a list — Handlebars loops through arrays without full logic in templates."
        },
        {
          "title": "Conditionals",
          "code": "{{#if user}}\n  Hello, {{user.name}}\n{{else}}\n  Please sign in.\n{{/if}}",
          "explanation": "`#if` chooses blocks based on truthy values; paths use dots for properties."
        },
        {
          "title": "Each loop",
          "code": "<ul>\n{{#each items}}\n  <li>{{this}}</li>\n{{/each}}\n</ul>",
          "explanation": "`#each` iterates arrays; `this` is the current element."
        },
        {
          "title": "Template compilation boundary - Handlebars's polyglot bridge",
          "code": "{{!-- Handlebars polyglot boundary: template compilation --}}\n{{!-- Templates compile to JS functions that produce HTML --}}\n{{!-- Any runtime (Node, browser, server) can execute them --}}\n\n{{!-- Precompile for production --}}\n{{!-- handlebars client-template.hbs -f templates.js --}}\n\n{{!-- Use in Node.js server --}}\nconst template = Handlebars.compile(source);\nconst html = template({ title: 'Hello' });\n\n{{!-- Use in browser --}}\nconst html = Handlebars.templates.myTemplate(data);\n\n{{!-- Use with frameworks --}}\n{{!-- Ember.js: built-in Handlebars --}}\n{{!-- Mustache: compatible subset --}}\n{{!-- Express: express-handlebars --}}",
          "explanation": "Iteration with {{#each}} over a list — Handlebars loops through arrays without full logic in templates."
        }
      ],
      "libraries": [
        {
          "name": "Handlebars docs",
          "url": "https://handlebarsjs.com/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Handlebars guide",
          "url": "https://handlebarsjs.com/guide/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "{{!-- Handlebars variables --}}\n{{name}}                    {{!-- simple variable --}}\n{{user.email}}              {{!-- nested path --}}\n{{lookup user 'email'}}     {{!-- dynamic lookup --}}\n\n{{!-- Register a variable --}}\n{{#with user}}\n  {{firstName}} {{lastName}}\n{{/with}}\n\n{{!-- No variable declaration; data comes from context --}}",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "{{!-- Handlebars conditionals --}}\n{{#if isAdmin}}\n  <span class=\"badge\">Admin</span>\n{{else}}\n  <span class=\"badge\">User</span>\n{{/if}}\n\n{{!-- unless (negated if) --}}\n{{#unless isHidden}}\n  <p>Visible content</p>\n{{/unless}}\n\n{{!-- Custom conditional helper --}}\nHandlebars.registerHelper('isEqual', function(a, b, options) {\n  return a === b ? options.fn(this) : options.inverse(this);\n});\n\n{{#isEqual role 'admin'}}Admin panel{{/isEqual}}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "{{!-- Handlebars loops --}}\n{{#each users}}\n  <li>{{this.name}} ({{@index}})</li>\n{{/each}}\n\n{{!-- With else (empty list) --}}\n{{#each items}}\n  <p>{{this}}</p>\n{{else}}\n  <p>No items found.</p>\n{{/each}}\n\n{{!-- Nested each --}}\n{{#each departments}}\n  <h2>{{this.name}}</h2>\n  {{#each this.employees}}\n    <p>{{this.name}}</p>\n  {{/each}}\n{{/each}}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "{{!-- Handlebars functions (helpers) --}}\n{{!-- Built-in helpers --}}\n{{formatDate date}}               {{!-- custom helper --}}\n{{log \"Debug message\"}}            {{!-- debug --}}\n{{lookup obj key}}                 {{!-- dynamic access --}}\n\n{{!-- Register a custom helper --}}\nHandlebars.registerHelper('formatDate', function(date) {\n  return new Date(date).toLocaleDateString();\n});\n\n{{!-- Block helper --}}\nHandlebars.registerHelper('bold', function(options) {\n  return '<strong>' + options.fn(this) + '</strong>';\n});\n\n{{#bold}}{{name}}{{/bold}}",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "{{!-- Handlebars performance: --}}\n{{!-- 1. Precompiled templates are very fast --}}\n{{!-- 2. Runtime compilation is slower (avoid in production) --}}\n{{!-- 3. Large lists with #each can be slow --}}\n{{!-- 4. Use Handlebars.precompile() for production --}}\n{{!-- 5. Partials are compiled once and reused --}}\n{{!-- 6. No runtime dependency with precompiled templates --}}",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "{{!-- Handlebars has no class/OOP system. --}}\n{{!-- Templates are logic-less by design. --}}\n{{!-- Reusability comes from: --}}\n{{!-- - Partials (template includes) --}}\n{{!-- - Helpers (functions) --}}\n{{!-- - Decorators (metadata) --}}\n{{!-- These are NOT classes in the OOP sense. --}}",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "{{!-- Handlebars strings --}}\n{{name}}                          {{!-- output variable --}}\n{{formatName user.firstName user.lastName}}  {{!-- helper --}}\n\n{{!-- String interpolation in helpers --}}\nHandlebars.registerHelper('greet', function(name) {\n  return 'Hello, ' + name + '!';\n});\n\n{{!-- Escaped vs unescaped --}}\n{{{rawHtml}}}    {{!-- triple braces = unescaped --}}\n{{escapedHtml}}  {{!-- double braces = escaped --}}\n\n{{!-- String concatenation is in helpers, not templates --}}",
          "difficulty": "basic"
        },
        "errors": {
          "code": "{{!-- Handlebars error handling --}}\n{{!-- Strict mode throws on missing properties --}}\n{{!-- Default: silently returns empty string --}}\n{{!-- \n{{!-- Compile options: --}}\n{{!-- strict: true - throw on undefined --}}\n{{!-- noEscape: true - don't escape HTML --}}\n{{!-- \n{{!-- Custom error helpers --}}\nHandlebars.registerHelper('required', function(value, options) {\n  if (!value) throw new Error('Required field missing');\n  return value;\n});\n\n{{!-- Runtime errors are JavaScript exceptions --}}\n{{!-- Compile errors show line/column --}}",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "{{!-- Handlebars imports (partials) --}}\n{{!-- Register a partial --}}\nHandlebars.registerPartial('nav', '<nav>{{title}}</nav>');\n\n{{!-- Use a partial --}}\n{{> nav title=\"Home\"}}\n\n{{!-- Dynamic partial --}}\n{{> (lookup . 'partialName') }}\n\n{{!-- Partial with context --}}\n{{> userCard user}}\n\n{{!-- Inline partial --}}\n{{#*inline \"myPartial\"}}\n  <span>{{content}}</span>\n{{/inline}}",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "handlebars-tip-escape-for-the-output-context",
          "title": "Escape for the output context",
          "body": "In Handlebars, the dangerous bug is often not the syntax but the context shift: HTML, attribute, URL, and script contexts all need different escaping. If data can cross a trust boundary, sanitize it for that exact output surface.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "handlebars-tip-keep-logic-out-of-the-template-when-it-grows",
          "title": "Keep logic out of the template when it grows",
          "body": "Handlebars stays pleasant when templates stay declarative. Once you start encoding business rules inside the view layer, debugging becomes guesswork and the same rule gets duplicated in several places.",
          "tag": "architecture",
          "status": "curated"
        }
      ],
      "categories": [
        "web",
        "templating"
      ],
      "overview": "A logic-less templating language — mustache-style {{ }} placeholders with helpers. Compile templates once, render many times with different data contexts. Web developers rendering server-side HTML or email templates — logic-less templates with helpers, partials, and safe HTML escaping built in.\n\nTypical projects include Email templates, Server-side rendering, Static site generation.",
      "learning_curve": "Gentle — Handlebars is intentionally logic-less, with minimal syntax ({{}}, {{#if}}, {{#each}}). Most developers learn it in under an hour. Custom helpers add moderate complexity. The 'logic-less' philosophy means complex logic belongs in the data layer, not templates.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Handlebars is one of the most popular template engines. Used by Ember.js, Express (via express-handlebars), and many email template systems. Compatible with Mustache (superset). Precompiled templates have no runtime dependency. Less feature-rich than Pug or EJS but intentionally so — enforces separation of logic and presentation.",
      "common_use_cases": [
        "Email templates",
        "Server-side rendering",
        "Static site generation"
      ],
      "docs_url": "https://handlebarsjs.com/guide/",
      "best_for": [
        "email template authoring with logic helpers",
        "Server-side HTML rendering",
        "static site generation with partials",
        "Server-side HTML rendering with Mustache-compatible partials"
      ],
      "weak_at": [
        "Highly interactive client apps better served by component frameworks",
        "Complex conditional UI state without helper proliferation and debugging pain",
        "Type-safe template contracts comparable to JSX or Svelte compile checks"
      ],
      "official_url": "https://handlebarsjs.com/",
      "paradigm": [
        "logic-less",
        "templating",
        "declarative"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Markup or data format (not a general-purpose programming language)",
        "runtime": "Parsed and validated by tools, pipelines, or hosts — no single standard VM",
        "memory": "Not an executable program on its own; hosts manage storage and memory"
      }
    },
    {
      "id": "pug",
      "name": "Pug",
      "color": "#a86454",
      "description": "An indentation-based HTML template engine — formerly Jade — common for Express views and static HTML generation.",
      "whoItIsFor": "Node.js developers who prefer terse, whitespace-significant HTML — compiles to clean markup and supports mixins, includes, and template inheritance.",
      "commonUses": [
        "Express views",
        "Static HTML generation"
      ],
      "patterns": [
        {
          "title": "Template",
          "code": "doctype html\nhtml\n  body\n    h1 Hello",
          "explanation": "Indentation replaces angle brackets."
        },
        {
          "title": "Tags and classes",
          "code": "doctype html\nhtml(lang=\"en\")\n  body\n    h1.title Hello\n    p.lead Welcome.",
          "explanation": "Indentation defines nesting; `.class` and `#id` shorthand attach to tags."
        },
        {
          "title": "Attributes",
          "code": "a.button(href=\"/docs\" target=\"_blank\" rel=\"noopener\") Read more",
          "explanation": "Attributes sit in parentheses after the tag name."
        },
        {
          "title": "HTML compilation boundary - Pug's polyglot bridge",
          "code": "// Pug polyglot boundary: template compilation\n// .pug → HTML at build time\n// Pug compiles to JS functions that produce HTML\n\n// Express integration\napp.set('view engine', 'pug');\napp.render('index', { title: 'Hello' });\n\n// CLI compilation\n// pug template.pug > output.html\n\n// Webpack/Vite integration\n// pug-loader / vite-plugin-pug\n\n// Runtime rendering\nconst html = pug.render('h1= title', { title: 'Hello' });",
          "explanation": "Pug's polyglot boundary is HTML compilation: .pug templates compile to JavaScript functions that produce HTML strings. Template inheritance (extends/block) enables layout composition, mixins provide reusable components, and includes allow file composition. Build tools (webpack, Vite, Express) integrate Pug compilation, making it a universal template bridge that connects data from any backend to HTML output with minimal syntax overhead."
        }
      ],
      "libraries": [
        {
          "name": "Pug docs",
          "url": "https://pugjs.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Pug reference",
          "url": "https://pugjs.org/api/getting-started.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// Pug variables\n- const name = 'Pug'\n- const items = ['apple', 'banana', 'cherry']\n\nh1= title\np Hello, #{name}!\n\n// Attribute interpolation\na(href=`/user/${id}`) Profile\n\n// Unbuffered code (runs at compile time)\n- const greeting = `Hello, ${name}!`",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// Pug conditionals\nif isAdmin\n  span.badge Admin\nelse if isEditor\n  span.badge Editor\nelse\n  span.badge User\n\n// Unless (negated if)\nunless isHidden\n  p This is visible\n\n// Ternary in attributes\ndiv(class=isActive ? 'active' : 'inactive')",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Pug loops\neach item in items\n  li= item\n\n// With index\neach item, index in items\n  li #{index + 1}: #{item}\n\n// Else clause\neach item in emptyList\n  li= item\nelse\n  li No items found\n\n// While loop (in unbuffered code)\n- let i = 0\nwhile i < 5\n  p= i++",
          "difficulty": "basic"
        },
        "functions": {
          "code": "// Pug mixins (reusable blocks, like functions)\nmixin card(title, content)\n  .card\n    h3= title\n    p= content\n\n+card('Hello', 'World')\n+card('Title', 'Body')\n\n// Mixin with block content\nmixin layout\n  .container\n    block\n\n+layout\n  h1 Page Title\n  p Content here\n\n// Mixin with attributes\nmixin button(text)\n  button(class=attributes.class)= text\n\n+button('Click')(class='primary')",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "// Pug performance:\n// 1. Compiled to JS functions at build time\n// 2. Very fast template rendering\n// 3. Compilation has overhead (use pug-client)\n// 4. No runtime parsing needed\n// 5. Source maps for debugging\n// 6. Use pug-cli for one-off compilation\n\n// Compile once, render many\nconst template = pug.compileFile('template.pug');\nhtml = template({ title: 'Hello' });",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "// Pug has no class/OOP system.\n// Reusability comes from:\n// - Mixins (reusable template blocks)\n// - Template inheritance (extends/block)\n// - Includes (file composition)\n// These are NOT classes in the OOP sense.\n// Use mixins and extends for shared layouts.\n\nextends layout.pug\nblock content\n  p Page-specific content",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "// Pug strings\nh1= 'Hello, Pug!'\np #{name} is #{age} years old\n\n// String interpolation\na(href=`/user/${id}`) Profile\n\n// Buffered code (outputs to template)\np= 'Escaped output: ' + name\np!= 'Unescaped: <strong>bold</strong>'\n\n// Raw text\ndiv.\n  This is a block of\n  plain text content.",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Pug error handling\n// Compile errors show line/column\n// Common errors:\n// - Unexpected token\n// - Incorrect indentation\n// - Undefined variable (if compileDebug)\n\n// Runtime errors\ntry {\n  const html = template(data);\n} catch (err) {\n  console.error('Template error:', err.message);\n}\n\n// Debug mode\nconst template = pug.compile(source, {\n  compileDebug: true,  // includes line numbers\n  debug: true          // outputs token stream\n});",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// Pug includes and extends\n// Include a partial\ninclude ./partials/header.pug\n\n// Template inheritance\n// layout.pug:\nhtml\n  head\n    block title\n  body\n    block content\n\n// page.pug:\nextends layout.pug\n\nblock title\n  title My Page\n\nblock content\n  h1 Hello World\n\n// Include with filters\ninclude:markdown ./readme.md\ninclude:css ./styles.css",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "pug-tip-whitespace-is-syntax-not-style",
          "title": "Whitespace is syntax, not style",
          "body": "Pug uses indentation or whitespace to mark structure, so align blocks consistently and let the editor show invisible characters. One stray space can change meaning, especially when copying snippets between files or chat tools.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "pug-tip-use-the-formatter-before-you-debug-the-logic",
          "title": "Use the formatter before you debug the logic",
          "body": "If the code looks wrong in Pug, run the formatter or linter first. Many apparent syntax bugs are really block-shape problems caused by mixed tabs, inconsistent indentation, or copy-pasted examples.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "categories": [
        "web"
      ],
      "overview": "An indentation-based HTML template engine — formerly Jade — common for Express views and static HTML generation. Node.js developers who prefer terse, whitespace-significant HTML — compiles to clean markup and supports mixins, includes, and template inheritance.\n\nTypical projects include Express views, Static HTML generation.",
      "learning_curve": "Gentle for basic usage — indentation-based syntax is intuitive for developers familiar with Python. Moderate for advanced features (mixins, template inheritance, inline code). The lack of closing tags speeds up writing but can cause indentation errors. Most developers learn the basics in under an hour.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Pug (formerly Jade) is a popular template engine for Node.js. Used with Express, Vue (pug-loader), and other frameworks. Indentation-based syntax reduces boilerplate. Compile-time template compilation is fast. Competing with EJS (more explicit), Handlebars (logic-less), and React JSX (component-based). Declining in popularity as React/Vue component models dominate.",
      "common_use_cases": [
        "Express views",
        "Static HTML generation"
      ],
      "docs_url": "https://pugjs.org/api/getting-started.html",
      "best_for": [
        "concise HTML template authoring",
        "Express view rendering pipeline",
        "inheritance-based static site templating",
        "Node.js server-rendered views with whitespace-sensitive Pug syntax"
      ],
      "weak_at": [
        "Large teams where significant whitespace causes merge conflict pain",
        "Strict HTML accessibility linting without compiled HTML visibility",
        "Front-end stacks standardized on JSX without separate template compilation"
      ],
      "official_url": "https://pugjs.org/",
      "paradigm": [
        "indentation-based",
        "templating",
        "HTML"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Markup or data format (not a general-purpose programming language)",
        "runtime": "Parsed and validated by tools, pipelines, or hosts — no single standard VM",
        "memory": "Not an executable program on its own; hosts manage storage and memory"
      }
    },
    {
      "id": "svelte",
      "name": "Svelte",
      "color": "#ff3e00",
      "description": "A component framework that compiles away — no virtual DOM, just surgical DOM updates. Write declarative markup; the compiler produces lean, fast vanilla JavaScript.",
      "whoItIsFor": "Frontend developers who want small bundles and reactive UI without a virtual DOM — compiles components to efficient vanilla JS at build time.",
      "commonUses": [
        "Web apps",
        "SPAs",
        "Component libraries"
      ],
      "patterns": [
        {
          "title": "Component",
          "code": "<script>\n  let count = 0;\n</script>\n<button on:click={() => count++}>{count}</button>",
          "explanation": "Reactive by default — assignments to variables automatically trigger DOM updates in Svelte."
        },
        {
          "title": "Component/store boundary - Svelte's polyglot bridge",
          "code": "<script>\n  // Svelte's polyglot boundary: component compilation\n  // .svelte → imperative JS (no virtual DOM)\n  \n  // Reactive store (shared state across components)\n  import { writable, derived } from 'svelte/store';\n  export const count = writable(0);\n  export const doubled = derived(count, $c => $c * 2);\n  \n  // Store subscriptions auto-update the DOM\n  // $count syntax auto-subscribes in components\n</script>\n\n<script>\n  // In another component:\n  import { count } from './stores.js';\n  // $count auto-subscribes and updates DOM\n</script>\n\n<p>{$count} (doubled: {$doubled})</p>",
          "explanation": "Reactive by default — assignments to variables automatically trigger DOM updates in Svelte."
        },
        {
          "title": "Reactive store boundary - cross-component state management",
          "code": "<script>\n  // stores.js - shared reactive state\n  import { writable, derived } from 'svelte/store';\n  \n  export const user = writable(null);\n  export const isLoggedIn = derived(user, $u => $u !== null);\n  \n  export function login(name) {\n    user.set({ name, loggedIn: Date.now() });\n  }\n  \n  export function logout() {\n    user.set(null);\n  }\n</script>\n\n<!-- Any component can subscribe -->\n<script>\n  import { user, isLoggedIn } from './stores.js';\n</script>\n\n{#if $isLoggedIn}\n  <p>Welcome, {$user.name}</p>\n{:else}\n  <button on:click={login}>Log in</button>\n{/if}",
          "explanation": "Svelte stores provide a reactive state boundary between components. Writable stores are shared mutable state, readable stores are read-only, and derived stores compute values from other stores. The $store syntax auto-subscribes and unsubscribes, making cross-component state management seamless. This bridges component isolation (props/events) with shared state (stores), giving Svelte both encapsulation and global reactivity."
        }
      ],
      "libraries": [
        {
          "name": "Svelte docs",
          "url": "https://svelte.dev/docs",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Svelte tutorial",
          "url": "https://svelte.dev/tutorial"
        }
      ],
      "compareData": {
        "variables": {
          "code": "<script>\n  // Svelte reactive variables\n  let count = 0;\n  let name = 'Svelte';\n  \n  // Derived (reactive)\n  $: doubled = count * 2;\n  \n  // Stores (shared state)\n  import { writable } from 'svelte/store';\n  const theme = writable('dark');\n</script>\n\n<p>{count}</p>\n<p>{name}</p>\n<p>{doubled}</p>",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "{#if isLoggedIn}\n  <p>Welcome back!</p>\n{:else if isAdmin}\n  <p>Admin panel</p>\n{:else}\n  <p>Please log in</p>\n{/if}\n\n// Ternary in expressions\n<p>Status: {isActive ? 'Active' : 'Inactive'}</p>",
          "difficulty": "basic"
        },
        "loops": {
          "code": "{#each items as item}\n  <li>{item.name}</li>\n{/each}\n\n// With index\n{#each items as item, i}\n  <li>{i}: {item.name}</li>\n{/each}\n\n// Keyed each (for efficient updates)\n{#each items as item (item.id)}\n  <li>{item.name}</li>\n{/each}\n\n// Else clause\n{#each items as item}\n  <li>{item}</li>\n{:else}\n  <li>No items</li>\n{/each}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "<script>\n  // Svelte functions (component methods)\n  function greet(name) {\n    alert(`Hello, ${name}!`);\n  }\n  \n  // Reactive declarations\n  $: filtered = items.filter(item => item.active);\n  \n  // Lifecycle functions\n  import { onMount, onDestroy } from 'svelte';\n  onMount(() => console.log('mounted'));\n</script>\n\n<button on:click={() => greet('World')}>\n  Greet\n</button>",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "<script>\n  // Svelte performance:\n  // 1. No virtual DOM — updates are surgical\n  // 2. Compiles to imperative DOM operations\n  // 3. Smaller bundle sizes than React/Vue\n  // 4. Reactive statements update only changed values\n  // 5. Use $: for derived state (avoids re-computation)\n  // 6. Keyed {#each} for efficient list updates\n  // 7. {#await} for async rendering\n</script>",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "<script>\n  // Svelte has no class-based OOP system.\n  // Reusability comes from:\n  // - Components (.svelte files)\n  // - Props (component inputs)\n  // - Slots (component content areas)\n  // - Stores (shared reactive state)\n  // These are NOT classes in the OOP sense.\n  // Use components and stores for shared logic.\n  \n  // Component composition\n  import Button from './Button.svelte';\n</script>\n\n<Button label=\"Click me\" />",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "<script>\n  let name = 'Svelte';\n  let greeting = `Hello, ${name}!`;\n</script>\n\n<p>{greeting}</p>\n<p>{name.toUpperCase()}</p>\n<p>{name.slice(0, 3)}</p>\n<p>{name.length} characters</p>",
          "difficulty": "basic"
        },
        "errors": {
          "code": "<script>\n  // Svelte error handling\n  // Compile-time: Svelte validates templates\n  // Runtime: try/catch for async operations\n  \n  try {\n    const data = await fetch('/api/data');\n    const json = await data.json();\n  } catch (error) {\n    console.error('Fetch failed:', error);\n  }\n</script>\n\n{#await getData()}\n  <p>Loading...</p>\n{:then data}\n  <p>{data}</p>\n{:catch error}\n  <p>Error: {error.message}</p>\n{/await}",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "<script>\n  // Svelte imports\n  import Component from './Component.svelte';\n  import { writable } from 'svelte/store';\n  import { onMount } from 'svelte';\n  import * as utils from './utils.js';\n  \n  // Context API (component tree sharing)\n  import { setContext, getContext } from 'svelte';\n  setContext('theme', 'dark');\n</script>\n\n<Component />",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "web",
        "ui-framework"
      ],
      "overview": "A component framework that compiles away — no virtual DOM, just surgical DOM updates. Write declarative markup; the compiler produces lean, fast vanilla JavaScript. Frontend developers who want small bundles and reactive UI without a virtual DOM — compiles components to efficient vanilla JS at build time.\n\nTypical projects include Web apps, SPAs, Component libraries. SvelteKit and compile-time reactivity keep bundles small.",
      "learning_curve": "Gentle — Svelte's syntax is close to HTML with minimal abstractions. Reactivity with $: is intuitive. The learning curve is gentler than React (no hooks) or Vue (no Options/Composition API split). Advanced features (stores, context, actions) add moderate complexity.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Svelte is a compile-time framework with growing adoption. SvelteKit for full-stack apps. No virtual DOM — compiles to imperative JS. Small bundle sizes. Rich transitions built in. Strong community but smaller than React/Vue. Used by The New York Times, Spotify, and others.",
      "common_use_cases": [
        "Web apps",
        "SPAs",
        "Component libraries"
      ],
      "docs_url": "https://svelte.dev/docs",
      "best_for": [
        "compiler-framework reactive UIs",
        "minimal JavaScript for DOM updates",
        "zero-runtime high-performance frontend apps",
        "Interactive web UIs compiling away framework runtime overhead"
      ],
      "weak_at": [
        "Large enterprises standardized on React hiring pipelines exclusively",
        "Native mobile apps without Capacitor or experimental native bindings",
        "Legacy IE support requiring polyfilled React ecosystem compatibility"
      ],
      "official_url": "https://svelte.dev/",
      "paradigm": [
        "component-based",
        "compiled",
        "reactive"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "JavaScript or TypeScript in application code; framework adds compile-time checks",
        "runtime": "Compiled to JavaScript; runs in browsers or server-side render hosts",
        "memory": "Garbage-collected (inherits the host JavaScript engine)"
      }
    },
    {
      "id": "vue",
      "name": "Vue (SFC)",
      "color": "#42b883",
      "description": "Vue Single-File Components — template, script, and style in one .vue file. Combines reactivity, composition API, and a rich ecosystem for building modern web interfaces.",
      "whoItIsFor": "Frontend developers building reactive UIs with a gentle learning curve — progressive framework, rich ecosystem, and strong tooling for SPAs.",
      "commonUses": [
        "Web apps",
        "Dashboards",
        "Progressive enhancement"
      ],
      "patterns": [
        {
          "title": "SFC",
          "code": "<template>\n  <p>{{ msg }}</p>\n</template>\n<script setup>\nconst msg = \"Hello\"\n</script>",
          "explanation": "A single-file component can use the Composition API with <script setup> for concise reactive logic."
        },
        {
          "title": "SFC script and template",
          "code": "<script setup>\nimport { ref } from \"vue\"\nconst count = ref(0)\n</script>\n<template>\n  <button @click=\"count++\">{{ count }}</button>\n</template>",
          "explanation": "`script setup` exposes bindings to the template; `ref` holds reactive state."
        },
        {
          "title": "Computed",
          "code": "import { computed, ref } from \"vue\"\nconst first = ref(\"Ada\")\nconst last = ref(\"Lovelace\")\nconst full = computed(() => `${first.value} ${last.value}`)",
          "explanation": "Computed values derive from refs and update when dependencies change."
        },
        {
          "title": "Virtual DOM / reactivity boundary - Vue's polyglot bridge",
          "code": "<script setup>\n  // Vue's polyglot boundary: reactive virtual DOM\n  // Templates compile to render functions\n  // Reactivity system tracks dependencies precisely\n  \n  import { ref, computed, watch } from 'vue'\n  \n  const count = ref(0)\n  const doubled = computed(() => count.value * 2)\n  \n  // Watch triggers side effects\n  watch(count, (newVal) => {\n    console.log('Count changed:', newVal)\n  })\n</script>\n\n<template>\n  <!-- Vue compiles this to efficient render functions -->\n  <p>{{ count }} (doubled: {{ doubled }})</p>\n  <button @click=\"count++\">Increment</button>\n</template>",
          "explanation": "Vue's polyglot boundary is its reactivity system combined with template compilation: .vue single-file components compile to efficient JavaScript render functions. The Composition API (ref, reactive, computed, watch) provides fine-grained reactivity that bridges declarative templates to imperative DOM updates. Vue's virtual DOM diffing minimizes actual DOM operations. This makes Vue a universal UI bridge that connects data models to DOM rendering across any JavaScript environment."
        }
      ],
      "libraries": [
        {
          "name": "Vue docs",
          "url": "https://vuejs.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Vue.js guide",
          "url": "https://vuejs.org/guide/introduction.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "<script setup>\n  // Vue 3 Composition API variables\n  const count = ref(0)\n  const name = ref('Vue')\n  \n  // Reactive object\n  const state = reactive({\n    items: [],\n    loading: false\n  })\n  \n  // Computed (derived)\n  const doubled = computed(() => count.value * 2)\n  \n  // Template ref\n  const inputRef = ref(null)\n</script>\n\n<template>\n  <p>{{ count }}</p>\n  <p>{{ name }}</p>\n  <p>{{ doubled }}</p>\n</template>",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "<template>\n  <!-- Vue conditionals -->\n  <div v-if=\"isAdmin\">Admin panel</div>\n  <div v-else-if=\"isEditor\">Editor tools</div>\n  <div v-else>User view</div>\n  \n  <!-- v-show (toggles display, keeps in DOM) -->\n  <p v-show=\"isVisible\">Always in DOM</p>\n  \n  <!-- Ternary in template -->\n  <p>Status: {{ isActive ? 'Active' : 'Inactive' }}</p>\n</template>",
          "difficulty": "basic"
        },
        "loops": {
          "code": "<template>\n  <!-- Vue loops -->\n  <ul>\n    <li v-for=\"item in items\" :key=\"item.id\">\n      {{ item.name }}\n    </li>\n  </ul>\n  \n  <!-- With index -->\n  <li v-for=\"(item, index) in items\" :key=\"item.id\">\n    {{ index }}: {{ item.name }}\n  </li>\n  \n  <!-- Range -->\n  <span v-for=\"n in 5\" :key=\"n\">{{ n }}</span>\n</template>",
          "difficulty": "basic"
        },
        "functions": {
          "code": "<script setup>\n  // Vue functions (component methods)\n  function greet(name) {\n    alert(`Hello, ${name}!`)\n  }\n  \n  // Lifecycle hooks\n  onMounted(() => console.log('mounted'))\n  onUnmounted(() => console.log('unmounted'))\n  \n  // Watchers\n  watch(count, (newVal, oldVal) => {\n    console.log(`Count changed from ${oldVal} to ${newVal}`)\n  })\n  \n  // Composables (reusable logic)\n  function useCounter(initial = 0) {\n    const count = ref(initial)\n    const increment = () => count.value++\n    return { count, increment }\n  }\n</script>",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "<script setup>\n  // Vue performance:\n  // 1. Virtual DOM with template compilation\n  // 2. Reactivity tracks dependencies precisely\n  // 3. v-once for static content\n  // 4. v-memo for conditional re-rendering\n  // 5. Lazy components with defineAsyncComponent\n  // 6. Keep-alive caches component instances\n  // 7. Shallow refs for large objects\n</script>\n\n<template>\n  <!-- Static content compiled once -->\n  <p v-once>{{ staticMessage }}</p>\n  \n  <!-- Memoized subtree -->\n  <div v-memo=\"[selectedId]\">\n    <ExpensiveComponent :id=\"selectedId\" />\n  </div>\n</template>",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "<script setup>\n  // Vue has no class/OOP system in the traditional sense.\n  // Reusability comes from:\n  // - Composables (reusable composition functions)\n  // - Components (.vue files)\n  // - Provide/Inject (dependency injection)\n  // - Pinia stores (state management)\n  // These are NOT classes in the OOP sense.\n  // Use composables and components for shared logic.\n  \n  // Composable pattern\n  function useAuth() {\n    const user = ref(null)\n    const login = async (credentials) => { ... }\n    const logout = () => { user.value = null }\n    return { user, login, logout }\n  }\n</script>",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "<script setup>\n  const name = ref('Vue')\n  const greeting = computed(() => `Hello, ${name.value}!`)\n</script>\n\n<template>\n  <p>{{ greeting }}</p>\n  <p>{{ name.toUpperCase() }}</p>\n  <p>{{ name.slice(0, 3) }}</p>\n  <p>{{ name.length }} characters</p>\n  \n  <!-- Raw HTML (use with caution) -->\n  <p v-html=\"rawHtmlContent\"></p>\n</template>",
          "difficulty": "basic"
        },
        "errors": {
          "code": "<script setup>\n  // Vue error handling\n  // Error boundary: errorCaptured hook\n  function onErrorCaptured(err, instance, info) {\n    console.error('Error:', err)\n    return false // prevent propagation\n  }\n  \n  // Async error handling\n  try {\n    const data = await fetch('/api/data')\n    const json = await data.json()\n  } catch (error) {\n    console.error('Fetch failed:', error)\n  }\n  \n  // Vue emits warnings in development\n  // Production: use errorHandler\n  // app.config.errorHandler = (err) => { ... }\n</script>\n\n<template>\n  <!-- Suspense for async components -->\n  <Suspense>\n    <template #default>\n      <AsyncComponent />\n    </template>\n    <template #fallback>\n      <p>Loading...</p>\n    </template>\n  </Suspense>\n</template>",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "<script setup>\n  // Vue imports (Composition API)\n  import { ref, reactive, computed, watch } from 'vue'\n  import { useRouter, useRoute } from 'vue-router'\n  import { useStore } from 'vuex'  // or Pinia\n  import ChildComponent from './Child.vue'\n  import { formatData } from './utils'\n  \n  // Dynamic import (lazy loading)\n  const AsyncComp = defineAsyncComponent(() =>\n    import('./HeavyComponent.vue')\n  )\n  \n  // Provide/Inject (dependency injection)\n  import { provide, inject } from 'vue'\n  provide('theme', 'dark')\n  const theme = inject('theme')\n</script>",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "vue-tip-escape-for-the-output-context",
          "title": "Escape for the output context",
          "body": "In Vue (SFC), the dangerous bug is often not the syntax but the context shift: HTML, attribute, URL, and script contexts all need different escaping. If data can cross a trust boundary, sanitize it for that exact output surface.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "vue-tip-keep-logic-out-of-the-template-when-it-grows",
          "title": "Keep logic out of the template when it grows",
          "body": "Vue (SFC) stays pleasant when templates stay declarative. Once you start encoding business rules inside the view layer, debugging becomes guesswork and the same rule gets duplicated in several places.",
          "tag": "architecture",
          "status": "curated"
        }
      ],
      "categories": [
        "web",
        "ui-framework"
      ],
      "overview": "Vue Single-File Components — template, script, and style in one .vue file. Combines reactivity, composition API, and a rich ecosystem for building modern web interfaces. Frontend developers building reactive UIs with a gentle learning curve — progressive framework, rich ecosystem, and strong tooling for SPAs.\n\nTypical projects include Web apps, Dashboards, Progressive enhancement. Vue 3 Composition API, Pinia, and Vite are the modern stack defaults.",
      "learning_curve": "Gentle for HTML/CSS/JS developers — Vue's template syntax is intuitive, and the Composition API is well-documented. Moderate for advanced features (reactivity gotchas, provide/inject, Pinia state management). The Options API is even gentler for beginners. Vue's two API styles (Options vs Composition) can cause initial confusion.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Vue is one of the top 3 frontend frameworks (with React and Angular). Vue 3 Composition API is the modern standard. Pinia for state management (replaces Vuex). Vue Router for routing. Nuxt for SSR/SSG. Vite is the recommended build tool (created by Vue's author). Strong adoption in China and enterprise.",
      "common_use_cases": [
        "Web apps",
        "Dashboards",
        "Progressive enhancement"
      ],
      "docs_url": "https://vuejs.org/guide/introduction.html",
      "best_for": [
        "interactive single-page application UIs",
        "dashboard and data visualisation frontends",
        "progressive web app development",
        "Progressive enhancement of server-rendered pages with Vue islands"
      ],
      "weak_at": [
        "Teams deeply invested in React Server Components patterns exclusively",
        "Native mobile without Quasar, Capacitor, or NativeScript integration",
        "Back-end-only products without client-side interactivity requirements"
      ],
      "official_url": "https://vuejs.org/",
      "paradigm": [
        "component-based",
        "reactive",
        "progressive"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "JavaScript or TypeScript in application code; framework adds compile-time checks",
        "runtime": "Compiled to JavaScript; runs in browsers or server-side render hosts",
        "memory": "Garbage-collected (inherits the host JavaScript engine)"
      }
    },
    {
      "id": "plsql",
      "name": "PL/SQL",
      "color": "#f80000",
      "description": "Oracle's procedural extension to SQL — stored procedures, triggers, and packages. Adds variables, loops, exception handling, and cursor logic on top of the declarative SQL foundation.",
      "whoItIsFor": "Oracle database developers and DBAs writing server-side logic — stored procedures, triggers, and business rules close to the data.",
      "commonUses": [
        "Oracle stored procedures",
        "Triggers",
        "ETL",
        "Reports"
      ],
      "patterns": [
        {
          "title": "Block",
          "code": "BEGIN\n  DBMS_OUTPUT.PUT_LINE('Hello');\nEND;",
          "explanation": "Anonymous PL/SQL block with DECLARE-BEGIN-END — the fundamental unit of procedural logic in Oracle."
        },
        {
          "title": "Anonymous block",
          "code": "DECLARE\n  n NUMBER := 10;\nBEGIN\n  DBMS_OUTPUT.PUT_LINE('n = ' || n);\nEND;\n/",
          "explanation": "PL/SQL blocks declare variables in `DECLARE` and run statements in `BEGIN`…`END`."
        },
        {
          "title": "Procedure header",
          "code": "CREATE OR REPLACE PROCEDURE add_job(\n  p_name IN VARCHAR2\n) IS\nBEGIN\n  INSERT INTO jobs(name) VALUES (p_name);\n  COMMIT;\nEND add_job;\n/",
          "explanation": "Stored procedures encapsulate SQL and logic inside the database."
        },
        {
          "title": "PL/SQL engine boundary - Oracle's polyglot bridge",
          "code": "-- PL/SQL's polyglot boundary is the Oracle engine:\n-- SQL and procedural code run in the database,\n-- minimizing network round trips.\n\n-- Embedded SQL (seamless SQL integration)\nCREATE OR REPLACE PROCEDURE process_employees IS\n  CURSOR c_emp IS SELECT emp_id, salary FROM employees;\nBEGIN\n  FOR r_emp IN c_emp LOOP\n    -- SQL and PL/SQL run in same process\n    UPDATE employees\n    SET salary = r_emp.salary * 1.1\n    WHERE emp_id = r_emp.emp_id;\n  END LOOP;\n  COMMIT;\nEND;\n\n-- External calls via Java or C\n-- CREATE OR REPLACE AND COMPILE JAVA SOURCE ...\n-- CREATE OR REPLACE LIBRARY my_lib AS 'mylib.so';\n\n-- DB links (remote databases)\nSELECT * FROM remote_table@remote_db;",
          "explanation": "PL/SQL's polyglot boundary is the Oracle database engine: SQL and procedural code run in the same process, eliminating network round trips. PL/SQL can call Java stored procedures (CREATE JAVA SOURCE) and C external procedures (EXTERNAL LIBRARY), bridging to other languages. Database links (DBLINK) connect to remote Oracle databases. This makes PL/SQL the universal data processing bridge within the Oracle ecosystem, combining declarative SQL with procedural logic."
        }
      ],
      "libraries": [
        {
          "name": "Oracle PL/SQL docs",
          "url": "https://docs.oracle.com/en/database/oracle/oracle-database/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "PL/SQL reference",
          "url": "https://docs.oracle.com/en/database/oracle/oracle-database/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "-- PL/SQL variables\nDECLARE\n  v_name    VARCHAR2(100) := 'Oracle';\n  v_count   NUMBER := 0;\n  v_date    DATE := SYSDATE;\n  v_flag    BOOLEAN := TRUE;\n  \n  -- Constant\n  c_max CONSTANT NUMBER := 100;\n  \n  -- Record type\n  TYPE emp_record IS RECORD (\n    emp_id   NUMBER,\n    emp_name VARCHAR2(100),\n    salary   NUMBER\n  );\n  v_emp emp_record;\n  \n  -- Anchored declaration\n  v_salary employees.salary%TYPE;\nBEGIN\n  v_count := v_count + 1;\nEND;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "-- PL/SQL conditionals\nIF v_salary > 100000 THEN\n  DBMS_OUTPUT.PUT_LINE('High earner');\nELSIF v_salary > 50000 THEN\n  DBMS_OUTPUT.PUT_LINE('Mid earner');\nELSE\n  DBMS_OUTPUT.PUT_LINE('Entry level');\nEND IF;\n\n-- CASE expression\nv_grade := CASE\n  WHEN v_score >= 90 THEN 'A'\n  WHEN v_score >= 80 THEN 'B'\n  WHEN v_score >= 70 THEN 'C'\n  ELSE 'F'\nEND;\n\n-- NULL handling\nIF v_value IS NULL THEN\n  v_value := 'default';\nEND IF;",
          "difficulty": "basic"
        },
        "loops": {
          "code": "-- PL/SQL loops\n-- Basic loop\nLOOP\n  v_count := v_count + 1;\n  EXIT WHEN v_count > 10;\nEND LOOP;\n\n-- WHILE loop\nWHILE v_count < 10 LOOP\n  v_count := v_count + 1;\nEND LOOP;\n\n-- FOR loop (numeric)\nFOR i IN 1..10 LOOP\n  DBMS_OUTPUT.PUT_LINE(i);\nEND LOOP;\n\n-- FOR loop (cursor)\nFOR emp_rec IN (SELECT * FROM employees) LOOP\n  DBMS_OUTPUT.PUT_LINE(emp_rec.emp_name);\nEND LOOP;\n\n-- BULK COLLECT (performance)\nSELECT * BULK COLLECT INTO v_employees FROM employees;",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "-- PL/SQL functions and procedures\n-- Function\nCREATE OR REPLACE FUNCTION get_salary(\n  p_emp_id IN NUMBER\n) RETURN NUMBER IS\n  v_salary NUMBER;\nBEGIN\n  SELECT salary INTO v_salary\n  FROM employees\n  WHERE emp_id = p_emp_id;\n  RETURN v_salary;\nEXCEPTION\n  WHEN NO_DATA_FOUND THEN\n    RETURN 0;\nEND;\n\n-- Procedure\nCREATE OR REPLACE PROCEDURE update_salary(\n  p_emp_id IN NUMBER,\n  p_raise   IN NUMBER\n) IS\nBEGIN\n  UPDATE employees\n  SET salary = salary + p_raise\n  WHERE emp_id = p_emp_id;\n  COMMIT;\nEND;\n\n-- Package (grouping)\nCREATE OR REPLACE PACKAGE emp_utils IS\n  FUNCTION get_salary(p_id NUMBER) RETURN NUMBER;\n  PROCEDURE update_salary(p_id NUMBER, p_raise NUMBER);\nEND emp_utils;",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "-- PL/SQL performance:\n-- 1. BULK COLLECT for batch operations\n-- 2. FORALL for batch DML\n-- 3. Use %ROWTYPE and %TYPE for anchoring\n-- 4. Avoid row-by-row processing\n-- 5. Use bind variables (not literals)\n-- 6. PRAGMA UDF for faster function calls\n-- 7. Result caching with RESULT_CACHE\n\n-- Bulk processing example\nFORALL i IN 1..v_ids.COUNT\n  UPDATE employees SET salary = salary * 1.1\n  WHERE emp_id = v_ids(i);\n\n-- Function result cache\nCREATE OR REPLACE FUNCTION get_dept(\n  p_id NUMBER\n) RETURN VARCHAR2 RESULT_CACHE IS\n  v_name VARCHAR2(100);\nBEGIN\n  SELECT dept_name INTO v_name FROM departments WHERE dept_id = p_id;\n  RETURN v_name;\nEND;",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "-- PL/SQL has limited/optional object-oriented features.\n-- Most PL/SQL is procedural and package-based.\n-- Object types exist but are rarely used:\n\nCREATE OR REPLACE TYPE employee_obj AS OBJECT (\n  emp_id   NUMBER,\n  emp_name VARCHAR2(100),\n  salary   NUMBER,\n  MEMBER FUNCTION annual_salary RETURN NUMBER\n);\n\n-- In practice, packages and records dominate:\n-- - Packages group related procedures/functions\n-- - Records define structured data\n-- - Object types are available but not the paradigm\n-- Use packages and records for most PL/SQL code.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "-- PL/SQL strings\nv_name := 'Oracle';\nv_greeting := 'Hello, ' || v_name || '!';\n\n-- String functions\nLENGTH(v_name)              -- 6\nUPPER(v_name)               -- 'ORACLE'\nLOWER(v_name)               -- 'oracle'\nSUBSTR(v_name, 1, 3)       -- 'Ora'\nINSTR(v_name, 'acl')       -- 3\nREPLACE(v_name, 'Ora', 'O') -- 'Ocle'\nTRIM('  hello  ')           -- 'hello'\n\n-- Quoting\nv_text := q'!It's a test!'   -- alternative quoting\nv_raw  := 'Hello' || CHR(10) || 'World';",
          "difficulty": "basic"
        },
        "errors": {
          "code": "-- PL/SQL error handling\nBEGIN\n  SELECT * INTO v_emp FROM employees WHERE emp_id = 999;\nEXCEPTION\n  WHEN NO_DATA_FOUND THEN\n    DBMS_OUTPUT.PUT_LINE('Employee not found');\n  WHEN TOO_MANY_ROWS THEN\n    DBMS_OUTPUT.PUT_LINE('Multiple employees found');\n  WHEN OTHERS THEN\n    DBMS_OUTPUT.PUT_LINE('Error: ' || SQLERRM);\n    -- Re-raise if needed\n    RAISE;\nEND;\n\n-- Custom exceptions\nDECLARE\n  e_invalid_salary EXCEPTION;\n  PRAGMA EXCEPTION_INIT(e_invalid_salary, -20001);\nBEGIN\n  IF v_salary < 0 THEN\n    RAISE e_invalid_salary;\n  END IF;\nEXCEPTION\n  WHEN e_invalid_salary THEN\n    DBMS_OUTPUT.PUT_LINE('Invalid salary');\nEND;",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "-- PL/SQL imports (packages and schema)\n-- Using a package\nCREATE OR REPLACE PACKAGE BODY emp_utils IS\n  FUNCTION get_salary(p_id NUMBER) RETURN NUMBER IS ... \nEND;\n\n-- Calling package functions\nv_sal := emp_utils.get_salary(100);\nemp_utils.update_salary(100, 5000);\n\n-- Schema-level objects\nCREATE TABLE employees (...);\nCREATE SEQUENCE emp_seq START WITH 1;\nCREATE VIEW active_employees AS SELECT * FROM employees WHERE active = 'Y';\n\n-- DB links (remote database access)\nSELECT * FROM employees@remote_db;\n\n-- GRANT access\nGRANT EXECUTE ON emp_utils TO hr_user;",
          "difficulty": "intermediate"
        }
      },
      "tips": [
        {
          "id": "plsql-tip-null-changes-the-rules",
          "title": "NULL changes the rules",
          "body": "In PL/SQL, NULL is not just another value — comparisons, joins, and aggregates all behave differently around it. If you are not explicit about null-handling, your query can look correct and still return the wrong result set.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "plsql-tip-joins-are-where-row-counts-surprise-you",
          "title": "Joins are where row counts surprise you",
          "body": "The quickest way to break a PL/SQL query is to assume the join cardinality is harmless. Check the row count after each join, and prefer a tiny intermediate query before layering filters, grouping, or window functions.",
          "tag": "data",
          "status": "curated"
        }
      ],
      "categories": [
        "data",
        "query"
      ],
      "overview": "Oracle's procedural extension to SQL — stored procedures, triggers, and packages. Adds variables, loops, exception handling, and cursor logic on top of the declarative SQL foundation. Oracle database developers and DBAs writing server-side logic — stored procedures, triggers, and business rules close to the data.\n\nTypical projects include Oracle stored procedures, Triggers, ETL. Three decades of Oracle integration keeps PL/SQL central for stored procedures, though it does not port to other databases.",
      "learning_curve": "Moderate for basic PL/SQL (procedures, functions, packages). Steep for advanced features (bulk processing, pipelined functions, AQ, advanced queuing). The Oracle-specific ecosystem (dbms_, utl_, apex_) adds complexity. DBMS_OUTPUT and SQL*Plus are the traditional debugging tools.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "PL/SQL is Oracle's procedural language extension for SQL. Used in Oracle Database, Apex, and Forms. Extremely mature (30+ years). No open-source implementation (only Oracle). Strong for data-intensive operations (eliminates network round trips). Competing with PostgreSQL PL/pgSQL, SQL Server T-SQL.",
      "common_use_cases": [
        "Oracle stored procedures",
        "Triggers",
        "ETL",
        "Reports"
      ],
      "docs_url": "https://docs.oracle.com/en/database/oracle/oracle-database/",
      "best_for": [
        "Oracle database package and trigger development",
        "enterprise Oracle PL/SQL logic",
        "Oracle-specific database application programming",
        "Oracle database stored procedures, packages, and trigger logic"
      ],
      "weak_at": [
        "Portable SQL workloads targeting PostgreSQL or SQL Server exclusively",
        "Cloud-native microservices without co-located Oracle database tiers",
        "Open-source-first stacks avoiding Oracle licensing and vendor lock-in"
      ],
      "official_url": "https://www.oracle.com/database/technologies/appdev/plsql.html",
      "paradigm": [
        "procedural",
        "SQL-extended",
        "set-oriented"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative query or policy notation (schema- or engine-driven)",
        "runtime": "Executed by a database, API server, or policy engine (product-specific)",
        "memory": "Managed by the host system running the query or policy"
      }
    },
    {
      "id": "tsql",
      "name": "T-SQL",
      "color": "#cc2927",
      "description": "Microsoft's SQL dialect for SQL Server — adds variables, control flow, and error handling. Transact-SQL extends ANSI SQL with stored procedures, triggers, and window functions.",
      "whoItIsFor": "SQL Server developers and DBAs writing stored procedures, triggers, and reporting queries — T-SQL extends standard SQL with control flow and locals.",
      "commonUses": [
        "SQL Server procedures",
        "Reporting",
        "ETL",
        "Azure SQL"
      ],
      "patterns": [
        {
          "title": "Variable",
          "code": "DECLARE @x INT = 10;\nPRINT @x;",
          "explanation": "DECLARE creates a batch-scoped T-SQL variable you can assign and use in subsequent statements."
        },
        {
          "title": "SELECT with TOP",
          "code": "SELECT TOP (10) name, create_date\nFROM sys.tables\nORDER BY create_date DESC;",
          "explanation": "`TOP` limits rows; `ORDER BY` defines which rows are “first”."
        },
        {
          "title": "Variable and batch",
          "code": "DECLARE @count INT;\nSELECT @count = COUNT(*) FROM Sales.Customer;\nSELECT @count AS customer_count;",
          "explanation": "TSQL variables use `@`; batches often combine DECLARE with SELECT."
        },
        {
          "title": "T-SQL engine boundary - SQL Server's polyglot bridge",
          "code": "-- T-SQL's polyglot boundary is the SQL Server engine:\n-- Procedural and set-based code run in the database,\n-- minimizing network round trips.\n\n-- Embedded SQL (seamless integration)\nCREATE PROCEDURE dbo.ProcessEmployees AS\nBEGIN\n  -- SQL and T-SQL run in same process\n  UPDATE employees\n  SET salary = salary * 1.1\n  WHERE dept = 'Engineering';\n\n  -- Call external programs\n  EXEC xp_cmdshell 'dir C:\\';  -- OS commands\n  \n  -- CLR integration (C# stored procedures)\n  -- CREATE ASSEMBLY MyAssembly FROM '...';\n  -- CREATE PROCEDURE dbo.MyProc EXTERNAL NAME MyAssembly.Class.Method;\nEND;\n\n-- OPENROWSET (ad-hoc remote access)\nSELECT * FROM OPENROWSET(\n  'Microsoft.ACE.OLEDB.12.0',\n  'Excel 12.0;Database=data.xlsx',\n  'SELECT * FROM [Sheet1$]'\n);",
          "explanation": "T-SQL's polyglot boundary is the SQL Server engine: SQL and procedural code run in the same process, eliminating network round trips. CLR integration allows C# stored procedures and functions via CREATE ASSEMBLY. xp_cmdshell bridges to OS commands. OPENROWSET and linked servers connect to external data sources (other databases, Excel, CSV). This makes T-SQL the universal data processing bridge within the SQL Server ecosystem, combining declarative SQL with procedural logic and external language integration."
        }
      ],
      "libraries": [
        {
          "name": "T-SQL docs",
          "url": "https://learn.microsoft.com/sql/t-sql/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "T-SQL reference",
          "url": "https://learn.microsoft.com/sql/t-sql/language-reference"
        }
      ],
      "compareData": {
        "variables": {
          "code": "-- T-SQL variables\nDECLARE @name NVARCHAR(100) = 'SQL Server';\nDECLARE @count INT = 0;\nDECLARE @date DATETIME = GETDATE();\nDECLARE @flag BIT = 1;\n\n-- Table variables\nDECLARE @results TABLE (\n  id INT,\n  name NVARCHAR(100)\n);\n\n-- Assignment\nSET @count = (SELECT COUNT(*) FROM employees);\n\n-- Concatenation\nSET @greeting = 'Hello, ' + @name + '!';",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "-- T-SQL conditionals\nIF @salary > 100000\nBEGIN\n  PRINT 'High earner';\nEND\nELSE IF @salary > 50000\nBEGIN\n  PRINT 'Mid earner';\nEND\nELSE\nBEGIN\n  PRINT 'Entry level';\nEND\n\n-- CASE expression\nSELECT\n  CASE\n    WHEN score >= 90 THEN 'A'\n    WHEN score >= 80 THEN 'B'\n    ELSE 'F'\n  END AS grade\nFROM students;\n\n-- IIF (shorthand)\nSELECT IIF(active = 1, 'Active', 'Inactive') AS status\nFROM users;",
          "difficulty": "basic"
        },
        "loops": {
          "code": "-- T-SQL loops\n-- WHILE loop\nWHILE @count < 10\nBEGIN\n  SET @count = @count + 1;\n  PRINT @count;\nEND\n\n-- CURSOR loop\nDECLARE emp_cursor CURSOR FOR\n  SELECT emp_id, salary FROM employees;\n\nOPEN emp_cursor;\nFETCH NEXT FROM emp_cursor INTO @id, @sal;\nWHILE @@FETCH_STATUS = 0\nBEGIN\n  -- Process each row\n  FETCH NEXT FROM emp_cursor INTO @id, @sal;\nEND\nCLOSE emp_cursor;\nDEALLOCATE emp_cursor;\n\n-- Set-based (preferred over cursors)\nUPDATE employees SET salary = salary * 1.1\nWHERE dept = 'Engineering';",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "-- T-SQL functions\n-- Built-in functions\nLEN(@name)              -- string length\nUPPER(@name)            -- uppercase\nSUBSTRING(@name, 1, 3)  -- substring\nGETDATE()               -- current datetime\nISNULL(@val, 0)         -- null coalesce\nCOALESCE(@a, @b, @c)   -- first non-null\n\n-- User-defined function\nCREATE FUNCTION dbo.GetSalary(\n  @emp_id INT\n) RETURNS DECIMAL(10,2)\nAS BEGIN\n  DECLARE @sal DECIMAL(10,2);\n  SELECT @sal = salary FROM employees\n  WHERE emp_id = @emp_id;\n  RETURN @sal;\nEND;\n\n-- Table-valued function\nCREATE FUNCTION dbo.GetEmployees(@dept NVARCHAR(50))\nRETURNS TABLE AS RETURN\n  SELECT * FROM employees WHERE department = @dept;",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "-- T-SQL performance:\n-- 1. Set-based operations over cursors\n-- 2. Use temp tables for intermediate results\n-- 3. NOLOCK hint for read-only queries\n-- 4. Parameter sniffing can hurt performance\n-- 5. Index tuning is critical\n-- 6. Execution plans: SET SHOWPLAN_TEXT ON\n-- 7. Wait stats: sys.dm_os_wait_stats\n\n-- Set-based update (fast)\nUPDATE e SET salary = e.salary * 1.1\nFROM employees e\nJOIN departments d ON e.dept_id = d.dept_id\nWHERE d.dept_name = 'Engineering';\n\n-- Indexed temp table\nCREATE TABLE #results (id INT PRIMARY KEY, name NVARCHAR(100));",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "-- T-SQL has no class/OOP system.\n-- Reusability comes from:\n-- - Stored procedures (parameterized SQL)\n-- - User-defined functions (scalar and table-valued)\n-- - Views (virtual tables)\n-- - Triggers (event-driven logic)\n-- - Schemas (namespace grouping)\n-- These are NOT classes in the OOP sense.\n-- Use procedures and functions for shared logic.\n\nCREATE PROCEDURE dbo.UpdateSalary\n  @emp_id INT,\n  @raise DECIMAL(10,2)\nAS BEGIN\n  UPDATE employees SET salary = salary + @raise\n  WHERE emp_id = @emp_id;\nEND;",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "-- T-SQL strings\nDECLARE @name NVARCHAR(100) = 'SQL Server';\nDECLARE @greeting NVARCHAR(200) = 'Hello, ' + @name + '!';\n\n-- String functions\nLEN(@name)                  -- 10\nUPPER(@name)                -- 'SQL SERVER'\nLOWER(@name)                -- 'sql server'\nSUBSTRING(@name, 1, 3)     -- 'SQL'\nCHARINDEX('Server', @name) -- 5\nREPLACE(@name, 'Server', 'DB') -- 'SQL DB'\nTRIM('  hello  ')           -- 'hello'\n\n-- QUOTENAME for safe identifiers\nQUOTENAME('table name')    -- '[table name]'\n\n-- CONCAT (NULL-safe)\nCONCAT(@first, ' ', @last)  -- handles NULLs",
          "difficulty": "basic"
        },
        "errors": {
          "code": "-- T-SQL error handling\nBEGIN TRY\n  SELECT 1/0;  -- division by zero\nEND TRY\nBEGIN CATCH\n  SELECT\n    ERROR_NUMBER() AS ErrorNumber,\n    ERROR_MESSAGE() AS ErrorMessage,\n    ERROR_SEVERITY() AS Severity,\n    ERROR_STATE() AS State,\n    ERROR_PROCEDURE() AS ProcedureName,\n    ERROR_LINE() AS LineNumber;\nEND CATCH\n\n-- Custom error\nRAISERROR('Custom error message', 16, 1);\n\n-- THROW (SQL Server 2012+)\nTHROW 50001, 'Custom error', 1;\n\n-- XACT_ABORT for transaction errors\nSET XACT_ABORT ON;",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "-- T-SQL imports (schema, linked servers, modules)\n-- T-SQL has no ES-style import system.\n-- Composition is via database schema and server links:\n\n-- Schema-level organization\nCREATE SCHEMA hr;\nCREATE TABLE hr.employees (...);\nCREATE PROCEDURE hr.UpdateSalary @emp_id INT AS ...;\n\n-- Linked servers (remote database access)\nSELECT * FROM [REMOTE_SERVER].[database].[schema].[table];\n\n-- OPENROWSET (ad-hoc remote access)\nSELECT * FROM OPENROWSET(\n  'SQLNCLI', 'Server=remote;Trusted_Connection=yes',\n  'SELECT * FROM database.schema.table'\n);\n\n-- Cross-database access\nSELECT * FROM OtherDB.dbo.table;",
          "difficulty": "intermediate"
        }
      },
      "tips": [
        {
          "id": "tsql-tip-null-changes-the-rules",
          "title": "NULL changes the rules",
          "body": "In T-SQL, NULL is not just another value — comparisons, joins, and aggregates all behave differently around it. If you are not explicit about null-handling, your query can look correct and still return the wrong result set.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "tsql-tip-joins-are-where-row-counts-surprise-you",
          "title": "Joins are where row counts surprise you",
          "body": "The quickest way to break a T-SQL query is to assume the join cardinality is harmless. Check the row count after each join, and prefer a tiny intermediate query before layering filters, grouping, or window functions.",
          "tag": "data",
          "status": "curated"
        }
      ],
      "categories": [
        "data",
        "query"
      ],
      "overview": "Microsoft's SQL dialect for SQL Server — adds variables, control flow, and error handling. Transact-SQL extends ANSI SQL with stored procedures, triggers, and window functions. SQL Server developers and DBAs writing stored procedures, triggers, and reporting queries — T-SQL extends standard SQL with control flow and locals.\n\nTypical projects include SQL Server procedures, Reporting, ETL. SSMS and Azure Data Studio support mature T-SQL on SQL Server and Azure SQL, but dialect features do not port elsewhere.",
      "learning_curve": "Moderate for basic T-SQL (SELECT, INSERT, UPDATE, stored procedures). Steep for advanced features (cursors, CTEs, window functions, query hints, partitioning). The SQL Server-specific ecosystem (SSIS, SSRS, SSAS) adds complexity. SSMS is the primary IDE.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "T-SQL is Microsoft SQL Server's procedural language. Used in SQL Server, Azure SQL, and Synapse Analytics. Extremely mature (30+ years). Strong tooling (SSMS, Azure Data Studio). Competes with PL/SQL (Oracle) and PL/pgSQL (PostgreSQL). Not portable to other databases.",
      "common_use_cases": [
        "SQL Server procedures",
        "Reporting",
        "ETL",
        "Azure SQL"
      ],
      "docs_url": "https://learn.microsoft.com/sql/t-sql/language-reference",
      "best_for": [
        "Microsoft SQL Server query and stored procedure authoring",
        "SQL Server-based ETL pipeline development",
        "Windows-ecosystem database application logic",
        "Microsoft SQL Server stored procedures, functions, and CLR integrations"
      ],
      "weak_at": [
        "Cross-database portability to PostgreSQL without T-SQL-specific constructs",
        "Linux-first data platforms standardized on open-source warehouses",
        "Application business logic better expressed in C# or TypeScript services"
      ],
      "official_url": "https://learn.microsoft.com/sql/t-sql/",
      "paradigm": [
        "procedural",
        "SQL-extended",
        "set-oriented"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative query or policy notation (schema- or engine-driven)",
        "runtime": "Executed by a database, API server, or policy engine (product-specific)",
        "memory": "Managed by the host system running the query or policy"
      }
    },
    {
      "id": "sparql",
      "name": "SPARQL",
      "color": "#0c479c",
      "description": "SQL for graph databases — a W3C standard query language for querying RDF triples. Its pattern-based matching turns linked data relationships into actionable query results.",
      "whoItIsFor": "Knowledge graph engineers and linked-data researchers — the standard query language for retrieving and filtering RDF data on the semantic web.",
      "commonUses": [
        "Wikidata queries",
        "Knowledge graphs",
        "Semantic web"
      ],
      "patterns": [
        {
          "title": "Query",
          "code": "PREFIX foaf: <http://xmlns.com/foaf/0.1/>\nSELECT ?name WHERE {\n  ?person foaf:name ?name .\n}",
          "explanation": "Triple pattern matching with SELECT — SPARQL queries RDF graphs by subject-predicate-object patterns."
        },
        {
          "title": "SELECT with PREFIX",
          "code": "PREFIX foaf: <http://xmlns.com/foaf/0.1/>\nSELECT ?name WHERE {\n  ?person a foaf:Person .\n  ?person foaf:name ?name .\n}\nLIMIT 20",
          "explanation": "PREFIX shortens IRIs; the WHERE block is a graph pattern; LIMIT caps results."
        },
        {
          "title": "FILTER",
          "code": "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\nSELECT ?s ?v WHERE {\n  ?s <http://example.org/value> ?v .\n  FILTER(?v > \"100\"^^xsd:integer)\n}",
          "explanation": "FILTER restricts bindings — here numeric comparison on a typed literal."
        },
        {
          "title": "Endpoint/query boundary - SPARQL's polyglot bridge",
          "code": "# SPARQL's polyglot boundary is the endpoint:\n# it queries RDF data from any source via HTTP.\n\n# Local RDF store (in-process)\n# Python: RDFLib\n# Java: Jena TDB\n\n# Remote SPARQL endpoints\nSELECT ?name ?age\nWHERE {\n  SERVICE <https://dbpedia.org/sparql> {\n    ?person foaf:name ?name .\n    ?person foaf:age ?age .\n  }\n}\n\n# Federation across multiple endpoints\nSELECT ?book ?author ?rating\nWHERE {\n  SERVICE <http://books.org/sparql> {\n    ?book dc:creator ?author .\n  }\n  SERVICE <http://reviews.org/sparql> {\n    ?book rev:rating ?rating .\n  }\n}",
          "explanation": "SPARQL's polyglot boundary is the SPARQL endpoint: it queries RDF data from any source via HTTP, enabling federation across multiple data sources. SERVICE clauses bridge different SPARQL endpoints in a single query. RDFLib (Python), Jena (Java), and other libraries convert between SPARQL results and native language objects. This makes SPARQL the universal query bridge that connects heterogeneous data sources through a single declarative query language."
        }
      ],
      "libraries": [
        {
          "name": "W3C SPARQL",
          "url": "https://www.w3.org/TR/sparql11-query/",
          "type": "Spec"
        }
      ],
      "docs": [
        {
          "name": "SPARQL spec",
          "url": "https://www.w3.org/TR/sparql11-query/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# SPARQL variables\n# Variables are prefixed with ? or $\nSELECT ?person ?name ?age\nWHERE {\n  ?person foaf:name ?name .\n  ?person foaf:age ?age .\n}\n\n# Bind a variable\nSELECT ?fullName\nWHERE {\n  ?person foaf:givenName ?given .\n  ?person foaf:familyName ?family .\n  BIND(CONCAT(?given, ' ', ?family) AS ?fullName)\n}",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# SPARQL conditionals (FILTER)\nSELECT ?person ?age\nWHERE {\n  ?person foaf:age ?age .\n  FILTER (?age > 30)           # numeric comparison\n  FILTER (REGEX(?name, '^A'))  # regex match\n  FILTER EXISTS { ?person rdf:type foaf:Person }\n  FILTER NOT EXISTS { ?person foaf:deceased true }\n  FILTER (LANG(?label) = 'en')  # language filter\n}\n\n# Optional patterns (left join)\nSELECT ?name ?email\nWHERE {\n  ?person foaf:name ?name .\n  OPTIONAL { ?person foaf:mbox ?email }\n}",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "# SPARQL has no loops.\n# SPARQL is a declarative query language.\n# Pattern matching replaces iteration:\n# - Basic graph patterns match all triples\n# - Property paths traverse relationships\n# - VALUES provides inline data\n#\n# Subquery is the closest to \"loop\" but is\n# still declarative:\nSELECT ?person (COUNT(?friend) AS ?friendCount)\nWHERE {\n  ?person foaf:knows ?friend .\n}\nGROUP BY ?person\nHAVING (COUNT(?friend) > 5)",
          "difficulty": "N/A"
        },
        "functions": {
          "code": "# SPARQL built-in functions\n# String functions\nSTR(?x)                    # cast to string\nLANG(?label)              # language tag\nDATATYPE(?value)          # datatype URI\nBOUND(?x)                 # is variable bound?\nisIRI(?x)                 # is IRI?\nisLiteral(?x)            # is literal?\nisNumeric(?x)             # is numeric?\n\n# Aggregation\nCOUNT(?x)                 # count\nSUM(?price)               # sum\nAVG(?price)               # average\nMIN(?price) / MAX(?price) # min/max\nGROUP_CONCAT(?name; SEPARATOR=', ')  # concatenate\n\n# Conditional\nIF(?age > 18, 'adult', 'minor')\nCOALESCE(?email, ?phone, 'N/A')",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "# SPARQL performance:\n# 1. Triple store indexing (SPO, POS, OSP)\n# 2. FILTER push-down reduces result sets early\n# 3. LIMIT/OFFSET for pagination\n# 4. Named graphs partition data\n# 5. Federation queries are expensive\n# 6. Use VALUES for known constants\n# 7. Property paths can be expensive\n# 8. SPARQL 1.1 subqueries allow optimization\n\n# Pagination\nSELECT ?s ?p ?o\nWHERE { ?s ?p ?o }\nLIMIT 100 OFFSET 200",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "# SPARQL has no class/OOP system.\n# SPARQL queries graph patterns\n# against RDF triples.\n# RDF Schema (rdfs:Class) and OWL provide\n# type hierarchies, but these are ontology\n# definitions, not OOP classes.\n#\n# Type checking in SPARQL:\n# ?person rdf:type foaf:Person .\n# ?person rdf:type schema:Employee .\n#\n# This is pattern matching on the graph,\n# not class instantiation.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# SPARQL strings\nSELECT ?name\nWHERE {\n  ?person foaf:name ?name .\n  FILTER (LANG(?name) = 'en')   # language filter\n}\n\n# String functions\nCONCAT(?given, ' ', ?family)    # concatenation\nCONTAINS(?name, 'John')         # substring test\nSTRSTARTS(?name, 'A')           # prefix test\nSTRENDS(?name, 'son')            # suffix test\nSTRLEN(?name)                   # length\nLCASE(?name)                    # lowercase\nUCASE(?name)                    # uppercase\nREPLACE(?name, 'a', 'b')       # regex replace\nENCODE_FOR_URI(?name)           # URL encode",
          "difficulty": "intermediate"
        },
        "errors": {
          "code": "# SPARQL error handling\n# SPARQL has no try/catch mechanism.\n# Errors are handled by the query engine:\n# - Type mismatches cause query failure\n# - Unbound variables produce empty results\n# - COALESCE handles missing values\n# - BOUND() checks if variable is bound\n# - IF/COALESCE for conditional defaults\n\nSELECT ?name\nWHERE {\n  ?person foaf:name ?name .\n  FILTER (BOUND(?email))\n}\n\n# HTTP error handling is application-level\n# (Python: RDFLib, Java: Jena, etc.)",
          "difficulty": "N/A"
        },
        "imports": {
          "code": "# SPARQL has no import/include system.\n# SPARQL operates on a named graph collection.\n# Dataset specification replaces imports:\n\n# FROM clause specifies graphs\nSELECT ?name\nFROM <http://example.org/people>\nFROM <http://example.org/addresses>\nWHERE {\n  ?person foaf:name ?name .\n}\n\n# SPARQL 1.1 SERVICE (federation)\nSELECT ?name ?salary\nWHERE {\n  ?person foaf:name ?name .\n  SERVICE <http://other-endpoint/sparql> {\n    ?person hr:salary ?salary .\n  }\n}\n\n# PREFIX declarations\nPREFIX foaf: <http://xmlns.com/foaf/0.1/>\nPREFIX schema: <http://schema.org/>",
          "difficulty": "intermediate"
        }
      },
      "tips": [],
      "categories": [
        "data",
        "query"
      ],
      "overview": "SQL for graph databases — a W3C standard query language for querying RDF triples. Its pattern-based matching turns linked data relationships into actionable query results. Knowledge graph engineers and linked-data researchers — the standard query language for retrieving and filtering RDF data on the semantic web.\n\nTypical projects include Wikidata queries, Knowledge graphs, Semantic web.",
      "learning_curve": "Moderate for basic queries (SELECT, WHERE, FILTER). Steep for advanced features (property paths, federation, CONSTRUCT, SPARQL Update). The RDF data model (triples, URIs, blank nodes) is different from relational SQL and requires a paradigm shift. OWL reasoning adds another layer of complexity.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "SPARQL is the W3C standard query language for RDF data. Used by Wikidata, DBpedia, Linked Data platforms, and knowledge graphs. Apache Jena (Java) and RDFLib (Python) are major implementations. SPARQL 1.1 adds federation, UPDATE, and JSON results. Competing with GraphQL for API queries but targeting graph/semantic data.",
      "common_use_cases": [
        "Wikidata queries",
        "Knowledge graphs",
        "Semantic web"
      ],
      "docs_url": "https://www.w3.org/TR/sparql11-query/",
      "best_for": [
        "RDF knowledge graph querying",
        "Wikidata structured data extraction",
        "Semantic web data integration",
        "RDF knowledge graph querying across linked open data endpoints"
      ],
      "weak_at": [
        "Tabular OLAP reporting better served by SQL aggregations",
        "High-throughput key-value lookups without triple-store infrastructure",
        "Teams without RDF schema design expertise or SPARQL endpoint ops"
      ],
      "official_url": "https://www.w3.org/TR/sparql11-query/",
      "paradigm": [
        "declarative",
        "graph",
        "RDF"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative query or policy notation (schema- or engine-driven)",
        "runtime": "Executed by a database, API server, or policy engine (product-specific)",
        "memory": "Managed by the host system running the query or policy"
      }
    },
    {
      "id": "cypher",
      "name": "Cypher",
      "color": "#018bff",
      "description": "Neo4j's graph query language — ASCII-art patterns describe nodes and relationships. Express complex graph traversals in a few lines that would take pages in SQL joins.",
      "whoItIsFor": "Graph database developers modelling connected data — Neo4j's declarative query language for social networks, fraud detection, and recommendations.",
      "commonUses": [
        "Neo4j queries",
        "Knowledge graphs",
        "Fraud detection",
        "Recommendations"
      ],
      "patterns": [
        {
          "title": "Match",
          "code": "MATCH (p:Person)-[:KNOWS]->(f)\nRETURN p.name, f.name",
          "explanation": "MATCH binds nodes and relationships in the graph so later clauses can filter and return data."
        },
        {
          "title": "MATCH and RETURN",
          "code": "MATCH (p:Person)-[:WORKS_AT]->(c:Company)\nWHERE c.name = \"Acme\"\nRETURN p.name, c.name",
          "explanation": "Pattern matching on nodes and relationships; `WHERE` filters results."
        },
        {
          "title": "CREATE",
          "code": "CREATE (a:Person {name: \"Ada\"})\nCREATE (b:Person {name: \"Grace\"})\nCREATE (a)-[:KNOWS]->(b)",
          "explanation": "Creates nodes with properties and a relationship between them."
        },
        {
          "title": "Transaction / graph traversal boundary - Cypher's polyglot bridge",
          "code": "// Cypher's boundary is the graph database API\n// Applications connect via bolt:// protocol\n\n// From Python (neo4j driver):\n//   driver = GraphDatabase.driver(\"bolt://localhost:7687\")\n//   session = driver.session()\n//   result = session.run(\"MATCH (p:Person) RETURN p\")\n\n// From Java:\n//   try (Session session = driver.session()) {\n//       Result result = session.run(\"MATCH (n) RETURN n\");\n//   }\n\n// Cypher queries are strings passed to drivers\n// The database handles optimization and execution\n\n// REST API also available\n// GET /db/neo4j/tx/commit\n//   {\"statements\": [{\"statement\": \"MATCH (n) RETURN n\"}]}",
          "explanation": "Cypher's polyglot boundary is the database driver API: applications in Python, Java, JavaScript, Go, etc. connect via the Bolt protocol and send Cypher queries as strings. The Neo4j driver handles connection pooling, transaction management, and result streaming. Cypher itself doesn't import external code — it queries and mutates the graph. The boundary is between the query language and the host application that orchestrates queries, processes results, and manages transactions."
        }
      ],
      "libraries": [
        {
          "name": "openCypher",
          "url": "https://opencypher.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Cypher language resources",
          "url": "https://opencypher.org/resources/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// Cypher variables (WITH clause)\nMATCH (p:Person)\nWITH p.name AS name, p.age AS age\nWHERE age > 30\nRETURN name, age\n\n// Parameters (prevent injection)\nMATCH (p:Person {name: $name})\nRETURN p\n// Pass: {name: 'Alice'}",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// Cypher conditionals (CASE)\nMATCH (p:Person)\nRETURN p.name,\n  CASE\n    WHEN p.age > 65 THEN 'senior'\n    WHEN p.age > 30 THEN 'middle'\n    ELSE 'young'\n  END AS category\n\n// WHERE clause filtering\nMATCH (p:Person)\nWHERE p.age > 30 AND p.city = 'NYC'\nRETURN p",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Cypher has no traditional loops\n// All iteration is via graph patterns\n\n// Traverse all friends (loop-free in Cypher)\nMATCH (p:Person)-[:KNOWS]->(friend)\nRETURN p.name, collect(friend.name)\n\n// Variable-length paths (graph traversal)\nMATCH (p:Person)-[:KNOWS*1..3]->(friend)\nRETURN p.name, friend.name\n\n// UNWIND for list expansion\nUNWIND [1, 2, 3] AS x\nRETURN x * 2",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "// Cypher built-in functions\n// Aggregation\nMATCH (p:Person)\nRETURN count(p), avg(p.age), max(p.age)\n\n// String functions\nRETURN toUpper('hello'), trim('  hi  ')\n\n// List functions\nRETURN range(1, 5), size([1,2,3])\n\n// Pattern predicates (EXISTS)\nMATCH (p:Person)\nWHERE EXISTS {\n  MATCH (p)-[:HAS_SKILL]->(:Skill {name: 'Python'})\n}\nRETURN p.name",
          "difficulty": "basic"
        },
        "performance": {
          "code": "// Cypher performance:\n// 1. Use indexes for property lookups\n//    CREATE INDEX FOR (n:Person) ON (n.name)\n// 2. Profile queries: PROFILE MATCH ...\n// 3. Avoid cartesian products (specify patterns)\n// 4. Use LIMIT for large result sets\n// 5. Parameterize queries (avoid re-planning)\n// 6. APOC for complex operations\n\n// Good: indexed lookup\nMATCH (p:Person {name: $name})\nRETURN p",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "// Cypher has labels and relationship types, not classes\n// Labels are like types on nodes\nCREATE (p:Person:Employee {name: 'Alice', age: 30})\n\n// Relationship types\nCREATE (a)-[:KNOWS {since: 2020}]->(b)\n\n// Schema constraints (unique, exists)\nCREATE CONSTRAINT FOR (p:Person)\n  REQUIRE p.email IS UNIQUE",
          "difficulty": "basic"
        },
        "strings": {
          "code": "// Cypher strings\nMATCH (p:Person)\nWHERE p.name STARTS WITH 'Al'\nRETURN p.name, toUpper(p.name)\n\n// String concatenation\nRETURN 'Hello, ' + 'World!'\n\n// String functions\nRETURN substring('Hello', 0, 3),  // 'Hel'\n       replace('Hello', 'l', 'L'),  // 'HeLLo'\n       size('Hello')                 // 5",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Cypher has no TRY/CATCH — handle errors in the client driver\n// Common Neo4j errors: constraint violations, syntax errors\n\nMATCH (p:Person {name: $name})\nRETURN p\n\n// Idempotent writes with MERGE:\nMERGE (p:Person {name: $name})\n  ON CREATE SET p.created = timestamp()\n  ON MATCH SET p.updated = timestamp()",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// Cypher has no import system\n// Queries run within a database context\n\n// Connect to specific database\n:use myDatabase\n\n// APOC procedures extend Cypher\nCALL apoc.load.json('file:///data.json')\nYIELD value\nCREATE (n:Data) SET n += value\n\n// GDS (Graph Data Science) library\nCALL gds.pageRank.stream('myGraph')\nYIELD nodeId, score\nRETURN gds.util.asNode(nodeId).name AS name, score",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "cypher-tip-cardinality",
          "title": "MATCH cardinality explodes quietly",
          "body": "Unconstrained MATCH patterns multiply rows. Profile queries and constrain relationships before blaming “package versions”.",
          "tag": "query",
          "status": "curated"
        }
      ],
      "categories": [
        "data",
        "query"
      ],
      "overview": "Neo4j's graph query language — ASCII-art patterns describe nodes and relationships. Express complex graph traversals in a few lines that would take pages in SQL joins. Graph database developers modelling connected data — Neo4j's declarative query language for social networks, fraud detection, and recommendations.\n\nTypical projects include Neo4j queries, Knowledge graphs, Fraud detection. Neo4j, APOC, and GDS anchor most Cypher work, with openCypher also supported by Neptune, Memgraph, and Redis Graph.",
      "learning_curve": "Gentle for developers familiar with SQL — the pattern-matching syntax (MATCH, WHERE, RETURN) is intuitive. Graph concepts (nodes, relationships, paths) take some adjustment. Advanced features (variable-length paths, APOC procedures) add depth.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Neo4j is the primary database. APOC provides 450+ procedures. GDS (Graph Data Science) for algorithms. Drivers for Python, Java, JS, Go, .NET. Cypher is standardized (openCypher) and used by Redis Graph, Amazon Neptune, and Memgraph.",
      "common_use_cases": [
        "Neo4j queries",
        "Knowledge graphs",
        "Fraud detection",
        "Recommendations"
      ],
      "docs_url": "https://neo4j.com/docs/cypher-manual/current/",
      "best_for": [
        "Neo4j graph database querying",
        "fraud detection and recommendation graph patterns",
        "knowledge graph traversal and path analysis",
        "Neo4j graph database querying with pattern-matching relationship traversals"
      ],
      "weak_at": [
        "Relational reporting normalized into third-normal-form SQL warehouses",
        "Simple CRUD APIs without graph-shaped data or traversal-heavy queries",
        "Multi-vendor graph stores without Neo4j-specific Cypher function dependencies"
      ],
      "official_url": "https://neo4j.com/docs/cypher-manual/",
      "paradigm": [
        "declarative",
        "graph",
        "pattern-matching"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative query or policy notation (schema- or engine-driven)",
        "runtime": "Executed by a database, API server, or policy engine (product-specific)",
        "memory": "Managed by the host system running the query or policy"
      }
    },
    {
      "id": "glsl",
      "name": "GLSL",
      "color": "#5586a4",
      "description": "OpenGL Shading Language — C-like code that runs on the GPU for rendering graphics. Write vertex and fragment shaders that transform geometry and colour every pixel.",
      "whoItIsFor": "Graphics programmers, game developers, and creative coders — the shading language for WebGL, OpenGL, and real-time visual effects on the GPU.",
      "commonUses": [
        "Vertex shaders",
        "Fragment shaders",
        "Post-processing",
        "Procedural art"
      ],
      "patterns": [
        {
          "title": "Fragment",
          "code": "void main() {\n  gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n}",
          "explanation": "The fragment shader returns a constant vec4 so every drawn fragment becomes the same red color."
        },
        {
          "title": "Fragment colour",
          "code": "#version 300 es\nprecision highp float;\nout vec4 fragColor;\nvoid main() {\n  fragColor = vec4(1.0, 0.5, 0.2, 1.0);\n}",
          "explanation": "Fragment shaders output a colour per pixel; `out` writes to the framebuffer."
        },
        {
          "title": "Texture sample (fragment)",
          "code": "#version 300 es\nprecision highp float;\nin vec2 vUv;\nuniform sampler2D uTex;\nout vec4 fragColor;\nvoid main() {\n  fragColor = texture(uTex, vUv);\n}",
          "explanation": "Fragment stage samples a 2D texture at UVs passed from the vertex shader."
        },
        {
          "title": "SSBO — read and write buffer data (data boundary)",
          "code": "#version 460\nlayout(local_size_x = 64) in;\n\nlayout(std430, binding = 0) readonly buffer InputBuf {\n  float data[];\n} input_buf;\n\nlayout(std430, binding = 1) writeonly buffer OutputBuf {\n  float data[];\n} output_buf;\n\nvoid main() {\n  uint i = gl_GlobalInvocationID.x;\n  output_buf.data[i] = input_buf.data[i] * 2.0;\n}",
          "explanation": "Shader Storage Buffer Objects (SSBOs) let compute shaders read and write large arrays of data. The std430 layout avoids padding waste. JavaScript or C++ binds these buffers via glBindBufferBase() matching the layout(binding = N)."
        }
      ],
      "libraries": [
        {
          "name": "OpenGL GLSL",
          "url": "https://registry.khronos.org/OpenGL-Refpages/gl4/index.php",
          "type": "Spec"
        }
      ],
      "docs": [
        {
          "name": "GLSL reference",
          "url": "https://registry.khronos.org/OpenGL-Refpages/gl4/index.php"
        }
      ],
      "compareData": {
        "variables": {
          "code": "float x = 10.0;\nint i = 5;\nuint idx = 0u;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5.0) {\n  // big\n} else {\n  // small\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// No traditional loops in fragment shaders\n// Compute shaders can use for:\nfor (int i = 0; i < 10; i++) { ... }",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "float add(float a, float b) {\n  return a + b;\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Runs on GPU; thousands of concurrent threads. Texture fetches are cached; SSBOs give raw memory. Bounded by memory bandwidth.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "// No string type in GLSL\n// Text handling stays on the CPU side",
          "difficulty": "basic"
        },
        "classes": {
          "code": "struct Light {\n  vec3 direction;\n  vec3 color;\n  float intensity;\n};",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Compile-time validation via GL compiler\n// Check glLinkProgram / glGetShaderInfoLog for errors",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "#version 460\n#extension GL_ARB_shader_ballot : enable\n// Resources bound via layout(binding = N)",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "glsl-tip-stages",
          "title": "Stage I/O and precision dominate bugs",
          "body": "Vertex/fragment mismatches and precision qualifiers cause most GLSL failures. Target a specific GLSL version and GPU, not “portable shell scripts”.",
          "tag": "graphics",
          "status": "curated"
        }
      ],
      "categories": [
        "graphics",
        "shader"
      ],
      "overview": "OpenGL Shading Language — C-like code that runs on the GPU for rendering graphics. Write vertex and fragment shaders that transform geometry and colour every pixel. Graphics programmers, game developers, and creative coders — the shading language for WebGL, OpenGL, and real-time visual effects on the GPU.\n\nTypical projects include Vertex shaders, Fragment shaders, Post-processing. Shadertoy helps learning; Vulkan/GLSL compatibility has some rough edges.",
      "learning_curve": "Moderate — C-like syntax is familiar, but GPU execution model (fragments, invocations, barriers) is different from CPU programming. Understanding the OpenGL/Vulkan pipeline is the bigger challenge.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Universal in OpenGL and WebGL; supported in Vulkan via SPIR-V compilation. Shadertoy is an excellent learning platform. Vulkan/GLSL compatibility has some rough edges.",
      "common_use_cases": [
        "Vertex shaders",
        "Fragment shaders",
        "Post-processing",
        "Procedural art"
      ],
      "docs_url": "https://registry.khronos.org/OpenGL/specs/gl/",
      "best_for": [
        "OpenGL shader development",
        "real-time graphics post-processing",
        "procedural art and visual effects",
        "OpenGL and WebGL shader development for real-time graphics pipelines"
      ],
      "weak_at": [
        "General CPU business logic without GPU context and driver constraints",
        "Cross-platform compute preferring Vulkan SPIR-V or CUDA ecosystems",
        "Large codebases requiring conventional debugging without GPU capture tools"
      ],
      "official_url": "https://www.khronos.org/opengl/wiki/OpenGL_Shading_Language",
      "paradigm": [
        "declarative",
        "GPU",
        "parallel"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static types for shaders and kernel parameters (profile-specific)",
        "runtime": "Compiled for GPUs or accelerators by vendor drivers and toolchains",
        "memory": "Device memory managed by the GPU runtime and kernel launch rules"
      }
    },
    {
      "id": "hlsl",
      "name": "HLSL",
      "color": "#6a9955",
      "description": "High-Level Shading Language — Microsoft's GPU language for DirectX and Xbox. Similar role to GLSL but with different syntax, semantics, and the HLSL-specific texture sampling model.",
      "whoItIsFor": "DirectX game developers and graphics engineers on Windows/Xbox — the shading language for DirectX pipelines, raytracing, and compute shaders.",
      "commonUses": [
        "DirectX shaders",
        "Xbox games",
        "Compute shaders"
      ],
      "patterns": [
        {
          "title": "Pixel shader",
          "code": "float4 main() : SV_Target {\n  return float4(1, 0, 0, 1);\n}",
          "explanation": "The pixel shader outputs a fixed float4 color — here a full-screen red for a minimal shader test."
        },
        {
          "title": "Pixel shader output",
          "code": "float4 main(float4 pos : SV_POSITION) : SV_Target {\n  return float4(1, 0.5, 0.2, 1);\n}",
          "explanation": "HLSL entry returns a float4; `SV_Target` marks the render target output."
        },
        {
          "title": "Texture sample",
          "code": "Texture2D tex;\nSamplerState samp;\nfloat4 main(float2 uv : TEXCOORD0) : SV_Target {\n  return tex.Sample(samp, uv);\n}",
          "explanation": "Uses a sampler to read a texture at UV coordinates."
        },
        {
          "title": "Constant buffer and structured buffer (data boundary)",
          "code": "// CPU-side data layout (must match shader register)\ncbuffer Scene : register(b0) {\n  float4x4 mViewProj;\n  float3   lightDir;\n  float    time;\n};\n\n// GPU-side structured buffer for reading bulk data\nStructuredBuffer<float> inputData : register(t0);\n\n// RW buffer for writing results (compute shader)\nRWStructuredBuffer<float> outputData : register(u0);\n\n[numthreads(64, 1, 1)]\nvoid CSMain(uint3 gid : SV_DispatchThreadID) {\n  outputData[gid.x] = inputData[gid.x] * time;\n}",
          "explanation": "cbuffer passes small uniforms (matrices, scalars) from CPU to shader. StructuredBuffer and RWStructuredBuffer handle bulk data — the register bindings (b0, t0, u0) match what the CPU sets in the root signature or pipeline layout."
        }
      ],
      "libraries": [
        {
          "name": "HLSL docs",
          "url": "https://learn.microsoft.com/windows/win32/direct3dhlsl/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "HLSL reference",
          "url": "https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl"
        }
      ],
      "compareData": {
        "variables": {
          "code": "float x = 10.0;\nint i = 5;\nuint idx = 0;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5.0) {\n  // big\n} else {\n  // small\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "[numthreads(64,1,1)]\nvoid CSMain(uint3 gid : SV_DispatchThreadID) {\n  // No traditional loop — each thread handles one index\n  output[gid.x] = input[gid.x] * 2.0;\n}",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "float add(float a, float b) {\n  return a + b;\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Runs on GPU; thousands of concurrent threads. Constant buffers are fast for small data; structured buffers for bulk. Bounded by memory bandwidth.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "// No string type in HLSL\n// Text handling stays on the CPU side",
          "difficulty": "basic"
        },
        "classes": {
          "code": "struct VSInput {\n  float3 pos : POSITION;\n  float2 uv  : TEXCOORD0;\n};",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Compile-time validation via D3D compiler\n// Check ID3DBlob* for errors after D3DCompile()",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// No import system — #include supported by some compilers\n// Resources bound via registers (b0, t0, u0, s0)",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "hlsl-tip-shader-model",
          "title": "Pin shader model and entry points",
          "body": "HLSL behaviour depends on shader model and target profile. Match the graphics API binding (DX/Vulkan) before blaming the language.",
          "tag": "graphics",
          "status": "curated"
        }
      ],
      "categories": [
        "graphics",
        "shader"
      ],
      "overview": "High-Level Shading Language — Microsoft's GPU language for DirectX and Xbox. Similar role to GLSL but with different syntax, semantics, and the HLSL-specific texture sampling model. DirectX game developers and graphics engineers on Windows/Xbox — the shading language for DirectX pipelines, raytracing, and compute shaders.\n\nTypical projects include DirectX shaders, Xbox games, Compute shaders. DirectX Shader Compiler (DXC) is open source.",
      "learning_curve": "Moderate to steep — requires understanding GPU pipeline stages, register bindings, and the DirectX root signature model. Easier if you know C or GLSL.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Strong in Windows/Xbox ecosystems. DirectX Shader Compiler (DXC) is open source. Fewer cross-platform resources than GLSL.",
      "common_use_cases": [
        "DirectX shaders",
        "Xbox games",
        "Compute shaders"
      ],
      "docs_url": "https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl",
      "best_for": [
        "DirectX shader authoring for games",
        "compute shader GPGPU workloads",
        "Xbox and Windows graphics programming",
        "Direct3D and Xbox graphics shaders using HLSL intrinsic functions"
      ],
      "weak_at": [
        "OpenGL-first macOS or Linux products without HLSL cross-compiler tooling",
        "Server-side REST APIs unrelated to GPU pipeline programming",
        "Web-first graphics without WebGPU WGSL or GLSL compilation targets"
      ],
      "official_url": "https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl",
      "paradigm": [
        "declarative",
        "GPU",
        "DirectX"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static types for shaders and kernel parameters (profile-specific)",
        "runtime": "Compiled for GPUs or accelerators by vendor drivers and toolchains",
        "memory": "Device memory managed by the GPU runtime and kernel launch rules"
      }
    },
    {
      "id": "wgsl",
      "name": "WGSL",
      "color": "#4285f4",
      "description": "WebGPU Shading Language — the shader language for the WebGPU API in browsers. Rust-inspired syntax, designed for safe, portable GPU compute and rendering on the web.",
      "whoItIsFor": "Web graphics developers using the next-gen GPU API — WebGPU's native shading language for compute and rendering in browser-based GPU applications.",
      "commonUses": [
        "WebGPU shaders",
        "Browser compute",
        "3D web apps"
      ],
      "patterns": [
        {
          "title": "Fragment",
          "code": "@fragment\nfn main() -> @location(0) vec4f {\n  return vec4f(1, 0, 0, 1);\n}",
          "explanation": "The @fragment entry returns a vec4<f32> so each pixel is filled with solid red in WebGPU."
        },
        {
          "title": "Entry point",
          "code": "@fragment\nfn fs_main() -> @location(0) vec4<f32> {\n  return vec4<f32>(1.0, 0.5, 0.2, 1.0);\n}",
          "explanation": "WGSL marks shader stages with attributes; fragment returns a colour."
        },
        {
          "title": "Uniform struct",
          "code": "struct Params {\n  tint: vec4<f32>,\n}\n@group(0) @binding(0) var<uniform> params: Params;",
          "explanation": "Groups and bindings match the pipeline layout for GPU resources."
        },
        {
          "title": "Storage buffer — read and write GPU data (data boundary)",
          "code": "// Read from one storage buffer, write to another\n@group(0) @binding(0) var<storage, read> input: array<f32>;\n@group(0) @binding(1) var<storage, read_write> output: array<f32>;\n\n@compute @workgroup_size(64)\nfn main(@builtin(global_invocation_id) gid: vec3u) {\n  let i = gid.x;\n  if (i < arrayLength(&input)) {\n    output[i] = input[i] * 2.0;\n  }\n}",
          "explanation": "Storage buffers are the primary way to move bulk data in and out of WGSL compute shaders. var<storage, read> is read-only; var<storage, read_write> lets the shader write back. JavaScript binds these with device.createBuffer() and passes them in the pipeline layout."
        }
      ],
      "libraries": [
        {
          "name": "WGSL spec",
          "url": "https://www.w3.org/TR/WGSL/",
          "type": "Spec"
        }
      ],
      "docs": [
        {
          "name": "WGSL specification",
          "url": "https://www.w3.org/TR/WGSL/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "var x: f32 = 10.0;\nlet y = 20;  // type inferred as i32",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5.0) {\n  // big\n} else {\n  // small\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// No general loops in WGSL\n// Use parallel dispatch instead: each invocation handles one index\nfor (var i: u32 = 0u; i < 10u; i++) {\n  // only allowed in @compute",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "fn add(a: f32, b: f32) -> f32 {\n  return a + b;\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Runs on GPU; thousands of concurrent threads. Bounded by memory bandwidth and workgroup scheduling.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "// No string type in WGSL\n// Pass text as array<u32> or handle on the JS side",
          "difficulty": "basic"
        },
        "classes": {
          "code": "struct Vertex {\n  @location(0) pos: vec3<f32>,\n  @location(1) uv: vec2<f32>,\n}",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// WGSL validates at shader compile time\n// JavaScript: device.pushErrorScope('validation')\n// Check compilation errors in createShaderModule()",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// No import system — all code in one file\n// Bind resources via @group/@binding attributes",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "wgsl-tip-bindings",
          "title": "Bindings and workgroup sizes are the contract",
          "body": "WGSL bugs are often bind-group layouts or compute workgroup sizing. Align shader with the WebGPU pipeline, not a generic toolchain tip.",
          "tag": "graphics",
          "status": "curated"
        }
      ],
      "categories": [
        "graphics",
        "shader"
      ],
      "overview": "WebGPU Shading Language — the shader language for the WebGPU API in browsers. Rust-inspired syntax, designed for safe, portable GPU compute and rendering on the web. Web graphics developers using the next-gen GPU API — WebGPU's native shading language for compute and rendering in browser-based GPU applications.\n\nTypical projects include WebGPU shaders, Browser compute, 3D web apps. Young but growing with WebGPU adoption in Chrome and wgpu.",
      "learning_curve": "Moderate if you know GLSL or HLSL; the Rust-like syntax and strict type system are friendly. Understanding WebGPU pipeline layout (bind groups, render passes) is the harder part.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Young but growing with WebGPU adoption. wgpu (Rust) and Chrome implement it. Fewer tutorials than GLSL/HLSL but the spec is clean.",
      "common_use_cases": [
        "WebGPU shaders",
        "Browser compute",
        "3D web apps"
      ],
      "docs_url": "https://www.w3.org/TR/WGSL/",
      "best_for": [
        "WebGPU cross-platform shader programming",
        "browser-based compute workloads",
        "3D web application rendering pipelines",
        "WebGPU cross-browser shaders with memory-safe GPU address spaces"
      ],
      "weak_at": [
        "Legacy WebGL-only deployments without WebGPU runtime availability",
        "Native CUDA or Metal kernels outside browser WebGPU sandbox model",
        "Teams needing mature shader debugging tools beyond browser capture layers"
      ],
      "official_url": "https://www.w3.org/TR/WGSL/",
      "paradigm": [
        "declarative",
        "GPU",
        "WebGPU"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static types for shaders and kernel parameters (profile-specific)",
        "runtime": "Compiled for GPUs or accelerators by vendor drivers and toolchains",
        "memory": "Device memory managed by the GPU runtime and kernel launch rules"
      }
    },
    {
      "id": "cuda",
      "name": "CUDA",
      "color": "#76b900",
      "description": "NVIDIA's parallel computing platform — write C/C++ kernels that run on GPU cores. The defacto standard for GPGPU programming in ML training, scientific simulation, and image processing.",
      "whoItIsFor": "ML engineers and scientists doing GPU-accelerated computation — the primary language for NVIDIA GPU programming in deep learning and simulation.",
      "commonUses": [
        "Deep learning",
        "Scientific simulation",
        "Image processing",
        "Crypto mining"
      ],
      "patterns": [
        {
          "title": "Kernel",
          "code": "__global__ void add(int *a, int *b, int *c) {\n  int i = threadIdx.x;\n  c[i] = a[i] + b[i];\n}",
          "explanation": "Parallel addition on the GPU — each thread processes one element via blockIdx and threadIdx."
        },
        {
          "title": "Kernel launch",
          "code": "__global__ void saxpy(int n, float a, const float *x, float *y) {\n  int i = blockIdx.x * blockDim.x + threadIdx.x;\n  if (i < n) y[i] = a * x[i] + y[i];\n}",
          "explanation": "Parallel addition on the GPU — each thread processes one element via blockIdx and threadIdx."
        },
        {
          "title": "Host launch",
          "code": "saxpy<<<(n+255)/256, 256>>>(n, 2.0f, d_x, d_y);",
          "explanation": "Triple angle brackets set grid and block dimensions for the kernel."
        },
        {
          "title": "Host ↔ Device memory transfer (data boundary)",
          "code": "#include <cstdio>\n#include <cuda_runtime.h>\n\n__global__ void double_vals(const float* in, float* out, int n) {\n    int i = blockIdx.x * blockDim.x + threadIdx.x;\n    if (i < n) out[i] = in[i] * 2.0f;\n}\n\nint main() {\n    const int N = 256;\n    float h_in[N], h_out[N];\n    for (int i = 0; i < N; ++i) h_in[i] = float(i);\n\n    float *d_in, *d_out;\n    cudaMalloc(&d_in, N * sizeof(float));\n    cudaMalloc(&d_out, N * sizeof(float));\n\n    // Host → Device\n    cudaMemcpy(d_in, h_in, N * sizeof(float), cudaMemcpyHostToDevice);\n\n    double_vals<<<(N+255)/256, 256>>>(d_in, d_out, N);\n\n    // Device → Host\n    cudaMemcpy(h_out, d_out, N * sizeof(float), cudaMemcpyDeviceToHost);\n\n    printf(\"%f\\n\", h_out[10]); // 20.0\n    cudaFree(d_in); cudaFree(d_out);\n}",
          "explanation": "cudaMemcpy moves data between host (CPU) and device (GPU) memory. This is the fundamental data boundary in CUDA: you allocate on the GPU, copy in, run kernels, copy out. Minimising transfers is the key performance lever."
        }
      ],
      "libraries": [
        {
          "name": "CUDA docs",
          "url": "https://docs.nvidia.com/cuda/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "CUDA toolkit docs",
          "url": "https://docs.nvidia.com/cuda/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "int x = 10;\nfloat f = 3.14f;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5) {\n  printf(\"big\\n\");\n} else {\n  printf(\"small\\n\");\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// No loops on device — use parallel threads instead\n// Host-side loop:\nfor (int i = 0; i < N; ++i) { ... }",
          "difficulty": "basic"
        },
        "functions": {
          "code": "__device__ float square(float x) {\n  return x * x;\n}\n// __global__ = callable from host, runs on device\n// __device__ = callable from device only",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "Runs on NVIDIA GPUs; thousands of concurrent threads. Memory transfers between host and device are the main bottleneck.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "// No std::string on device; use char arrays\n__device__ char name[32];",
          "difficulty": "basic"
        },
        "classes": {
          "code": "// No virtual functions on device\nstruct Point {\n  float x, y;\n  __device__ float len() { return sqrtf(x*x + y*y); }\n};",
          "difficulty": "intermediate"
        },
        "errors": {
          "code": "cudaError_t err = cudaMalloc(&ptr, size);\nif (err != cudaSuccess) {\n  printf(\"CUDA error: %s\\n\", cudaGetErrorString(err));\n}",
          "difficulty": "basic"
        },
        "imports": {
          "code": "#include <cuda_runtime.h>\n#include <cstdio>",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "systems",
        "gpu"
      ],
      "overview": "NVIDIA's parallel computing platform — write C/C++ kernels that run on GPU cores. The defacto standard for GPGPU programming in ML training, scientific simulation, and image processing. ML engineers and scientists doing GPU-accelerated computation — the primary language for NVIDIA GPU programming in deep learning and simulation.\n\nTypical projects include Deep learning, Scientific simulation, Image processing. NVIDIA-only — cuDNN and cuBLAS provide high-level primitives.",
      "learning_curve": "Steep — requires understanding GPU memory hierarchy, thread hierarchy (grid/block/thread), and host-device data flow. Prior C/C++ experience expected.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "NVIDIA-only ecosystem. cuDNN, cuBLAS, and Thrust provide high-level primitives. Competition from ROCm/HIP for AMD GPUs.",
      "common_use_cases": [
        "Deep learning",
        "Scientific simulation",
        "Image processing",
        "Crypto mining"
      ],
      "docs_url": "https://docs.nvidia.com/cuda/",
      "best_for": [
        "GPU-accelerated deep learning training",
        "scientific simulation on NVIDIA hardware",
        "high-performance parallel algorithm implementation",
        "NVIDIA GPU kernels for deep learning training and inference acceleration"
      ],
      "weak_at": [
        "Cross-vendor GPU code targeting AMD or Intel without portability layers",
        "Small embedded devices without discrete NVIDIA GPU hardware",
        "Business logic better expressed on CPU without kernel launch overhead"
      ],
      "official_url": "https://developer.nvidia.com/cuda-toolkit",
      "paradigm": [
        "imperative",
        "GPU",
        "data-parallel"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static types for shaders and kernel parameters (profile-specific)",
        "runtime": "Compiled for GPUs or accelerators by vendor drivers and toolchains",
        "memory": "Device memory managed by the GPU runtime and kernel launch rules"
      }
    },
    {
      "id": "opencl",
      "name": "OpenCL",
      "color": "#ed1c24",
      "description": "Open Computing Language — cross-vendor parallel programming for GPUs and CPUs with portable kernels and queues.",
      "whoItIsFor": "HPC developers targeting heterogeneous hardware (AMD, Intel, NVIDIA) — write parallel kernels that run across CPUs, GPUs, and accelerators.",
      "commonUses": [
        "Scientific computing",
        "Image processing",
        "Cross-vendor GPU"
      ],
      "patterns": [
        {
          "title": "Vector addition kernel",
          "code": "__kernel void add(__global int* a, __global int* b, __global int* c) {\n  int i = get_global_id(0);\n  c[i] = a[i] + b[i];\n}",
          "explanation": "Each work-item adds one element — the host launches an NDRange over the buffer length."
        },
        {
          "title": "Kernel",
          "code": "__kernel void square(__global const float *in, __global float *out) {\n  int i = get_global_id(0);\n  out[i] = in[i] * in[i];\n}",
          "explanation": "OpenCL kernels use `get_global_id` for the parallel index."
        },
        {
          "title": "Vector add",
          "code": "__kernel void add(\n  __global const float *a,\n  __global const float *b,\n  __global float *c\n) {\n  int i = get_global_id(0);\n  c[i] = a[i] + b[i];\n}",
          "explanation": "Each work-item adds one element — the host launches an NDRange over the buffer length."
        },
        {
          "title": "Create buffers and transfer data (host ↔ device boundary)",
          "code": "// Host code (C API)\ncl_mem d_a = clCreateBuffer(ctx, CL_MEM_READ_ONLY,\n                            N * sizeof(float), NULL, &err);\ncl_mem d_b = clCreateBuffer(ctx, CL_MEM_READ_ONLY,\n                            N * sizeof(float), NULL, &err);\ncl_mem d_c = clCreateBuffer(ctx, CL_MEM_WRITE_ONLY,\n                            N * sizeof(float), NULL, &err);\n\n// Copy host data to device\nclEnqueueWriteBuffer(queue, d_a, CL_TRUE, 0,\n                     N * sizeof(float), h_a, 0, NULL, NULL);\nclEnqueueWriteBuffer(queue, d_b, CL_TRUE, 0,\n                     N * sizeof(float), h_b, 0, NULL, NULL);\n\n// Set kernel arguments and launch\nclSetKernelArg(kernel, 0, sizeof(cl_mem), &d_a);\nclSetKernelArg(kernel, 1, sizeof(cl_mem), &d_b);\nclSetKernelArg(kernel, 2, sizeof(cl_mem), &d_c);\nclEnqueueNDRangeKernel(queue, kernel, 1, NULL,\n                       &global_size, &local_size, 0, NULL, NULL);\n\n// Read result back to host\nclEnqueueReadBuffer(queue, d_c, CL_TRUE, 0,\n                    N * sizeof(float), h_c, 0, NULL, NULL);",
          "explanation": "clCreateBuffer allocates device memory. clEnqueueWriteBuffer copies host data to the device. clSetKernelArg binds those buffers to kernel parameters. clEnqueueNDRangeKernel runs the kernel across work-items. clEnqueueReadBuffer copies results back. This is the core data-flow cycle in OpenCL."
        }
      ],
      "libraries": [
        {
          "name": "OpenCL spec",
          "url": "https://www.khronos.org/opencl/",
          "type": "Spec"
        }
      ],
      "docs": [
        {
          "name": "OpenCL reference",
          "url": "https://www.khronos.org/opencl/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "__global float x = 10.0f;\n__private int i = 5;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "if (x > 5.0f) {\n  // big\n} else {\n  // small\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Inside a kernel, each work-item handles one index\nfor (int i = 0; i < N; i++) { ... }",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "__kernel void add(__global float* a, __global float* b, __global float* c) {\n  int i = get_global_id(0);\n  c[i] = a[i] + b[i];\n}",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "Runs on GPU/CPU accelerators; thousands of concurrent work-items. Memory transfers between host and device are the main bottleneck.",
          "difficulty": "basic"
        },
        "strings": {
          "code": "// No string type in OpenCL C\n// Text handling stays on the host side",
          "difficulty": "basic"
        },
        "classes": {
          "code": "// No classes in OpenCL C — use structs\ntypedef struct { float x, y; } Point;",
          "difficulty": "basic"
        },
        "errors": {
          "code": "cl_int err;\ncl_mem buf = clCreateBuffer(ctx, CL_MEM_READ_ONLY, size, NULL, &err);\nif (err != CL_SUCCESS) {\n  printf(\"OpenCL error: %d\\n\", err);\n}",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// No includes in kernel code\n// Host: #include <CL/cl.h>",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "systems",
        "gpu"
      ],
      "overview": "Open Computing Language — cross-vendor parallel programming for GPUs and CPUs with portable kernels and queues. HPC developers targeting heterogeneous hardware (AMD, Intel, NVIDIA) — write parallel kernels that run across CPUs, GPUs, and accelerators.\n\nTypical projects include Scientific computing, Image processing, Cross-vendor GPU. Driver quality varies across vendors; SYCL and Vulkan compute compete in new projects.",
      "learning_curve": "Steep — requires understanding platform/device model, context creation, command queues, buffer management, and kernel compilation. More verbose than CUDA for the same tasks.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Cross-vendor (AMD, Intel, NVIDIA, ARM) but fragmented driver quality. OpenCL 3.0 is the latest spec. Being supplanted by SYCL and Vulkan compute in new projects.",
      "common_use_cases": [
        "Scientific computing",
        "Image processing",
        "Cross-vendor GPU"
      ],
      "docs_url": "https://registry.khronos.org/OpenCL/",
      "best_for": [
        "Cross-vendor GPGPU computing",
        "heterogeneous device parallel processing",
        "portable GPU-accelerated scientific code",
        "Cross-vendor GPGPU computing on CPUs, GPUs, and accelerators"
      ],
      "weak_at": [
        "NVIDIA-only ML stacks where CUDA ecosystem maturity dominates",
        "Simple scripts without heterogeneous device management complexity",
        "Web-facing services without batch offline compute scheduling needs"
      ],
      "official_url": "https://www.khronos.org/opencl/",
      "paradigm": [
        "imperative",
        "GPU",
        "heterogeneous"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static types for shaders and kernel parameters (profile-specific)",
        "runtime": "Compiled for GPUs or accelerators by vendor drivers and toolchains",
        "memory": "Device memory managed by the GPU runtime and kernel launch rules"
      }
    },
    {
      "id": "verilog",
      "name": "Verilog",
      "color": "#848200",
      "description": "A hardware description language for designing digital circuits — FPGAs and ASICs. Describe what hardware does, not how to build it; the synthesiser generates the gates.",
      "whoItIsFor": "Hardware engineers designing chips and FPGA logic — the foundational HDL for digital circuit description, simulation, and synthesis.",
      "commonUses": [
        "FPGA design",
        "ASIC design",
        "Digital logic simulation"
      ],
      "patterns": [
        {
          "title": "Module",
          "code": "module adder(input [7:0] a, b, output [7:0] sum);\n  assign sum = a + b;\nendmodule",
          "explanation": "Combinational adder module — Verilog modules describe hardware blocks with input and output ports."
        },
        {
          "title": "Sequential always block",
          "code": "always @(posedge clk or negedge rst_n)\n  if (!rst_n)\n    q <= 1'b0;\n  else\n    q <= d;",
          "explanation": "Classic Verilog: nonblocking assignments (`<=`) model flip-flops on the clock edge."
        },
        {
          "title": "Instantiation",
          "code": "adder u_add (\n  .a(a[7:0]),\n  .b(b[7:0]),\n  .sum(sum[7:0])\n);",
          "explanation": "Named port connection wires child ports to parent signals."
        },
        {
          "title": "Simulation/synthesis boundary - Verilog's polyglot bridge",
          "code": "// Verilog's polyglot boundary is simulation/synthesis:\n// RTL code compiles to gate-level netlists (synthesis)\n// and simulates as digital hardware (simulation).\n\n// Top-level module\nmodule top (\n  input clk, reset,\n  output [7:0] led\n);\n  // Instantiate sub-modules\n  counter #(.WIDTH(8)) u_counter (\n    .clk(clk),\n    .reset(reset),\n    .count(led)\n  );\nendmodule\n\n// Testbench (simulation only)\nmodule tb;\n  reg clk, reset;\n  wire [7:0] led;\n  \n  top uut (.clk(clk), .reset(reset), .led(led));\n  \n  initial begin\n    clk = 0; reset = 1;\n    #10 reset = 0;\n    #1000 $finish;\n  end\n  always #5 clk = ~clk;\nendmodule",
          "explanation": "Verilog's polyglot boundary is simulation/synthesis: the same RTL code compiles to gate-level netlists for FPGA/ASIC implementation (synthesis) and simulates as digital hardware (testbench). Module instantiation bridges different abstraction levels (behavioral, RTL, gate). SystemVerilog extends this with classes, interfaces, and packages for testbench verification. This makes Verilog the universal hardware description bridge that connects design intent to physical implementation."
        }
      ],
      "libraries": [
        {
          "name": "IEEE Verilog",
          "url": "https://standards.ieee.org/standard/1364-2005.html",
          "type": "Standard"
        }
      ],
      "docs": [
        {
          "name": "Verilog tutorial",
          "url": "https://www.chipverify.com/verilog/verilog-tutorial"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// Verilog variables\nreg [7:0] data_bus;      // 8-bit register\nwire [31:0] address;     // 32-bit wire\ninteger count;            // integer variable\nreal pi;                  // real number\nparameter WIDTH = 8;      // compile-time constant\nlocalparam DEPTH = 16;    // local constant\n\n// Arrays\nreg [7:0] memory [0:255]; // 256x8 memory\n\n// Assignment\nalways @(posedge clk) begin\n  data_bus <= 8'hFF;     // non-blocking\n  count = count + 1;      // blocking\nend",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// Verilog conditionals\n// if/else\nif (reset) begin\n  count <= 0;\nend else if (enable) begin\n  count <= count + 1;\nend else begin\n  count <= count;\nend\n\n// Ternary\nassign result = (sel == 2'b00) ? a :\n                (sel == 2'b01) ? b :\n                (sel == 2'b10) ? c : d;\n\n// case\nalways @(*) begin\n  case (state)\n    2'b00: next_state = 2'b01;\n    2'b01: next_state = 2'b10;\n    2'b10: next_state = 2'b11;\n    default: next_state = 2'b00;\n  endcase\nend",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Verilog loops\n// for loop (synthesizable with constant bounds)\ninteger i;\nalways @(posedge clk) begin\n  for (i = 0; i < 8; i = i + 1) begin\n    memory[i] <= 0;\n  end\nend\n\n// generate loop (creates hardware)\ngenvar j;\ngenerate\n  for (j = 0; j < 8; j = j + 1) begin : gen_bit\n    assign result[j] = a[j] & b[j];\n  end\nendgenerate\n\n// while loop (simulation only)\nalways begin\n  while (enable) begin\n    #10 data = data + 1;\n  end\nend",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "// Verilog functions (task and function)\n// Function (returns value, no delays)\nfunction [7:0] reverse_bits;\n  input [7:0] data;\n  integer i;\n  begin\n    for (i = 0; i < 8; i = i + 1)\n      reverse_bits[7-i] = data[i];\n  end\nendfunction\n\n// Task (can have delays, no return value)\ntask add_values;\n  input [7:0] a, b;\n  output [7:0] result;\n  begin\n    result = a + b;\n  end\nendtask\n\n// Always use function over task when possible\n// (synthesizable, no timing controls)",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "// Verilog performance:\n// 1. Simulation speed depends on testbench design\n// 2. Synthesis maps to FPGA/ASIC gates\n// 3. Critical path determines max clock frequency\n// 4. Pipelining increases throughput\n// 5. Blocking assignments in combinational logic\n// 6. Non-blocking in sequential logic\n// 7. Use generate for replicated structures\n\n// Timing analysis\n// set_max_delay 10 [get_paths]\n// set_min_delay 2 [get_paths]",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "// Verilog has no class/OOP system.\n// Reusability comes from:\n// - Modules (hardware blocks)\n// - Parameters (generic modules)\n// - Generate blocks (replicated structures)\n// - Tasks and functions (behavioral)\n// These are NOT classes in the OOP sense.\n// Use modules and parameters for reusable hardware.\n\n// Parameterized module\nmodule adder #(\n  parameter WIDTH = 8\n)(\n  input  [WIDTH-1:0] a, b,\n  output [WIDTH-1:0] sum\n);\n  assign sum = a + b;\nendmodule",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "// Verilog strings\n// Limited in Verilog; richer in SystemVerilog\n// Verilog: strings are bit vectors\nreg [8*6-1:0] greeting = \"Hello!\";\n\n// SystemVerilog has proper string type\n// string msg = \"Hello, Verilog!\";\n\n// Display strings\ndisplay_data: $display(\"Value: %0d\", count);\n$display(\"String: %s\", greeting);\n$display(\"Hex: %h\", data_bus);\n\n// Note: Classic Verilog has limited string\n// handling. Use SystemVerilog 'string' type\n// for proper string operations.",
          "difficulty": "N/A"
        },
        "errors": {
          "code": "// Verilog error handling\n// Compile-time errors\n// - Undefined module\n// - Port mismatch\n// - Width mismatch\n\n// Simulation-time errors\n// - X propagation (unknown values)\n// - Z propagation (high impedance)\n\n// Debugging\ninitial begin\n  $display(\"Starting simulation\");\n  $monitor(\"Time=%0t count=%0d\", $time, count);\n  $assert(a != b);  // assertion\nend\n\n// System tasks\n// $finish - end simulation\n// $stop - pause simulation\n// $error - report error\n// $warning - report warning\n// $fatal - report fatal error",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// Verilog imports (include files)\n// `include directive\n`include \"defines.v\"       // include file\n`include \"modules.v\"      // include modules\n\n// Library modules\n// Use `-y` flag in simulation for library paths\n// iverilog -y ./lib -o sim tb.v top.v\n\n// SystemVerilog packages\npackage my_pkg;\n  parameter WIDTH = 8;\n  typedef logic [WIDTH-1:0] data_t;\nendpackage\n\nimport my_pkg::*;\n\n// Note: Verilog uses `include and -y\n// library paths, not ES-style imports.\n// SystemVerilog adds packages and import.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "verilog-tip-sim-vs-synth",
          "title": "Simulation vs synthesis are different languages",
          "body": "Many Verilog constructs simulate but do not synthesize. Separate testbenches from RTL and pin the simulator/synthesis tool pair.",
          "tag": "hdl",
          "status": "curated"
        }
      ],
      "categories": [
        "hardware",
        "hdl"
      ],
      "overview": "A hardware description language for designing digital circuits — FPGAs and ASICs. Describe what hardware does, not how to build it; the synthesiser generates the gates. Hardware engineers designing chips and FPGA logic — the foundational HDL for digital circuit description, simulation, and synthesis.\n\nTypical projects include FPGA design, ASIC design, Digital logic simulation.",
      "learning_curve": "Steep — Verilog requires understanding digital logic (flip-flops, state machines, timing) before writing meaningful code. Synthesis constraints add complexity. The distinction between blocking/non-blocking assignments trips up beginners. Simulation vs synthesis mismatch is a common pitfall. SystemVerilog adds more features but also more complexity.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Verilog is the dominant HDL alongside VHDL. Used for FPGA and ASIC design. Icarus Verilog (open-source simulator), Verilator (fast simulator), Vivado (Xilinx), Quartus (Intel). SystemVerilog extends Verilog with OOP, interfaces, assertions. Most new projects use SystemVerilog for verification.",
      "common_use_cases": [
        "FPGA design",
        "ASIC design",
        "Digital logic simulation"
      ],
      "docs_url": "https://www.chipverify.com/verilog/verilog-tutorial",
      "best_for": [
        "FPGA and ASIC digital logic design",
        "hardware simulation and synthesis",
        "low-level digital circuit description",
        "RTL digital design for ASIC and FPGA synthesis flows"
      ],
      "weak_at": [
        "Software application backends without EDA toolchain investments",
        "Agile web product iteration unrelated to gate-level timing closure",
        "Teams without silicon validation labs or FPGA prototyping hardware"
      ],
      "official_url": "https://ieeexplore.ieee.org/document/1620780",
      "paradigm": [
        "hardware-description",
        "event-driven",
        "RTL"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Hardware description with static structure (not a software application language)",
        "runtime": "Synthesised or simulated by EDA tools (not executed like application code)",
        "memory": "Hardware resources described structurally; not a software heap"
      }
    },
    {
      "id": "vhdl",
      "name": "VHDL",
      "color": "#adb2cb",
      "description": "VHSIC Hardware Description Language — verbose but precise digital circuit design. Its strong typing and simulation features catch design errors before synthesis.",
      "whoItIsFor": "European and defence-sector hardware engineers and FPGA developers — strongly typed HDL preferred for safety-critical and military-grade designs.",
      "commonUses": [
        "FPGA design",
        "ASIC design",
        "Military/aerospace hardware"
      ],
      "patterns": [
        {
          "title": "Entity",
          "code": "entity adder is\n  port(a, b : in integer; sum : out integer);\nend adder;\n\narchitecture rtl of adder is\nbegin\n  sum <= a + b;\nend rtl;",
          "explanation": "Entity declares the interface; architecture defines the behaviour — VHDL separates spec from impl."
        },
        {
          "title": "Entity and architecture",
          "code": "entity xor2 is\n  port (\n    a, b : in  std_logic;\n    y    : out std_logic\n  );\nend entity xor2;\n\narchitecture rtl of xor2 is\nbegin\n  y <= a xor b;\nend architecture rtl;",
          "explanation": "Entity declares the interface; architecture defines behaviour — here a two-input XOR gate, not an adder."
        },
        {
          "title": "Process",
          "code": "process(clk)\nbegin\n  if rising_edge(clk) then\n    q <= d;\n  end if;\nend process;",
          "explanation": "Processes describe sequential logic sensitive to clock edges."
        },
        {
          "title": "Simulation/synthesis boundary - VHDL's polyglot bridge",
          "code": "-- VHDL's polyglot boundary is simulation/synthesis:\n-- RTL code compiles to gate-level netlists (synthesis)\n-- and simulates as digital hardware (testbench).\n\n-- Entity declaration (interface)\nentity top is\n  port (\n    clk   : in std_logic;\n    reset : in std_logic;\n    led   : out std_logic_vector(7 downto 0)\n  );\nend entity;\n\n-- Architecture (implementation)\narchitecture rtl of top is\n  component counter is\n    generic (WIDTH : integer := 8);\n    port (clk, reset : in std_logic;\n          count : out std_logic_vector(WIDTH-1 downto 0));\n  end component;\nbegin\n  u_counter : counter generic map (WIDTH => 8)\n    port map (clk => clk, reset => reset, count => led);\nend architecture;\n\n-- Testbench\nentity tb is end entity;\narchitecture sim of tb is\n  signal clk, reset : std_logic;\n  signal led : std_logic_vector(7 downto 0);\nbegin\n  uut : entity work.top port map (clk, reset, led);\n  clk_gen : process begin clk <= '0'; wait for 5 ns; clk <= '1'; wait for 5 ns; end process;\nend architecture;",
          "explanation": "VHDL's polyglot boundary is simulation/synthesis: the same RTL code compiles to gate-level netlists for FPGA/ASIC implementation (synthesis) and simulates as digital hardware (testbench). Entity/architecture separation allows multiple implementations of the same interface. Generate statements create replicated hardware structures. This makes VHDL the universal hardware description bridge that connects design intent to physical implementation, with strong typing catching errors before synthesis."
        }
      ],
      "libraries": [
        {
          "name": "VHDL reference",
          "url": "https://www.vhdl.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "VHDL tutorial",
          "url": "https://www.nandland.com/vhdl/tutorials/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "-- VHDL variables\nsignal count : integer := 0;\nsignal data  : std_logic_vector(7 downto 0) := (others => '0');\nconstant WIDTH : integer := 8;\n\n-- Variable (inside process)\nprocess(clk)\n  variable temp : std_logic_vector(7 downto 0);\nbegin\n  temp := data_bus;\n  count <= count + 1;  -- signal assignment\nend process;\n\n-- Generic (parameter)\nentity adder is\n  generic (WIDTH : integer := 8);\n  port (a, b : in std_logic_vector(WIDTH-1 downto 0);\n        sum  : out std_logic_vector(WIDTH-1 downto 0));\nend entity;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "-- VHDL conditionals\n-- if/then/else\nprocess(clk)\nbegin\n  if reset = '1' then\n    count <= 0;\n  elsif rising_edge(clk) then\n    if enable = '1' then\n      count <= count + 1;\n    end if;\n  end if;\nend process;\n\n-- case/when\nprocess(sel)\nbegin\n  case sel is\n    when \"00\" => result <= a;\n    when \"01\" => result <= b;\n    when \"10\" => result <= c;\n    when others => result <= d;\n  end case;\nend process;\n\n-- when/else (concurrent)\nresult <= a when sel = \"00\" else\n          b when sel = \"01\" else\n          c;",
          "difficulty": "basic"
        },
        "loops": {
          "code": "-- VHDL loops\n-- for loop (synthesizable with constant bounds)\nprocess(clk)\nbegin\n  if rising_edge(clk) then\n    for i in 0 to 7 loop\n      memory(i) <= memory(i+1);\n    end loop;\n  end if;\nend process;\n\n-- generate loop (creates hardware)\ngen: for i in 0 to 7 generate\n  bit_slice : entity work.and_gate\n    port map (a => data(i), b => mask(i), y => result(i));\nend generate;\n\n-- while loop (simulation only)\nprocess\n  variable i : integer := 0;\nbegin\n  while i < 10 loop\n    report \"i = \" & integer'image(i);\n    i := i + 1;\n  end loop;\n  wait;\nend process;",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "-- VHDL functions and procedures\n-- Function (returns value, no delays)\nfunction parity(d : std_logic_vector) return std_logic is\n  variable result : std_logic := '0';\nbegin\n  for i in d'range loop\n    result := result xor d(i);\n  end loop;\n  return result;\nend function;\n\n-- Procedure (can have delays, no return value)\nprocedure reset_signal(\n  signal rst : out std_logic;\n  constant duration : in time\n) is\nbegin\n  rst <= '1';\n  wait for duration;\n  rst <= '0';\nend procedure;\n\n-- Package (grouping)\npackage my_pkg is\n  function parity(d : std_logic_vector) return std_logic;\n  constant WIDTH : integer := 8;\nend package;",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "-- VHDL performance:\n-- 1. Simulation speed depends on testbench design\n-- 2. Synthesis maps to FPGA/ASIC gates\n-- 3. Critical path determines max clock frequency\n-- 4. Pipelining increases throughput\n-- 5. Use numeric_std (not std_logic_arith)\n-- 6. Avoid latch inference in combinational blocks\n-- 7. Use generate for replicated structures\n\n-- Timing constraints (Vivado)\n-- create_clock -period 10 [get_ports clk]\n-- set_max_delay 5 [get_paths -from data_in]",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "-- VHDL has no class/OOP system.\n-- Reusability comes from:\n-- - Entities and architectures (hardware blocks)\n-- - Generic parameters (configurable modules)\n-- - Generate statements (replicated structures)\n-- - Packages (shared declarations)\n-- - Configurations (binding)\n-- These are NOT classes in the OOP sense.\n-- Use entities and generics for reusable hardware.\n\n-- Generic module\nentity counter is\n  generic (WIDTH : integer := 8);\n  port (clk   : in std_logic;\n        reset : in std_logic;\n        count : out std_logic_vector(WIDTH-1 downto 0));\nend entity;",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "-- VHDL strings\n-- String literals\nconstant greeting : string := \"Hello, VHDL!\";\n\n-- Character type\nsignal ch : character := 'A';\n\n-- String operations\n-- VHDL has limited built-in string operations\n-- Most string handling is via packages\n\n-- Display\nreport \"Counter value: \" & integer'image(count);\nreport \"Error at time \" & time'image(now);\n\n-- Text I/O (simulation)\nuse std.textio.all;\nprocess\n  variable line_buf : line;\nbegin\n  write(line_buf, string'(\"Value: \"));\n  write(line_buf, count);\n  writeline(output, line_buf);\nend process;",
          "difficulty": "basic"
        },
        "errors": {
          "code": "-- VHDL error handling\n-- Compile-time errors\n-- - Type mismatches\n-- - Undeclared signals\n-- - Port width mismatches\n\n-- Simulation-time assertions\nassert reset = '1' or enable = '0'\n  report \"Reset must be active or enable inactive\"\n  severity error;\n\n-- Debugging\nreport \"Current state: \" & state_type'image(current_state);\n\n-- Severity levels\nassert false\n  report \"Simulation completed\"\n  severity note;    -- note, warning, error, failure\n\n-- Simulation control\n-- wait;  -- stop simulation\n-- assert condition report \"msg\" severity level;",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "-- VHDL imports (library and use)\n-- Library declaration\nlibrary IEEE;\nuse IEEE.STD_LOGIC_1164.ALL;\nuse IEEE.NUMERIC_STD.ALL;\n\n-- Work library (current project)\nuse work.my_pkg.all;\n\n-- Package declaration\npackage my_pkg is\n  constant WIDTH : integer := 8;\n  type state_type is (IDLE, RUN, DONE);\n  function parity(d : std_logic_vector) return std_logic;\nend package;\n\n-- Package body\npackage body my_pkg is\n  function parity(d : std_logic_vector) return std_logic is\n  begin\n    -- implementation\n  end function;\nend package body;\n\n-- Note: VHDL uses library/use, not ES-style imports.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "vhdl-tip-sim-vs-synth",
          "title": "Simulation vs synthesis diverge",
          "body": "VHDL testbenches and synthesizable RTL follow different rules. Explicit clocks/resets beat “unsafe/FFI” framing.",
          "tag": "hdl",
          "status": "curated"
        }
      ],
      "categories": [
        "hardware",
        "hdl"
      ],
      "overview": "VHSIC Hardware Description Language — verbose but precise digital circuit design. Its strong typing and simulation features catch design errors before synthesis. European and defence-sector hardware engineers and FPGA developers — strongly typed HDL preferred for safety-critical and military-grade designs.\n\nTypical projects include FPGA design, ASIC design, Military/aerospace hardware. Mandatory for US DoD projects; preferred in Europe and defence industries.",
      "learning_curve": "Steep — VHDL's strong typing system and verbose syntax create a high barrier to entry. Understanding digital logic (flip-flops, state machines, timing) is prerequisite. The distinction between signals and variables, and concurrent vs sequential statements, trips up beginners. However, the strong typing catches many errors before simulation.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "VHDL is the dominant HDL alongside Verilog. Mandatory for US Department of Defense projects (its origin). Strongly typed, verbose, and unambiguous. Used for FPGA and ASIC design. GHDL (open-source simulator), Vivado (Xilinx), Quartus (Intel), ModelSim/Questa (Mentor). VHDL-2019 adds improved features. Preferred in Europe and defense industries.",
      "common_use_cases": [
        "FPGA design",
        "ASIC design",
        "Military/aerospace hardware"
      ],
      "docs_url": "https://www.ieee.org/",
      "best_for": [
        "defence and aerospace hardware design",
        "safety-critical FPGA development",
        "formal hardware specification and verification",
        "Avionics and defense FPGA designs favoring VHDL typing discipline"
      ],
      "weak_at": [
        "Rapid scripting automation unrelated to hardware description languages",
        "JavaScript front-end products without RTL simulation environments",
        "Startups without FPGA boards, synthesis licenses, or verification IP"
      ],
      "official_url": "https://ieeexplore.ieee.org/document/8938196",
      "paradigm": [
        "hardware-description",
        "strongly-typed",
        "RTL"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Hardware description with static structure (not a software application language)",
        "runtime": "Synthesised or simulated by EDA tools (not executed like application code)",
        "memory": "Hardware resources described structurally; not a software heap"
      }
    },
    {
      "id": "systemverilog",
      "name": "SystemVerilog",
      "color": "#daa520",
      "description": "An extension of Verilog adding OOP, assertions, and verification features. Used for both design and testbench; its constrained-random verification methodology dominates ASIC verification.",
      "whoItIsFor": "Verification engineers and chip designers needing testbench power — extends Verilog with OOP, assertions, and constrained-random stimulus.",
      "commonUses": [
        "Chip verification",
        "UVM testbenches",
        "FPGA design"
      ],
      "patterns": [
        {
          "title": "Class",
          "code": "class Packet;\n  rand bit [7:0] data;\nendclass",
          "explanation": "Randomizable class with rand variables — SystemVerilog's OOP enables constrained-random verification."
        },
        {
          "title": "Interface",
          "code": "interface bus_if;\n  logic clk;\n  logic [7:0] data;\n  modport master (input clk, output data);\nendinterface",
          "explanation": "Bundles signals and defines modports for master/slave views."
        },
        {
          "title": "Assertion",
          "code": "assert property (@(posedge clk) req |-> ##1 gnt);\n",
          "explanation": "SVA expresses temporal properties checked by simulators or formal tools."
        },
        {
          "title": "Verification/synthesis boundary - SystemVerilog's polyglot bridge",
          "code": "// SystemVerilog's polyglot boundary is verification/synthesis:\n// The same language serves both design (synthesizable RTL)\n// and verification (testbench with OOP, constrained random).\n\n// Synthesizable design module\nmodule counter #(\n  parameter WIDTH = 8\n)(\n  input  logic             clk,\n  input  logic             reset,\n  output logic [WIDTH-1:0] count\n);\n  always_ff @(posedge clk)\n    if (reset) count <= 0;\n    else       count <= count + 1;\nendmodule\n\n// Testbench using classes (not synthesizable)\nclass CounterTest extends uvm_test;\n  `uvm_component_utils(CounterTest)\n  \n  task run_phase(uvm_phase phase);\n    CounterTxn txn;\n    for (int i = 0; i < 10; i++) begin\n      txn = new();\n      assert(txn.randomize());\n      // Drive DUT and check responses\n    end\n  endtask\nendclass",
          "explanation": "SystemVerilog's polyglot boundary is verification/synthesis: the same language bridges synthesizable RTL (design intent) with verification testbenches (constrained random, coverage, assertions). SystemVerilog extends Verilog with OOP (classes, inheritance), proper strings, and packages — making it both a hardware description language and a verification language. UVM (Universal Verification Methodology) is built on this dual nature, using classes for testbenches while the design compiles to gates."
        }
      ],
      "libraries": [
        {
          "name": "IEEE SV",
          "url": "https://standards.ieee.org/standard/1800-2017.html",
          "type": "Standard"
        }
      ],
      "docs": [
        {
          "name": "SystemVerilog reference",
          "url": "https://www.chipverify.com/systemverilog/systemverilog-tutorial"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// SystemVerilog variables\nlogic [7:0] data_bus;     // 8-bit logic signal\nbit [31:0] address;     // 2-state 32-bit\nint unsigned count;       // 32-bit unsigned integer\nreal pi;                  // real number\nparameter WIDTH = 8;      // compile-time constant\nlocalparam DEPTH = 16;    // local constant\n\n// Dynamic array\nint dyn_arr[];\n\n// Associative array\nint assoc_arr[string];\n\n// Queue\nint queue[$];\n\n// Assignment\ndata_bus <= 8'hFF;  // non-blocking in always_ff\ncount = count + 1;  // blocking in always_comb",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// SystemVerilog conditionals\n// if/else\nalways_ff @(posedge clk) begin\n  if (reset)\n    count <= 0;\n  else if (enable)\n    count <= count + 1;\nend\n\n// Ternary\nassign result = (sel == 2'b00) ? a :\n                 (sel == 2'b01) ? b : c;\n\n// case (unique for synthesis)\nalways_comb begin\n  unique case (state)\n    IDLE:   next_state = START;\n    START:  next_state = RUN;\n    default: next_state = IDLE;\n  endcase\nend\n\n// case inside class\nconstraint c_val { val inside {[0:255]}; }",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// SystemVerilog loops\n// for loop\nfor (int i = 0; i < 8; i++) begin\n  memory[i] <= 0;\nend\n\n// foreach (iterates over array)\nforeach (mem[i]) begin\n  mem[i] = 0;\nend\n\n// generate loop\ngenvar j;\ngenerate\n  for (j = 0; j < 8; j++) begin : gen_bit\n    assign result[j] = a[j] & b[j];\n  end\nendgenerate\n\n// repeat\nrepeat(10) begin\n  // execute 10 times\nend",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "// SystemVerilog functions and tasks\n// Function (returns value)\nfunction [7:0] reverse_bits;\n  input [7:0] data;\n  for (int i = 0; i < 8; i++)\n    reverse_bits[7-i] = data[i];\nendfunction\n\n// Task (can have delays)\ntask add_values;\n  input [7:0] a, b;\n  output [7:0] result;\n  result = a + b;\nendtask\n\n// Void function (no return)\nfunction void print_msg;\n  $display(\"Hello, SystemVerilog!\");\nendfunction\n\n// Automatic (re-entrant) function\nfunction automatic int factorial;\n  input int n;\n  if (n <= 1) return 1;\n  else return n * factorial(n-1);\nendfunction",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "// SystemVerilog performance:\n// 1. UVM (Universal Verification Methodology)\n// 2. Constrained random stimulus generation\n// 3. Coverage-driven verification\n// 4. $assert for immediate assertions\n// 5. covergroup for functional coverage\n// 6. Always use always_ff/always_comb\n// 7. Avoid latch inference\n\n// Coverage example\ncovergroup cg_bus;\n  cp_data: coverpoint data_bus;\n  cp_addr: coverpoint address;\nendgroup\n\n// Assertion\nassert property (@(posedge clk) req |-> ##1 ack);",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "// SystemVerilog has real OOP classes (unlike Verilog)\nclass Packet;\n  rand bit [7:0] data;\n  rand bit [31:0] addr;\n  \n  // Constructor\n  function new(bit [31:0] a, bit [7:0] d);\n    addr = a;\n    data = d;\n  endfunction\n  \n  // Method\n  function void print();\n    $display(\"Addr=%0h Data=%0h\", addr, data);\n  endfunction\nendclass\n\n// Inheritance\nclass BadPacket extends Packet;\n  rand bit [7:0] error;\n  \n  function void print();\n    $display(\"Addr=%0h Data=%0h Err=%0h\", addr, data, error);\n  endfunction\nendclass\n\n// Virtual class (abstract)\nvirtual class BasePacket;\n  pure virtual function void process();\nendclass",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "// SystemVerilog strings (real string type)\nstring greeting = \"Hello, SystemVerilog!\";\nstring name = \"Alice\";\n\n// String operations\nstring msg;\nmsg = greeting + \" My name is \" + name + \".\";\n\n// String methods\ninteger len = greeting.len();       // 22\nstring upper = greeting.toupper();   // \"HELLO, SYSTEMVERILOG!\"\nstring lower = greeting.tolower();   // \"hello, systemverilog!\"\nstring sub = greeting.substr(0, 4);  // \"Hello\"\n\n// $sformatf for formatting\nstring formatted = $sformatf(\"Count: %0d\", count);\n\n// Compare\nif (name == \"Alice\")\n  $display(\"Match!\");",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// SystemVerilog error handling\n// Assertions (primary error mechanism)\nassert_grant: assert property (@(posedge clk) req |-> ##[0:3] ack)\n  else $error(\"Grant not received within 3 cycles\");\n\n// Immediate assertions\nalways_comb begin\n  assert (data != 0) else $error(\"Data is zero\");\nend\n\n// Cover assertions (no error, just monitoring)\ncover property (@(posedge clk) req and ack);\n\n// $fatal, $error, $warning, $info severity\ninitial begin\n  if (reset) begin\n    // OK\n  end else begin\n    $warning(\"Reset not active at time %0t\", $time);\n  end\nend\n\n// Constrain random values\nconstraint c_valid { data inside {[0:255]}; }",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// SystemVerilog imports\n// `include directive\n`include \"defines.svh\"\n\n// Package declaration\npackage my_pkg;\n  parameter WIDTH = 8;\n  typedef logic [WIDTH-1:0] data_t;\n  \n  function automatic data_t reverse(data_t d);\n    data_t result;\n    for (int i = 0; i < WIDTH; i++)\n      result[WIDTH-1-i] = d[i];\n    return result;\n  endfunction\nendpackage\n\n// Import from package\nimport my_pkg::*;\n\n// Import specific items\nimport my_pkg::WIDTH;\nimport my_pkg::data_t;\n\n// UVM import\nimport uvm_pkg::*;\n`include \"uvm_macros.svh\"",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "systemverilog-tip-assertions",
          "title": "Use assertions for protocol bugs",
          "body": "SystemVerilog’s value for verification is assertions and constrained random — not package managers. Keep RTL and UVM environments versioned together.",
          "tag": "hdl",
          "status": "curated"
        }
      ],
      "categories": [
        "hardware",
        "hdl"
      ],
      "overview": "An extension of Verilog adding OOP, assertions, and verification features. Used for both design and testbench; its constrained-random verification methodology dominates ASIC verification. Verification engineers and chip designers needing testbench power — extends Verilog with OOP, assertions, and constrained-random stimulus.\n\nTypical projects include Chip verification, UVM testbenches, FPGA design. UVM testbenches are built on SystemVerilog classes.",
      "learning_curve": "Steep for design, moderate for verification — SystemVerilog adds OOP, constrained random, coverage, and assertions on top of Verilog. The two paradigms (synthesizable RTL vs testbench OOP) require different mindsets. UVM adds significant complexity. However, the class system makes verification more approachable than Verilog testbenches.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "SystemVerilog is the industry-standard HDL for verification. IEEE 1800 standard. Used by all major EDA vendors (Synopsys, Cadence, Mentor). UVM (Universal Verification Methodology) is built on SystemVerilog classes. Supersedes Verilog for new projects. Most ASIC/FPGA verification uses SystemVerilog + UVM.",
      "common_use_cases": [
        "Chip verification",
        "UVM testbenches",
        "FPGA design"
      ],
      "docs_url": "https://www.chipverify.com/systemverilog/systemverilog-tutorial",
      "best_for": [
        "ASIC and FPGA design verification",
        "hardware testbench development",
        "register-transfer level digital logic design",
        "UVM testbench construction and constrained-random verification flows"
      ],
      "weak_at": [
        "Application software backends without semiconductor EDA toolchain spend",
        "Continuous web deployment cycles incompatible with tape-out gate reviews",
        "Teams lacking SystemVerilog simulator licenses and regression farms"
      ],
      "official_url": "https://ieeexplore.ieee.org/document/8299595",
      "paradigm": [
        "hardware-description",
        "verification",
        "object-oriented"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Hardware description with static structure (not a software application language)",
        "runtime": "Synthesised or simulated by EDA tools (not executed like application code)",
        "memory": "Hardware resources described structurally; not a software heap"
      }
    },
    {
      "id": "flutter",
      "name": "Flutter (Dart)",
      "color": "#02569b",
      "description": "Google's UI toolkit using Dart — one codebase for iOS, Android, web, and desktop. Its widget tree model and hot reload make iterative UI development fast and expressive.",
      "whoItIsFor": "Mobile developers who want cross-platform apps from a single codebase — iOS, Android, web, and desktop from one Dart-based widget tree.",
      "commonUses": [
        "Cross-platform mobile",
        "Web apps",
        "Desktop apps"
      ],
      "patterns": [
        {
          "title": "Widget",
          "code": "import 'package:flutter/material.dart';\n\nvoid main() => runApp(\n  MaterialApp(home: Text('Hello')),\n);",
          "explanation": "Minimal Flutter app with a single Text widget — every UI element in Flutter is a widget."
        },
        {
          "title": "Stateless widget",
          "code": "import 'package:flutter/material.dart';\n\nclass Hello extends StatelessWidget {\n  const Hello({super.key});\n  @override\n  Widget build(BuildContext context) {\n    return const Text('Hello');\n  }\n}",
          "explanation": "Widgets describe UI; `build` returns a tree of child widgets."
        },
        {
          "title": "Stateful counter",
          "code": "class Counter extends StatefulWidget {\n  const Counter({super.key});\n  @override\n  State<Counter> createState() => _CounterState();\n}\n\nclass _CounterState extends State<Counter> {\n  int n = 0;\n  @override\n  Widget build(BuildContext context) {\n    return FilledButton(\n      onPressed: () => setState(() => n++),\n      child: Text(\"$n\"),\n    );\n  }\n}",
          "explanation": "`setState` triggers rebuild when mutable state changes."
        },
        {
          "title": "Platform channel boundary - Flutter's polyglot bridge",
          "code": "// Flutter's polyglot boundary is the platform channel:\n// Dart code communicates with native Android/iOS code.\n\n// Dart side\nconst platform = MethodChannel('com.example/battery');\n\nFuture<int> getBatteryLevel() async {\n  try {\n    final level = await platform.invokeMethod('getBatteryLevel');\n    return level;\n  } on PlatformException catch (e) {\n    print('Failed: ${e.message}');\n    return -1;\n  }\n}\n\n// Android (Kotlin)\noverride fun onMethodCall(call: MethodCall, result: Result) {\n  when (call.method) {\n    \"getBatteryLevel\" -> {\n      val level = batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY)\n      result.success(level)\n    }\n    else -> result.notImplemented()\n  }\n}\n\n// iOS (Swift)\nlet channel = FlutterMethodChannel(name: \"com.example/battery\", binaryMessenger: controller.binaryMessenger)\nchannel.setMethodCallHandler { call, result in\n  if call.method == \"getBatteryLevel\" {\n    result(self.batteryLevel)\n  }\n}",
          "explanation": "Flutter's polyglot boundary is the platform channel: Dart code communicates with native Android (Kotlin/Java) and iOS (Swift/Objective-C) code through MethodChannel. This bridges Flutter's cross-platform UI with platform-specific APIs (battery, camera, sensors, etc.). FFI (Foreign Function Interface) allows direct C library calls. This makes Flutter a universal app bridge that connects declarative UI to native platform capabilities."
        }
      ],
      "libraries": [
        {
          "name": "Flutter docs",
          "url": "https://docs.flutter.dev/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Flutter documentation",
          "url": "https://docs.flutter.dev/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// Flutter/Dart variables\nvar count = 0;                    // inferred type\nString name = 'Flutter';         // explicit type\nfinal apiKey = 'abc123';          // runtime constant\nconst pi = 3.14159;              // compile-time constant\n\n// Nullable (null safety)\nString? nickname = null;\n\n// Collections\nList<String> items = ['a', 'b', 'c'];\nMap<String, int> scores = {'Alice': 100};\n\n// Stateful widget state\nclass _MyWidgetState extends State<MyWidget> {\n  int _counter = 0;\n  String _title = 'Hello';\n}",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// Flutter/Dart conditionals\nif (isLoggedIn) {\n  return const Text('Welcome');\n} else if (isAdmin) {\n  return const Text('Admin Panel');\n} else {\n  return const Text('Log in');\n}\n\n// Ternary\nColor color = isActive ? Colors.green : Colors.grey;\n\n// Switch\nswitch (status) {\n  case 'active':\n    return Icon(Icons.check);\n  case 'inactive':\n    return Icon(Icons.close);\n  default:\n    return Icon(Icons.help);\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Flutter/Dart loops\n// for\nfor (int i = 0; i < items.length; i++) {\n  print(items[i]);\n}\n\n// for-in\nfor (final item in items) {\n  print(item);\n}\n\n// while\nint i = 0;\nwhile (i < 10) {\n  i++;\n}\n\n// ListView.builder (Flutter pattern)\nListView.builder(\n  itemCount: items.length,\n  itemBuilder: (context, index) {\n    return ListTile(title: Text(items[index]));\n  },\n)",
          "difficulty": "basic"
        },
        "functions": {
          "code": "// Flutter/Dart functions\n// Top-level function\nvoid greet(String name) {\n  print('Hello, $name!');\n}\n\n// Arrow function\nint double(int x) => x * 2;\n\n// Named parameters\nvoid configure({required String title, int timeout = 30}) {\n  print('Config: $title, timeout: $timeout');\n}\n\n// Async function\nFuture<Data> fetchData() async {\n  final response = await http.get(Uri.parse('/api/data'));\n  return Data.fromJson(jsonDecode(response.body));\n}\n\n// Anonymous function (callback)\nitems.forEach((item) {\n  print(item.name);\n});",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "// Flutter performance:\n// 1. const constructors for immutable widgets\n// 2. Keys for efficient list updates\n// 3. RepaintBoundary for complex layouts\n// 4. Avoid unnecessary setState calls\n// 5. Use ListView.builder for long lists\n// 6. Profile with Flutter DevTools\n// 7. Isolates for CPU-intensive work\n\n// Const widget (reused, not rebuilt)\nconst Text('Hello')\n\n// RepaintBoundary\nRepaintBoundary(\n  child: ExpensiveWidget(),\n)",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "// Flutter/Dart classes (real OOP)\nclass User {\n  final String name;\n  final int age;\n  \n  // Constructor\n  User(this.name, this.age);\n  \n  // Named constructor\n  User.anonymous() : name = 'Guest', age = 0;\n  \n  // Factory constructor\n  factory User.fromJson(Map<String, dynamic> json) {\n    return User(json['name'], json['age']);\n  }\n  \n  // Method\n  String greet() => 'Hello, I am $name';\n  \n  // Override\n  @override\n  String toString() => 'User($name, $age)';\n}\n\n// Inheritance\nclass AdminUser extends User {\n  AdminUser(String name, int age) : super(name, age);\n}",
          "difficulty": "basic"
        },
        "strings": {
          "code": "// Flutter/Dart strings\nString name = 'Flutter';\nString greeting = 'Hello, $name!';            // interpolation\nString multi = '''\n  Multiple\n  lines\n''';\n\n// String methods\nname.length          // 7\nname.toUpperCase()   // 'FLUTTER'\nname.substring(0, 3) // 'Flu'\nname.contains('utt') // true\nname.replaceAll('Flutter', 'Dart')\n\n// Raw string (no escape needed)\nString path = r'C:\\Users\\file.txt';\n\n// StringBuffer for concatenation\nvar buf = StringBuffer();\nbuf.write('Hello');\nbuf.write(' World');\nString result = buf.toString();",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Flutter/Dart error handling\ntry {\n  final data = await fetchData();\n} on FormatException catch (e) {\n  print('Format error: $e');\n} on HttpException catch (e) {\n  print('HTTP error: $e');\n} catch (e) {\n  print('Unknown error: $e');\n} finally {\n  print('Cleanup');\n}\n\n// Custom exception\nclass AppException implements Exception {\n  final String message;\n  AppException(this.message);\n  @override\n  String toString() => 'AppException: $message';\n}\n\n// Error widget for Flutter UI\nErrorWidget.builder = (details) => CustomError(details);",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// Flutter/Dart imports\nimport 'package:flutter/material.dart';\nimport 'package:http/http.dart' as http;\nimport 'package:my_app/models/user.dart';\nimport 'dart:convert';\nimport 'dart:async';\n\n// Relative imports\nimport '../widgets/my_widget.dart';\nimport 'utils.dart';\n\n// Show/hide specific items\nimport 'package:math/math.dart' show sqrt, pi;\nimport 'package:math/math.dart' hide log;\n\n// Deferred import (lazy loading)\nimport 'package:heavy_lib/heavy.dart' deferred as heavy;\nFuture<void> loadHeavy() async {\n  await heavy.loadLibrary();\n  heavy.HeavyWidget();\n}",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "mobile",
        "ui-framework"
      ],
      "overview": "Google's UI toolkit using Dart — one codebase for iOS, Android, web, and desktop. Its widget tree model and hot reload make iterative UI development fast and expressive. Mobile developers who want cross-platform apps from a single codebase — iOS, Android, web, and desktop from one Dart-based widget tree.\n\nTypical projects include Cross-platform mobile, Web apps, Desktop apps. Pub.dev and Flutter DevTools support cross-platform widget development.",
      "learning_curve": "Moderate — Dart is familiar to Java/JavaScript developers. Widget composition and state management (setState, Provider, Riverpod, Bloc) are the main learning curves. The declarative UI paradigm differs from imperative UI frameworks. Hot reload makes experimentation fast.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Flutter is Google's cross-platform UI framework. Uses Dart. Compiles to native ARM code for iOS, Android, web, desktop. Strong tooling (Flutter DevTools, hot reload). Pub.dev package ecosystem. Competing with React Native, Kotlin Multiplatform, and SwiftUI. Used by Alibaba, BMW, Google Pay, and many startups.",
      "common_use_cases": [
        "Cross-platform mobile",
        "Web apps",
        "Desktop apps"
      ],
      "docs_url": "https://docs.flutter.dev/",
      "best_for": [
        "cross-platform mobile app development",
        "single-codebase web and desktop apps",
        "high-fidelity UI with material design",
        "Cross-platform mobile, web, and desktop UI from a single Dart codebase"
      ],
      "weak_at": [
        "Platform-heavy apps needing latest iOS APIs on day-one without delays",
        "Teams standardized on native Swift and Kotlin with platform SDK expertise",
        "Back-end-only microservices without client UI delivery requirements"
      ],
      "official_url": "https://flutter.dev/",
      "paradigm": [
        "declarative",
        "UI",
        "cross-platform"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Uses Dart (static) for application code",
        "runtime": "Flutter framework on the Dart VM or ahead-of-time compiled mobile/desktop targets",
        "memory": "Garbage-collected (Dart runtime)"
      }
    },
    {
      "id": "terraform",
      "name": "Terraform (HCL)",
      "color": "#7b42bc",
      "description": "HashiCorp Configuration Language — declare cloud infrastructure as code. Terraform's plan-apply workflow shows changes before making them, enabling safe infrastructure management.",
      "whoItIsFor": "DevOps and platform engineers managing AWS, GCP, or Azure resources declaratively — version-controlled infra-as-code with state tracking and plans.",
      "commonUses": [
        "Cloud infrastructure",
        "Multi-cloud provisioning",
        "GitOps"
      ],
      "patterns": [
        {
          "title": "Resource",
          "code": "resource \"aws_instance\" \"web\" {\n  ami           = \"ami-abc123\"\n  instance_type = \"t3.micro\"\n}",
          "explanation": "Declares an EC2 instance resource — Terraform maps declarative blocks to real cloud infrastructure."
        },
        {
          "title": "Variables and output",
          "code": "variable \"region\" {\n  type    = string\n  default = \"us-east-1\"\n}\n\noutput \"region_used\" {\n  value = var.region\n}",
          "explanation": "Input variables parameterise modules; outputs expose values after apply."
        },
        {
          "title": "Data source",
          "code": "data \"aws_ami\" \"ubuntu\" {\n  most_recent = true\n  owners      = [\"099720109477\"]\n  filter {\n    name   = \"name\"\n    values = [\"ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*\"]\n  }\n}",
          "explanation": "Data sources read existing cloud objects without creating them."
        },
        {
          "title": "Provider/resource boundary - Terraform's polyglot bridge",
          "code": "# Terraform's polyglot boundary is the provider:\n# it bridges declarative HCL to cloud APIs.\n\n# AWS provider (Go SDK under the hood)\nprovider \"aws\" {\n  region = var.aws_region\n}\n\n# Resource maps to AWS API calls\nresource \"aws_instance\" \"web\" {\n  ami           = data.aws_ami.latest.id\n  instance_type = var.instance_type\n\n  tags = local.common_tags\n}\n\n# Data source reads from AWS\nresource \"aws_db_instance\" \"db\" {\n  engine     = \"postgres\"\n  # Cross-resource dependency (implicit)\n  instance_class = var.db_instance_class\n}\n\n# Multi-cloud: same HCL, different providers\nprovider \"azurerm\" {\n  features {}\n}\n\nprovider \"google\" {\n  project = var.gcp_project\n}",
          "explanation": "Terraform's polyglot boundary is the provider: declarative HCL configuration bridges to cloud provider APIs via Go-based provider plugins (AWS, Azure, GCP, and hundreds more). Each provider translates HCL resource definitions into API calls, creating a universal infrastructure bridge. Cross-resource dependencies are resolved automatically through the resource graph. This makes Terraform a universal infrastructure-as-code bridge that connects declarative configuration to any cloud API."
        }
      ],
      "libraries": [
        {
          "name": "Terraform docs",
          "url": "https://developer.hashicorp.com/terraform/docs",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Terraform documentation",
          "url": "https://developer.hashicorp.com/terraform/docs"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# Terraform variables\nvariable \"instance_type\" {\n  description = \"EC2 instance type\"\n  type        = string\n  default     = \"t3.micro\"\n}\n\nvariable \"allowed_ips\" {\n  type    = list(string)\n  default = [\"10.0.0.0/8\"]\n}\n\n# Local values\nlocals {\n  name_prefix = \"${var.project}-${var.env}\"\n  common_tags = {\n    Environment = var.env\n    Project     = var.project\n  }\n}\n\n# Data sources\ndata \"aws_ami\" \"latest\" {\n  most_recent = true\n  filter {\n    name   = \"name\"\n    values = [\"amzn2-ami-hvm-*\"]\n  }\n}",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# Terraform conditionals\n# Ternary expression\ninstance_type = var.production ? \"m5.large\" : \"t3.micro\"\n\n# count (create resource conditionally)\nresource \"aws_instance\" \"app\" {\n  count = var.enabled ? 1 : 0\n  # ...\n}\n\n# for_each with conditional\nresource \"aws_security_group_rule\" \"rule\" {\n  for_each = var.enable_ssh ? toset([\"22\"]) : toset([])\n  # ...\n}\n\n# Dynamic blocks with conditional\nvariable \"enable_monitoring\" {\n  default = true\n}\n\n# Prevent destruction\nlifecycle {\n  prevent_destroy = true\n}",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "# Terraform loops\n# count (numeric iteration)\nresource \"aws_instance\" \"web\" {\n  count         = 3\n  ami           = data.aws_ami.latest.id\n  instance_type = var.instance_type\n  tags = {\n    Name = \"web-${count.index}\"\n  }\n}\n\n# for_each (map/set iteration)\nresource \"aws_instance\" \"app\" {\n  for_each = var.instances\n  ami           = each.value.ami\n  instance_type = each.value.type\n  tags = {\n    Name = each.key\n  }\n}\n\n# for expression (transform)\noutput \"instance_ips\" {\n  value = [for inst in aws_instance.web : inst.public_ip]\n}\n\n# for with filter\nlocals {\n  large_instances = [\n    for inst in var.instances : inst.name\n    if inst.type == \"large\"\n  ]\n}",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "# Terraform built-in functions\n# String\nupper(\"hello\")              # \"HELLO\"\nlower(\"HELLO\")              # \"hello\"\njoin(\"-\", [\"a\", \"b\", \"c\"])  # \"a-b-c\"\nsplit(\",\", \"a,b,c\")        # [\"a\", \"b\", \"c\"]\n\n# Numeric\nmax(1, 2, 3)               # 3\nmin(1, 2, 3)               # 1\n\n# Collection\nlength([\"a\", \"b\"])          # 2\nmerge({a=1}, {b=2})        # {a=1, b=2}\nkeys({a=1, b=2})           # [\"a\", \"b\"]\nvalues({a=1, b=2})         # [1, 2]\n\n# Encoding\njsonencode({a=1})          # '{\"a\":1}'\nyamlencode({a=1})          # 'a: 1'\n\n# File\nfile(\"${path.module}/config.yaml\")",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "# Terraform performance:\n# 1. Use -target for partial applies\n# 2. State locking prevents parallel corruption\n# 3. Use data sources sparingly (API calls)\n# 4. Large states slow down plan/apply\n# 5. Split into multiple states for scalability\n# 6. Use workspace isolation\n# 7. Parallelism flag: -parallelism=N\n# 8. Refresh only when needed: -refresh=false",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "# Terraform has no class/OOP system.\n# Reusability comes from:\n# - Modules (reusable resource groups)\n# - Variables and outputs (parameterization)\n# - Workspaces (environment isolation)\n# - Providers (cloud API wrappers)\n# These are NOT classes in the OOP sense.\n# Use modules for shared infrastructure patterns.\n\nmodule \"vpc\" {\n  source  = \"terraform-aws-modules/vpc/aws\"\n  version = \"~> 5.0\"\n  \n  cidr = var.vpc_cidr\n  azs  = var.availability_zones\n}",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# Terraform strings\nvariable \"name\" {\n  default = \"my-app\"\n}\n\n# Interpolation\nlocals {\n  full_name = \"${var.project}-${var.env}\"\n  greeting   = \"Hello, ${var.name}!\"\n}\n\n# String functions\njoin(\"-\", [\"app\", var.env])     # \"app-prod\"\nsplit(\",\", \"a,b,c\")            # [\"a\", \"b\", \"c\"]\ntrimprefix(\"app-prod\", \"app-\")   # \"prod\"\nreplace(\"hello world\", \" \", \"-\") # \"hello-world\"\n\n# Heredoc\ntemplate = <<-EOT\n  Server: ${var.name}\n  Region: ${var.region}\n  EOT\n\n# Templatefile\ntemplatefile(\"${path.module}/user_data.sh\", {\n  name = var.name\n})",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# Terraform error handling\n# try() evaluates and catches errors\nlocals {\n  result = try(jsondecode(var.json_string), {})\n}\n\n# can() checks if expression succeeds (no error)\nlocals {\n  can_decode = can(jsondecode(var.json_string))\n}\n\n# Preconditions and postconditions (Terraform 1.2+)\nresource \"aws_instance\" \"app\" {\n  ami           = var.ami\n  instance_type = var.instance_type\n\n  lifecycle {\n    precondition {\n      condition     = var.instance_type != \"t2.micro\" || var.env != \"prod\"\n      error_message = \"t2.micro not allowed in production\"\n    }\n    postcondition {\n      condition     = self.public_ip != \"\"\n      error_message = \"Instance must have a public IP\"\n    }\n  }\n}\n\n# Terraform errors are plan-time or apply-time\n# Plan errors: invalid configuration\n# Apply errors: API failures",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "# Terraform imports (modules)\n# Module from registry\nmodule \"vpc\" {\n  source  = \"terraform-aws-modules/vpc/aws\"\n  version = \"~> 5.0\"\n  cidr    = var.vpc_cidr\n}\n\n# Local module\nmodule \"network\" {\n  source = \"./modules/network\"\n  cidr   = var.vpc_cidr\n}\n\n# Git module\nmodule \"database\" {\n  source = \"git::https://example.com/tf-modules.git//db\"\n}\n\n# Provider configuration\nterraform {\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      version = \"~> 5.0\"\n    }\n  }\n}\n\nprovider \"aws\" {\n  region = var.aws_region\n}",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "terraform-tip-providers",
          "title": "Pin providers and modules",
          "body": "Most Terraform surprises are provider/module version drift or state mismatches. Pin versions and plan before apply.",
          "tag": "iac",
          "status": "curated"
        }
      ],
      "categories": [
        "devops",
        "iac"
      ],
      "overview": "Declare cloud infrastructure as code with HCL — write what resources you want (servers, databases, networks) and Terraform plans, diffs, and applies the changes. State files track what exists; modules organise reusable stacks. The learning curve is in provider resources and state management, not HCL syntax itself.",
      "learning_curve": "Moderate — HCL syntax is declarative and relatively simple. The learning curve is in understanding cloud provider resources (AWS, Azure, GCP), state management, module composition, and workspaces. Advanced features (dynamic blocks, for_each, moved blocks, import blocks) add complexity.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Terraform is the dominant infrastructure-as-code tool (HashiCorp). HCL is declarative. Massive provider ecosystem (AWS, Azure, GCP, Kubernetes, etc.). Terraform Cloud/Enterprise for collaboration. OpenTofu is the open-source fork (BSL license change). State management is critical. Competing with Pulumi (imperative), CloudFormation (AWS-only), Crossplane (Kubernetes-native).",
      "common_use_cases": [
        "Cloud infrastructure",
        "Multi-cloud provisioning",
        "GitOps"
      ],
      "docs_url": "https://developer.hashicorp.com/terraform/docs",
      "paradigm": [
        "declarative",
        "infrastructure",
        "graph-based"
      ],
      "best_for": [
        "multi-cloud infrastructure provisioning",
        "GitOps-driven infrastructure as code",
        "repeatable cloud environment automation",
        "Multi-cloud infrastructure as code with plan and apply workflows"
      ],
      "weak_at": [
        "Imperative one-off hotfixes better done with cloud vendor CLIs directly",
        "Organizations mandating Pulumi or CloudFormation without HCL appetite",
        "Application feature development unrelated to cloud resource graphs"
      ],
      "official_url": "https://www.terraform.io/",
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative configuration or build DSL (not a general-purpose programming language)",
        "runtime": "Evaluated by a host tool (Ansible, Terraform, Make, Nix, etc.) — no standalone VM",
        "memory": "Managed by the host tool running the configuration or build"
      }
    },
    {
      "id": "ansible",
      "name": "Ansible (YAML)",
      "color": "#ee0000",
      "description": "Agentless automation using YAML playbooks — configure servers, deploy apps, orchestrate. Its idempotent modules and bare SSH requirement make it the simplest path to configuration management.",
      "whoItIsFor": "Sysadmins and DevOps engineers automating infrastructure — agentless YAML playbooks for configuration management, deployment, and orchestration.",
      "commonUses": [
        "Server configuration",
        "App deployment",
        "Orchestration"
      ],
      "patterns": [
        {
          "title": "Task",
          "code": "- name: Install nginx\n  apt:\n    name: nginx\n    state: present",
          "explanation": "A task invokes a module with parameters — Ansible applies it idempotently on matched hosts."
        },
        {
          "title": "Playbook task",
          "code": "---\n- hosts: web\n  become: true\n  tasks:\n    - name: Ensure nginx is installed\n      ansible.builtin.apt:\n        name: nginx\n        state: present\n        update_cache: true",
          "explanation": "Plays target host groups; tasks call modules with declarative arguments."
        },
        {
          "title": "Handler",
          "code": "  handlers:\n    - name: Restart nginx\n      ansible.builtin.service:\n        name: nginx\n        state: restarted",
          "explanation": "Handlers run only when notified by tasks that report a change."
        },
        {
          "title": "Task idempotency - Ansible's convergence boundary",
          "code": "# Ansible tasks should be idempotent: run N times = run once\n- name: Ensure nginx is installed\n  apt:\n    name: nginx\n    state: present        # converges to 'installed'\n  become: yes\n\n- name: Ensure nginx is running\n  service:\n    name: nginx\n    state: started        # converges to 'running'\n    enabled: yes\n\n# This is Ansible's data boundary:\n# desired state -> converged state (idempotent)\n# Not imperative commands, but declarative convergence",
          "explanation": "Ansible's core pattern is idempotent convergence: tasks declare desired state, not commands. 'state: present' means 'ensure installed', not 'install'. Running the same playbook 100 times produces the same result as running it once. This is Ansible's boundary with the real world — it converges systems to declared states, and this convergence is how Ansible integrates with OS package managers, cloud APIs, and container runtimes in polyglot pipelines."
        }
      ],
      "libraries": [
        {
          "name": "Ansible docs",
          "url": "https://docs.ansible.com/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Ansible documentation",
          "url": "https://docs.ansible.com/"
        }
      ],
      "compareData": {
        "classes": {
          "code": "# No class system - Ansible uses YAML data structures\n# Structured data via dictionaries and lists:\nserver:\n  ip: \"10.0.0.1\"\n  role: web\n  environment: production",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# Ansible uses Jinja2 templating for strings\n- name: Set greeting\n  set_fact:\n    greeting: \"Hello, {{ inventory_hostname }}!\"\n\n# String filters\nmsg: \"{{ greeting | upper }}\"",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# Ansible uses failed_when and block/rescue for error handling\n- block:\n    - name: Risky operation\n      command: /usr/bin/risky\n  rescue:\n    - name: Handle failure\n      debug:\n        msg: \"Operation failed: {{ ansible_failed_result }}\"\n  always:\n    - name: Cleanup\n      command: /usr/bin/cleanup",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "# Ansible uses include/import tasks and roles\n- import_playbook: base.yml\n\n- name: Include web tasks\n  include_tasks: web.yml\n\n# Role dependencies in requirements.yml\n- src: geerlingguy.apache",
          "difficulty": "basic"
        },
        "variables": {
          "code": "# Ansible variables: host-based, role-based, or computed\napp_port: 8080\ndeploy_env: \"{{ lookup('env', 'DEPLOY_ENV') }}\"\n\n# Host variables in inventory\n[webservers]\nweb1 ansible_host=10.0.0.1 app_port=8080\n\n# Registered variables from tasks\n- name: Check disk\n  command: df -h /\n  register: disk_result",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# Ansible conditionals with when\n- name: Install Apache on Debian\n  apt:\n    name: apache2\n    state: present\n  when: ansible_os_family == \"Debian\"\n\n# Conditional with jinja2 filters\n- name: Restart service\n  service:\n    name: nginx\n    state: restarted\n  when: nginx_config.changed | default(false)",
          "difficulty": "basic"
        },
        "loops": {
          "code": "# Ansible loops with with_items or loop\n- name: Install packages\n  apt:\n    name: \"{{ item }}\"\n    state: present\n  loop:\n    - nginx\n    - postgresql\n    - redis\n\n# Loop over dictionaries\n- name: Create users\n  user:\n    name: \"{{ item.name }}\"\n    groups: \"{{ item.groups }}\"\n  loop: \"{{ users }}\"",
          "difficulty": "basic"
        },
        "functions": {
          "code": "# Ansible 'functions' are custom modules or roles\n# Custom filter plugins (Python)\n\n# In Jinja2 templates:\n{{ my_value | default('fallback') }}\n{{ list_of_dicts | json_query('[].name') }}\n\n# Custom modules are Python scripts placed in library/\n# Roles group tasks, handlers, and templates\n- role: geerlingguy.apache",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "# Ansible performance: SSH overhead per task\n# Strategies to improve:\n# 1. Mitogen plugin: 2-10x faster\n# 2. Strategy: free (parallel tasks)\n# 3. Async tasks for long operations\n# 4. Gather facts: no (skip when unused)\n# 5. Pipelining: enabled in ansible.cfg\n\n# Mitogen connector\nstrategy_plugins = /usr/share/mitogen/ansible_mitogen/plugins/strategy\nstrategy = mitogen_linear",
          "difficulty": "intermediate"
        }
      },
      "tips": [
        {
          "id": "ansible-tip-idempotency",
          "title": "Idempotency is the contract",
          "body": "Write tasks that converge. Inventory and variable precedence cause more bugs than “package managers” as a language tip.",
          "tag": "iac",
          "status": "curated"
        }
      ],
      "categories": [
        "devops",
        "iac"
      ],
      "overview": "Agentless automation using YAML playbooks — configure servers, deploy apps, orchestrate. Its idempotent modules and bare SSH requirement make it the simplest path to configuration management. Sysadmins and DevOps engineers automating infrastructure — agentless YAML playbooks for configuration management, deployment, and orchestration.\n\nTypical projects include Server configuration, App deployment, Orchestration. Ansible Galaxy provides community roles across 3000+ modules.",
      "learning_curve": "Gentle for simple playbooks — YAML is readable and the module library is vast. Advanced Ansible (custom modules, filter plugins, Molecule testing, Ansible Tower) adds significant depth. Jinja2 templating is the main learning curve.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Ansible Galaxy provides community roles. Ansible Automation Platform (Tower) is the enterprise offering. Used for configuration management, deployment, and orchestration. Massive module collection (3000+). Owned by Red Hat. Strong enterprise adoption.",
      "common_use_cases": [
        "Server configuration",
        "App deployment",
        "Orchestration"
      ],
      "docs_url": "https://docs.ansible.com/",
      "best_for": [
        "agentless server configuration",
        "application deployment automation",
        "idempotent infrastructure orchestration",
        "Agentless server configuration over SSH without daemon installation"
      ],
      "weak_at": [
        "Windows-heavy shops without OpenSSH and Python controller readiness",
        "Hard real-time embedded firmware outside Linux SSH reachability",
        "Complex stateful cluster orchestration better handled by Kubernetes operators"
      ],
      "official_url": "https://www.ansible.com/",
      "paradigm": [
        "declarative",
        "imperative",
        "agentless"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative configuration or build DSL (not a general-purpose programming language)",
        "runtime": "Evaluated by a host tool (Ansible, Terraform, Make, Nix, etc.) — no standalone VM",
        "memory": "Managed by the host tool running the configuration or build"
      }
    },
    {
      "id": "dockerfile",
      "name": "Dockerfile",
      "color": "#2496ed",
      "description": "A recipe for building container images — typically a Dockerfile consumed by Docker or compatible builders, with directives like FROM, RUN, and COPY forming layers.",
      "whoItIsFor": "Teams packaging apps as images who can reason about base images, registries, build context, and CI — the file does not by itself guarantee portability, reproducibility, or security.",
      "commonUses": [
        "Container images",
        "CI/CD builds",
        "Microservices packaging"
      ],
      "patterns": [
        {
          "title": "Image",
          "code": "FROM node:20-alpine\nWORKDIR /app\nCOPY . .\nRUN npm ci\nCMD [\"node\", \"index.js\"]",
          "explanation": "FROM picks a base image; WORKDIR sets the working directory; COPY brings build context in; RUN runs shell commands during build; CMD sets the default process at run time. Most instructions add a layer, but exact behavior and caching depend on the builder (for example classic vs BuildKit) and invalidation rules."
        },
        {
          "title": "Multi-stage build",
          "code": "FROM node:20-alpine AS build\nWORKDIR /app\nCOPY package*.json ./\nRUN npm ci\nCOPY . .\nRUN npm run build\n\nFROM nginx:alpine\nCOPY --from=build /app/dist /usr/share/nginx/html",
          "explanation": "Earlier stages can hold compilers and dev dependencies; later stages COPY only the artifacts you need. In this example the final image carries static assets plus nginx — your real outputs and runtime base will differ by project."
        },
        {
          "title": "RUN and ENV",
          "code": "ENV NODE_ENV=production\nRUN addgroup -g 1001 app && adduser -D -u 1001 -G app app\nUSER app",
          "explanation": "ENV sets defaults for later layers and the container environment unless overridden. USER runs subsequent RUN and the default process as non-root when supported by the base image — one hardening step, not a complete security story on its own."
        },
        {
          "title": "Build stage / layer boundary - Dockerfile's polyglot bridge",
          "code": "# Dockerfile multi-stage: COPY sources before build commands\n\nFROM golang:1.21 AS go-builder\nWORKDIR /build\nCOPY go.mod go.sum ./\nCOPY . .\nRUN go build -o /myapp\n\nFROM node:18 AS js-builder\nWORKDIR /build\nCOPY package*.json ./\nRUN npm ci\nCOPY . .\nRUN npm run build\n\nFROM alpine:3.18\nCOPY --from=go-builder /myapp /usr/local/bin/myapp\nCOPY --from=js-builder /build/dist /app/dist\nCMD [\"myapp\"]",
          "explanation": "Multi-stage builds let each FROM use a different base (toolchains, OS packages) and COPY --from pull forward binaries or built assets. Builders may reuse cached layers when prior steps are unchanged, but build context, ARG values, and floating tags on FROM lines often invalidate more than teams expect — always verify in your CI and target architecture (plain build vs buildx)."
        }
      ],
      "libraries": [
        {
          "name": "Dockerfile ref",
          "url": "https://docs.docker.com/engine/reference/builder/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Dockerfile reference",
          "url": "https://docs.docker.com/engine/reference/builder/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# Dockerfile variables (ARG and ENV)\nARG VERSION=20.04\nFROM ubuntu:${VERSION}\n\n# Build-time variables (ARG)\nARG NODE_VERSION=18\nRUN apt-get update && apt-get install -y nodejs=${NODE_VERSION}\n\n# Runtime variables (ENV)\nENV APP_PORT=8080\nENV APP_HOME=/app\nWORKDIR ${APP_HOME}",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# Dockerfile conditionals (limited)\n# No if/else -- use shell logic in RUN\nRUN if [ \"$ENV\" = \"prod\" ]; then \\\n      cp prod.conf /etc/app.conf; \\\n    else \\\n      cp dev.conf /etc/app.conf; \\\n    fi\n\n# Multi-stage builds as conditional strategy\nFROM node:18 AS builder\nRUN npm run build\n\nFROM nginx:alpine AS production\nCOPY --from=builder /app/dist /usr/share/nginx/html",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "# Dockerfile has no loops\n# Use shell commands in RUN for iteration\nRUN for pkg in curl wget git; do \\\n      apt-get install -y $pkg; \\\n    done\n\n# Multi-stage builds for build-time iteration\nFROM golang:1.21 AS builder\n# ... build steps ...\n\nFROM alpine:3.18\nCOPY --from=builder /app /app",
          "difficulty": "N/A"
        },
        "functions": {
          "code": "# Dockerfile has no functions\n# Reusable patterns via:\n# 1. Multi-stage builds (shared build stages)\n# 2. Docker Compose extends\n# 3. Build args for parameterization\n# 4. COPY --from for stage references\n\n# Parameterized build\nARG BASE_IMAGE=node:18\nFROM ${BASE_IMAGE}\nARG APP_ENV=development\nENV NODE_ENV=${APP_ENV}",
          "difficulty": "N/A"
        },
        "performance": {
          "code": "# Dockerfile performance (rules of thumb; builder-dependent):\n# 1. Order steps so slow/rarely-changing work runs before frequently-changing COPY\n# 2. Combine RUN where it helps (trade readability vs layer count)\n# 3. .dockerignore shrinks context and avoids accidental invalidation\n# 4. Multi-stage builds can trim what ships in the final image\n# 5. Smaller bases help, but compatibility and CVE posture still matter\n# 6. BuildKit can change caching/parallelism vs legacy builders\n\n# Good: combined layers\nRUN apt-get update && apt-get install -y \\\n    curl wget git && rm -rf /var/lib/apt/lists/*",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "# No class system -- Dockerfile uses build stages\n# Multi-stage builds are the closest to 'classes'\n\nFROM node:18 AS builder\nWORKDIR /app\nCOPY package*.json ./\nRUN npm ci\nCOPY . .\nRUN npm run build\n\nFROM nginx:alpine AS production\nCOPY --from=builder /app/dist /usr/share/nginx/html\nEXPOSE 80",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# Dockerfile strings (ENV, ARG, LABEL)\nLABEL maintainer=\"dev@example.com\"\nLABEL description=\"My App Container\"\n\nENV APP_NAME=\"myapp\"\nENV GREETING=\"Hello, Docker!\"\n\n# String interpolation with ARG\nARG VERSION=1.0\nLABEL version=\"${VERSION}\"\nRUN echo \"Building version ${VERSION}\"",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# Dockerfile error handling\n# No try/catch -- use shell logic in RUN\nRUN apt-get update || (echo 'Update failed' && exit 1)\n\n# Health check for runtime\nHEALTHCHECK --interval=30s --timeout=3s \\\n  CMD curl -f http://localhost:8080/health || exit 1\n\n# Build failure stops the build\n# docker build . 2>&1 | tail -20",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "# Dockerfile imports (FROM)\nFROM node:18-alpine\n\n# Multi-stage import\nCOPY --from=builder /app/dist /usr/share/nginx/html\n\n# Copy from other images\nCOPY --from=ghcr.io/example/base:latest /usr/local/bin/tool /usr/local/bin/\n\n# ADD URL fetches at build time — verify checksums if you need reproducibility\nADD https://example.com/config.tar.gz /opt/\nCOPY ./src /app/src",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "dockerfile-tip-pin-bases",
          "title": "Pin base images for repeatable builds",
          "body": "Floating tags like latest or rolling distro tags can change underneath you. Prefer immutable references (digest pin) or explicit version tags, and rebuild deliberately when upstream patches land — otherwise \"rebuild the same Dockerfile\" may not reproduce the same layers.",
          "tag": "intermediate",
          "status": "curated"
        }
      ],
      "categories": [
        "devops",
        "config"
      ],
      "overview": "A Dockerfile lists ordered build instructions interpreted by your container builder and registry workflow. The same file can yield different layers when FROM tags move, build platforms differ (for example buildx targets), or daemon/builder versions change — it is a build recipe, not the app runtime and not a substitute for scanning, secrets handling, or supply-chain review. Dockerfile is a build/config DSL for container images, not a general-purpose programming language.",
      "learning_curve": "Gentle surface syntax (FROM, RUN, COPY, CMD) with a steeper curve in layer caching, multi-stage design, and CI integration. BuildKit, provenance/SBOM tooling, and multi-arch builds add more knobs.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Docker Hub and other registries host base images; rate limits, mirroring, and trust policies vary by org. Compose describes multi-container setups in YAML (related but not the same document as a Dockerfile). BuildKit is standard with many current Docker installs yet not identical across every tool. Optional linters (Hadolint) and image inspectors (Dive) help review; they do not replace policy.",
      "common_use_cases": [
        "Container images",
        "CI/CD builds",
        "Microservices packaging"
      ],
      "docs_url": "https://docs.docker.com/build/",
      "best_for": [
        "containerised application builds",
        "CI/CD pipeline image creation",
        "reproducible deployment packaging",
        "Reproducible container images for CI/CD pipeline deployment artifacts"
      ],
      "weak_at": [
        "General application logic better authored in host language source files",
        "Infrastructure graphs spanning many services without compose or orchestrators",
        "Bare-metal deployments without container runtime operational maturity"
      ],
      "official_url": "https://docs.docker.com/reference/dockerfile/",
      "paradigm": [
        "declarative",
        "imperative",
        "build"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative configuration or build DSL (not a general-purpose programming language)",
        "runtime": "Evaluated by a host tool (Ansible, Terraform, Make, Nix, etc.) — no standalone VM",
        "memory": "Managed by the host tool running the configuration or build"
      }
    },
    {
      "id": "brainfuck",
      "name": "Brainfuck",
      "color": "#2f2f2f",
      "description": "An esoteric language with only 8 commands — a Turing-complete thought experiment. The pointer moves along a tape of cells; > < + - . , [ ] are the entire language.",
      "whoItIsFor": "Hobbyists and CS students exploring the limits of minimal computation — an esoteric eight-instruction language for Turing-completeness demonstrations.",
      "commonUses": [
        "Code golf",
        "Turing machine demos",
        "Puzzle challenges"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>. >+++.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.",
          "explanation": "Prints Hello World through careful tape manipulation — Brainfuck's only I/O is dot (output) and comma (input)."
        },
        {
          "title": "Increment and output",
          "code": "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.",
          "explanation": "Loops and pointer moves encode “Hello World”; each cell is a byte."
        },
        {
          "title": "Minimal loop",
          "code": "++[>++<-]>",
          "explanation": "Builds a value with nested loops — typical BF uses `[]` for while (*ptr)."
        },
        {
          "title": "Cell/tape boundary - brainfuck's only data structure",
          "code": "The tape is brainfuck's entire data model:\n\n  >  move pointer right\n  <  move pointer left\n  +  increment current cell\n  -  decrement current cell\n  .  output current cell (byte)\n  ,  input to current cell (byte)\n  [  loop if current cell != 0\n  ]  end loop\n\nHello World (minimal):\n++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>++\n>[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.\n--------.>>+.>++.",
          "explanation": "brainfuck's only boundary is the tape: an array of byte cells with a movable pointer. Input and output are single bytes (the . and , instructions). There is no FFI, no memory layout beyond the tape, no networking. The polyglot boundary is purely stdin/stdout byte streams — brainfuck reads bytes and writes bytes, making it the ultimate minimal computation model that can only communicate through byte I/O."
        }
      ],
      "libraries": [
        {
          "name": "Esolang wiki",
          "url": "https://esolangs.org/wiki/Brainfuck",
          "type": "Wiki"
        }
      ],
      "docs": [
        {
          "name": "Brainfuck spec",
          "url": "https://esolangs.org/wiki/Brainfuck"
        }
      ],
      "compareData": {
        "classes": {
          "code": "No class system -- brainfuck has no types, no abstractions,\nno structures. Only 8 instructions and a tape of bytes.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "No string type -- brainfuck operates on raw byte values.\nStrings are sequences of ASCII values manually stored on the tape.\nPrinting 'Hi' requires emitting 72 then 105:\n++++++++[>+++++++++<-]>+.  // H (72)\n>++++++++++.",
          "difficulty": "N/A"
        },
        "errors": {
          "code": "No error handling -- brainfuck has no exceptions,\nno assertions, no runtime checks. The program either\nproduces output or loops forever. Debugging is by\nmanual tape inspection.",
          "difficulty": "N/A"
        },
        "imports": {
          "code": "No import system -- brainfuck programs are self-contained.\nEach program is a single stream of 8 instructions.\nNo modules, no libraries, no linking.",
          "difficulty": "N/A"
        },
        "variables": {
          "code": "No variable system -- brainfuck has only a tape of byte cells\nand a movable pointer. Cells are the closest to 'variables':\n\n++++++++[>+++++++++<-]>-.  // stores 72 in cell 1\n\nAll data lives on the tape. There are no names,\nno scopes, no types. The programmer tracks which\ncell holds which value mentally.",
          "difficulty": "N/A"
        },
        "conditionals": {
          "code": "No if/else -- brainfuck's [ ] is the only conditional:\n[  enter loop if current cell != 0\n]  return to [ if current cell != 0\n\nThis doubles as both conditional and loop:\n- Check cell and skip: move to a known-zero cell first\n- if-else requires copying a value and testing both paths\n\nExample: set cell 1 to 0 if non-zero\n[-]  // zero the current cell (loop: decrement until 0)",
          "difficulty": "N/A"
        },
        "loops": {
          "code": "Only [ ] loops -- decrement/increment until zero:\n[  start loop (enter if cell != 0)\n]  end loop (jump back if cell != 0)\n\nCommon patterns:\n[-]          // zero current cell\n[->+<]       // move value to next cell\n[->++<]      // multiply by 2 (double)\n[->>+++<<<]  // copy with multiplier\n\nNo for/while/do-while, no break, no continue.\nLoops always test the current cell against zero.",
          "difficulty": "N/A"
        },
        "functions": {
          "code": "No function system -- brainfuck has no functions, methods,\nor call/return mechanism. Programs are flat sequences\nof the 8 instructions.\n\nConvention: comment blocks between instructions\nuse any char other than +-<>.,[] which is ignored.\n\nExample of 'subroutine' convention:\n+++  SET THREE\n[-   START CLEAR LOOP\n  >+  INCREMENT NEXT CELL\n<]  END LOOP",
          "difficulty": "N/A"
        },
        "performance": {
          "code": "Not applicable for performance measurement -- brainfuck\nis designed for minimalism, not efficiency.\n\nTypical implementations: tape of 30000 cells (8-bit).\nNo optimization, no JIT, no memory management.\nPrograms run in O(n*m) where n = instructions, m = data.\n\nSome interpreters add bounds checking, others don't.\nReal-world use: education, esoterica, code golf only.",
          "difficulty": "N/A"
        }
      },
      "tips": [
        {
          "id": "brainfuck-tip-toy",
          "title": "Treat it as a teaching toy, not a toolchain",
          "body": "Brainfuck has no package manager or standard library. Interpreter differences in cell width and EOF are the whole portability story.",
          "tag": "esolang",
          "status": "curated"
        }
      ],
      "categories": [
        "esoteric"
      ],
      "overview": "An esoteric language with only 8 commands — a Turing-complete thought experiment. The pointer moves along a tape of cells; > < + - . , [ ] are the entire language. Hobbyists and CS students exploring the limits of minimal computation — an esoteric eight-instruction language for Turing-completeness demonstrations.\n\nTypical projects include Code golf, Turing machine demos, Puzzle challenges.",
      "learning_curve": "Paradoxically steep — the language is trivially simple (8 instructions) but writing anything non-trivial requires extreme mental effort. Rewarding only as an educational exercise in understanding minimal computation.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Multiple implementations exist (bf2c, bf2py, online interpreters). No package manager, no standard library. Purely educational and esoteric. Used for code golf, Turing-completeness proofs, and understanding minimal computational models. Tiny community of enthusiasts.",
      "common_use_cases": [
        "Code golf",
        "Turing machine demos",
        "Puzzle challenges"
      ],
      "docs_url": "https://esolangs.org/wiki/Brainfuck",
      "best_for": [
        "esoteric programming challenges and code golf",
        "Turing-machine simulation and demos",
        "compiler and interpreter test targets",
        "Esoteric programming challenges and minimal Turing machine demonstrations"
      ],
      "weak_at": [
        "Production business applications requiring maintainable team onboarding",
        "Performance-sensitive services where interpreter overhead is unacceptable",
        "Enterprise compliance environments mandating supported language runtimes"
      ],
      "official_url": "https://esolangs.org/wiki/Brainfuck",
      "paradigm": [
        "esoteric",
        "Turing-complete",
        "minimal"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Minimal or implicit (not designed for production type systems)",
        "runtime": "Tiny interpreters or compilers built for experimentation",
        "memory": "Implementation-defined; not designed for production memory models"
      }
    },
    {
      "id": "lolcode",
      "name": "LOLCODE",
      "color": "#cc9900",
      "description": "An esoteric language parodying internet slang — HAI, CAN HAS, KTHXBYE. Turing-complete but deliberately absurd; a fun introduction to language design concepts.",
      "whoItIsFor": "People who want to laugh while learning language design concepts — an esoteric meme language that teaches parsing, syntax, and interpreter basics.",
      "commonUses": [
        "Humor",
        "Teaching tokenisation concepts"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "HAI 1.2\n  VISIBLE \"Hello\"\nKTHXBYE",
          "explanation": "Program structure with HAI/KTHXBYE — LOLCODE wraps programs in visible open and close markers."
        },
        {
          "title": "HAI program",
          "code": "HAI 1.2\n  VISIBLE \"Hello, world!\"\nKTHXBYE",
          "explanation": "Programs start with `HAI` and end with `KTHXBYE`; `VISIBLE` prints."
        },
        {
          "title": "Variable",
          "code": "HAI 1.2\n  I HAS A name ITZ \"Ada\"\n  VISIBLE name\nKTHXBYE",
          "explanation": "`I HAS A` declares a variable; `ITZ` assigns an initial value."
        },
        {
          "title": "Interpreter boundary - LOLCODE's polyglot bridge",
          "code": "HAI 1.2\n  BTW LOLCODE's boundary is the interpreter:\n  BTW it runs in a VM that bridges internet slang to computation.\n  \n  BTW File I/O\n  I HAS A FILE ITZ I IZ OPEN YR \"data.txt\" MKAY\n  \n  BTW Network (implementation-dependent)\n  BTW Some implementations support HTTP\n  \n  BTW The practical boundary is calling out to\n  BTW the host language (Python, JavaScript, etc.)\n  BTW via the LOLCODE interpreter.\n  \n  VISIBLE \"LOLCODE bridges humor to computation!\"\nKTHXBYE",
          "explanation": "LOLCODE's polyglot boundary is its interpreter: LOLCODE programs run in an interpreter written in a host language (Python, JavaScript, etc.), bridging internet meme syntax to actual computation. The CAN HAS directive checks for module availability. File I/O and basic networking are implementation-dependent. LOLCODE is primarily educational and entertaining, but demonstrates how language design choices affect syntax and semantics."
        }
      ],
      "libraries": [
        {
          "name": "LOLCODE spec",
          "url": "https://lolcode.org/",
          "type": "Spec"
        }
      ],
      "docs": [
        {
          "name": "LOLCODE wiki",
          "url": "https://esolangs.org/wiki/LOLCODE"
        }
      ],
      "compareData": {
        "variables": {
          "code": "HAI 1.2\n  I HAS A NAME ITZ \"LOLCODE\"\n  I HAS A COUNT ITZ 0\n  I HAS A FLAG ITZ WIN\n  \n  VISIBLE NAME\n  VISIBLE COUNT\n  VISIBLE FLAG\nKTHXBYE",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "HAI 1.2\n  I HAS A SCORE ITZ 85\n  \n  BOTH SAEM SCORE AN BIGGR OF SCORE AN 90\n  O RLY?\n    YA RLY\n      VISIBLE \"A grade!\"\n    MEBBE BOTH SAEM SCORE AN BIGGR OF SCORE AN 80\n      VISIBLE \"B grade\"\n    NO WAI\n      VISIBLE \"Keep trying\"\n  OIC\nKTHXBYE",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "HAI 1.2\n  I HAS A COUNT ITZ 0\n  IM IN YR LOOP UPPIN YR COUNT TIL BOTH SAEM COUNT AN 10\n    VISIBLE COUNT\n  IM OUTTA YR LOOP\n  \n  I HAS A ITEMS ITZ A BUCKET\n  ITEMS HAS A FIRST ITZ 1\n  ITEMS HAS A SECOND ITZ 2\n  IM IN YR ITEMS UPPIN YR COUNT TIL BOTH SAEM COUNT AN 3\n    VISIBLE ITEMS'Z COUNT\n  IM OUTTA YR ITEMS\nKTHXBYE",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "HAI 1.2\n  HOW IZ I GREET YR NAME\n    FOUND YR SMOOSH \"Hello \" AN NAME MKAY\n  IF U SAY SO\n  \n  HOW IZ I ADD YR A AN YR B\n    FOUND YR SUM OF A AN B\n  IF U SAY SO\n  \n  VISIBLE I IZ GREET YR \"World\" MKAY\n  VISIBLE I IZ ADD YR 3 AN YR 4 MKAY\nKTHXBYE",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "# LOLCODE performance:\n# 1. Interpreted language, not for production\n# 2. No optimization passes\n# 3. All operations are runtime-evaluated\n# 4. No JIT or AOT compilation\n# 5. Designed for humor, not speed\n# 6. String concatenation is SMOOSH\n# 7. Use for education and entertainment only",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "# LOLCODE has no class/OOP system.\n# LOLCODE is an esoteric language designed\n# for humor and entertainment.\n# Reusability comes from:\n# - Functions (HOW IZ I ... IF U SAY SO)\n# - Variables (I HAS A)\n# - Buckets (simple key-value)\n# These are NOT classes in the OOP sense.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "HAI 1.2\n  I HAS A NAME ITZ \"LOLCODE\"\n  \n  VISIBLE \"Hello, \" AN NAME AN \"!\"\n  \n  SMOOSH \"Hello, \" AN NAME AN \"!\" MKAY\n  \n  I HAS A LEN ITZ I IZ LEN YR NAME MKAY\n  VISIBLE LEN\nKTHXBYE",
          "difficulty": "basic"
        },
        "errors": {
          "code": "HAI 1.2\n  I HAS A X\n  \n  BTW LOLCODE has minimal error handling\n  BTW Accessing uninitialized variable gives NOOB (null)\n  VISIBLE X  BTW prints NOOB (or empty)\n  \n  BTW Type mismatches cause runtime errors\n  BTW Division by zero is an error\n  \n  BTW CAN HAS STDIO? checks for module availability\n  BTW No try/catch mechanism exists\n  \n  BTW Errors typically crash the program\nKTHXBYE",
          "difficulty": "N/A"
        },
        "imports": {
          "code": "HAI 1.2\n  BTW LOLCODE imports (module system)\n  CAN HAS STDIO?\n  \n  BTW The CAN HAS directive checks if a module is available\n  BTW Only STDIO and a few others are standard\n  \n  BTW Most LOLCODE programs are single-file\n  BTW No package manager or module registry\n  \n  BTW External file inclusion:\n  BTW Not part of the standard; implementations vary\nKTHXBYE",
          "difficulty": "N/A"
        }
      },
      "tips": [
        {
          "id": "lolcode-tip-toy",
          "title": "Dialect jokes ≠ portable programs",
          "body": "LOLCODE implementations disagree on keywords and I/O. Keep examples tiny and educational; do not invent a “toolchain” tip.",
          "tag": "esolang",
          "status": "curated"
        }
      ],
      "categories": [
        "esoteric"
      ],
      "overview": "An esoteric language parodying internet slang — HAI, CAN HAS, KTHXBYE. Turing-complete but deliberately absurd; a fun introduction to language design concepts. People who want to laugh while learning language design concepts — an esoteric meme language that teaches parsing, syntax, and interpreter basics.\n\nTypical projects include Humor, Teaching tokenisation concepts.",
      "learning_curve": "Paradoxically moderate — the syntax is intentionally humorous and uses internet slang (HAI, KTHXBYE, O RLY?, YA RLY, NO WAI), which makes it memorable. However, the unconventional vocabulary makes it harder to transfer skills to/from real languages. Best understood as a teaching tool for language concepts.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "LOLCODE is an esoteric language created by Adam Lindsay in 2007. Inspired by lolcats internet slang. Multiple interpreters exist (Python, JavaScript, .NET, Go). Not used in production. Popular for code golf, programming contests, and teaching language concepts in a memorable way. The 1.2 spec is the most widely implemented.",
      "common_use_cases": [
        "Humor",
        "Teaching tokenisation concepts"
      ],
      "docs_url": "https://lolcode.org/",
      "best_for": [
        "humour-oriented programming demonstrations",
        "language parsing and tokenisation teaching",
        "esoteric language design exploration",
        "Esolang humor projects and programming language parody implementations"
      ],
      "weak_at": [
        "Production systems requiring SLA-backed vendor support contracts",
        "Large teams needing static analysis and IDE refactoring tooling",
        "Security-sensitive deployments without esolang interpreter audit trails"
      ],
      "official_url": "https://lolcode.org/",
      "paradigm": [
        "esoteric",
        "humor",
        "imperative"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Minimal or implicit (not designed for production type systems)",
        "runtime": "Tiny interpreters or compilers built for experimentation",
        "memory": "Implementation-defined; not designed for production memory models"
      }
    },
    {
      "id": "scratch",
      "name": "Scratch",
      "color": "#ffbf00",
      "description": "MIT's visual block-based language — drag and drop code blocks to create animations and games. A common first step into programming for millions of young learners worldwide.",
      "whoItIsFor": "Children and beginners learning programming concepts with block-based editors — not an esoteric language.",
      "commonUses": [
        "Education",
        "Animations",
        "Simple games",
        "Interactive stories"
      ],
      "patterns": [
        {
          "title": "Block",
          "code": "when green flag clicked\nsay [Hello] for (2) seconds",
          "explanation": "Event-driven blocks snap together — when the green flag clicks, the stack of blocks runs in order."
        },
        {
          "title": "Blocks (conceptual)",
          "code": "[When green flag clicked]\n  [say Hello for 2 secs]\n  [forever: if touching edge, turn 180 degrees]",
          "explanation": "Event-driven blocks snap together — when the green flag clicks, the stack of blocks runs in order."
        },
        {
          "title": "Variable block",
          "code": "[set myVar to 0]\n[change myVar by 1]",
          "explanation": "Variables are created in the Data category; blocks read and update them."
        },
        {
          "title": "Sprite/event boundary - Scratch's polyglot bridge",
          "code": "# Scratch's polyglot boundary is the sprite/event model:\n# Visual blocks bridge to JavaScript in the browser.\n\n# Broadcast messages connect sprites\nbroadcast [start-game v]\nwhen I receive [start-game v]\nsay [Game started!]\n\n# Clone for dynamic objects\nwhen [green-flag v] clicked\nrepeat [10]\n  create clone of [enemy v]\nend\n\n# When clone starts\nwhen I start as a clone\nmove [pick random [-200] to [200]>] steps\n\n# Extensions bridge to hardware\n# micro:bit: tilt sensing\nwhen [micro:bit tilted v] [left v]\nmove [-10] steps\n\n# Video sensing (camera)\nwhen [video motion v] > [10]\nchange [score v] by [1]",
          "explanation": "Scratch's polyglot boundary is the sprite/event model: visual blocks compile to JavaScript that runs in the browser. Broadcast messages connect sprites (like message passing between microservices). Cloning creates dynamic instances. Extensions bridge to hardware (micro:bit, LEGO) and APIs (translate, text-to-speech). This makes Scratch a universal visual bridge that connects block-based programming to real computation, sensors, and multimedia."
        }
      ],
      "libraries": [
        {
          "name": "Scratch",
          "url": "https://scratch.mit.edu/",
          "type": "Platform"
        }
      ],
      "docs": [
        {
          "name": "Scratch wiki",
          "url": "https://en.scratch-wiki.info/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# Scratch variables\n# Scratch uses blocks, not text code.\n# Variables are created in the \"Variables\" category.\n\n# Set a variable\nset [score v] to [0]\nchange [score v] by [1]\n\n# Show/hide variable on stage\nshow variable [score v]\nhide variable [score v]\n\n# Cloud variables (multiplayer)\nset [☁ high-score v] to [100]\n\n# Lists\nadd [item] to [shopping-list v]\ndelete [1 v] of [shopping-list v]\nitem [1 v] of [shopping-list v]\nlength of [shopping-list v]",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# Scratch conditionals\n# if/else blocks\nif <[score] > [100]> then\n  say [High score!]\nelse\n  say [Keep going!]\nend\n\n# Wait until condition\nwait until <[touching mouse-pointer v]>\n\n# Repeat until\nrepeat until <[game-over v] = [1]>\n  move [10] steps\nend\n\n# Boolean operators\n<<[x position v] > [0]> and <[x position v] < [240]>>\n<not <[touching edge v]>>",
          "difficulty": "basic"
        },
        "loops": {
          "code": "# Scratch loops\n# Repeat N times\nrepeat [10]\n  move [10] steps\n  turn cw [15] degrees\nend\n\n# Forever loop\nforever\n  move [1] steps\n  if <[touching edge v]> then\n    turn cw [180] degrees\n  end\nend\n\n# Repeat until\nrepeat until <[game-over v] = [1]>\n  move [5] steps\nend\n\n# For each (Scratch lists)\n# (No built-in for-each; use repeat with index)",
          "difficulty": "basic"
        },
        "functions": {
          "code": "# Scratch functions (custom blocks)\ndefine [draw-square] size [side-length]\npen down\nrepeat [4]\n  move [side-length] steps\n  turn cw [90] degrees\nend\npen up\n\n# Using the custom block\ndraw-square size [50]\n\n# Custom block with boolean input\ndefine [check-password] password [pwd]\nif <[pwd] = [secret123]> then\n  say [Access granted!]\nelse\n  say [Try again!]\nend\n\n# Run without screen refresh (for fast computation)\ndefine [compute-factorial] n [num] [run without screen refresh]\nif <[num] = [0]> then\n  set [result v] to [1]\nelse\n  compute-factorial n [[num] - [1]]\n  set [result v] to [[num] * [result]]\nend",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "# Scratch performance:\n# 1. Runs in browser (JavaScript interpreter)\n# 2. 30 FPS refresh rate\n# 3. No JIT or compilation\n# 4. Large projects can lag\n# 5. \"Run without screen refresh\" for fast blocks\n# 6. Clone limit (300 by default)\n# 7. List operations are O(n) for access\n# 8. Cloud variables are rate-limited\n#\n# Scratch is designed for education, not performance.\n# Turbowarp is an optimized fork for larger projects.",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "# Scratch has no class/OOP system.\n# Scratch uses a visual/block paradigm:\n# - Sprites are objects with scripts\n# - Custom blocks are like functions\n# - Variables can be \"for this sprite only\" (instance)\n#   or \"for all sprites\" (global)\n# - Lists are shared or per-sprite\n# These are NOT classes in the OOP sense.\n# Sprites provide encapsulation via\n# \"for this sprite only\" variables.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# Scratch strings\nsay [Hello, World!]\nset [name v] to [Alice]\nsay [join [Hello, ] [name]]\n\n# String operations\nletter [1] of [name]           # \"A\"\nlength of [name]                # 5\n[answer]                        # user input\n\n# String comparison\nif <[name] = [Alice]> then\n  say [Welcome, Alice!]\nend\n\n# String contains\nif <[name] contains [lic]> then\n  say [Contains 'lic'!]\nend",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# Scratch error handling\n# Scratch has no try/catch mechanism.\n# Errors typically cause scripts to stop silently.\n# Common error handling strategies:\n#\n# 1. Validate input before operations\nif <not <[answer] = []>> then\n  say [Please enter a value]\nend\n\n# 2. Guard against division by zero\nif <not <[divisor] = [0]>> then\n  set [result v] to [[numerator] / [divisor]]\nend\n\n# 3. Use \"if on edge, bounce\" for bounds\n# 4. Cloud variable errors are silent\n#\n# Scratch programs are expected to be\n# simple enough that formal error handling\n# is not needed.",
          "difficulty": "N/A"
        },
        "imports": {
          "code": "# Scratch imports\n# Scratch does not have a traditional import system.\n# Code reuse happens through:\n#\n# 1. Backpack (save/load projects)\n# 2. \"Get Info\" to copy sprites from other projects\n# 3. Scratch extensions (pen, music, video sensing)\n# 4. Custom blocks (define once, use everywhere)\n# 5. Sprite cloning (create copies programmatically)\n#\n# Scratch 3.0 Extensions:\n# - Pen (drawing)\n# - Music (instruments)\n# - Video Sensing (camera)\n# - Text-to-Speech\n# - Translate\n# - micro:bit\n#\n# Extensions are loaded from the Scratch library,\n# not imported from files.",
          "difficulty": "N/A"
        }
      },
      "tips": [
        {
          "id": "scratch-tip-blocks",
          "title": "Blocks hide concurrency and clone bugs",
          "body": "Scratch bugs are usually clone/state races or costume timing, not package versions. Reproduce with the smallest sprite script.",
          "tag": "education",
          "status": "curated"
        }
      ],
      "categories": [
        "education",
        "visual"
      ],
      "overview": "MIT's visual block-based language — drag and drop code blocks to create animations and games. A common first step into programming for millions of young learners worldwide. Kids (8+) and beginners learning programming concepts visually — block-based, no syntax errors, with a huge community sharing games and animations.\n\nTypical projects include Education, Animations, Simple games.",
      "learning_curve": "Very gentle — Scratch is designed for ages 8+ with no text syntax to learn. Drag-and-drop blocks eliminate syntax errors. The learning curve is in computational thinking (sequencing, loops, conditionals, variables). Advanced concepts (custom blocks, clones, cloud variables) add moderate depth.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Scratch is MIT's visual programming language (2007). Used by millions of students worldwide. Scratch 3.0 runs in browser (JavaScript). Extensions bridge to hardware (micro:bit, LEGO). Turbowarp is an optimized fork. Strong community (scratch.mit.edu). Not for production code but excellent for teaching computational thinking.",
      "common_use_cases": [
        "Education",
        "Animations",
        "Simple games",
        "Interactive stories"
      ],
      "docs_url": "https://en.scratch-wiki.info/",
      "best_for": [
        "introductory programming for children",
        "interactive animations and simple games",
        "visual block-based coding education",
        "Block-based coding for children learning sequencing and event handlers"
      ],
      "weak_at": [
        "Professional backend services requiring typed APIs and unit test culture",
        "Performance-critical native applications outside Scratch VM constraints",
        "Enterprise DevOps pipelines without Scratch desktop or web editor integration"
      ],
      "official_url": "https://scratch.mit.edu/",
      "paradigm": [
        "visual",
        "educational",
        "event-driven"
      ],
      "review_notes": "Verification 2026-07-23: removed “gateway drug” slang; categories education/visual.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Interpreted or bytecode-based in common implementations (engines vary)",
        "memory": "Garbage-collected in mainstream implementations",
        "abstraction": "High-level for typical scripting and application use"
      }
    },
    {
      "id": "logo",
      "name": "Logo",
      "color": "#ffa500",
      "description": "A Lisp-derived educational language famous for turtle graphics — draw by moving a cursor. Explores recursion, geometry, and procedural thinking through visual feedback.",
      "whoItIsFor": "Young learners and educators teaching geometry and programming basics — turtle graphics make loops, angles, and recursion intuitively visible.",
      "commonUses": [
        "Turtle graphics",
        "Education",
        "Geometry exploration"
      ],
      "patterns": [
        {
          "title": "Square",
          "code": "REPEAT 4 [FD 100 RT 90]",
          "explanation": "Repeats forward and right turns so the turtle traces a square on the canvas."
        },
        {
          "title": "Turtle square",
          "code": "repeat 4 [ forward 100 right 90 ]",
          "explanation": "Moves the turtle forward and turns — four times makes a square."
        },
        {
          "title": "Procedure",
          "code": "to square :size\n  repeat 4 [ forward :size right 90 ]\nend",
          "explanation": "`to` defines a procedure with an input parameter."
        },
        {
          "title": "Turtle graphics boundary - Logo's polyglot bridge",
          "code": "; Logo's polyglot boundary is turtle graphics:\n; the turtle bridges abstract geometry to visual output.\n\n; Drawing a square\nto square :size\n  repeat 4 [forward :size right 90]\nend\n\n; Drawing a star\nto star :size\n  repeat 5 [forward :size right 144]\nend\n\n; Fractal tree\nto tree :size\n  if :size < 5 [stop]\n  forward :size\n  left 30 tree :size * 0.7\n  right 30 back :size\n  right 30 tree :size * 0.7\n  left 30\nend\n\n; Export to different systems\ncs    ; clear screen\npu   ; pen up\nsetxy -200 -200  ; position\npd   ; pen down\nstar 100",
          "explanation": "Logo's polyglot boundary is turtle graphics: the turtle bridges abstract procedural commands (forward, right, pen) to visual geometric output. This makes Logo a universal educational bridge that connects mathematical thinking (angles, coordinates, recursion) to visual art. Different Logo implementations (FMSLogo, UCBLogo, MSWLogo) can also interface with hardware (robots, sensors), extending the visual boundary to physical computing."
        }
      ],
      "libraries": [
        {
          "name": "UCBLogo",
          "url": "https://people.eecs.berkeley.edu/~bh/logo.html",
          "type": "Implementation"
        }
      ],
      "docs": [
        {
          "name": "Logo Foundation",
          "url": "https://el.media.mit.edu/logo-foundation/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "; LOGO variables\nmake \"name \"Alice\"\nmake \"count 0\nmake \"colors [red green blue]\n\n; Access\nprint :name        ; Alice\nprint :count       ; 0\nprint item 2 :colors ; green\n\n; Arithmetic\nmake \"count :count + 1\nmake \"area 3.14159 * :radius * :radius",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "; LOGO conditionals\nif :score > 100 [print [High score!]]\nifelse :age > 18 [\n  print [Adult]\n] [\n  print [Minor]\n]\n\n; Test operations\nif equalp :name \"Alice\" [print [Welcome, Alice!]]\nif emptyp :list [print [List is empty]]\nif numberp :value [print [It is a number]]\n\n; Logical\nif and :x > 0 :x < 100 [print [In range]]",
          "difficulty": "basic"
        },
        "loops": {
          "code": "; LOGO loops\n; repeat\nrepeat 4 [forward 100 right 90]\n\n; for (some dialects)\nfor [i 1 10] [print :i]\n\n; while\nmake \"x 0\nwhile [:x < 10] [\n  print :x\n  make \"x :x + 1\n]\n\n; Recursion\nto spiral :size\n  if :size > 100 [stop]\n  forward :size\n  right 91\n  spiral :size + 2\nend\nspiral 1",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "; LOGO functions (procedures)\nto greet :name\n  print sentence [Hello] :name\nend\ngreet \"Alice   ; Hello Alice\n\n; Recursive procedure\nto tree :size\n  if :size < 5 [stop]\n  forward :size\n  left 30\n  tree :size * 0.7\n  right 30\n  back :size\n  right 30\n  tree :size * 0.7\n  left 30\nend\n\n; Output function (reports value)\nto square :x\n  output :x * :x\nend\nprint square 5   ; 25",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "; LOGO performance:\n; 1. Interpreted language\n; 2. Turtle graphics can be slow for complex drawings\n; 3. Recursion depth varies by implementation\n; 4. Screen refresh after each command (can be disabled)\n; 5. Good for education, not production\n; 6. FMSLogo and UCBLogo are common implementations\n\n; Disable screen refresh for speed\nnorefresh  ; begin batch mode\n; ... complex drawing ...\nrefresh    ; update screen",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "; LOGO has no class/OOP system.\n; Reusability comes from:\n; - Procedures (to ... end)\n; - Libraries (erload, bury)\n; - Workspace management\n; These are NOT classes in the OOP sense.\n; Use procedures and libraries for shared logic.\n\nto draw-square :size\n  repeat 4 [forward :size right 90]\nend\n\ndraw-square 50\ndraw-square 100",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "; LOGO strings\nmake \"name \"Alice\"\nprint :name                    ; Alice\nprint sentence [Hello] :name  ; Hello Alice\nprint word [Hello] :name     ; HelloAlice\n\n; String operations\nprint first \"Hello            ; H\nprint last \"Hello             ; o\nprint butfirst \"Hello          ; ello\nprint butlast \"Hello           ; Hell\nprint count \"Hello            ; 5\n\n; Quoted word vs list\nprint [Hello World]           ; Hello World\nprint \"Hello                  ; Hello",
          "difficulty": "basic"
        },
        "errors": {
          "code": "; LOGO error handling\n; LOGO stops on errors by default\n; Common errors:\n; - Undefined procedure\n; - Wrong number of inputs\n; - Division by zero\n\n; Catch errors (some dialects)\ncatch \"error [\n  make \"result 10 / 0\n]\nprint :error  ; division by zero\n\n; Check before operating\nif not numberp :value [\n  print [Not a number]\n  stop\n]\n\n; Debugging\ntrace     ; show procedure calls\npause     ; pause execution\nstep     ; step through",
          "difficulty": "N/A"
        },
        "imports": {
          "code": "; LOGO imports (workspace management)\n; Save workspace\nsave \"mywork.lgo\n\n; Load workspace\nload \"mywork.lgo\n\n; Bury procedures (hide from user)\nbury \"helper-procedure\n\n; Erase procedures\nerase \"old-procedure\n\n; Some dialects support libraries\n; FMSLogo: file operations\n; UCBLogo: standard library\n\n; Note: LOGO uses load/save for workspace\n; management, not ES-style imports.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "logo-tip-turtle",
          "title": "Turtle state is global and easy to desync",
          "body": "Logo surprises are pen state, heading, and interpreter dialect — keep demos tiny for learners.",
          "tag": "education",
          "status": "curated"
        }
      ],
      "categories": [
        "education"
      ],
      "overview": "A Lisp-derived educational language famous for turtle graphics — draw by moving a cursor. Explores recursion, geometry, and procedural thinking through visual feedback. Young learners and educators teaching geometry and programming basics — turtle graphics make loops, angles, and recursion intuitively visible.\n\nTypical projects include Turtle graphics, Education, Geometry exploration.",
      "learning_curve": "Gentle — Logo was designed for children. The turtle graphics paradigm makes geometry and programming immediately visual and tangible. Recursion and procedures add moderate depth. Different dialects (FMSLogo, UCBLogo, Scratch Logo) have slight variations.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Logo was created by Seymour Papert at MIT (1967). Turtle graphics revolutionized CS education. UCBLogo (Berkeley) is the standard open-source implementation. FMSLogo is the most popular Windows version. Used in education worldwide. Influenced Scratch, Snap!, and other visual languages.",
      "common_use_cases": [
        "Turtle graphics",
        "Education",
        "Geometry exploration"
      ],
      "docs_url": "https://el.media.mit.edu/logo-foundation/what_is_logo/logo_programming.html",
      "best_for": [
        "turtle graphics geometry education",
        "introductory recursion and procedural thinking",
        "classroom programming fundamentals instruction",
        "Turtle graphics curricula teaching geometry through procedural drawing"
      ],
      "weak_at": [
        "Production web APIs without Logo interpreter embedding in host stacks",
        "Large-scale data processing pipelines outside educational VM contexts",
        "Mobile consumer apps expecting native UI frameworks and app store polish"
      ],
      "official_url": "https://el.media.mit.edu/logo-foundation/",
      "paradigm": [
        "educational",
        "interpreted",
        "turtle-graphics"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Interpreted or bytecode-based in common implementations (engines vary)",
        "memory": "Garbage-collected in mainstream implementations",
        "abstraction": "High-level for typical scripting and application use"
      }
    },
    {
      "id": "ballerina",
      "name": "Ballerina",
      "color": "#585a5e",
      "description": "A cloud-native programming language with built-in networking, data, and concurrency primitives. Write services, clients, and integration logic without boilerplate HTTP library code.",
      "whoItIsFor": "Integration developers building microservices and API compositions — network-aware types, service declarations, and built-in observability.",
      "commonUses": [
        "Microservices",
        "API integration",
        "Cloud-native backends"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "import ballerina/io;\npublic function main() {\n    io:println(\"Hello\");\n}",
          "explanation": "A public main function acts as the entry point when you run the Ballerina module."
        },
        {
          "title": "Service resource",
          "code": "import ballerina/http;\n\nservice / on new http:Listener(8080) {\n  resource function get hello() returns string {\n    return \"Hello\";\n  }\n}",
          "explanation": "Network-aware services expose resources on paths; types are explicit."
        },
        {
          "title": "Client call",
          "code": "http:Client cl = check new (\"https://api.example.com\");\njson|error res = cl->/users;",
          "explanation": "`check` propagates errors; client types describe remote calls."
        },
        {
          "title": "Network service boundary - Ballerina's native integration",
          "code": "import ballerina/http;\n\nservice / on new http:Listener(9090) {\n    resource function get greeting() returns string {\n        return \"Hello, Ballerina!\";\n    }\n\n    resource function post data(string name) returns json {\n        // Call an external API\n        http:Client weatherApi = check new (\"https://api.weather.com\");\n        json response = check weatherApi->get(\"/forecast/\" + name);\n        return response;\n    }\n}",
          "explanation": "Ballerina's primary boundary is network services — HTTP, gRPC, GraphQL, WebSockets, and message queues are first-class language constructs, not libraries. The 'service' and 'resource' keywords define API endpoints; 'Client' objects call external services. Ballerina generates OpenAPI specs from service definitions. This makes it uniquely suited for integration: the language IS the API gateway in polyglot pipelines."
        }
      ],
      "libraries": [
        {
          "name": "Ballerina docs",
          "url": "https://ballerina.io/learn/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Ballerina documentation",
          "url": "https://ballerina.io/learn/"
        }
      ],
      "compareData": {
        "classes": {
          "code": "type Point record {\n    float x;\n    float y;\n};\n\nfunction length(Point p) returns float {\n    return math:sqrt(p.x * p.x + p.y * p.y);\n}",
          "difficulty": "basic"
        },
        "strings": {
          "code": "string greeting = \"Hello, Ballerina!\";\nio:println(greeting);\n\n// String interpolation\nstring msg = string `Value: ${val}`;",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Ballerina uses union types for error handling\nfunction divide(float x, float y) returns float|error {\n    if y == 0.0 {\n        return error(\"Division by zero\");\n    }\n    return x / y;\n}\n\n// Callers handle with check or match\nfloat|error result = divide(10.0, 0.0);\nif result is error {\n    io:println(\"Error: \", result.message());\n}",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "import ballerina/io;\nimport ballerina/http;\nimport ballerina/sql;\n\n// Ballerina's stdlib covers network protocols natively",
          "difficulty": "basic"
        },
        "variables": {
          "code": "// Ballerina variables\nstring greeting = \"Hello, Ballerina!\";\nint count = 0;\nfloat pi = 3.14159;\nboolean active = true;\n\n// Type inference with var\nvar result = calculateResult();\n\n// Union types\nstring|int value = \"hello\";\nvalue = 42;  // valid",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// Ballerina conditionals\nif count > 100 {\n    io:println(\"High\");\n} else if count > 50 {\n    io:println(\"Medium\");\n} else {\n    io:println(\"Low\");\n}\n\n// Type guard with is\nstring|int val = getValue();\nif val is string {\n    io:println(\"String: \" + val);\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Ballerina loops\n// foreach over array\nforeach var item in items {\n    io:println(item);\n}\n\n// while loop\nint i = 0;\nwhile i < items.length() {\n    io:println(items[i]);\n    i = i + 1;\n}\n\n// Range iteration\nforeach int j in 0 ... 9 {\n    io:println(j);\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "// Ballerina functions\nfunction add(int a, int b) returns int {\n    return a + b;\n}\n\n// Function returning union type (error handling)\nfunction divide(int a, int b) returns int|error {\n    if b == 0 {\n        return error(\"Division by zero\");\n    }\n    return a / b;\n}\n\n// Call with check (error propagation)\nint result = check divide(10, 2);\n\n// Default parameters\nfunction greet(string name = \"World\") returns string {\n    return \"Hello, \" + name;\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "// Ballerina performance:\n// 1. Runs on JVM (Ballerina Runtime on JRE)\n// 2. Network I/O is non-blocking by default\n// 3. Strand scheduler for concurrent services\n// 4. Compiled to Java bytecode\n// 5. Suitable for API gateway / integration workloads\n// 6. Not designed for CPU-intensive computation\n\n// Concurrency with workers\nworker A {\n    // concurrent work\n}\nworker B {\n    // concurrent work\n}\nawait A;  // wait for completion",
          "difficulty": "intermediate"
        }
      },
      "tips": [],
      "categories": [
        "web"
      ],
      "overview": "A cloud-native programming language with built-in networking, data, and concurrency primitives. Write services, clients, and integration logic without boilerplate HTTP library code. Integration developers building microservices and API compositions — network-aware types, service declarations, and built-in observability.\n\nTypical projects include Microservices, API integration, Cloud-native backends. Ballerina Central provides packages; HTTP, gRPC, and GraphQL are language constructs.",
      "learning_curve": "Moderate for developers with Java/Go experience — the syntax is C-family. The network-first paradigm (services are language constructs) takes adjustment. Error handling with union types and 'check' is clean once understood.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Ballerina Central provides packages. WSO2 backs development. Built-in network protocol support (HTTP, gRPC, GraphQL, WebSockets, Kafka, RabbitMQ). Strong in API integration and microservices. Ballerina Swan Lake (current version) is a significant improvement over earlier releases.",
      "common_use_cases": [
        "Microservices",
        "API integration",
        "Cloud-native backends"
      ],
      "docs_url": "https://ballerina.io/learn/",
      "best_for": [
        "cloud-native microservice orchestration",
        "REST and GraphQL API integration",
        "distributed application with built-in sequence diagrams",
        "Network-aware integration services with first-class HTTP and gRPC types"
      ],
      "weak_at": [
        "Legacy mainframe batch without cloud-native networking requirements",
        "Teams standardized on Java Spring or Go without Ballerina hiring pipelines",
        "Desktop GUI products outside Ballerina server-side integration focus"
      ],
      "official_url": "https://ballerina.io/",
      "paradigm": [
        "concurrent",
        "network-aware",
        "integration"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static with structural typing and open records",
        "runtime": "Runs on the Ballerina runtime (JVM-based or native targets depending on distribution)",
        "memory": "Garbage-collected on typical Ballerina deployments",
        "abstraction": "High-level for network services and integration"
      }
    },
    {
      "id": "chapel",
      "name": "Chapel",
      "color": "#1c4966",
      "description": "A parallel programming language from Cray — designed for HPC from the ground up. Its locality-aware abstractions map naturally to multi-node clusters and shared-memory machines.",
      "whoItIsFor": "Scientists and HPC developers running code on supercomputers — high-level parallel programming that scales from laptops to multi-node clusters.",
      "commonUses": [
        "HPC",
        "Parallel computing",
        "Scientific simulation"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "writeln(\"Hello\");",
          "explanation": "writeln runs on the main thread — parallel execution comes from forall/coforall and locales, not from every top-level statement."
        },
        {
          "title": "Parallel forall",
          "code": "var A: [1..10] int;\nforall i in 1..10 do\n  A[i] = i * i;",
          "explanation": "`forall` may execute iterations in parallel across locales or threads."
        },
        {
          "title": "Config const",
          "code": "config const n = 1000;",
          "explanation": "`config` lets users override values at launch without recompiling."
        },
        {
          "title": "extern C - Chapel's HPC interop boundary",
          "code": "// Chapel calls C functions via extern declarations\nextern proc sqrt(x: real): real;\n\n// Export Chapel functions callable from C\nexport proc chapel_add(a: int, b: int): int {\n  return a + b;\n}\n\n// Link with C libraries\n// chpl -o myapp myapp.chpl -lgsl -lblas\npragma \"export node\"\nproc main() {\n  writeln(sqrt(2.0));  // calls C sqrt\n}",
          "explanation": "Chapel's extern/export mechanism is its HPC boundary. extern proc declares C functions callable from Chapel; export proc makes Chapel functions callable from C. This is how Chapel integrates with existing HPC libraries (GSL, BLAS, LAPACK, MPI) and how polyglot HPC pipelines connect Chapel's data-parallel abstractions to legacy C/Fortran code."
        },
        {
          "title": "Locales and domains - Chapel's distributed data boundary",
          "code": "// Each locale maps to a compute node\nconst numLocales = Locales.size;\n\n// Domains define iteration spaces (distributed arrays)\nconst D = {1..n} dmapped Block({1..n});\nvar A: [D] real;\n\n// coforall spawns one task per locale\ncoforall loc in Locales {\n  on loc {\n    writeln(\"Running on \", here.id);\n  }\n}",
          "explanation": "Chapel's locale and domain model is its distributed data boundary. Locales represent compute nodes; domains define distributed iteration spaces with dmapped distributions (Block, Cyclic, etc.). The 'on' keyword places computation on a specific locale. This is how Chapel handles the data-movement challenge in HPC: data placement and task distribution are first-class language concepts."
        }
      ],
      "libraries": [
        {
          "name": "Chapel docs",
          "url": "https://chapel-lang.org/docs/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Chapel documentation",
          "url": "https://chapel-lang.org/docs/"
        }
      ],
      "compareData": {
        "classes": {
          "code": "record Point {\n  var x: real;\n  var y: real;\n  proc length() {\n    return sqrt(x*x + y*y);\n  }\n}\n\nvar p = new Point(3.0, 4.0);",
          "difficulty": "basic"
        },
        "strings": {
          "code": "var greeting: string = \"Hello, Chapel!\";\nwriteln(greeting);\n\n// String interpolation\nwriteln(\"Point at (%.1f, %.1f)\".format(p.x, p.y));",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Chapel uses try/halt for error handling\ntry {\n  var f = open(\"data.txt\", iomode.r);\n} catch e: FileNotFoundError {\n  writeln(\"File not found: \", e.message());\n} catch e {\n  writeln(\"Error: \", e.message());\n}",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "use IO;\nuse Math;\nuse Map;\nuse List;\nuse Time;\n// Chapel modules are loaded with 'use'",
          "difficulty": "basic"
        },
        "variables": {
          "code": "// Chapel variables\nvar x: int = 42;\nvar y: real = 3.14;\nvar name: string = \"hello\";\n\n// Const (immutable)\nconst pi: real = 3.14159;\n\n// Config (settable at runtime)\nconfig const n = 100;\n// Run with: ./myapp --n=1000\n\n// Ref (alias)\nref alias = x;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// Chapel conditionals\nif x > 100 {\n    writeln(\"high\");\n} else if x > 50 {\n    writeln(\"medium\");\n} else {\n    writeln(\"low\");\n}\n\n// Select (similar to switch)\nselect color {\n    when \"red\" do writeln(\"hot\");\n    when \"blue\" do writeln(\"cool\");\n    otherwise do writeln(\"unknown\");\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Chapel loops\n// for loop\nfor i in 1..10 do writeln(i);\n\n// Parallel forall loop (distributed!)\nforall i in 1..n do A[i] = i * 2.0;\n\n// coforall (one task per iteration)\ncoforall loc in Locales do on loc {\n    writeln(\"Running on \", here.id);\n}\n\n// while loop\nvar i = 0;\nwhile i < n {\n    A[i] = 0.0;\n    i += 1;\n}",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "// Chapel functions (procs)\nproc add(a: int, b: int): int {\n    return a + b;\n}\n\n// Function with where clause (overloading)\nproc abs(x: int): int where x >= 0 do return x;\nproc abs(x: int): int where x < 0 do return -x;\n\n// Iterator (yield-based)\niter fibonacci(n: int): int {\n    var (a, b) = (0, 1);\n    for i in 1..n {\n        yield a;\n        (a, b) = (b, a + b);\n    }\n}",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "// Chapel performance:\n// 1. Compiles to native code (via LLVM)\n// 2. forall/coforall auto-parallelize across cores/locales\n// 3. Domain maps control data distribution\n// 4. Single-locale: competitive with C/Fortran\n// 5. Multi-locale: scales to HPC clusters\n// 6. Communication overhead is main bottleneck\n\n// Data-parallel example\nforall i in D with (ref A) {\n    A[i] = computeExpensive(i);  // auto-parallel\n}",
          "difficulty": "intermediate"
        }
      },
      "tips": [],
      "categories": [
        "systems",
        "data"
      ],
      "overview": "A parallel programming language from Cray — designed for HPC from the ground up. Its locality-aware abstractions map naturally to multi-node clusters and shared-memory machines. Scientists and HPC developers running code on supercomputers — high-level parallel programming that scales from laptops to multi-node clusters.\n\nTypical projects include HPC, Parallel computing, Scientific simulation. Developed at Cray/HPE for exascale clusters; the community is smaller than Fortran or MPI C but growing in HPC centers.",
      "learning_curve": "Steep for HPC newcomers — the locale/domain model, distributed arrays, and task parallelism are unique to Chapel. Easier for Fortran/MPI programmers who understand distributed computing. The single-threaded subset is straightforward.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Developed at Cray/HPE (now part of HPE). Designed for exascale computing. Used in HPC centers worldwide. Good interoperability with C, MPI, and BLAS/LAPACK. CHAMPS framework for atmospheric modeling. Smaller community than Fortran/C but growing in HPC.",
      "common_use_cases": [
        "HPC",
        "Parallel computing",
        "Scientific simulation"
      ],
      "docs_url": "https://chapel-lang.org/docs/",
      "best_for": [
        "high-performance computing (HPC) simulations",
        "parallel algorithm research and development",
        "scalable multi-locale scientific computing",
        "HPC parallel programming with partitioned global address space abstractions"
      ],
      "weak_at": [
        "Interactive web CRUD apps without HPC cluster scheduling infrastructure",
        "Mobile client applications outside Chapel compilation and runtime model",
        "Startups without access to Cray/HPE Chapel toolchain support contracts"
      ],
      "official_url": "https://chapel-lang.org/",
      "paradigm": [
        "parallel",
        "HPC",
        "partitioned-global"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static with optional type inference",
        "runtime": "Compiled via LLVM to native code; multi-locale builds target HPC clusters",
        "memory": "Manual for low-level code; locale-aware arrays manage distributed data placement",
        "abstraction": "High-level parallel abstractions over native performance"
      }
    },
    {
      "id": "idris",
      "name": "Idris",
      "color": "#b30000",
      "description": "A dependently-typed functional language — types can encode program proofs. Write the invariant in the type; the compiler ensures your code cannot violate it.",
      "whoItIsFor": "PL researchers and developers exploring type-driven development — dependent types let you express and verify complex properties at compile time.",
      "commonUses": [
        "Verified software",
        "Type-driven development",
        "Research"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "main : IO ()\nmain = putStrLn \"Hello\"",
          "explanation": "putStrLn is an IO action that prints a line while keeping side effects in the IO type."
        },
        {
          "title": "Dependent type signature",
          "code": "append : Vect n a -> Vect m a -> Vect (n + m) a",
          "explanation": "Types can mention values — here vector length is tracked in the type."
        },
        {
          "title": "Hole",
          "code": "rev : Vect n a -> Vect n a\nrev xs = ?rev_rhs",
          "explanation": "Holes (`?name`) mark incomplete code; the compiler reports expected types."
        },
        {
          "title": "FFI boundary - Idris's polyglot bridge",
          "code": "-- Idris's polyglot boundary is FFI:\n-- dependent types compile to Chez Scheme\n-- and can call C/Scheme functions.\n\n-- C FFI\n%foreign \"C:malloc,lib:c\"\nprim_malloc : Int -> Ptr\n\n%foreign \"C:free,lib:c\"\nprim_free : Ptr -> PrimIO ()\n\n-- Scheme FFI\n%foreign \"scheme:display\"\nprim_display : String -> PrimIO ()\n\n-- Node.js FFI (Idris 2)\n%foreign \"node:lambda: (x) => console.log(x)\"\nprim_log : String -> PrimIO ()\n\n-- Using FFI in Idris\nmalloc : (n : Nat) -> IO (Ptr)\nmalloc n = primIO (prim_malloc (cast n))\n\nfree : Ptr -> IO ()\nfree p = primIO (prim_free p)",
          "explanation": "Idris's polyglot boundary is its FFI system: Idris 2 compiles to Chez Scheme and can call C, Scheme, and Node.js functions via %foreign declarations. The type system guarantees safety at the boundary — dependent types can verify that FFI calls receive correct arguments. This makes Idris a proof-level bridge that connects formally verified logic to runtime systems (C libraries, Scheme VMs, JavaScript environments)."
        }
      ],
      "libraries": [
        {
          "name": "Idris docs",
          "url": "https://idris2.readthedocs.io/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Idris 2 docs",
          "url": "https://idris2.readthedocs.io/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "-- Idris variables\n-- Idris uses type declarations (optional with inference)\nx : Int\nx = 42\n\nname : String\nname = \"Idris\"\n\n-- Dependent types\nvec : Vect 3 Int\nvec = [1, 2, 3]\n\n-- Type inference\ny = x + 1   -- inferred as Int\n\n-- Let bindings\ngreet : String -> String\ngreet name =\n  let greeting = \"Hello, \"\n  in greeting ++ name\n\n-- Where clauses\nfib : Nat -> Nat\nfib n = fibHelper n 0 1\n  where\n    fibHelper : Nat -> Nat -> Nat -> Nat\n    fibHelper Z a b = a\n    fibHelper (S k) a b = fibHelper k b (a + b)",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "-- Idris conditionals\n-- if/then/else\nclassify : Int -> String\nclassify x =\n  if x > 100 then \"large\"\n  else if x > 0 then \"small\"\n  else \"non-positive\"\n\n-- Pattern matching (preferred)\nfactorial : Nat -> Nat\nfactorial Z = 1\nfactorial (S n) = (S n) * factorial n\n\n-- Case expression\ndescribe : Nat -> String\ndescribe n = case n of\n  0 => \"zero\"\n  1 => \"one\"\n  _ => \"many\"\n\n-- Dependent type conditionals\nsafeDiv : (x : Int) -> (y : Int) -> NotZero y => Int\nsafeDiv x y = x `div` y",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "-- Idris loops\n-- Idris uses recursion instead of loops\n-- Recursion is the primary iteration mechanism\n\nsumList : List Int -> Int\nsumList [] = 0\nsumList (x :: xs) = x + sumList xs\n\n-- Tail-recursive (efficient)\nsumListTR : List Int -> Int -> Int\nsumListTR [] acc = acc\nsumListTR (x :: xs) acc = sumListTR xs (acc + x)\n\n-- For loop (Idris 2)\nmain : IO ()\nmain = do\n  for i in [0..9]\n    putStrLn (show i)\n\n-- List comprehension\nevens : List Int\nevens = [x * 2 | x <- [1..10]]",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "-- Idris functions\n-- Simple function\nadd : Int -> Int -> Int\nadd x y = x + y\n\n-- Curried by default\nincrement : Int -> Int\nincrement = add 1\n\n-- Dependent type function\nreplicate : (n : Nat) -> (x : a) -> Vect n a\nreplicate Z x = []\nreplicate (S k) x = x :: replicate k x\n\n-- Implicit arguments\nlookup : (idx : Fin n) -> Vect n a -> a\nlookup FZ (x :: xs) = x\nlookup (FS k) (x :: xs) = lookup k xs\n\n-- IO functions\nmain : IO ()\nmain = putStrLn \"Hello, Idris!\"\n\n-- do notation\nreadAndPrint : IO ()\nreadAndPrint = do\n  putStrLn \"Enter name:\"\n  name <- getLine\n  putStrLn (\"Hello, \" ++ name)",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "-- Idris performance:\n-- 1. Compiled via Chez Scheme (Idris 2)\n-- 2. Type checking is compile-time (zero runtime cost)\n-- 3. Dependent types can slow compilation\n-- 4. %static directives for specialization\n-- 5. C FFI available for performance-critical code\n-- 6. Erasure analysis removes unused proofs\n-- 7. Not designed for raw performance\n-- 8. Use FFI for hot paths",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "-- Idris has type classes (interfaces), NOT OOP classes.\n-- Type classes define interfaces for polymorphism.\n\n-- Define a type class\nclass Show a where\n  show : a -> String\n\n-- Implement for a type\nShow Int where\n  show x = cast x\n\n-- Built-in type classes\n-- Eq, Ord, Num, Functor, Applicative, Monad\n-- These are NOT OOP classes.\n-- They are interfaces for ad-hoc polymorphism.\n\n-- Custom type class\nclass Container (f : Type -> Type) where\n  empty : f a\n  insert : a -> f a -> f a\n  size : f a -> Nat",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "-- Idris strings\ngreeting : String\ngreeting = \"Hello, Idris!\"\n\n-- String concatenation\nfull : String -> String -> String\nfull first last = first ++ \" \" ++ last\n\n-- String functions\nlength : String -> Nat       -- built-in\nreverse : String -> String   -- built-in\nsubstr : Nat -> Nat -> String -> String\n\n-- String interpolation (Idris 2)\nmessage : String\nmessage = \"Value: \\{show 42}\"\n\n-- Chars\nch : Char\nch = 'A'",
          "difficulty": "basic"
        },
        "errors": {
          "code": "-- Idris error handling\n-- Maybe type (optional value)\nsafeDiv : Int -> Int -> Maybe Int\nsafeDiv _ 0 = Nothing\nsafeDiv x y = Just (x `div` y)\n\n-- Either type (error with info)\nsafeRead : String -> Either String Int\nsafeRead s = case cast s of\n  Just n => Right n\n  Nothing => Left \"Not a number\"\n\n-- Dependent types prevent errors at compile time\nhead : (xs : Vect (S n) a) -> a\nhead (x :: xs) = x  -- can't be called on empty list!\n\n-- IO errors\nmain : IO ()\nmain = do\n  result <- readFile \"data.txt\"\n    `catch` \\err => pure \"Error reading file\"\n  putStrLn result",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "-- Idris imports\n-- Module declaration\nmodule MyModule\n\n-- Import a module\nimport Data.Vect\nimport Data.List\n\n-- Import with alias\nimport Data.Vect as V\n\n-- Import specific names\nimport Data.List (filter, map)\n\n-- Import for implementation only (%hide)\nimport public Data.String\n\n-- Package dependency (in .ipkg file)\n-- depends = contrib, network\n\n-- Note: Idris uses module imports, not ES-style.\n-- Package manager is idris2 --install",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "idris-tip-recursion-and-immutability-are-the-defaults-not",
          "title": "Recursion and immutability are the defaults, not the extras",
          "body": "In Idris, the cleanest code usually leans on recursion, pure functions, and immutable data. If you force an imperative style too early, you often make the program harder to reason about than the language intended.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "categories": [
        "academic",
        "functional"
      ],
      "overview": "A dependently-typed functional language — types can encode program proofs. Write the invariant in the type; the compiler ensures your code cannot violate it. PL researchers and developers exploring type-driven development — dependent types let you express and verify complex properties at compile time.\n\nTypical projects include Verified software, Type-driven development, Research.",
      "learning_curve": "Very steep — Idris's dependent type system is fundamentally different from mainstream languages. Understanding type-level computation, proofs, and the relationship between types and values requires significant mathematical maturity. The IDE (idris2-mode) helps with holes and type checking. Not recommended as a first language.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Idris is a dependently-typed programming language created by Edwin Brady. Idris 2 compiles to Chez Scheme. Primarily academic/research. Used for theorem proving, verified programming, and language research. Small but dedicated community. Strong type system catches many errors at compile time. Competing with Agda and Coq for verified programming.",
      "common_use_cases": [
        "Verified software",
        "Type-driven development",
        "Research"
      ],
      "docs_url": "https://idris2.readthedocs.io/",
      "best_for": [
        "dependently-typed verified software development",
        "type-driven program synthesis research",
        "formal verification with dependent types",
        "Dependently typed programs with compile-time proof obligations"
      ],
      "weak_at": [
        "Rapid CRUD delivery without dependent type learning curve tolerance",
        "Large teams standardized on Java or Go without FP hiring pipelines",
        "Runtime environments rejecting GC and lazy evaluation overhead"
      ],
      "official_url": "https://www.idris-lang.org/",
      "paradigm": [
        "functional",
        "dependent-types",
        "proof-oriented"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static (often with type inference)",
        "runtime": "Compiled to native code or bytecode; implementation and runtime vary by compiler",
        "memory": "Garbage-collected in most mainstream compilers"
      }
    },
    {
      "id": "agda",
      "name": "Agda",
      "color": "#4e7ebb",
      "description": "A dependently-typed language and proof assistant — used for formal verification. Its interactive development mode lets you construct programs and proofs hole-by-hole.",
      "whoItIsFor": "Mathematicians and PL researchers writing machine-checked proofs — dependent types enable precise specifications and constructive proof development.",
      "commonUses": [
        "Formal proofs",
        "Verified programs",
        "Type theory research"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "open import IO\nmain = run (putStrLn \"Hello\")",
          "explanation": "Illustrative IO entry — requires agda-stdlib and a matching backend; not a one-line runnable script without project setup."
        },
        {
          "title": "Data declaration",
          "code": "data Nat : Set where\n  zero : Nat\n  suc  : Nat → Nat",
          "explanation": "Inductive types define constructors; `Set` is the type of small types."
        },
        {
          "title": "Function by pattern",
          "code": "add : Nat → Nat → Nat\nadd zero    m = m\nadd (suc n) m = suc (add n m)",
          "explanation": "Pattern matching on constructors is total when all cases are covered."
        },
        {
          "title": "COMPILE/foreign - Agda's FFI boundary (backend-dependent)",
          "code": "-- Agda compiles via backends (GHC, JS). The FFI depends on backend.\n-- GHC backend: COMPILE pragmas link to Haskell\ndata Unit : Set where\n  unit : Unit\n\n{-# COMPILE GHC unit = () #-}\n\n-- JavaScript backend: COMPILE JS pragms\n{-# COMPILE JS unit = {} #-}\n\n-- postulate declares external functions\npostulate putStrLn : String -> IO Unit\n{-# COMPILE GHC putStrLn = Data.PutStrLn #-}\n\n-- Note: exact FFI details depend on backend and flags.\n-- Not all backends support all COMPILE forms.",
          "explanation": "Agda's boundary to the outside world depends on which backend you compile with. The GHC backend uses COMPILE GHC pragmas to link Haskell functions; the JS backend uses COMPILE JS. postulate declares external functions that must be compiled via a backend. This is Agda's polyglot boundary: dependent types verified internally, then compiled to Haskell or JavaScript for runtime behavior and I/O."
        }
      ],
      "libraries": [
        {
          "name": "Agda wiki",
          "url": "https://wiki.portal.chalmers.se/agda/",
          "type": "Wiki"
        }
      ],
      "docs": [
        {
          "name": "Agda documentation",
          "url": "https://agda.readthedocs.io/"
        }
      ],
      "compareData": {
        "classes": {
          "code": "-- No class system; Agda uses records and modules\nrecord Point (A : Set) where\n  field\n    x : A\n    y : A\n\nopen Point {{...}}",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "-- Agda uses String from the standard library\nopen import Data.String\n\ngreeting : String\ngreeting = \"Hello, Agda!\"",
          "difficulty": "basic"
        },
        "errors": {
          "code": "-- Agda does not have runtime exceptions in the usual sense\n-- Proofs eliminate invalid states at compile time\n-- The closest to 'error handling' is the Maybe type:\ndata Maybe (A : Set) : Set where\n  just : A -> Maybe A\n  nothing : Maybe A",
          "difficulty": "advanced"
        },
        "imports": {
          "code": "open import Data.Nat using (Nat; suc; zero)\nopen import Data.List using (List; _::_; [])\nopen import Data.String using (String)",
          "difficulty": "basic"
        },
        "variables": {
          "code": "-- Agda variables are bindings in dependent types\nn : Nat\nn = 42\n\n-- Implicit variables\nopen import Data.Nat using (Nat; suc)\n\n-- Pattern variables in function definitions\nadd : Nat -> Nat -> Nat\nadd zero m = m\nadd (suc n) m = suc (add n m)",
          "difficulty": "intermediate"
        },
        "conditionals": {
          "code": "-- Agda uses pattern matching, not if/else\nisZero : Nat -> Bool\nisZero zero = true\nisZero (suc _) = false\n\n-- with-abstraction for conditional reasoning\nfilter : (A -> Bool) -> List A -> List A\nfilter p [] = []\nfilter p (x :: xs) with p x\n... | true  = x :: filter p xs\n... | false = filter p xs",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "-- Agda uses recursion; termination must be proven\nrepeat : {A : Set} -> Nat -> A -> List A\nrepeat zero _ = []\nrepeat (suc n) x = x :: repeat n x\n\n-- Vect shows loop length in the type\nreplicate : {A : Set} -> (n : Nat) -> A -> Vec A n\nreplicate zero _ = []\nreplicate (suc n) x = x :: replicate n x",
          "difficulty": "advanced"
        },
        "functions": {
          "code": "-- Dependent types allow precise function signatures\n_+_ : Nat -> Nat -> Nat\nzero + m = m\n(suc n) + m = suc (n + m)\n\n-- Implicit arguments\nid : {A : Set} -> A -> A\nid x = x\n\n-- Records as dependent records\nopen import Data.Nat using (Nat)",
          "difficulty": "basic"
        },
        "performance": {
          "code": "-- Agda compiles via GHC or JS backends\n-- Performance depends on backend choice\n-- GHC backend: compiles to Haskell, then native\n-- JS backend: compiles to JavaScript\n\n-- Type checking is the main cost\n-- Large proofs can be slow to verify\n-- Runtime performance matches backend (Haskell or JS)",
          "difficulty": "N/A"
        }
      },
      "tips": [],
      "categories": [
        "academic",
        "proof"
      ],
      "overview": "A dependently-typed language and proof assistant — used for formal verification. Its interactive development mode lets you construct programs and proofs hole-by-hole. Mathematicians and PL researchers writing machine-checked proofs — dependent types enable precise specifications and constructive proof development.\n\nTypical projects include Formal proofs, Verified programs, Type theory research.",
      "learning_curve": "Very steep — dependent types, propositional equality, and proof construction require significant mathematical maturity. Even experienced functional programmers find Agda challenging. The reward is the ability to eliminate entire classes of bugs at compile time.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Standard library (agda-stdlib) is the primary library. Agda is primarily a research language (Chalmers, elsewhere). Small but deeply expert community. Used in type theory research, formal verification, and language design. No commercial tooling.",
      "common_use_cases": [
        "Formal proofs",
        "Verified programs",
        "Type theory research"
      ],
      "docs_url": "https://agda.readthedocs.io/",
      "best_for": [
        "dependently-typed theorem proving",
        "formal mathematics with homotopy type theory",
        "type theory research and verified programming",
        "Formal verification of algorithms and mathematical theorems in Agda"
      ],
      "weak_at": [
        "Production web services without proof assistant operational tooling",
        "Teams needing quick feature shipping without universes and termination checking",
        "Mobile apps outside Agda compilation to executable backend targets"
      ],
      "official_url": "https://wiki.portal.chalmers.se/agda/",
      "paradigm": [
        "functional",
        "proof-assistant",
        "dependent-types"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dependent types (proofs and programs share the type system)",
        "runtime": "Extracted or compiled via backends (GHC/Haskell or JavaScript); not a standalone production VM",
        "memory": "Depends on the chosen backend (typically GC-managed on GHC/JS targets)",
        "abstraction": "Proof assistant and verified programming language"
      }
    },
    {
      "id": "coq",
      "name": "Coq",
      "color": "#d0b68c",
      "description": "An interactive theorem prover — write proofs as programs in a dependently-typed language. Used in verified compilers (CompCert), cryptographic code, and mathematical foundations.",
      "whoItIsFor": "Formal methods researchers and verified-software teams — a proof assistant for mathematical theorems, certified compilers, and security-critical code.",
      "commonUses": [
        "Formal proofs",
        "Verified compilers",
        "Math formalisation"
      ],
      "patterns": [
        {
          "title": "Theorem",
          "code": "Theorem add_comm : forall n m, n + m = m + n.",
          "explanation": "Illustrative excerpt — Coq programs usually live in `.v` files with Require/Import setup; run via coqc or the Coq IDE, not as a bare script."
        },
        {
          "title": "Inductive and fixpoint",
          "code": "Inductive nat : Set :=\n| O : nat\n| S : nat -> nat.\n\nFixpoint add (n m : nat) : nat :=\n  match n with\n  | O => m\n  | S n' => S (add n' m)\n  end.",
          "explanation": "Coq uses inductive definitions and recursive functions with termination checks."
        },
        {
          "title": "Theorem",
          "code": "Theorem add_O_n : forall n : nat, add O n = n.\nProof. intros n. reflexivity. Qed.",
          "explanation": "States commutativity of addition — Coq's tactic engine constructs the proof term interactively."
        },
        {
          "title": "Extraction / FFI boundary - Coq's verified code bridge",
          "code": "(* Coq extracts verified proofs to runnable code.\n   Extraction depends on target and what's Extracted:\n   - OCaml backend (primary, mature)\n   - Haskell backend (secondary)\n   - Scheme backend (experimental)\n*)\n\nRequire Import Coq.Lists.List.\nRequire Extraction.\n\n(* Extract to OCaml *)\nExtraction Language OCaml.\n\n(* Extract Coq nat to OCaml int *)\nExtract Inlined Constant nat_sub =>\n  \"(fun x -> fun y -> Int.sub x y)\".\n\n(* Extract the verified function *)\nExtraction \"mylib.ml\" factorial safe_div.\n\n(* Coq's boundary:\n   Proofs stay in Coq (erased at extraction)\n   Verified functions compile to OCaml/Haskell\n   The polyglot boundary is extraction, not FFI *)",
          "explanation": "Coq's boundary to other languages is extraction, not FFI. Verified Coq functions are extracted to OCaml (primary) or Haskell, with proofs erased at extraction time. The key insight: extraction is Coq's polyglot bridge — it transforms verified Coq definitions into runnable OCaml/Haskell code while preserving the computational behavior. External libraries can be linked via Extract Inlined Constant directives. This is not a simple FFI; it's a verified-to-imperative bridge that maintains correctness guarantees across the boundary."
        }
      ],
      "libraries": [
        {
          "name": "Coq docs",
          "url": "https://coq.inria.fr/documentation",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Coq reference",
          "url": "https://coq.inria.fr/refman/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "(* Coq variables are definitions *)\nDefinition x : nat := 42.\nDefinition name : string := \"Coq\".\n\n(* Let bindings for local scope *)\nLet y := 10 in y + x.\n\n(* Implicit variables *)\nDefinition id {A : Type} (a : A) : A := a.\n\n(* Setoid variables *)\nVariable n : nat.  (* in Section context *)",
          "difficulty": "intermediate"
        },
        "conditionals": {
          "code": "(* Coq conditionals require both branches with same type *)\nDefinition max (a b : nat) : nat :=\n  if a <=? b then b else a.\n\n(* match is the primary conditional *)\nDefinition is_zero (n : nat) : bool :=\n  match n with\n  | 0 => true\n  | S _ => false\n  end.\n\n(* Decidable propositions *)\nCheck (Nat.eq_dec 3 3).  (* left refl : 3 = 3 *)",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "(* Coq uses recursion; all loops must terminate *)\nFixpoint factorial (n : nat) : nat :=\n  match n with\n  | 0 => 1\n  | S n' => n * factorial n'\n  end.\n\n(* For loop in Ltac (tactic language) *)\nLtac repeat_tac n :=\n  match n with\n  | 0 => idtac\n  | S ?n' => tac; repeat_tac n'\n  end.\n\n(* fold (structural recursion) *)\nDefinition sum_list (l : list nat) : nat :=\n  fold_left Nat.add l 0.",
          "difficulty": "advanced"
        },
        "functions": {
          "code": "(* Coq functions *)\nDefinition add (a b : nat) : nat := a + b.\n\n(* Polymorphic *)\nDefinition fst {A B : Type} (p : A * B) : A :=\n  match p with (a, _) => a end.\n\n(* Fixpoint (recursive) *)\nFixpoint length {A : Type} (l : list A) : nat :=\n  match l with\n  | [] => 0\n  | _ :: l' => S (length l')\n  end.\n\n(* Higher-order *)\nDefinition apply {A B} (f : A -> B) (x : A) : B := f x.",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "(* Coq performance considerations:\n   1. Type checking is the main cost (can be slow)\n   2. Proof terms are verified at compile time\n   3. Extraction to OCaml/Haskell runs at native speed\n   4. VM compilation (vm_compute) is 10-100x faster\n   5. Native compute (native_compute) uses OCaml compiler\n   6. No runtime GC overhead (proofs are erased)\n*)\n\nEval vm_compute in (factorial 20).  (* fast *)",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "(* Coq uses typeclasses (like Haskell) *)\nClass Point (A : Type) := {\n  x : A;\n  y : A\n}.\n\n(* Or records *)\nRecord point := {\n  x : nat;\n  y : nat\n}.\n\nDefinition length (p : point) : nat :=\n  Nat.sqrt (p.(x) * p.(x) + p.(y) * p.(y)).",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "(* Coq strings (from Coq.Strings.String) *)\nRequire Import Coq.Strings.String.\n\nDefinition greeting : string := \"Hello, Coq!\".\n\n(* String concatenation *)\nDefinition msg := greeting ++ \" Welcome!\".\n\n(* String operations are limited;\n   most string processing is done after extraction *)",
          "difficulty": "basic"
        },
        "errors": {
          "code": "(* Coq does not have runtime errors in verified code\n   The type system eliminates invalid states.\n   The closest to 'error handling' is option/result types: *)\n\nDefinition safe_div (n m : nat) : option nat :=\n  match m with\n  | 0 => None\n  | _ => Some (n / m)\n  end.\n\n(* sumbool for decidable propositions *)\nDefinition decide_eq (a b : nat) : {a = b} + {a <> b} :=\n  Nat.eq_dec a b.",
          "difficulty": "advanced"
        },
        "imports": {
          "code": "(* Coq imports *)\nRequire Import Coq.Lists.List.\nRequire Import Coq.Arith.Nat.\nRequire Import Coq.Strings.String.\n\n(* Import from local files *)\nRequire Import MyModule.\n\n(* Open scope for notation *)\nOpen Scope nat_scope.\n\n(* Import with alias *)\nFrom Coq Require Import Arith as Arith.",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "academic",
        "proof"
      ],
      "overview": "An interactive theorem prover — write proofs as programs in a dependently-typed language. Used in verified compilers (CompCert), cryptographic code, and mathematical foundations. Formal methods researchers and verified-software teams — a proof assistant for mathematical theorems, certified compilers, and security-critical code.\n\nTypical projects include Formal proofs, Verified compilers, Math formalisation.",
      "learning_curve": "Very steep — dependent types, tactic-based proving, and the Curry-Howard correspondence require significant mathematical maturity. Even experienced functional programmers find Coq challenging. Used primarily for formal verification in math and critical software.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Coq is developed by INRIA and the Coq community. Uses opam for package management. Primary editor: CoqIDE or Proof General (Emacs) / Coq tail. Used for CompCert (verified C compiler), Fiat-Crypto, and mathematical proofs. Small but expert community. Mathematical Components and Software Foundations are key learning resources.",
      "common_use_cases": [
        "Formal proofs",
        "Verified compilers",
        "Math formalisation"
      ],
      "docs_url": "https://coq.inria.fr/documentation",
      "best_for": [
        "interactive theorem proving and proof automation",
        "compiler verification with formal semantics",
        "certified program extraction from proofs",
        "Mechanized proof of cryptographic protocols and compiler correctness"
      ],
      "weak_at": [
        "Business CRUD APIs without formal methods staffing and review cycles",
        "JavaScript-first product teams without Coq proof engineering culture",
        "Hard real-time firmware without extracted code verification pipelines"
      ],
      "official_url": "https://coq.inria.fr/",
      "paradigm": [
        "functional",
        "proof-assistant",
        "dependent-types"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dependent types (Calculus of Inductive Constructions)",
        "runtime": "Extracted to OCaml/Haskell or compiled via VM (Coq kernel); not a general scripting runtime",
        "memory": "Managed by the extracted host language or Coq VM during proof checking",
        "abstraction": "Interactive theorem prover and verified program development"
      }
    },
    {
      "id": "lean",
      "name": "Lean",
      "color": "#2e3440",
      "description": "A functional language and theorem prover — used for Mathlib and verified programming. Its mathlib library is the fastest-growing formalised mathematics repository ever built.",
      "whoItIsFor": "Mathematicians formalising proofs and developers wanting verified code — interactive proof assistant with growing libraries in math and verification.",
      "commonUses": [
        "Math formalisation (Mathlib)",
        "Verified programming",
        "Research"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "#eval \"Hello\"",
          "explanation": "Evaluates and prints via IO — Lean programs use IO monads and can be verified by the type system."
        },
        {
          "title": "Def and theorem",
          "code": "def double (n : Nat) : Nat := n + n\n\ntheorem double_eq_add_self (n : Nat) : double n = n + n := by\n  rfl",
          "explanation": "Definitions introduce functions; `by` blocks use tactics like `rfl`."
        },
        {
          "title": "Structure",
          "code": "structure Point where\n  x : Float\n  y : Float",
          "explanation": "Structures bundle fields; Lean 4 syntax is similar to programming with proofs."
        },
        {
          "title": "Extraction/FFI boundary - Lean's polyglot bridge",
          "code": "-- Lean's polyglot boundary is extraction + FFI:\n-- proofs verify at compile time, C runs at runtime.\n\n-- C FFI\n@[extern \"lean_malloc\"]\nconstant cMalloc (n : USize) : IO Pointers.Ptr\n\n-- Embed C code\n@[extern \"c_puts\"]\nconstant cPuts (s : @& String) : IO Int32\n\n-- Tactic proofs are erased at runtime\ntheorem list_length_append (xs ys : List α) :\n    (xs ++ ys).length = xs.length + ys.length := by\n  simp [List.length_append]\n\n-- Main function (compiled to C)\ndef main : IO Unit := do\n  let x := 42\n  IO.println s!\"The answer is {x}\"\n  -- Proof erased, only computation remains",
          "explanation": "Lean's polyglot boundary is extraction + FFI: proofs verify properties at compile time (erased at runtime), while compiled C code runs efficiently. The @[extern] attribute bridges Lean to C libraries. Lean 4 compiles to C, making it suitable for verified systems code. Tactic proofs (by simp, omega, etc.) are compile-time guarantees that don't exist at runtime. This makes Lean a proof-level bridge that connects mathematical verification to efficient runtime execution."
        }
      ],
      "libraries": [
        {
          "name": "Lean docs",
          "url": "https://lean-lang.org/lean4/doc/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Lean 4 documentation",
          "url": "https://lean-lang.org/lean4/doc/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "-- Lean variables\n-- Lean 4 syntax\ndef x : Int := 42\ndef name : String := \"Lean\"\n\n-- Type inference\ndef y := x + 1  -- inferred as Int\n\n-- Mutable variable in do block\ndef main : IO Unit := do\n  let mut count := 0\n  count := count + 1\n  IO.println s!\"Count: {count}\"\n\n-- Dependent types\ndef vec : Vector Nat 3 := ⟨[1, 2, 3]⟩\n\n-- Pattern matching\ndef pair : Nat × String := (42, \"hello\")\ndef (n, s) := pair",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "-- Lean conditionals\ndef classify (x : Int) : String :=\n  if x > 100 then \"large\"\n  else if x > 0 then \"small\"\n  else \"non-positive\"\n\n-- Pattern matching\ndef fib : Nat → Nat\n  | 0 => 0\n  | 1 => 1\n  | n + 2 => fib (n + 1) + fib n\n\n-- Match expression\ndef describe : Nat → String\n  | 0 => \"zero\"\n  | 1 => \"one\"\n  | _ => \"many\"\n\n-- if-let (pattern matching in condition)\ndef getHead? : List α → Option α\n  | [] => none\n  | a :: _ => some a",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "-- Lean loops\n-- Lean uses recursion and monadic for-loops\n-- (not C-style imperative loops)\n\n-- Recursion\ndef sumList : List Nat → Nat\n  | [] => 0\n  | a :: as => a + sumList as\n\n-- Tail recursion\ndef sumTR : List Nat → Nat → Nat\n  | [] acc => acc\n  | a :: as acc => sumTR as (acc + a)\n\n-- for in do (Lean 4 monadic loop)\ndef main : IO Unit := do\n  for i in [0:10] do\n    IO.println i\n\n-- List comprehension (via List.map/filter)\ndef evens : List Nat :=\n  (List.range 10).filter (· % 2 = 0)",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "-- Lean functions\ndef add (x y : Int) : Int := x + y\n\n-- Curried by default\ndef increment : Int → Int := add 1\n\n-- Dependent types\ndef replicate (n : Nat) (x : α) : List α :=\n  match n with\n  | 0 => []\n  | n + 1 => x :: replicate n x\n\n-- Type class constraint\ndef showMax [Ord α] [Max α] (a b : α) : α := max a b\n\n-- Tactic mode (proofs)\ntheorem add_comm (a b : Nat) : a + b = b + a := by\n  omega\n\n-- IO function\ndef main : IO Unit := do\n  IO.println \"Hello, Lean!\"",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "-- Lean performance:\n-- 1. Compiles to C via Lean 4 code generator\n-- 2. Very fast compiled code (comparable to C)\n-- 3. Type checking is at compile time\n-- 4. Proof erasure: proofs don't exist at runtime\n-- 5. Efficient FFI to C\n-- 6. Lake build system for package management\n-- 7. Incremental compilation supported\n-- 8. Not designed for hot-path performance\n--    but generated C is quite fast",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "-- Lean has type classes (NOT OOP classes).\n-- Type classes define interfaces for polymorphism.\n\n-- Define a type class\nclass HasToString (α : Type) where\n  toString : α → String\n\n-- Instance for Nat\ninstance : HasToString Nat where\n  toString n := toString n\n\n-- Built-in type classes:\n-- BEq, Ord, Hashable, ToString\n-- Functor, Applicative, Monad\n-- These are NOT OOP classes.\n-- They are interfaces for ad-hoc polymorphism.\n\n-- Instance for custom type\nstructure Point where\n  x : Int\n  y : Int\n\ninstance : ToString Point where\n  toString p := s!\"({p.x}, {p.y})\"",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "-- Lean strings\ndef greeting : String := \"Hello, Lean!\"\n\n-- String interpolation (Lean 4)\ndef msg : String := s!\"Value: {42}\"\n\n-- String operations\ndef len : Nat := greeting.length\ndef upper : String := greeting.toUpper\ndef lower : String := greeting.toLower\n\n-- String concatenation\ndef full : String := \"Hello\" ++ \" \" ++ \"Lean\"\n\n-- Substring\ndef sub : String := greeting.extract 0 5  -- \"Hello\"\n\n-- Char\ndef ch : Char := 'A'\ndef isLetter : Bool := ch.isAlpha",
          "difficulty": "basic"
        },
        "errors": {
          "code": "-- Lean error handling\n-- Option type (may fail)\ndef safeDiv (x y : Int) : Option Int :=\n  if y = 0 then none else some (x / y)\n\n-- Except type (error with info)\ndef parseNat (s : String) : Except String Nat :=\n  match s.toNat? with\n  | some n => Except.ok n\n  | none => Except.error s!\"'{s}' is not a natural number\"\n\n-- Tactic mode for compile-time proofs\ntheorem div_pos (a b : Int) (h : b > 0) : a / b ≥ 0 := by\n  omega\n\n-- Runtime errors via panic\ndef unsafeHead : List α → α\n  | [] => panic! \"empty list\"\n  | a :: _ => a",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "-- Lean imports\n-- Import a module\nimport Lean\nimport Mathlib.Data.List.Basic\nimport Mathlib.Tactic\n\n-- Open a namespace\nopen List (map filter)\nopen IO\n\n-- Package management (Lake)\n-- lakefile.lean:\n-- require mathlib from git\n--   \"https://github.com/leanprover-community/mathlib4\"\n\n-- Note: Lean uses import/open, not ES-style.\n-- Lake is the build system and package manager.\n-- Mathlib is the primary library.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "lean-tip-format-pass11",
          "title": "Lake/toolchain pins",
          "body": "Lean proofs break across toolchain bumps. Commit `lean-toolchain` and regenerate Lake deps deliberately.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "categories": [
        "academic",
        "proof"
      ],
      "overview": "A functional language and theorem prover — used for Mathlib and verified programming. Its mathlib library is the fastest-growing formalised mathematics repository ever built. Mathematicians formalising proofs and developers wanting verified code — interactive proof assistant with growing libraries in math and verification.\n\nTypical projects include Math formalisation (Mathlib), Verified programming, Research.",
      "learning_curve": "Very steep — Lean requires understanding dependent types, tactic proofs, and the monad-based IO system. The proof assistant (tactic mode, hole filling) helps but has significant cognitive overhead. Mathlib (the primary library) is massive. Lean 4 improved ergonomics over Lean 3 but remains challenging. Best for mathematicians and verification engineers.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Lean is a dependently-typed programming language and theorem prover. Lean 4 (current) compiles to C. Mathlib is the primary library (200k+ theorems). Used for formalizing mathematics (Fields Medal work by Tao, Scholze). Lake is the build system. Strong community at leanprover-community. Competing with Coq and Agda for verified programming. Used by AWS for verifying S3 properties.",
      "common_use_cases": [
        "Math formalisation (Mathlib)",
        "Verified programming",
        "Research"
      ],
      "docs_url": "https://lean-lang.org/documentation/",
      "best_for": [
        "interactive theorem proving for mathematics",
        "Mathlib formalisation of advanced mathematics",
        "verified software development with dependent types",
        "Formal mathematics formalization projects like Mathlib community efforts"
      ],
      "weak_at": [
        "Conventional SaaS feature velocity without proof maintenance overhead",
        "Teams without mathematically trained contributors for Lean development",
        "Legacy Python ML stacks without Lean interop or extraction requirements"
      ],
      "official_url": "https://lean-lang.org/",
      "paradigm": [
        "functional",
        "theorem-proving",
        "metaprogramming"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static (often with type inference)",
        "runtime": "Compiled to native code or bytecode; implementation and runtime vary by compiler",
        "memory": "Garbage-collected in most mainstream compilers"
      }
    },
    {
      "id": "unison",
      "name": "Unison",
      "color": "#4e8eca",
      "description": "A content-addressed language — code is stored by hash, not by file, enabling frictionless refactoring. Change a function, and Unison figures out what else needs updating.",
      "whoItIsFor": "Developers interested in distributed, conflict-free code management — content-addressed definitions eliminate merge conflicts and easy refactoring.",
      "commonUses": [
        "Distributed systems",
        "Refactoring-friendly code",
        "Cloud functions"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "main = printLine \"Hello\"",
          "explanation": "Top-level definition with a unique hash — Unison identifies code by content, not by file name."
        },
        {
          "title": "Term with type",
          "code": "double : Nat -> Nat\ndouble n = n + n",
          "explanation": "Unison stores definitions by hash; types are separate from names."
        },
        {
          "title": "Ability (effect)",
          "code": "program : '{IO} ()\nprogram _ = printLine \"hi\"",
          "explanation": "Abilities track effects; the type shows `IO` is required."
        },
        {
          "title": "Ability boundary - Unison's polyglot bridge",
          "code": "-- Unison's polyglot boundary is its ability system:\n-- abilities (effects) separate what from how.\n\n-- Define an ability (effect)\nability FileSystem where\n  readFile : FilePath ->{FileSystem} Text\n  writeFile : FilePath -> Text ->{FileSystem} ()\n\n-- Program uses ability (what)\nprocessFile : FilePath ->{FileSystem} ()\nprocessFile path =\n  let content = FileSystem.readFile path\n  let result = Text.toUppercase content\n  FileSystem.writeFile (path ++ \".out\") result\n\n-- Handler implements ability (how)\n-- Real implementation talks to OS\nhandleFS : Request FileSystem a ->{IO} a\nhandleFS = handle with\n  { FileSystem.readFile p -> k ->\n    let! content = IO.readFile p\n    k content\n  }\n  { FileSystem.writeFile p c -> k ->\n    let! _ = IO.writeFile p c\n    k ()\n  }",
          "explanation": "Unison's polyglot boundary is its ability system: abilities (algebraic effects) separate what a program needs (FileSystem, IO, Exception) from how it's implemented. Handlers bridge abilities to concrete runtimes (OS file system, HTTP, etc.). This makes Unison a universal effect bridge — programs declare what they need, and handlers provide the how. Content-addressed code storage means dependencies are identified by hash, not file paths, enabling strong caching for content-addressed code and distributed execution."
        }
      ],
      "libraries": [
        {
          "name": "Unison docs",
          "url": "https://www.unison-lang.org/learn/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Unison language",
          "url": "https://www.unison-lang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "-- Unison variables\n-- Unison uses structural types, no type declarations needed\nx = 42\nname = \"Unison\"\n\n-- Type annotations (optional)\ny : Int\ny = x + 1\n\n-- Immutable by default\n-- Unison has no mutable variables\n\n-- Ability-typed\nhello : IO ()\nhello =\n  printLine \"Hello, Unison!\"\n\n-- Let bindings\ngreet : Text ->{IO} ()\ngreet name =\n  let greeting = \"Hello, \" ++ name\n  printLine greeting",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "-- Unison conditionals\nclassify : Int -> Text\nclassify x =\n  if x > 100 then \"large\"\n  else if x > 0 then \"small\"\n  else \"non-positive\"\n\n-- Pattern matching\ndescribe : Nat -> Text\ndescribe n = match n with\n  0 => \"zero\"\n  1 => \"one\"\n  _ => \"many\"\n\n-- Optional values\ndefaultZero : Optional Int -> Int\ndefaultZero = cases\n  Some x => x\n  None => 0",
          "difficulty": "basic"
        },
        "loops": {
          "code": "-- Unison loops\n-- Unison uses recursion (no built-in loops)\n-- List.map for iteration\n\nsumList : [Int] -> Int\nsumList =\n  List.foldLeft (+) 0\n\n-- Recursive definition\nfactorial : Nat -> Nat\nfactorial n =\n  if n <= 1 then 1\n  else n * factorial (n - 1)\n\n-- List iteration\nforEachElement : [Int] ->{IO} ()\nforEachElement xs =\n  List.forEach xs (x -> printLine (Int.toText x))\n\n-- Range\noneToTen : [Nat]\noneToTen = List.range 0 10",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "-- Unison functions\n-- Named function\nadd : Int -> Int -> Int\nadd x y = x + y\n\n-- Curried by default\nincrement : Int -> Int\nincrement = add 1\n\n-- Lambda\ndouble : Int -> Int\ndouble = x -> x * 2\n\n-- Ability-typed function\nreadFile : FilePath ->{IO} Text\nreadFile path =\n  let content = read! path\n  content\n\n-- Multiple abilities\ndoBoth :{IO, Exception} ()\ndoBoth =\n  let! content = readFile \"data.txt\"\n  printLine content",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "-- Unison performance:\n-- 1. Compiles to native code via Unison Runtime\n-- 2. Content-addressed storage (no redundant computation)\n-- 3. Ability handlers can be optimized\n-- 4. Lazy evaluation where appropriate\n-- 5. No runtime type checking needed\n-- 6. Small but growing standard library\n-- 7. Not designed for raw performance\n-- 8. Good for distributed/async systems",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "-- Unison has abilities (NOT OOP classes).\n-- Abilities are Unison's effect system.\n\n-- Define an ability\nability Store where\n  get : Nat ->{Store} Int\n  put : Nat -> Int ->{Store} ()\n\n-- Handler (implementation)\nhandleStore : Request Store a -> a\nhandleStore =\n  handle with\n    { Store.get i -> k ->\n        handle k (i * 2)\n    }\n    { Store.put i v -> k ->\n        handle k ()\n    }\n\n-- Abilities are NOT OOP classes.\n-- They are algebraic effects,\n-- separating what from how.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "-- Unison strings\ngreeting : Text\ngreeting = \"Hello, Unison!\"\n\n-- String concatenation\nfull : Text -> Text -> Text\nfull first last = first ++ \" \" ++ last\n\n-- String interpolation (no template literals)\nmessage : Text\nmessage = \"Value: \" ++ Int.toText 42\n\n-- String functions\nlength : Text -> Nat\nlength t = Text.size t\n\nupper : Text -> Text\nupper t = Text.toUppercase t\n\n-- Pattern matching on characters\nfirstChar : Text -> Optional Char\nfirstChar t =\n  if Text.size t > 0 then Some (Text.uncons t |> Tuple.first)\n  else None",
          "difficulty": "basic"
        },
        "errors": {
          "code": "-- Unison error handling\n-- Optional type (no null)\nsafeDiv : Int -> Int -> Optional Int\nsafeDiv _ 0 = None\nsafeDiv x y = Some (x / y)\n\n-- Either type (error with info)\nparseNat : Text -> Either Text Nat\nparseNat s =\n  case Nat.fromText s of\n    Some n => Right n\n    None => Left (s ++ \" is not a natural number\")\n\n-- Exception ability (effect)\nexceptionHandler : Request Exception a -> a\nexceptionHandler =\n  handle with\n    { Exception.raise msg -> _ ->\n        -- handle the exception\n        bug msg\n    }\n\n-- Pattern matching covers all cases\nhead : [a] -> Optional a\nhead = cases\n  [x, ...] => Some x\n  [] => None",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "-- Unison imports (namespace-based)\n-- Unison uses content-addressed code, not file paths\n-- Use 'use' to bring names into scope\nuse IO\nuse List map filter forEach\nuse Int + - *\n\n-- Namespace declaration\nnamespace MyLib where\n  add : Int -> Int -> Int\n  add x y = x + y\n\n  double : Int -> Int\n  double = add 2\n\n-- Import from Unison Share (package registry)\n-- lib.base provides standard library\n-- No file paths — code is identified by hash\n\n-- Note: Unison uses content-addressed storage,\n-- not file-based imports.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "unison-tip-content-addressed",
          "title": "Code is content-addressed",
          "body": "Unison stores code by hash. Refactors are rename/propagate operations — not package-manager tips copied from npm.",
          "tag": "language",
          "status": "curated"
        }
      ],
      "categories": [
        "functional"
      ],
      "overview": "A content-addressed language — code is stored by hash, not by file, enabling frictionless refactoring. Change a function, and Unison figures out what else needs updating.",
      "learning_curve": "Steep — Unison's ability system (algebraic effects), content-addressed code, and structural typing require a paradigm shift from conventional languages. No files or directories — code lives in a codebase database. The Unison Share package registry is the import mechanism. Good documentation but small community.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Unison is a functional language with algebraic effects and content-addressed code storage. Created by Paul Chiusano (Scala co-creator). No files or directories — code is identified by hash. Unison Share is the package registry. Compile to native or JavaScript. Small but growing community. Unique approach to versioning (no breaking changes possible). Good for distributed systems.",
      "common_use_cases": [
        "Distributed systems",
        "Refactoring-friendly code",
        "Cloud functions"
      ],
      "docs_url": "https://www.unison-lang.org/docs/",
      "best_for": [
        "content-addressed functional programming",
        "fearless refactoring without merge conflicts",
        "distributed systems with strongly-typed effects",
        "Distributed Unison services with content-addressed immutable code storage"
      ],
      "weak_at": [
        "Relational CRUD monoliths without distributed runtime requirements",
        "Teams standardized on Kubernetes plus Go without Unison runtime ops",
        "Browser-only SPAs without Unison JavaScript compilation pipeline setup"
      ],
      "official_url": "https://www.unison-lang.org/",
      "paradigm": [
        "functional",
        "distributed",
        "content-addressed"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static (often with type inference)",
        "runtime": "Compiled to native code or bytecode; implementation and runtime vary by compiler",
        "memory": "Garbage-collected in most mainstream compilers"
      }
    },
    {
      "id": "roc",
      "name": "Roc",
      "color": "#7c38bc",
      "description": "A fast, friendly functional language — compiles to native or WASM with no runtime exceptions. Its platform concept separates application logic from I/O effects cleanly.",
      "whoItIsFor": "Developers who want Elm-like safety for CLI tools, servers, and scripts — fast compilation, no nulls, and principled error handling built in.",
      "commonUses": [
        "CLI tools",
        "Web backends",
        "Scripts"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "main =\n    Stdout.line \"Hello\"",
          "explanation": "Platform-based IO — Roc programs declare effects through platforms, keeping application logic pure."
        },
        {
          "title": "Function",
          "code": "double = \\n -> n * 2",
          "explanation": "Roc uses concise lambda syntax for pure functions."
        },
        {
          "title": "Record",
          "code": "user = { name: \"Ada\", score: 100 }",
          "explanation": "Records group named fields; types are often inferred."
        },
        {
          "title": "Platform boundary - Roc's polyglot bridge",
          "code": "# Roc's polyglot boundary is the platform:\n# platforms provide effect handlers,\n# Roc provides pure business logic.\n\n# Pure function (testable, no effects)\naddNumbers : List Int -> Int\naddNumbers = List.sum\n\n# Platform provides effects\napp \"main\" [platform] exposes [main]\n\nmain =\n    Stdout.line \"Hello from Roc!\"\n\n# Platform declaration (effects)\n# platform \"roc/basic\" provides:\n#   Stdout.line : Str -> Task void []\n#   Stdin.line : Task Str [StdinErr]\n\n# Custom platform (Zig)\n# app \"myapp\" [MyPlatform] exposes [main]\n# MyPlatform exposes [readFile, writeFile, httpGet]\n\n# Effects are handled by the platform,\n# not by the Roc application.",
          "explanation": "Roc's polyglot boundary is the platform system: Roc applications write pure business logic, and platforms (implemented in Zig, Rust, etc.) provide effect handlers (IO, HTTP, file system). This separation means the same Roc code can run on different platforms (CLI, web server, embedded). The platform boundary makes Roc a universal logic bridge — write business logic once, run it with any effect handler. This is fundamentally different from FFI; it's a capability-based effect system."
        }
      ],
      "libraries": [
        {
          "name": "Roc docs",
          "url": "https://www.roc-lang.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Roc language",
          "url": "https://www.roc-lang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# Roc variables\nx : Int\nx = 42\n\nname : Str\nname = \"Roc\"\n\n# Type inference\ny = x + 1  # inferred as Int\n\n# Tag union\nColor : [Red, Green, Blue]\ncolor : Color\ncolor = Red\n\n# Record\nperson : { name : Str, age : Int }\nperson = { name: \"Alice\", age: 30 }\n\n# Destructuring\n{ name } = person",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# Roc conditionals\nclassify : Int -> Str\nclassify x =\n    if x > 100 then \"large\"\n    else if x > 0 then \"small\"\n    else \"non-positive\"\n\n# Pattern matching on tags\ndescribe : Color -> Str\ndescribe color = when color is\n    Red => \"red\"\n    Green => \"green\"\n    Blue => \"blue\"\n\n# Pattern matching on structure\nhead : List a -> Result a [EmptyList]\nhead list = when list is\n    [] -> Err EmptyList\n    first :: _ -> Ok first",
          "difficulty": "basic"
        },
        "loops": {
          "code": "# Roc uses recursion instead of loops\n# No built-in for/while loops\n\n# List.map for iteration\nincrementAll : List Int -> List Int\nincrementAll = List.map (\\x -> x + 1)\n\n# Recursion\nsumList : List Int -> Int\nsumList list =\n    when list is\n        [] -> 0\n        first :: rest -> first + sumList rest\n\n# List functions (preferred over manual recursion)\nevens : List Int\nevens = List.range 0 10 |> List.filter (\\x -> x % 2 == 0)\n\n# Tail recursion (efficient)\nsumTR : List Int -> Int -> Int\nsumTR list acc =\n    when list is\n        [] -> acc\n        first :: rest -> sumTR rest (acc + first)",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "# Roc functions\nadd : Int, Int -> Int\nadd x y = x + y\n\n# Partial application uses closures, not automatic currying\ndouble : Int -> Int\ndouble n = add n n\n\n# Lambda\nincrementAll : List Int -> List Int\nincrementAll = List.map (|n| n + 1)\n\n# Platform effect\nmain =\n    Stdout.line \"Hello, Roc!\"",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "# Roc performance:\n# 1. Compiles via LLVM for native performance\n# 2. Deterministic memory management (no GC)\n# 3. In-place mutation where safe\n# 4. Efficient pattern matching\n# 5. Tail call optimization\n# 6. Monomorphization for specialization\n# 7. Early stage — performance improving rapidly\n# 8. Zig backend also available",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "# Roc has no class/OOP system.\n# Roc uses tags (sum types) and records.\n# Polymorphism comes from:\n# - Tags (algebraic data types)\n# - Records (structural typing)\n# - Abilities (typeclass-like interfaces)\n# These are NOT classes in the OOP sense.\n# Use tags and abilities for shared behavior.\n\n# Ability (like typeclass)\nability Hash a where\n    hash : a -> U64\n\n# Implement for a type\nHash Int where\n    hash = \\x -> Num.toU64 x\n\n# Record type\nPoint : { x : F64, y : F64 }",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# Roc strings\nname : Str\nname = \"Roc\"\n\ngreeting : Str\ngreeting = \"Hello, \" ++ name ++ \"!\"\n\n# String operations\nlen : Nat\nlen = Str.count grapheme name\n\nupper : Str\nupper = Str.toUppercase name\n\nlower : Str\nlower = Str.toLowercase name\n\n# String splitting\nwords : List Str\nwords = Str.split \"hello world\" \" \"\n\n# Contains\nhasHello : Bool\nhasHello = Str.contains greeting \"Hello\"",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# Roc error handling\n# Result type (no exceptions)\nsafeDiv : Int, Int -> Result Int [DivByZero]\nsafeDiv _ 0 = Err DivByZero\nsafeDiv x y = Ok (x / y)\n\n# Tag unions for rich errors\nparseAge : Str -> Result Int [InvalidNumber, NegativeAge]\nparseAge s =\n    when Str.toInt s is\n        Ok n -> if n < 0 then Err NegativeAge else Ok n\n        Err _ -> Err InvalidNumber\n\n# Crash for impossible cases\nhead : List a -> a\nhead list =\n    when list is\n        [] -> crash \"empty list has no head\"\n        first :: _ -> first\n\n# Pattern matching is exhaustive\nhandleResult : Result Int [DivByZero] -> Int\nhandleResult result = when result is\n    Ok n -> n\n    Err DivByZero -> 0",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "# Roc imports\n# Platform declaration (entry point)\napp \"hello\" [platform] exposes [main]\n\n# Import module\nimport Json.Encode\nimport Http\n\n# Platform provides effect handlers\n# Built-in platforms:\n# - platform \"roc/basic\"\n# - platform \"roc/cli\"\n# - platform \"roc/web-server\"\n\n# Package imports (from package registry)\n# packages:\n#   \"roc/json\" with [Json.Encode, Json.Decode]\n\n# Note: Roc uses platform-based architecture,\n# not ES-style file imports.\n# Packages are managed by the build system.",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "functional"
      ],
      "overview": "A fast, friendly functional language — compiles to native or WASM with no runtime exceptions. Its platform concept separates application logic from I/O effects cleanly. Developers who want Elm-like safety for CLI tools, servers, and scripts — fast compilation, no nulls, and principled error handling built in.\n\nTypical projects include CLI tools, Web backends, Scripts. Pre-1.0 with breaking changes still common.",
      "learning_curve": "Moderate to steep — Roc's syntax is clean but the platform/ability system requires understanding effect handlers. No built-in loops (recursion only) is a shift. Early stage language means breaking changes and limited documentation. The structural typing and tag unions are intuitive for ML programmers.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Roc is a functional language created by Richard Feldman (Elm co-creator). Compiles via LLVM for native performance. No garbage collector (deterministic memory management). Platform-based architecture separates pure logic from effects. Very early stage (pre-1.0). Small but enthusiastic community. Spiritual successor to Elm but targeting general-purpose programming.",
      "common_use_cases": [
        "CLI tools",
        "Web backends",
        "Scripts"
      ],
      "docs_url": "https://www.roc-lang.org/tutorial",
      "best_for": [
        "fast functional programming with easy syntax",
        "CLI tool and backend development",
        "compiled functional language for application development",
        "Fast-compiling functional applications with explicit effect tracking"
      ],
      "weak_at": [
        "Production systems requiring mature 1.0 package ecosystem stability today",
        "Large JVM or .NET enterprises without Roc runtime operational playbooks",
        "Mobile UI products outside Roc experimental platform targets"
      ],
      "official_url": "https://www.roc-lang.org/",
      "paradigm": [
        "functional",
        "systems",
        "fast-compile"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static (often with type inference)",
        "runtime": "Compiled to native code or bytecode; implementation and runtime vary by compiler",
        "memory": "Garbage-collected in most mainstream compilers"
      }
    },
    {
      "id": "haxe",
      "name": "Haxe",
      "color": "#ea8220",
      "description": "A cross-platform toolkit that compiles to JS, C++, C#, Java, Python, Lua, and more. Write once, target many; its macro system and type inference keep code DRY.",
      "whoItIsFor": "Game developers and teams targeting many platforms from one codebase — compiles to JS, C++, Java, Flash, and more from a single typed language.",
      "commonUses": [
        "Cross-platform games",
        "Web",
        "Mobile",
        "Server"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "class Main {\n  static function main() {\n    trace(\"Hello\");\n  }\n}",
          "explanation": "trace() is the universal print — works on every Haxe target without conditional compilation."
        },
        {
          "title": "Class",
          "code": "class Greeter {\n  public function new() {}\n  public function hi(): String return \"Hello\";\n}",
          "explanation": "Haxe targets many platforms; classes compile to JS, C++, HashLink, etc."
        },
        {
          "title": "Enum",
          "code": "enum Color { Red; Green; Blue; }",
          "explanation": "Algebraic enums with optional payloads compile efficiently per target."
        },
        {
          "title": "Target boundary - Haxe's polyglot bridge",
          "code": "// Haxe's polyglot boundary is the target system:\n// one codebase compiles to JS, C++, Neko, HashLink,\n// PHP, Python, Lua, JVM, and more.\n\n// Cross-platform code\nclass Main {\n  static function main() {\n    #if js\n      js.Browser.document.getElementById(\"app\");\n    #elseif cpp\n      cpp.Sys.println(\"Running as native C++\");\n    #elseif sys\n      Sys.println(\"Running on sys target\");\n    #end\n  }\n}\n\n// Externs define the target boundary\n@:native(\"HTMLElement\")\nextern class HTMLElement {\n  var innerHTML:String;\n  function appendChild(child:HTMLElement):HTMLElement;\n}\n\n// @:gen bridges to C++\n@:cppFileCode(\"#include <stdio.h>\")\nclass NativeBridge {\n  @:native(\"printf\")\n  extern static function printf(fmt:cpp.ConstCharStar, val:Int):Void;\n}",
          "explanation": "Haxe's polyglot boundary is the target system: one Haxe codebase compiles to JavaScript, C++, Neko, HashLink, PHP, Python, Lua, JVM, and more. The `#if` conditional compilation flags bridge platform-specific code, while externs define the interface to target-specific APIs. This makes Haxe a universal compile target bridge — write once, compile anywhere, with type safety preserved across all targets."
        }
      ],
      "libraries": [
        {
          "name": "Haxe docs",
          "url": "https://haxe.org/documentation/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Haxe manual",
          "url": "https://haxe.org/manual/introduction.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// Haxe variables\nvar count = 0;                    // inferred Int\nvar name:String = \"Haxe\";       // explicit type\nfinal pi = 3.14159;             // runtime constant\n\n// Nullable\nvar nickname:Null<String> = null;\n\n// Collections\nvar items:Array<String> = [\"a\", \"b\", \"c\"];\nvar scores:Map<String, Int> = [\"Alice\" => 100];\n\n// Enums (algebraic)\nenum Color {\n  Red;\n  Green;\n  Blue(r:Int, g:Int, b:Int);\n}\nvar c = Color.Blue(0, 0, 255);",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// Haxe conditionals\nif (score > 100) {\n  trace(\"High score!\");\n} else if (score > 0) {\n  trace(\"Normal\");\n} else {\n  trace(\"Invalid\");\n}\n\n// Ternary\nvar label = active ? \"on\" : \"off\";\n\n// Switch (exhaustive on enums)\nswitch (color) {\n  case Red: trace(\"red\");\n  case Green: trace(\"green\");\n  case Blue(r, g, b): trace('blue: $r,$g,$b');\n}\n\n// Pattern matching\nswitch (value) {\n  case 0: trace(\"zero\");\n  case _: trace(\"other\");\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Haxe loops\nfor (i in 0...10) {\n  trace(i);\n}\n\nfor (item in items) {\n  trace(item);\n}\n\nvar i = 0;\nwhile (i < 10) {\n  i++;\n}\n\n// Lambda iteration\nLambda.iter(items, function(item) {\n  trace(item);\n});\n\n// Comprehension\nvar doubled = [for (x in 0...10) x * 2];",
          "difficulty": "basic"
        },
        "functions": {
          "code": "// Haxe functions\nfunction greet(name:String):String {\n  return 'Hello, $name!';\n}\n\n// Arrow function\nvar double = (x:Int) -> x * 2;\n\n// Default arguments\nfunction configure(title:String, timeout:Int = 30):Void {\n  trace('Config: $title, timeout: $timeout');\n}\n\n// Generic function\nfunction first<T>(arr:Array<T>):Null<T> {\n  return arr.length > 0 ? arr[0] : null;\n}\n\n// Inline (performance)\ninline function square(x:Int):Int {\n  return x * x;\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "// Haxe performance:\n// 1. Static typing catches errors at compile time\n// 2. Compiles to optimized native code (C++, HashLink)\n// 3. Dead code elimination removes unused code\n// 4. Inline functions for hot paths\n// 5. @:generic for monomorphization\n// 6. Allocators selectable per target\n// 7. HashLink/C is the fastest interpreter target\n// 8. Avoid reflection (@:noCompletion) in hot loops",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "// Haxe classes (real OOP)\nclass User {\n  public var name:String;\n  public var age:Int;\n  \n  public function new(name:String, age:Int) {\n    this.name = name;\n    this.age = age;\n  }\n  \n  public function greet():String {\n    return 'Hello, I am $name';\n  }\n}\n\n// Inheritance\nclass AdminUser extends User {\n  public var role:String;\n  \n  public function new(name:String, age:Int, role:String) {\n    super(name, age);\n    this.role = role;\n  }\n}\n\n// Interface\ninterface Greetable {\n  function greet():String;\n}\n\n// Abstract (compile-time wrapper)\nabstract Kilometers(Float) from Float to Float {\n  @:from static inline function fromMeters(m:Float):Kilometers\n    return new Kilometers(m / 1000);\n}",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "// Haxe strings\nvar name:String = \"Haxe\";\nvar greeting:String = 'Hello, $name!';     // interpolation\nvar raw:String = 'Value: ${1 + 2}';       // expression\n\n// String methods\nname.length;                    // 4\nname.toUpperCase();             // \"HAXE\"\nname.toLowerCase();             // \"haxe\"\nname.substring(0, 2);          // \"Ha\"\nname.indexOf(\"ax\");            // 1\nname.split(\"\");                // [\"H\",\"a\",\"x\",\"e\"]\n\n// StringBuf for concatenation\nvar buf = new StringBuf();\nbuf.add(\"Hello\");\nbuf.add(\" World\");\nvar result = buf.toString();",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Haxe error handling\n// Null safety (optional)\nvar result:Null<String> = riskyOperation();\nswitch (result) {\n  case null: trace(\"Operation failed\");\n  case v: trace('Got: $v');\n}\n\n// haxe.Exception (Haxe 4+)\ntry {\n  var data = readFile(\"config.txt\");\n} catch (e:haxe.io.Error) {\n  trace('IO error: $e');\n} catch (e:Dynamic) {\n  trace('Unknown error: $e');\n}\n\n// Custom exception\nclass AppException extends haxe.Exception {\n  public var code:Int;\n  public function new(message:String, code:Int) {\n    super(message);\n    this.code = code;\n  }\n}\n\n// Outcome type (functional error handling)\ntypedef Result<T> = haxe.ds.Either<String, T>;",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// Haxe imports\nimport haxe.ds.Map;\nimport haxe.Json;\nimport Lambda;\n\n// Import with alias\nimport haxe.ds.StringMap as SMap;\n\n// Import static members\nimport Math.*;\n\n// Import specific\nimport haxe.io.Path in P;\n\n// Package declaration\npackage com.example.app;\n\n// Conditional compilation\n#if js\nimport js.Browser;\n#elseif cpp\nimport cpp.Sys;\n#end\n\n// Type resolution\nusing StringTools;  // adds methods to String\nusing Lambda;      // adds methods to Iterable",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "haxe-tip-format-pass11",
          "title": "Target backend differences",
          "body": "Haxe compiles to many backends; JS vs C++ vs HashLink disagree on numbers and APIs. Test on the shipping target.",
          "tag": "portability",
          "status": "curated"
        }
      ],
      "categories": [
        "web",
        "games"
      ],
      "overview": "A cross-platform toolkit that compiles to JS, C++, C#, Java, Python, Lua, and more. Write once, target many; its macro system and type inference keep code DRY. Game developers and teams targeting many platforms from one codebase — compiles to JS, C++, Java, Flash, and more from a single typed language.\n\nTypical projects include Cross-platform games, Web, Mobile. Haxelib and cross-target compilation reach JS, C++, and more from one typed codebase, though the community is small but dedicated.",
      "learning_curve": "Moderate — Haxe syntax is familiar to Java/TypeScript developers. The type system (generics, abstracts, enums with parameters) adds moderate depth. Cross-target compilation and conditional compilation (#if) require understanding of target differences. The macro system is very powerful but adds significant complexity.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Haxe is a cross-platform toolkit that compiles to 10+ targets. Used for game development (Heaps, Ceramic, Armory3D), web apps, and tools. Strong type system with inference. Haxelib package manager. Community is small but dedicated. Heaps is the primary game engine (Shiro Games). Competing with TypeScript (web), Unity (games), and Kotlin Multiplatform (cross-platform).",
      "common_use_cases": [
        "Cross-platform games",
        "Web",
        "Mobile",
        "Server"
      ],
      "docs_url": "https://haxe.org/documentation/",
      "best_for": [
        "cross-platform game development",
        "compile-to-multiple-targets workflow",
        "framework-agnostic multi-platform libraries",
        "Cross-compiling game logic to JavaScript, C++, and HashLink targets"
      ],
      "weak_at": [
        "Teams standardized on TypeScript monorepos without Haxe toolchain appetite",
        "Native iOS SwiftUI apps without Haxe cross-compilation maturity",
        "Data science notebooks expecting Python ecosystem interop natively"
      ],
      "official_url": "https://haxe.org/",
      "paradigm": [
        "object-oriented",
        "cross-target",
        "static"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static",
        "runtime": "Compiles to JavaScript, C++, HashLink, Neko, PHP, Python, Lua, Java, and other targets",
        "memory": "Depends on the chosen compilation target"
      }
    },
    {
      "id": "gdscript",
      "name": "GDScript",
      "color": "#478cbf",
      "description": "Godot Engine's Python-like scripting language — tightly integrated with the game editor. Signals, nodes, and exports map directly to the editor's property panel and scene tree.",
      "whoItIsFor": "Indie game developers using the Godot engine — Python-like syntax, built-in editor integration, and first-class support for 2D and 3D game logic.",
      "commonUses": [
        "Godot games",
        "Game prototyping",
        "2D/3D games"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "func _ready():\n    print(\"Hello\")",
          "explanation": "Called when node enters the scene tree."
        },
        {
          "title": "Node script",
          "code": "extends Node\n\nfunc _ready() -> void:\n    print(\"Ready\")\n",
          "explanation": "Godot calls `_ready` when the node enters the scene tree."
        },
        {
          "title": "Signal",
          "code": "signal health_changed(new_value: int)\n\nfunc take_damage(amount: int) -> void:\n    hp -= amount\n    health_changed.emit(hp)",
          "explanation": "Signals decouple nodes; other scripts connect with `connect`."
        },
        {
          "title": "GDExtension boundary - GDScript's polyglot bridge",
          "code": "# GDScript's polyglot boundary is GDExtension:\n# GDScript bridges to C/C++/Rust for performance-critical code.\n\n# GDScript side (game logic)\nextends Node2D\n\nfunc _ready():\n\tvar result = NativeMath.compute_fast(100)\n\tprint(\"Result: \", result)\n\n# GDExtension C++ side\n# class NativeMath : public GDExtensionClass {\n#   double compute_fast(int value) {\n#     return value * 3.14159;\n#   }\n# };\n\n# C# integration (GodotSharp)\n# using Godot;\n# public partial class NativeMath : Node {\n#   [Export]\n#   public double ComputeFast(int value) {\n#     return value * Math.PI;\n#   }\n# }\n\n# The boundary bridges:\n# GDScript (game logic) <-> C++ (performance)\n# GDScript (game logic) <-> C# (ecosystem)",
          "explanation": "GDScript's polyglot boundary is GDExtension: GDScript handles game logic and scene orchestration, while GDExtension (C/C++/Rust) handles performance-critical code (pathfinding, physics, procedural generation). C# integration (GodotSharp) bridges to the .NET ecosystem. This makes GDScript a game-engine bridge that connects rapid iteration (hot reload, scene editor) to native performance when needed."
        }
      ],
      "libraries": [
        {
          "name": "GDScript docs",
          "url": "https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "GDScript reference",
          "url": "https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_basics.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# GDScript variables\nvar count = 0                    # inferred int\nvar name: String = \"GDScript\"   # explicit type\nconst PI = 3.14159              # constant\n\n@export var speed: float = 200.0  # exposed to editor\n@onready var sprite = $Sprite2D   # resolved when node ready\n\n# Nullable\nvar nickname: String = \"\"\n\n# Collections\nvar items: Array[String] = [\"a\", \"b\", \"c\"]\nvar scores: Dictionary = {\"Alice\": 100}\n\n# Enum\nenum Direction {UP, DOWN, LEFT, RIGHT}",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# GDScript conditionals\nif score > 100:\n\tprint(\"High score!\")\nelif score > 0:\n\tprint(\"Normal\")\nelse:\n\tprint(\"Invalid\")\n\n# Ternary (ternary-if)\nvar label = \"on\" if active else \"off\"\n\n# Match (pattern matching)\nmatch direction:\n\tDirection.UP:\n\t\tprint(\"Going up\")\n\tDirection.DOWN:\n\t\tprint(\"Going down\")\n\t_:\n\t\tprint(\"Sideways\")\n\n# Type checking\nif sprite is Sprite2D:\n\tsprite.play(\"default\")",
          "difficulty": "basic"
        },
        "loops": {
          "code": "# GDScript loops\nfor i in range(10):\n\tprint(i)\n\nfor item in items:\n\tprint(item)\n\nvar i = 0\nwhile i < 10:\n\ti += 1\n\n# Iterate dictionary\nfor key in scores:\n\tprint(key, scores[key])\n\n# Iterate with index\nfor i in len(items):\n\tprint(i, items[i])\n\n# Break/continue\nfor item in items:\n\tif item == \"skip\":\n\t\tcontinue\n\tprint(item)",
          "difficulty": "basic"
        },
        "functions": {
          "code": "# GDScript functions\nfunc greet(name: String) -> String:\n\treturn \"Hello, \" + name + \"!\"\n\n# Default arguments\nfunc configure(title: String, timeout: int = 30) -> void:\n\tprint(\"Config: \", title, \" timeout: \", timeout)\n\n# Static function\nstatic func create() -> MyClass:\n\treturn MyClass.new()\n\n# Lambda (callable)\nvar double = func(x): return x * 2\nprint(double.call(5))  # 10\n\n# Signal callback\nfunc _on_button_pressed():\n\tprint(\"Button pressed!\")\n\n# Setter/getter\nvar health: int = 100:\n\tset(v):\n\t\thealth = clampi(v, 0, 100)\n\tget:\n\t\treturn health",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "# GDScript performance:\n# 1. Interpreted (GDScript 2.0 uses bytecode VM)\n# 2. Use @export sparingly (editor overhead)\n# 3. Object pooling for frequently created nodes\n# 4. Avoid _process() for non-essential logic\n# 5. Use physics_process() for physics\n# 6. Profile with Godot Profiler\n# 7. GDExtension (C/C++) for hot paths\n# 8. C# integration for CPU-intensive logic\n# 9. Use typed arrays (Array[T]) for performance",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "# GDScript classes (real OOP)\nclass_name Player\nextends CharacterBody2D\n\nvar health: int = 100\nvar speed: float = 200.0\n\nfunc _ready():\n\tprint(\"Player ready!\")\n\nfunc take_damage(amount: int) -> void:\n\thealth -= amount\n\tif health <= 0:\n\t\tdie()\n\nfunc die() -> void:\n\tqueue_free()\n\n# Inner class\nclass Inventory:\n\tvar items: Array[String] = []\n\t\n\tfunc add(item: String) -> void:\n\t\titems.append(item)\n\t\n\tfunc has(item: String) -> bool:\n\t\treturn item in items\n\n# Inheritance\nclass Enemy extends CharacterBody2D:\n\tvar damage: int = 10",
          "difficulty": "basic"
        },
        "strings": {
          "code": "# GDScript strings\nvar name: String = \"GDScript\"\nvar greeting: String = \"Hello, %s!\" % name   # format\nvar multi: String = \"\"\"Multiple\nlines\"\"\"\n\n# String methods\nname.length()            # 8\nname.to_upper()          # \"GDSCRIPT\"\nname.to_lower()          # \"gdscript\"\nname.substr(0, 2)        # \"GD\"\nname.find(\"Script\")       # 2\nname.replace(\"GD\", \"Godot\")\n\n# String formatting\nvar msg = \"Score: %d, Name: %s\" % [100, \"Alice\"]\n\n# String interpolation (GDScript 2.0+)\nvar score = 100\nprint(\"Score is {score}\".format({\"score\": score}))",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# GDScript error handling\n# No try/catch — use null checks and return values\n\n# Safe null check\nvar node = get_node_or_null(\"Missing\")\nif node == null:\n\tprinterr(\"Node not found\")\n\treturn\n\n# push_error/push_warning\npush_error(\"Invalid configuration\")\npush_warning(\"Deprecated API\")\n\n# assert (debug only)\nassert(health > 0, \"Health must be positive\")\n\n# Return error value\nfunc divide(a: float, b: float) -> Dictionary:\n\tif b == 0.0:\n\t\treturn {\"error\": \"Division by zero\"}\n\treturn {\"result\": a / b}\n\n# Custom error reporting\nclass AppError:\n\tvar message: String\n\tvar code: int\n\tfunc _init(msg: String, c: int = -1):\n\t\tmessage = msg\n\t\tcode = c",
          "difficulty": "N/A"
        },
        "imports": {
          "code": "# GDScript imports\n# class_name makes a class globally available\n# extends for inheritance\nextends Node2D\n\n# Preload resources\nconst PlayerScene = preload(\"res://scenes/player.tscn\")\nvar player = PlayerScene.instantiate()\n\n# Load at runtime\nvar level = load(\"res://scenes/level.tscn\")\n\n# Access autoloads (singleton)\n# GameManager is registered as autoload\nGameManager.reset_score()\n\n# Inner class usage\nvar inv = Player.Inventory.new()\n\n# Note: GDScript uses class_name + preload/load\n# rather than ES-style file imports.",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "games"
      ],
      "overview": "Godot Engine's Python-like scripting language — tightly integrated with the game editor. Signals, nodes, and exports map directly to the editor's property panel and scene tree. Indie game developers using the Godot engine — Python-like syntax, built-in editor integration, and first-class support for 2D and 3D game logic.\n\nTypical projects include Godot games, Game prototyping, 2D/3D games.",
      "learning_curve": "Gentle — GDScript syntax is Python-like with indentation and keywords. The learning curve is in understanding Godot's node system, signals, and the scene tree. GDScript 2.0 added optional static typing. The editor integration (autocomplete, docs) lowers the barrier significantly. Game development concepts (physics, rendering) are the real challenge, not the language.",
      "good_for_teaching": "good",
      "ecosystem_notes": "GDScript is Godot Engine's primary scripting language. Python-like syntax with optional typing. Godot 4.x uses GDScript 2.0 (bytecode VM). Tight editor integration (autocomplete, docs). GDExtension for C/C++/Rust. C# support via GodotSharp. Growing community. Competing with Unity/C# and Unreal/Blueprints for indie game development.",
      "common_use_cases": [
        "Godot games",
        "Game prototyping",
        "2D/3D games"
      ],
      "docs_url": "https://docs.godotengine.org/",
      "best_for": [
        "Godot Engine game development",
        "2D and 3D game prototyping",
        "Godot gameplay logic and scene scripting",
        "Godot Engine game development with scene tree and signal idioms"
      ],
      "weak_at": [
        "Enterprise ERP backends without game engine runtime dependencies",
        "High-frequency trading systems outside Godot VM performance envelope",
        "Teams requiring statically typed large-scale module boundaries exclusively"
      ],
      "official_url": "https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/",
      "paradigm": [
        "object-oriented",
        "game-scripting",
        "dynamically-typed"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Interpreted or bytecode-based in common implementations (engines vary)",
        "memory": "Garbage-collected in mainstream implementations",
        "abstraction": "High-level for typical scripting and application use"
      }
    },
    {
      "id": "fennel",
      "name": "Fennel",
      "color": "#fff3d7",
      "description": "A Lisp that compiles to Lua — bring s-expressions and macros to the Lua ecosystem. Zero overhead at runtime; every Fennel construct maps to idiomatic Lua code.",
      "whoItIsFor": "Lua users wanting Lisp ergonomics in Neovim, games, or embedded scripting — compiles to clean Lua with macros, pattern matching, and no runtime.",
      "commonUses": [
        "Neovim config",
        "Love2D games",
        "Embedded scripting"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "(print \"Hello\")",
          "explanation": "Compiles to Lua's print — Fennel's (print ...) becomes a plain Lua print call."
        },
        {
          "title": "Define function",
          "code": "(fn greet [name]\n  (print (.. \"Hello, \" name)))",
          "explanation": "Fennel is a Lisp that compiles to Lua; `..` concatenates strings."
        },
        {
          "title": "Local binding",
          "code": "(let [x 10\n      y 20]\n  (+ x y))",
          "explanation": "`let` binds locals for a body — similar to Lua’s local scoping."
        },
        {
          "title": "Lua interop boundary - Fennel's polyglot bridge",
          "code": "; Fennel's polyglot boundary is the Lua interop:\n; Fennel compiles 1:1 to Lua, sharing the same VM.\n\n; Call any Lua function directly\n(local json (require :dkjson))\n(print (json.encode {:a 1 :b 2}))\n\n; Access Lua globals\n(print _VERSION)   ; Lua 5.x\n(print (tostring 42))\n\n; Use Lua tables natively\n(local t {:a 1 :b 2})\n(print t.a)   ; 1\n\n; Lua FFI (via LuaJIT)\n(when jit\n  (local ffi (require :ffi))\n  (ffi.cdef \"int printf(const char *fmt, ...);\")\n  (ffi.C.printf \"Hello from C! %d\\n\" 42))\n\n; Fennel is a Lisp that compiles to Lua.\n; Every Fennel expression maps to a Lua expression.",
          "explanation": "Fennel's polyglot boundary is its 1:1 Lua compilation: every Fennel expression compiles to equivalent Lua code, sharing the same VM, standard library, and ecosystem. LuaJIT FFI extends the boundary further to C. This makes Fennel a Lisp-to-Lua bridge — Lisp syntax and macros on top of Lua's runtime. No FFI layer needed for Lua interop; it's the same language at the bytecode level."
        }
      ],
      "libraries": [
        {
          "name": "Fennel docs",
          "url": "https://fennel-lang.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Fennel language",
          "url": "https://fennel-lang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "; Fennel variables\n(local count 0)           ; local (immutable by default)\n(var name \"Fennel\")       ; var (mutable)\n(local pi 3.14159)        ; constant\n\n; Destructuring\n(local [a b c] [1 2 3])\n(local {: name : age} person)\n\n; Collection\n(local items [\"a\" \"b\" \"c\"])\n(local scores {:Alice 100 :Bob 90})\n\n; Reassignment (var only)\n(set count (+ count 1))",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "; Fennel conditionals\n(if (> score 100)\n    (print \"High score!\")\n    (> score 0)\n    (print \"Normal\")\n    (print \"Invalid\"))\n\n; when (implicit do, no else)\n(when (> health 0)\n  (print \"Alive\")\n  (print \"Keep going\"))\n\n; match (pattern matching)\n(match value\n  0 (print \"zero\")\n  1 (print \"one\")\n  _ (print \"other\"))\n\n; Boolean\n(and (> x 0) (< x 100))\n(or (= status \"active\") (> score 50))",
          "difficulty": "basic"
        },
        "loops": {
          "code": "; Fennel loops\n; each (iterate over table/sequence)\n(each [_ item (ipairs items)]\n  (print item))\n\n; for (numeric)\n(for [i 1 10]\n  (print i))\n\n; while\n(var x 0)\n(while (< x 10)\n  (set x (+ x 1)))\n\n; collect (list comprehension)\n(local evens (collect [_ i (range 10)]\n  (when (= (% i 2) 0) (values i (* i 2)))))\n\n; icollect (indexed list comprehension)\n(local doubled (icollect [_ i (range 5)]\n  (* i 2)))",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "; Fennel functions\n(fn greet [name]\n  (.. \"Hello, \" name \"!\"))\n\n; Lambda\n(local double (fn [x] (* x 2)))\n\n; Multiple return values\n(fn divide [a b]\n  (values (/ a b) nil))\n\n; Variadic\n(fn sum [...]\n  (var total 0)\n  (each [_ v (pairs [...])]\n    (set total (+ total v)))\n  total)\n\n; Local function shorthand\n(local add (fn [a b] (+ a b)))\n\n; Method call (Lua colon syntax)\n(obj:method args)",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "; Fennel performance:\n; 1. Compiles to Lua (same runtime performance)\n; 2. Zero overhead — compiles 1:1 to Lua\n; 3. No runtime type checking\n; 4. Use LuaJIT for maximum speed\n; 5. Pattern matching compiles to if/elseif\n; 6. No boxed types or wrappers\n; 7. Table operations are O(1) for hash\n; 8. String interning in Lua VM",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "; Fennel has no class/OOP keyword.\n; Lua tables + metatables provide OOP-like behavior.\n; Fennel offers macros and let-over-lambda.\n\n; Object via metatable\n(local Animal)\n(fn Animal.new [name sound]\n  (set Animal (or Animal {}))\n  (local self {:name name :sound sound})\n  (set self.speak (fn [_] (print sound)))\n  self)\n\n(local cat (Animal.new \"Cat\" \"Meow\"))\n(cat:speak)  ; Meow\n\n; These are NOT classes in the OOP sense.\n; They are tables with functions.\n; Use macros for shared behavior.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "; Fennel strings\n(local name \"Fennel\")\n(local greeting (.. \"Hello, \" name \"!\"))  ; concatenation\n\n; String functions (Lua stdlib)\n(length name)              ; 6\n(string.upper name)       ; \"FENNEL\"\n(string.lower name)       ; \"fennel\"\n(string.sub name 1 3)     ; \"Fen\"\n(string.find name \"nn\")   ; 3 4\n(string.format \"Hi %s!\" name)  ; \"Hi Fennel!\"\n\n; Multi-line\n(local multi \"Multiple\\\nlines\")\n\n; Pattern matching (Lua patterns)\n(string.match name \"F.n+\")  ; \"Fenn\"",
          "difficulty": "basic"
        },
        "errors": {
          "code": "; Fennel error handling\n; Uses Lua's pcall/xpcall\n(local (ok? result) (pcall risky-fn))\n(if ok?\n    (print \"Success:\" result)\n    (print \"Error:\" result))\n\n; xpcall with custom handler\n(local (ok? val) (xpcall load-data\n  (fn [err]\n    (print \"Handler caught:\" err)\n    nil)))\n\n; assert (throws on nil/false)\n(local data (assert (load-data)))\n\n; error (throw)\n(when (< health 0)\n  (error \"Health cannot be negative\"))\n\n; nil check\n(when (= result nil)\n  (print \"No result\"))",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "; Fennel imports (Lua require)\n(local json (require :dkjson))\n(local http (require :socket.http))\n\n; Fennel's own require\n(local utils (require :utils))\n\n; Destructuring import\n(local {: encode : decode} (require :dkjson))\n\n; Multiple values\n(local (a b) (values 1 2))\n\n; Relative require\n(local config (require :..config))\n\n; Note: Fennel uses Lua's require(),\n; not ES-style imports.\n; Luarocks is the package manager.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "fennel-tip-format-pass11",
          "title": "Lua host version",
          "body": "Fennel inherits the host Lua/LuaJIT version and module path. Pin both Fennel and the Lua runtime.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "categories": [
        "functional"
      ],
      "overview": "A Lisp that compiles to Lua — bring s-expressions and macros to the Lua ecosystem. Zero overhead at runtime; every Fennel construct maps to idiomatic Lua code. Lua users wanting Lisp ergonomics in Neovim, games, or embedded scripting — compiles to clean Lua with macros, pattern matching, and no runtime.\n\nTypical projects include Neovim config, Love2D games, Embedded scripting.",
      "learning_curve": "Gentle for Lisp users, moderate for others — Fennel's syntax is minimal and consistent (like Clojure). The learning curve is understanding Lua semantics (tables, metatables, 1-based indexing). Macro system adds power but also complexity. Best for developers who want Lisp expressiveness with Lua's lightweight runtime.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Fennel is a Lisp that compiles to Lua. Used for Neovim configuration, LÖVE game development, and general Lua scripting. Minimal syntax. Macro system. Zero overhead (1:1 Lua compilation). Luarocks package manager. Small but growing community. Tight Neovim integration. Competing with Lua itself and Teal (typed Lua).",
      "common_use_cases": [
        "Neovim config",
        "Love2D games",
        "Embedded scripting"
      ],
      "docs_url": "https://fennel-lang.org/reference",
      "best_for": [
        "embeddable Lisp that compiles to Lua",
        "Lua ecosystem metaprogramming",
        "functional scripting for Lua environments",
        "Lua ecosystem metaprogramming with s-expression syntax and macro hygiene"
      ],
      "weak_at": [
        "Large Java or C# teams without Lisp syntax onboarding bandwidth",
        "Browser SPAs without Lua or Fennel-to-JavaScript compilation pipelines",
        "Regulated codebases mandating mainstream language static analysis tooling"
      ],
      "official_url": "https://fennel-lang.org/",
      "paradigm": [
        "functional",
        "lisp",
        "Lua-embedded"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic (optional static checks in some dialects and tooling)",
        "runtime": "Interpreted or compiled to bytecode/native depending on implementation",
        "memory": "Garbage-collected in mainstream implementations"
      }
    },
    {
      "id": "janet",
      "name": "Janet",
      "color": "#aa88ff",
      "description": "A lightweight, embeddable Lisp with PEG parsing, fibers, and a C API — aimed at scripting and embedding in native apps.",
      "whoItIsFor": "Developers wanting a tiny, batteries-included scripting language — Lisp syntax, immutable data structures, and a small C core for embedding.",
      "commonUses": [
        "Embedded scripting",
        "CLI tools",
        "Prototyping"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "(print \"Hello\")",
          "explanation": "print writes the greeting to standard output from a Janet script’s entry point."
        },
        {
          "title": "Def and loop",
          "code": "(def x 10)\n(loop [i :range [0 3]]\n  (print i))",
          "explanation": "Janet is a Lisp-like embeddable language; `loop` macros simplify iteration."
        },
        {
          "title": "Struct",
          "code": "(def p {:name \"Ada\" :score 100})\n(:name p)",
          "explanation": "Tables double as structs; keywords access fields."
        },
        {
          "title": "C FFI boundary - Janet's polyglot bridge",
          "code": "# Janet's polyglot boundary is its C FFI:\n# Janet can call C functions directly via ffi.\n\n# Define a C function binding\n(def- c-malloc (ffi/bind\n  :malloc\n  :pointer\n  [:size]))\n\n# Or use the simpler approach\n(ffi/defbind malloc :pointer [:size size])\n\n# Call native code\n(def ptr (malloc 1024))\n(ffi/free ptr)\n\n# Embed Janet in C\n# int main() {\n#   janet_init();\n#   JanetTable *env = janet_core_env(NULL);\n#   janet_dostring(env, \"(+ 1 2)\", \"main\", NULL);\n#   janet_deinit();\n# }\n\n# Janet's C API makes it easy to embed\n# or extend with native code.",
          "explanation": "Janet's polyglot boundary is its C FFI system: Janet can call C functions directly via ffi/bind and ffi/defbind, and C code can embed the Janet VM with a simple API. Fibers provide lightweight concurrency and error handling at the boundary. This makes Janet a scripting bridge — embed it in C applications for configuration and extension, or call C libraries from Janet scripts."
        }
      ],
      "libraries": [
        {
          "name": "Janet docs",
          "url": "https://janet-lang.org/docs/index.html",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Janet language",
          "url": "https://janet-lang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# Janet variables\n(def count 0)              # immutable\n(var name \"Janet\")        # mutable\n(def pi 3.14159)          # constant\n\n# Destructuring\n(def [a b c] [1 2 3])\n(def {:name n :age a} person)\n\n# Collections\n(def items @[\"a\" \"b\"])     # array\n(def scores @{:Alice 100}) # table\n\n# Namespace\n(def- private 42)  # private def",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# Janet conditionals\n(if (> score 100)\n  (print \"High score!\")\n  (print \"Normal\"))\n\n# Cond\n(cond\n  (> score 100) \"High\"\n  (> score 0) \"Normal\"\n  true \"Invalid\")\n\n# Switch/case\n(case direction\n  :up (print \"Going up\")\n  :down (print \"Going down\")\n  (print \"Unknown\"))\n\n# when\n(when (> health 0)\n  (print \"Alive\")\n  (print \"Keep going\"))",
          "difficulty": "basic"
        },
        "loops": {
          "code": "# Janet loops\n# for (numeric)\n(for i 0 10\n  (print i))\n\n# each (iterate)\n(each item items\n  (print item))\n\n# while\n(var x 0)\n(while (< x 10)\n  (set x (+ x 1)))\n\n# loop macro (powerful)\n(loop [i :range [0 10]]\n  (print i))\n\n# Comprehension\n(def evens (loop [i :range [0 10]\n                  :when (= (% i 2) 0)]\n            i))",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "# Janet functions\n(defn greet [name]\n  (string \"Hello, \" name \"!\"))\n\n# Anonymous\n(def double (fn [x] (* x 2)))\n\n# Multiple return values\n(defn divide [a b]\n  (tuple (/ a b) nil))\n\n# Variadic\n(defn sum [& args]\n  (reduce + 0 args))\n\n# Keyword arguments\n(defn configure [&keys {:title title :timeout timeout}]\n  (printf \"Config: %s timeout: %d\" title timeout))\n\n# Defn with docstring\n(defn add\n  \"Add two numbers together.\"\n  [a b]\n  (+ a b))",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "# Janet performance:\n# 1. Bytecode interpreter (efficient)\n# 2. Persistent data structures (array/tuple)\n# 3. JIT compilation possible (not default)\n# 4. Fibers for lightweight concurrency\n# 5. C FFI with no overhead\n# 6. PEG (Parsing Expression Grammars) built-in\n# 7. Async I/O via ev module\n# 8. Good for scripting, not compute-heavy work",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "# Janet has no class/OOP keyword.\n# Tables + prototypes provide OOP-like behavior.\n\n# Object via table\n(def Animal\n  {:speak (fn [self]\n    (print (string self.sound \"!\")))})\n\n(def cat\n  (table/setproto {:name \"Cat\" :sound \"Meow\"} Animal))\n\n(:speak cat)  ; Meow!\n\n# These are NOT classes in the OOP sense.\n# They are tables with prototype chains.\n# Use tables and defn for shared behavior.\n\n# Struct (immutable)\n(def person {:name \"Alice\" :age 30})",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# Janet strings\n(def name \"Janet\")\n(def greeting (string \"Hello, \" name \"!\"))  # concatenation\n\n# String functions\n(length name)             # 5\n(string/upper name)       # \"JANET\"\n(string/lower name)       # \"janet\"\n(string/slice name 0 3)  # \"Jan\"\n(string/find \"ne\" name)   # 2\n(string/format \"Hi %s!\" name)  # \"Hi Janet!\"\n\n# Buffer (mutable string)\n(def buf @\"\")\n(buffer/push-string buf \"Hello\")\n(buffer/push-string buf \" World\")\n(print buf)  # Hello World\n\n# Pattern matching\n(def m (peg/find '(* \"Ja\" (thru \"et\")) name))",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# Janet error handling\n# try\n(try\n  (risky-fn)\n  ([err] (print \"Error: \" err)))\n\n# with (resource cleanup)\n(with [f (file/open \"data.txt\")]\n  (print (file/read f :line)))\n\n# error/raise\n(when (< health 0)\n  (error \"Health cannot be negative\"))\n\n# Fiber-based error propagation\n(def f (fiber/new (fn [] (error \"boom\"))))\n(def result (resume f))\n(when (fiber/status f :error)\n  (print \"Fiber error:\" result))\n\n# assert\n(assert (> health 0) \"Health must be positive\")",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "# Janet imports\n(import json)\n(import http)\n\n# Destructuring import\n(import json :prefix \"j/\")  # j/encode, j/decode\n\n# Relative import\n(import ./utils)\n\n# use (import + refer)\n(use ./helpers)  # all public symbols in scope\n\n# Package management\n# jpm (Janet Package Manager)\n# dependency in project.janet:\n# {:dependencies [\"spork/json\"]}\n\n# Note: Janet uses import/use,\n# not ES-style file imports.\n# jpm is the package manager.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "janet-tip-format-pass11",
          "title": "Janet version and native modules",
          "body": "Janet scripts can break across minor versions and native module ABIs. Pin Janet with the project lock.",
          "tag": "tooling",
          "status": "curated"
        }
      ],
      "categories": [
        "functional"
      ],
      "overview": "A lightweight, embeddable Lisp with PEG parsing, fibers, and a C API — aimed at scripting and embedding in native apps. Developers wanting a tiny, batteries-included scripting language — Lisp syntax, immutable data structures, and a small C core for embedding.\n\nTypical projects include Embedded scripting, CLI tools, Prototyping.",
      "learning_curve": "Moderate — Janet is a Lisp with a small, consistent syntax. The learning curve is in understanding Janet's unique features: fibers (lightweight concurrency), PEG (parsing expression grammars), and tables/prototypes. The documentation is good but the community is small. Familiar to Clojure/Scheme developers.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Janet is a functional-imperative Lisp created by Calvin Rose. Self-contained (one binary, no dependencies). C FFI built-in. Fibers for concurrency. PEG for pattern matching. jpm package manager. Used for scripting, configuration, and embedded DSLs. Small but dedicated community. Competing with Fennel (Lua-based) and Babashka (JVM-based) for scripting.",
      "common_use_cases": [
        "Embedded scripting",
        "CLI tools",
        "Prototyping"
      ],
      "docs_url": "https://janet-lang.org/docs/",
      "best_for": [
        "lightweight embedded scripting",
        "programmable game and app logic",
        "tiny interpreter for DSL and configuration",
        "Embeddable scripting with immutable data and lightweight C interop"
      ],
      "weak_at": [
        "Enterprise Spring microservices without Janet runtime operational support",
        "Browser-first products without Janet JavaScript compilation targets",
        "Teams needing largest package registries comparable to npm or PyPI"
      ],
      "official_url": "https://janet-lang.org/",
      "paradigm": [
        "functional",
        "imperative",
        "embeddable"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic (optional static checks in some dialects and tooling)",
        "runtime": "Interpreted or compiled to bytecode/native depending on implementation",
        "memory": "Garbage-collected in mainstream implementations"
      }
    },
    {
      "id": "red",
      "name": "Red",
      "color": "#e60000",
      "description": "A full-stack language inspired by Rebol — from system programming to GUI scripting in one tool. Its reactive view dialect and binary format make it uniquely compact.",
      "whoItIsFor": "Developers wanting a single language from OS-level scripting to GUI apps — full-stack with no separate build step or runtime dependency required.",
      "commonUses": [
        "GUI apps",
        "Scripting",
        "DSLs",
        "System tools"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "Red []\nprint \"Hello\"",
          "explanation": "Red/System style scripts can print text with a tiny header and a print call."
        },
        {
          "title": "Hello",
          "code": "Red []\nprint \"Hello\"",
          "explanation": "Red/System dialects share syntax; `print` outputs to console."
        },
        {
          "title": "View block",
          "code": "view [button \"Click\" [print \"clicked\"]]",
          "explanation": "VID dialect describes GUIs declaratively."
        },
        {
          "title": "Red/System boundary - Red's polyglot bridge",
          "code": "; Red's polyglot boundary is Red/System:\n; Red (interpreted DSL) bridges to\n; Red/System (compiled C-like) for native code.\n\n; Red/System function (compiled)\n#system [\n  sum: func [a [integer!] b [integer!] return: [integer!]] [\n    a + b\n  ]\n]\n\n; Call from Red\nprobe sum 3 4  ; 7\n\n; Red/System for FFI\n#system [\n  #import [\"libc.so.6\" cdecl [\n    malloc: [size [integer!] return: [byte-ptr!]]\n    free: [ptr [byte-ptr!]]\n  ]]\n]\n\n; The boundary bridges:\n; Red (high-level DSL) <-> Red/System (low-level native)\n; Same language, different compilation targets.",
          "explanation": "Red's polyglot boundary is Red/System: Red (a high-level REBOL-like DSL) bridges to Red/System (a low-level C-like compiled language) for performance-critical code and FFI. Both share the same toolchain and can be mixed in a single source file using #system directives. This makes Red a full-stack bridge — high-level expression (parse dialect, VID GUI) and low-level control (memory management, C interop) in one language."
        }
      ],
      "libraries": [
        {
          "name": "Red docs",
          "url": "https://www.red-lang.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Red language",
          "url": "https://www.red-lang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "; Red variables\nname: \"Red\"\ncount: 0\npi: 3.14159\n\n; Series (Red's core data type)\nitems: [\"a\" \"b\" \"c\"]\nscores: make map! [Alice 100 Bob 90]\n\n; Type annotation (Red 0.6+)\ncount: integer!\nname: string!\n\n; None\nresult: none\n\n; Set-word (assignment)\nx: 10\ny: x + 1",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "; Red conditionals\nif score > 100 [print \"High score!\"]\n\neither score > 100 [\n  print \"High\"\n] [\n  print \"Normal\"\n]\n\n; case\ncase [\n  score > 100 [\"High\"]\n  score > 0   [\"Normal\"]\n  true        [\"Invalid\"]\n]\n\n; switch\nswitch direction [\n  'up   [print \"Going up\"]\n  'down [print \"Going down\"]\n]",
          "difficulty": "basic"
        },
        "loops": {
          "code": "; Red loops\nloop 10 [print \"Hello\"]\n\nrepeat i 10 [print i]\n\nforeach item items [print item]\n\n; for\nfor i 1 10 1 [print i]\n\n; while\nx: 0\nwhile [x < 10] [\n  x: x + 1\n]\n\n; series iteration\nforeach [key value] scores [\n  print [key value]\n]\n\n; map (collect)\ncollect [repeat i 10 [keep i * 2]]",
          "difficulty": "basic"
        },
        "functions": {
          "code": "; Red functions\ngreet: func [name] [\n  rejoin [\"Hello, \" name \"!\"]\n]\n\n; With local variables\nadd-and-print: func [a b /local sum] [\n  sum: a + b\n  print sum\n]\n\n; Refinements (optional parameters)\nconfigure: func [title /timeout secs] [\n  print rejoin [\"Config: \" title]\n  if timeout [print [\"Timeout:\" secs]]\n]\n\n; Return value\nadd: func [a b] [a + b]\n\n; Does (shortcut for no-arg function)\nsay-hi: does [print \"Hi!\"]",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "; Red performance:\n; 1. Interpreted (Red interpreter)\n; 2. Red/System compiles to native code\n; 3. REBOL-style series operations\n; 4. Mezzanine functions are interpreted\n; 5. Native! functions are compiled\n; 6. Use Red/System for hot paths\n; 7. Good for DSLs and scripting, not compute\n; 8. JIT compilation planned for future",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "; Red has no class/OOP keyword.\n; Objects are created with make object!\n; They use prototype-based inheritance.\n\nanimal: make object! [\n  name: none\n  sound: none\n  speak: does [print rejoin [name \" says \" sound]]\n]\n\ncat: make animal [\n  name: \"Cat\"\n  sound: \"Meow\"\n]\n\ncat/speak  ; Cat says Meow\n\n; These are NOT classes in the OOP sense.\n; They are objects with prototype chains.\n; Use make object! and contexts for encapsulation.\n\n; Contexts (namespaces)\nmylib: context [\n  version: 1.0\n  greet: func [name] [print rejoin [\"Hi \" name]]\n]",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "; Red strings\nname: \"Red\"\ngreeting: rejoin [\"Hello, \" name \"!\"]\n\n; String functions\nlength? name              ; 3\nuppercase copy name       ; \"RED\"\nlowercase copy name       ; \"red\"\ncopy/part name 2          ; \"Re\"\nfind name \"e\"            ; position\nreplace copy name \"e\" \"E\" ; \"REd\"\n\n; String series operations\ninsert \"Hello\" \"XX\"     ; \"XXHello\"\nappend \"Hello\" \" World\"  ; \"Hello World\"\n\n; Form (convert to string)\nform 42                   ; \"42\"\n\n; Mold (serialize)\nmold [1 2 3]              ; \"[1 2 3]\"",
          "difficulty": "basic"
        },
        "errors": {
          "code": "; Red error handling\n; try/attempt\nattempt [divide 10 0]  ; returns none on error\n\n; try\nif error? try [\n  risky-operation\n] [\n  print \"Error occurred\"\n]\n\n; Custom errors\ncause-error 'user 'message [\"Something went wrong\"]\n\n; Disarm (get error object)\nresult: try [divide 10 0]\nif error? result [\n  print [\"Error:\" result/type result/id]\n]\n\n; Assert\nunless positive? health [\n  cause-error 'user 'invalid [\"Health must be positive\"]\n]",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "; Red imports\n; do (load and execute a file)\ndo %mylib.red\n\n; do/expand (expand macros first)\ndo/expand %template.red\n\n; load (parse Red code)\ndata: load %config.red\n\n; require (module system - Red 0.7+)\n; Red's module system is still evolving\n\n; Standard library is always available\n; No import needed for built-in functions\n\n; Note: Red uses do/load for file inclusion,\n; not ES-style imports.\n; The module system is still in development.",
          "difficulty": "basic"
        }
      },
      "tips": [],
      "categories": [
        "systems"
      ],
      "overview": "A full-stack language inspired by Rebol — from system programming to GUI scripting in one tool. Its reactive view dialect and binary format make it uniquely compact. Developers wanting a single language from OS-level scripting to GUI apps — full-stack with no separate build step or runtime dependency required.\n\nTypical projects include GUI apps, Scripting, DSLs.",
      "learning_curve": "Moderate — Red's REBOL-like syntax is unusual (no parentheses for function calls, series-oriented). The learning curve is in understanding the series model, dialects (parse, VID), and the Red/System boundary. Good documentation but small community. Easier for REBOL developers.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Red is a full-stack programming language created by Nenad Rakocevic. REBOL-like syntax. Red/System compiles to native code. Built-in GUI (VID), parsing (Parse dialect). Self-hosting compiler. Small but dedicated community. Used for DSLs, GUI apps, and systems programming. No mainstream adoption yet but unique approach to full-stack in one language.",
      "common_use_cases": [
        "GUI apps",
        "Scripting",
        "DSLs",
        "System tools"
      ],
      "docs_url": "https://www.red-lang.org/p/documentation.html",
      "best_for": [
        "cross-platform GUI application prototyping",
        "bytecode-compiled systems scripting",
        "REBOL-inspired concise DSL development",
        "Full-stack Red and Red/System development from high to low levels"
      ],
      "weak_at": [
        "Cloud Kubernetes services without Red server runtime maturity",
        "Fortune 500 hiring pipelines expecting Java or C# credentials",
        "Hard real-time avionics without Red toolchain certification evidence"
      ],
      "official_url": "https://www.red-lang.org/",
      "paradigm": [
        "imperative",
        "dialect",
        "homoiconic"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Interpreted or bytecode-based in common implementations (engines vary)",
        "memory": "Garbage-collected in mainstream implementations",
        "abstraction": "High-level for typical scripting and application use"
      }
    },
    {
      "id": "io",
      "name": "Io",
      "color": "#a9188d",
      "description": "A pure prototype-based language — everything is an object, everything is a message. Its minimalist syntax and dynamic nature make it an elegant vehicle for learning OO concepts.",
      "whoItIsFor": "Language enthusiasts exploring prototype OOP and actors — a small dynamic language inspired by Smalltalk and Self for experimental programming.",
      "commonUses": [
        "Language research",
        "Concurrency experiments"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "\"Hello\" println",
          "explanation": "Message send on a string — in Io, even a string literal is an object that receives messages."
        },
        {
          "title": "Message send",
          "code": "Vehicle := Object clone\ndrive := method(\"Driving\")\nVehicle drive",
          "explanation": "Io uses prototype inheritance; `clone` copies an object."
        },
        {
          "title": "List",
          "code": "list(1, 2, 3) foreach(i, i println)",
          "explanation": "Lists are dynamic; `foreach` iterates with index and value."
        },
        {
          "title": "Addon/VM boundary - Io's polyglot bridge",
          "code": "// Io's polyglot boundary is the addon system:\n// Io bridges to C via AddonLoader.\n\n// Use a C addon\nAddonLoader load(\"Socket\")\nsocket := Socket clone\nsocket setHost(\"127.0.0.1\")\nsocket setPort(8080)\nsocket connect\n\n// Define a C addon (Io C API)\n// IoObject *IoSocket_connect(IoObject *self,\n//   IoObject *locals, IoMessage *m) {\n//   // C implementation\n//   return self;\n// }\n\n// The addon boundary bridges:\n// Io (prototype-based scripting) <-> C (native performance)\n// Objects can have slots backed by C functions.\n\n// Coroutines for async\ncoro := Coroutine clone\ncoro setBlock(block(\"Running\" println))\ncoro resume",
          "explanation": "Io's polyglot boundary is the addon system: Io bridges to C via AddonLoader, allowing native code extensions for performance and system access. The Io C API is simple — every Io message maps to a C function. Coroutines provide lightweight concurrency. This makes Io a prototype-based scripting bridge that connects message-passing objects to native C code."
        }
      ],
      "libraries": [
        {
          "name": "Io language",
          "url": "https://iolanguage.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Io guide",
          "url": "https://iolanguage.org/guide/guide.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// Io variables\ncount := 0\nname := \"Io\"\npi := 3.14159\n\n// Update existing\ncount = count + 1\n\n// Nil\nresult := nil\n\n// List\nitems := list(\"a\", \"b\", \"c\")\n\n// Map\nscores := Map clone\nscores atPut(\"Alice\", 100)\n\n// Type checking\ncount type  // \"Number\"",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// Io conditionals\nif(score > 100,\n  \"High score!\" println,\n  \"Normal\" println\n)\n\n// If-else returns value\nresult := if(active, \"on\", \"off\")\n\n// Multiple conditions\nif(score > 100,\n  \"High\" println,\n  score > 0,\n  \"Normal\" println,\n  \"Invalid\" println\n)\n\n// Boolean\nx > 0 and x < 100\nstatus or fallback",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Io loops\n// for\nfor(i, 0, 9,\n  i println\n)\n\n// foreach\nitems foreach(item,\n  item println\n)\n\n// while\ni := 0\nwhile(i < 10,\n  i = i + 1\n)\n\n// Loop\ni := 0\nloop(\n  if(i > 10, break)\n  i = i + 1\n)\n\n// Map iteration\nscores foreach(key, value,\n  (key .. \": \" .. value) println\n)",
          "difficulty": "basic"
        },
        "functions": {
          "code": "// Io functions (methods)\ngreet := method(name,\n  \"Hello, \" .. name .. \"!\" println\n)\n\n// Return value\nadd := method(a, b, a + b)\n\n// Block (closure)\ncounter := block(\n  count := 0\n  block(count = count + 1)\n)\n\n// Variable arguments\nsum := method(\n  args := call evalArgs\n  args reduce(+)\n)\n\n// Method on object\nDog := Object clone\ndog bark := method(\"Woof!\" println)",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "// Io performance:\n// 1. Interpreted language (slow for compute)\n// 2. Prototype-based (no class overhead)\n// 3. Message passing is the core operation\n// 4. Incremental GC (low pause)\n// 5. Use C addons for hot paths\n// 6. Good for DSLs and prototyping\n// 7. Not designed for raw performance\n// 8. Actor model via coroutines",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "// Io has no class keyword.\n// Io uses prototype-based OOP (like JavaScript).\n// Objects clone from other objects.\n\nAnimal := Object clone\nAnimal name := nil\nAnimal sound := nil\nAnimal speak := method(\n  (name .. \" says \" .. sound) println\n)\n\nCat := Animal clone\nCat name = \"Cat\"\nCat sound = \"Meow\"\nCat speak  // Cat says Meow\n\n// These are NOT classes in the class-based OOP sense.\n// They are prototypes cloned from Object.\n// Use clone for inheritance, slots for encapsulation.\n\n// Slot introspection\nCat slotNames  // list(speak, name, sound)",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "// Io strings\nname := \"Io\"\ngreeting := \"Hello, \" .. name .. \"!\"  // concatenation\n\n// String methods\nname size               // 2\nname asUppercase        // \"IO\"\nname asLowercase        // \"io\"\nname slice(0, 1)       // \"I\"\nname contains(\"o\")     // true\nname split(\"\")         // list(\"I\", \"o\")\n\n// String interpolation (via .. operator)\nmsg := \"Count: \" .. count .. \", Name: \" .. name\n\n// Format\n\"Hello, %s!\" format(\"World\") println",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Io error handling\n// try/catch/finally\ntry(\n  riskyOperation\n) catch(exception,\n  \"Error: \" .. exception .. \"!\" println\n)\n\n// Custom exception\nMyError := Exception clone\nMyError raise(\"Something went wrong\")\n\n// assert\nassert(count > 0, \"Count must be positive\")\n\n// Nil checks\nif(result,\n  result println,  // truthy\n  \"No result\" println  // nil/false\n)\n\n// return (early exit from method)\nvalidate := method(input,\n  if(input isNil, return nil)\n  input\n)",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// Io imports\n// C addon import\nAddonLoader load(\"myaddon\")\n\n// File execution\ndoFile(\"utils.io\")\n\n// Relative path\ndoRelativeFile(\"helpers.io\")\n\n// doString (eval code)\ndoString(\"1 + 2\")  // 3\n\n// Note: Io uses doFile/doRelativeFile\n// for file inclusion and AddonLoader\n// for C extensions, not ES-style imports.\n// The package ecosystem is minimal.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "io-tip-prototypes",
          "title": "Prototype chains replace classes",
          "body": "Io’s object model is prototype-based. Unexpected slot lookup is more common than “dependency drift” — keep examples tiny.",
          "tag": "language",
          "status": "curated"
        }
      ],
      "categories": [
        "esoteric"
      ],
      "overview": "A pure prototype-based language — everything is an object, everything is a message. Its minimalist syntax and dynamic nature make it an elegant vehicle for learning OO concepts. Language enthusiasts exploring prototype OOP and actors — a small dynamic language inspired by Smalltalk and Self for experimental programming.\n\nTypical projects include Language research, Concurrency experiments.",
      "learning_curve": "Moderate — Io's syntax is minimal (no keywords, everything is a message). The prototype-based model is natural for JavaScript developers. The learning curve is in understanding message forwarding (forward, doesNotUnderstand), the actor model, and the lack of mainstream tooling. Small community means limited documentation.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Io is a prototype-based language created by Steve Dekorte. Pure message-passing (everything is a message). Minimal syntax (no keywords). Actor model via coroutines. Small but dedicated community. Used for teaching prototype-based OOP and language design. No mainstream adoption. Influenced by Self, Smalltalk, and Lisp.",
      "common_use_cases": [
        "Language research",
        "Concurrency experiments"
      ],
      "docs_url": "https://iolanguage.org/guide/guide.html",
      "best_for": [
        "prototype-based OOP language research",
        "concurrent actor model experiments",
        "small embeddable DSL prototyping",
        "Prototype-based scripting with actor-like concurrent message passing"
      ],
      "weak_at": [
        "Large statically typed enterprise APIs with schema registry governance",
        "Mobile consumer apps without Io runtime on iOS or Android stores",
        "Teams requiring ISO-standard language specifications and vendor SLAs"
      ],
      "official_url": "https://iolanguage.org/",
      "paradigm": [
        "object-oriented",
        "prototype-based",
        "concurrent"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic",
        "runtime": "Interpreted or bytecode-based in common implementations (engines vary)",
        "memory": "Garbage-collected in mainstream implementations",
        "abstraction": "High-level for typical scripting and application use"
      }
    },
    {
      "id": "factor",
      "name": "Factor",
      "color": "#636746",
      "description": "A concatenative, stack-based language with a rich standard library and interactive development. Programs are sequences of words that pop and push values on a data stack.",
      "whoItIsFor": "Developers exploring concatenative programming and stack machines — a mature Forth-inspired language with rich libraries and an interactive IDE.",
      "commonUses": [
        "Scripting",
        "Language research",
        "Interactive development"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "USE: io\n\"Hello\" print",
          "explanation": "Pushes the string onto the stack, then calls print — Factor's postfix concatenative style in action."
        },
        {
          "title": "Stack effect",
          "code": ": square ( n -- n ) dup * ;",
          "explanation": "Words declare stack effects; `dup *` squares the top number."
        },
        {
          "title": "Quotation",
          "code": "[ 1 2 3 ] [ 2 * ] map",
          "explanation": "Quotations are code blocks; `map` applies a quotation to a sequence."
        },
        {
          "title": "FFI boundary - Factor's C library interface",
          "code": "! Factor's FFI calls C functions directly\n! No wrapper generation needed\n\nLIBRARY: libc\nFUNCTION: void* malloc ( ulong size ) ;\nFUNCTION: void free ( void* ptr ) ;\nFUNCTION: int printf ( c-string fmt, void* args ) ;\n\n! Use in Factor\n: allocate-and-print ( -- )\n    1024 malloc\n    dup \"Hello from C!\" printf\n    free ;\n\n! Structs map to C structs\nC-STRUCT: point\n    { double x }\n    { double y } ;\n\n! Factor manages the stack; C sees native ABI",
          "explanation": "Factor's FFI is its polyglot boundary: it calls C functions directly without wrapper generation, using FUNCTION: declarations that specify the library, function name, and stack effect. C-STRUCT maps C structs to Factor tuples. The Factor compiler handles ABI conventions (calling convention, argument passing, return values). This makes Factor effective for systems programming: high-level concatenative code with zero-overhead C interop."
        }
      ],
      "libraries": [
        {
          "name": "Factor docs",
          "url": "https://docs.factorcode.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Factor documentation",
          "url": "https://docs.factorcode.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "! Factor variables (dynamic and lexical)\n! Dynamic variables (namespace-scoped)\nSYMBOL: count\n0 count set\n\ncount get  ! => 0\n1 count + count set\ncount get  ! => 1\n\n! Lexical variables (locals)\n:: add ( a b -- c )\n    a b + ;\n\n! Local bindings\n[let\n    10 :> x\n    20 :> y\n    x y +\n]",
          "difficulty": "intermediate"
        },
        "conditionals": {
          "code": "! Factor conditionals (postfix notation)\n10 20 > [ \"20 is bigger\" print ] [ \"10 is bigger\" print ] if\n\n! Multiple branches\n3 {\n    { [ dup 0 > ] [ \"positive\" ] }\n    { [ dup 0 < ] [ \"negative\" ] }\n    [ \"zero\" ]\n} cond\n\n! cond for pattern matching\n10 {\n    { [ dup 5 > ] [ \"big\" ] }\n    { [ dup 0 > ] [ \"small\" ] }\n} cond",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "! Factor loops\n! each (iterate for side effects)\n{ 1 2 3 4 } [ . ] each\n\n! map (transform)\n{ 1 2 3 4 } [ 2 * ] map  ! => { 2 4 6 8 }\n\n! filter\n{ 1 2 3 4 5 } [ even? ] filter  ! => { 2 4 }\n\n! reduce\n{ 1 2 3 } 0 [ + ] reduce  ! => 6\n\n! Looping combinators\n10 [1..b] [ . ] each  ! prints 1..10\n10 [1..b] [ sq ] map  ! squares",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "! Factor functions (words)\n: sq ( x -- y ) dup * ;\n: greet ( name -- ) \"Hello, \" prepend print ;\n\n: length ( x y -- z )\n    [ sq ] bi@ + sqrt ; inline\n\n! Stack effects (declaration)\n: add ( a b -- c ) + ;\n\n! Combinators (higher-order)\n2 [ 2 * ] times  ! apply 2*\n{ 1 2 3 } [ sq ] map\n\n! Quotations (anonymous functions)\n[ 2 * ]  ! quotation",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "! Factor performance:\n! 1. Compiles to native code (using LLVM)\n! 2. Stack operations are very fast\n! 3. Inline declarations help the compiler\n! 4. Specialized arrays for numeric types\n! 5. GC is generational\n! 6. FFI calls have minimal overhead\n\n! Inline for speed\n: fast-add ( a b -- c ) + ; inline\n\n! Specialized arrays\nBV{ 1 2 3 }  ! byte vector (compact)",
          "difficulty": "intermediate"
        },
        "classes": {
          "code": "! Factor uses tuples (records) and mixins\ntuple: point x y ;\n\n: <point> ( x y -- point ) point boa ;\n: point-length ( point -- z )\n    [ x>> ] [ y>> ] bi [ sq ] bi@ + sqrt ;\n\n1 2 <point> point-length  ! => 2.236\n\n! Mixins (interfaces)\nmixins: measurable\ngeneric: area ( measurable -- n ) ;\n\n! Implement for point\nM: point area dup x>> sq dup y>> sq + sqrt ;",
          "difficulty": "advanced"
        },
        "strings": {
          "code": "! Factor strings\n\"Hello, Factor!\" print\n\n! String operations\n\"hello\" >upper        ! \"HELLO\"\n\"hello world\" >lower  ! \"hello world\"\n\"hello\" reverse      ! \"olleh\"\n5 \"x\" <repetition>   ! \"xxxxx\"\n\n! String interpolation\nsprintf(\"Hello, %s\" \"World\")",
          "difficulty": "basic"
        },
        "errors": {
          "code": "! Factor error handling\n! Exceptions with throw/catch\n\"error!\" throw\n\n[ \"error!\" throw ] [ \":error!\" print ] recover\n\n! Custom errors\nERROR: division-by-zero a b ;\n\n: safe-div ( a b -- c )\n    dup zero? [\n        division-by-zero\n    ] [\n        /\n    ] if ;\n\n[ 10 0 safe-div ] [ division-by-zero? ] recover",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "! Factor imports (USING:)\nUSING: math sequences io strings ;\n\n! Vocabularies (packages)\nUSING: math.parser io.files io.encodings.utf8 ;\n\n! Require a vocabulary\nREQUIRE: json\n\n! Qualified imports\nQUALIFIED: math\nmath:pi  ! => 3.14159...\n\n! Rename imports\nQUALIFIED-WITH: math m\nm:pi  ! => 3.14159...",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "factor-tip-stack",
          "title": "Stack effect comments are documentation",
          "body": "Factor concatenative code lives or dies by stack effects. Prefer small words with declared effects over long quotations.",
          "tag": "stack",
          "status": "curated"
        }
      ],
      "categories": [
        "functional"
      ],
      "overview": "A concatenative, stack-based language with a rich standard library and interactive development. Programs are sequences of words that pop and push values on a data stack. Developers exploring concatenative programming and stack machines — a mature Forth-inspired language with rich libraries and an interactive IDE.\n\nTypical projects include Scripting, Language research, Interactive development.",
      "learning_curve": "Very steep — the concatenative (postfix, stack-based) paradigm is fundamentally different from most languages. Every operation modifies the stack. Requires thinking in data flow, not control flow. Rewarding for those who master it, but few transferable skills.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Factor is maintained by a small community. factorcode.org hosts the implementation and docs. Comes with a rich standard library (UI, networking, math, JSON, etc.). Used for language exploration and concatenative programming research. Very small but passionate community. The listener (REPL) is the primary development tool.",
      "common_use_cases": [
        "Scripting",
        "Language research",
        "Interactive development"
      ],
      "docs_url": "https://docs.factorcode.org/",
      "best_for": [
        "concatenative language exploration",
        "interactive scripting with stack-based paradigm",
        "recreational language-oriented programming",
        "Concatenative stack programming with interactive listener development"
      ],
      "weak_at": [
        "CRUD web APIs without Factor HTTP server ecosystem maturity",
        "Git-centric PR workflows expecting text-file source over saved images",
        "Cross-platform mobile UI without Factor GUI framework investments"
      ],
      "official_url": "https://factorcode.com/",
      "paradigm": [
        "concatenative",
        "stack-based",
        "interactive"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Dynamic with optional stack-effect documentation",
        "runtime": "Native code image compiled from Factor source (self-hosting compiler)",
        "memory": "Garbage-collected in the Factor VM",
        "abstraction": "High-level concatenative language with rich libraries"
      }
    },
    {
      "id": "pony",
      "name": "Pony",
      "color": "#2b2b2b",
      "description": "An actor-model language with capabilities-secure types — data-race-free by construction. Its reference capabilities enforce safe concurrency without locks or runtime checks.",
      "whoItIsFor": "Concurrency enthusiasts wanting compile-time safety from data races — reference capabilities enforce message-passing discipline at the type level.",
      "commonUses": [
        "Concurrent systems",
        "Distributed computing"
      ],
      "patterns": [
        {
          "title": "Hello",
          "code": "actor Main\n  new create(env: Env) =>\n    env.out.print(\"Hello\")",
          "explanation": "Actor-based entry point — top-level code runs inside the Main actor; every concurrent unit is an actor."
        },
        {
          "title": "Actor",
          "code": "actor Counter\n  var _n: USize = 0\n  be inc() => _n = _n + 1\n  be value(fn: {(USize): None} iso) => fn(_n)",
          "explanation": "Actors encapsulate state; `be` methods are asynchronous behaviours."
        },
        {
          "title": "Reference capability",
          "code": "class val Point\n  let x: F64\n  let y: F64\n  new create(x': F64, y': F64) =>\n    x = x'\n    y = y'",
          "explanation": "`val` objects are immutable and shareable across actors."
        },
        {
          "title": "Actor/message boundary - Pony's polyglot bridge",
          "code": "// Pony's polyglot boundary is the actor/message model:\n// actors communicate via async messages,\n// C FFI bridges to native code.\n\nactor Database\n  var _data: Map[String, String] = Map[String, String]\n\n  be set(key: String, val: String) =>\n    _data(key) = val\n\n  be get(key: String, promise: Promise[String]) =>\n    match _data.get(key)\n    | let v: String => promise(v)\n    else promise.reject(\"not found\")\n    end\n\n// C FFI\n// @fun[\n//   name: \"malloc\",\n//   params: [USize],\n//   result: Pointer[U8]\n// ]\n// fun malloc(size: USize): Pointer[U8] =>\n//   @malloc(size)\n\n// Actor boundary bridges:\n// Pony (safe concurrency) <-> C (native performance)\n// Zero-copy via iso reference capability.",
          "explanation": "Pony's polyglot boundary is the actor/message model: actors communicate via asynchronous messages with zero-copy semantics (iso reference capability). C FFI bridges to native code for performance-critical operations. Reference capabilities (iso, val, ref, box, tag) guarantee data-race freedom at compile time. This makes Pony a concurrent bridge — write safe concurrent code without locks, and call C when you need raw speed."
        }
      ],
      "libraries": [
        {
          "name": "Pony docs",
          "url": "https://www.ponylang.io/learn/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Pony tutorial",
          "url": "https://tutorial.ponylang.io/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// Pony variables\nvar count: U32 = 0           // mutable\nlet name: String = \"Pony\"    // immutable\nlet pi: F64 = 3.14159        // constant\n\n// Nullable (unions with None)\nvar nickname: (String | None) = None\n\n// Collections\nlet items: Array[String] = [\"a\"; \"b\"; \"c\"]\nlet scores: Map[String, U32] = Map[String, U32]\n\n// Reference capabilities\nvar x: String iso = \"isolated\"\nvar y: String val = \"immutable\"\nvar z: String ref = \"mutable\"\nvar w: String box = \"read-only\"\nvar v: String tag = \"opaque\"",
          "difficulty": "intermediate"
        },
        "conditionals": {
          "code": "// Pony conditionals\nif score > 100 then\n  env.out.print(\"High score!\")\nelseif score > 0 then\n  env.out.print(\"Normal\")\nelse\n  env.out.print(\"Invalid\")\nend\n\n// Match (pattern matching)\nmatch direction\n| \"up\" => env.out.print(\"Going up\")\n| \"down\" => env.out.print(\"Going down\")\nelse\n  env.out.print(\"Unknown\")\nend\n\n// Match with type\nmatch animal\n| let c: Cat => c.meow()\n| let d: Dog => d.bark()\nend\n\n// Ternary via if-expression\nlet label = if active then \"on\" else \"off\" end",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Pony loops\nfor i in Range[U32](0, 10) do\n  env.out.print(i.string())\nend\n\nfor item in items.values() do\n  env.out.print(item)\nend\n\n// While\nvar i: U32 = 0\nwhile i < 10 do\n  i = i + 1\nend\n\n// Loop with break\nvar found: Bool = false\nfor item in items.values() do\n  if item == \"target\" then\n    found = true\n    break\n  end\nend\n\n// Iterators\nlet doubled = Array[U32]\nfor i in Range[U32](0, 5) do\n  doubled.push(i * 2)\nend",
          "difficulty": "basic"
        },
        "functions": {
          "code": "// Pony functions\nfun greet(name: String): String =>\n  \"Hello, \" + name + \"!\"\n\n// Arrow function (lambda)\nlet double = {(x: U32): U32 => x * 2 }\n\n// Default arguments not supported;\n// use overloads or builder pattern\n\n// Generic function\nfun first[A](arr: Array[A]): (A | None) =>\n  if arr.size() > 0 then arr(0)? else None end\n\n// Be function (actor behavior)\nbe process(data: Array[U8] iso) =>\n  // Process data asynchronously\n  None\n\n// Function reference capabilities\nfun ref mutate() =>\n  // Can modify fields\n  None",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "// Pony performance:\n// 1. Compiled to native code via LLVM\n// 2. Message passing between actors (no locks)\n// 3. Garbage collection per-actor (no stop-the-world)\n// 4. Reference capabilities eliminate data races\n// 5. Zero-copy message passing (iso)\n// 6. C FFI for hot paths\n// 7. Orca GC (cycle detection across actors)\n// 8. Excellent for concurrent/parallel workloads",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "// Pony has class and actor (real syntax).\n// Reference capabilities differ from typical OOP\n// but class/actor/trait are first-class.\n\nclass Player\n  var _name: String\n  var _score: U32\n\n  new create(name: String) =>\n    _name = name\n    _score = 0\n\n  fun ref add_score(points: U32) =>\n    _score = _score + points\n\n  fun name(): String => _name\n  fun score(): U32 => _score\n\n// Actor (concurrent entity — like class with behaviors)\nactor GameMaster\n  var _players: Map[String, Player] = Map[String, Player]\n\n  be join(name: String) =>\n    _players(name) = Player(name)\n    // Process asynchronously\n\n  be report() =>\n    for p in _players.values() do\n      // Log player info\n    end\n\n// Trait (like interface)\ntrait Named\n  fun name(): String\n\n// Interface (structural typing)\ninterface HasName\n  fun name(): String",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "// Pony strings\nlet name: String = \"Pony\"\nlet greeting: String = \"Hello, \" + name + \"!\"  // concatenation\n\n// String methods\nname.size()                     // 4\nname.upper()                    // \"PONY\"\nname.lower()                    // \"pony\"\nname.substring(0, 2)            // \"Po\"\nname.contains(\"on\")             // true\n\n// String builder\nlet buf = String\nduf .append(\"Hello\")\nbuf.append(\" World\")\n\n// String comparison\nif name == \"Pony\" then\n  env.out.print(\"Match!\")\nend\n\n// Bytes vs codepoints\nname.size()        // bytes\nname.codepoints()  // codepoints",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Pony error handling\n// Error type (must be explicitly handled)\nfun safe_div(a: U32, b: U32): U32 ? =>\n  if b == 0 then error else a / b end\n\n// Try/catch\nclass Main\n  fun try_div(a: U32, b: U32): U32 =>\n    try\n      safe_div(a, b)?\n    else\n      0  // default on error\n    end\n\n// Partial functions (can error)\nfun head(arr: Array[U32]): U32 ? =>\n  arr(0)?\n\n// ? suffix = partial (can raise error)\n// try / else / end = error handler\n\n// No exceptions — errors are values\n// Reference capabilities prevent data races\n// at compile time.",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// Pony imports\n// Use keyword\nuse \"collections\"\nuse \"net\"\n\n// Conditional use\nuse \"promises\" if windows\n\n// Use with alias\nuse \"time\" as TimeLib\n\n// Package structure\n// package.json in each directory\n// The package name matches the directory\n\n// Builtin package always available\n// use \"builtin\"  // not needed\n\n// Note: Pony uses 'use' for packages,\n// not ES-style file imports.\n// corral is the package manager.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "pony-tip-format-pass11",
          "title": "Reference capabilities are the hard part",
          "body": "Pony bugs are usually capability/viewpoint mistakes, not package drift. Keep examples small and compile with the same ponyc version.",
          "tag": "safety",
          "status": "curated"
        }
      ],
      "categories": [
        "systems"
      ],
      "overview": "An actor-model language with capabilities-secure types — data-race-free by construction. Its reference capabilities enforce safe concurrency without locks or runtime checks. Concurrency enthusiasts wanting compile-time safety from data races — reference capabilities enforce message-passing discipline at the type level.\n\nTypical projects include Concurrent systems, Distributed computing.",
      "learning_curve": "Very steep — Pony's reference capability system (iso, val, ref, box, tag, trn) is unique and requires significant mental model adjustment. The actor model is conceptually simple but reference capabilities add complexity. The compiler is strict (rejects unsafe code). Good documentation but small community. Best for developers who need safe concurrency.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Pony is an object-capability language created by Sylvan Clebsch. Compiled via LLVM. Reference capabilities eliminate data races at compile time. Actor model for concurrency. Per-actor garbage collection (no stop-the-world). Used in finance (Wallaroo Labs). Small community. corral package manager. Competing with Rust (safety), Erlang (concurrency), and Go (simplicity).",
      "common_use_cases": [
        "Concurrent systems",
        "Distributed computing"
      ],
      "docs_url": "https://www.ponylang.io/learn/",
      "best_for": [
        "actor-model concurrent systems programming",
        "reference-capability-safe distributed computing",
        "deadlock-free high-concurrency applications",
        "High-performance actor-model services with compile-time capability safety"
      ],
      "weak_at": [
        "Windows desktop LOB apps without Pony platform support priorities",
        "Teams needing mature ORM and web framework ecosystems today",
        "JVM shops standardized on Java concurrency without Pony runtime ops"
      ],
      "official_url": "https://www.ponylang.io/",
      "paradigm": [
        "object-oriented",
        "actor-model",
        "reference-capabilities"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static, with reference capabilities checked at compile time",
        "runtime": "Compiled ahead-of-time to native code",
        "memory": "Reference-counted without a tracing garbage collector in the core model"
      }
    },
    {
      "id": "move",
      "name": "Move",
      "color": "#4a90d9",
      "description": "A resource-oriented language for blockchain — assets can't be copied, only moved. Designed for Diem/Libra; its linear type system prevents double-spend at the language level.",
      "whoItIsFor": "Blockchain developers on Aptos and Sui building safe smart contracts — resource-oriented types prevent double-spend by default in asset programming.",
      "commonUses": [
        "Blockchain (Aptos/Sui)",
        "Digital assets",
        "Smart contracts"
      ],
      "patterns": [
        {
          "title": "Module",
          "code": "module example::counter {\n  struct Counter has key { value: u64 }\n}",
          "explanation": "A module declares resource types and capabilities that Move’s borrow checker tracks for safe on-chain state."
        },
        {
          "title": "Module and struct",
          "code": "module 0x1::coin {\n  struct Coin has store { value: u64 }\n}",
          "explanation": "Move modules define types for safe resource-oriented programming on chain."
        },
        {
          "title": "Acquires",
          "code": "public fun mint(account: &signer, amount: u64) acquires Balance { /* ... */ }",
          "explanation": "`acquires` lists global resources a function may borrow."
        },
        {
          "title": "Entry/VM boundary - Move's polyglot bridge",
          "code": "// Move's polyglot boundary is the entry/VM bridge:\n// Move code runs on the Move VM,\n// entry functions are called from outside.\n\nmodule my_addr::coin {\n    struct Coin has store, drop { value: u64 }\n\n    // Entry function (callable from SDK/CLI)\n    public entry fun mint(\n        sender: &signer,\n        amount: u64\n    ) {\n        let coin = Coin { value: amount };\n        // Transfer to sender\n        transfer::public_transfer(coin, sender);\n    }\n}\n\n// Called from TypeScript SDK:\n// const tx = new Transaction();\n// tx.moveCall({\n//   target: `${packageId}::coin::mint`,\n//   arguments: [tx.pure.u64(100)],\n// });\n// const result = await client.signAndExecuteTransaction({\n//   transaction: tx,\n//   signer,\n// });\n\n// The boundary bridges:\n// Move (on-chain logic) <-> SDK/CLI (off-chain)",
          "explanation": "Move's polyglot boundary is the entry/VM bridge: entry functions are called from off-chain code (TypeScript/Python SDKs, CLI), and the Move VM executes them deterministically. Structs with abilities (copy, drop, store, key) define how data crosses the boundary — resources cannot be duplicated or accidentally destroyed. This makes Move a blockchain bridge that connects off-chain orchestration to on-chain resource-safe execution."
        }
      ],
      "libraries": [
        {
          "name": "Move docs",
          "url": "https://move-language.github.io/move/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Move book",
          "url": "https://move-language.github.io/move/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// Move variables\nlet count: u64 = 0;\nlet name: vector<u8> = b\"Move\";  // strings are byte vectors\nlet is_active: bool = true;\n\n// Struct\nstruct User has store, drop {\n    name: vector<u8>,\n    age: u8,\n}\n\nlet user = User { name: b\"Alice\", age: 30 };\n\n// Mutable reference\nfun increment(count: &mut u64) {\n    *count = *count + 1;\n}\n\n// Constants\nconst DECIMAL: u64 = 1_000_000_000;",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// Move conditionals\nif (score > 100) {\n    // high score\n} else if (score > 0) {\n    // normal\n} else {\n    // invalid\n};\n\n// If as expression\nlet label = if (active) { b\"on\" } else { b\"off\" };\n\n// Match-like pattern via if-let is not available;\n// use destructuring with let\n\n// Abort (irrecoverable)\nif (balance < amount) {\n    abort 1;\n};\n\n// Assert\nassert!(balance >= amount, 1);",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Move loops\n// while loop\nlet mut i = 0;\nwhile (i < 10) {\n    i = i + 1;\n};\n\n// No for-each; iterate manually\nlet mut i = 0;\nlet len = vector::length(&items);\nwhile (i < len) {\n    let item = vector::borrow(&items, i);\n    // process item\n    i = i + 1;\n};\n\n// Vector operations (functional style)\nvector::for_each(&items, |item| {\n    // process item\n});\n\n// vector::map\nlet doubled = vector::map(&numbers, |n| n * 2);",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "// Move functions\nfun greet(name: &vector<u8>): vector<u8> {\n    let mut greeting = b\"Hello, \";\n    vector::append(&mut greeting, *name);\n    vector::append(&mut greeting, b\"!\");\n    greeting\n}\n\n// Public entry function (callable from outside)\npublic entry fun transfer(sender: &signer, recipient: address, amount: u64) {\n    // ... transfer logic\n}\n\n// Generic function\nfun first<T>(items: &vector<T>): &T {\n    vector::borrow(items, 0)\n}\n\n// Mutable reference parameter\nfun increment(counter: &mut u64) {\n    *counter = *counter + 1;\n}",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "// Move performance:\n// 1. Runs on Move VM (deterministic execution)\n// 2. Gas metering for every operation\n// 3. Flat storage model (no deep nesting)\n// 4. Parallel execution possible (no shared state)\n// 5. Bytecode verification before execution\n// 6. Storage access is the bottleneck\n// 7. Use tables for large datasets\n// 8. Minimize cross-module calls",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "// Move has no class/OOP system.\n// Move uses structs with abilities.\n\n// Abilities: copy, drop, store, key\nstruct Coin has store, drop {\n    value: u64,\n}\n\n// Resource (non-copyable, non-droppable)\nstruct Asset has key, store {\n    value: u64,\n}\n\n// Struct with methods (separate)\nmodule my_module::user {\n    struct User has store, drop {\n        name: vector<u8>,\n        age: u8,\n    }\n\n    public fun new(name: vector<u8>, age: u8): User {\n        User { name, age }\n    }\n\n    public fun name(user: &User): &vector<u8> {\n        &user.name\n    }\n}\n\n// Structs + abilities ≠ OOP classes.\n// Methods are module-level functions.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "// Move strings\n// Move has no native string type.\n// Strings are vector<u8> (byte vectors).\nlet name: vector<u8> = b\"Move\";\n\n// String operations via std::string module\nuse std::string::{Self, String};\n\nlet s: String = string::utf8(b\"Hello\");\n\n// Append\nlet mut greeting = b\"Hello, \";\nvector::append(&mut greeting, b\"World!\");\n\n// Length\nlet len = vector::length(&greeting);\n\n// Substring (manual via vector::borrow)\n// No built-in substring\n\n// Note: String handling is minimal in Move.\n// Use std::string for UTF-8 validation.",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Move error handling\n// abort (irrecoverable)\nif (balance < amount) {\n    abort 1;  // error code\n};\n\n// assert!\nassert!(balance >= amount, 1);\n\n// Option type\nuse std::option::{Self, Option};\n\nfun safe_div(a: u64, b: u64): Option<u64> {\n    if (b == 0) {\n        option::none()\n    } else {\n        option::some(a / b)\n    }\n}\n\n// No try/catch. Errors abort the transaction.\n// Option for recoverable errors.\n// abort for irrecoverable errors.",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// Move imports\n// Module declaration\nmodule my_addr::my_module {\n    // ...\n}\n\n// Use statement\nuse std::vector;\nuse std::string::{Self, String};\nuse sui::coin::{Self, Coin};\n\n// Friend declarations (for testing)\nfriend my_addr::test_module;\n\n// Script imports (entry points)\n// No ES-style imports; use module paths\n\n// Package structure:\n// sources/   - Move source files\n// tests/    - test files\n// Move.toml - package manifest\n\n// Note: Move uses module paths,\n// not ES-style file imports.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "move-tip-resources",
          "title": "Resources cannot be copied or dropped casually",
          "body": "Move’s resource safety is the point. Aborts and ability annotations matter more than generic toolchain tips.",
          "tag": "contracts",
          "status": "curated"
        }
      ],
      "categories": [
        "blockchain"
      ],
      "overview": "A resource-oriented language for blockchain — assets can't be copied, only moved. Designed for Diem/Libra; its linear type system prevents double-spend at the language level. Blockchain developers on Aptos and Sui building safe smart contracts — resource-oriented types prevent double-spend by default in asset programming.\n\nTypical projects include Blockchain (Aptos/Sui), Digital assets, Smart contracts.",
      "learning_curve": "Steep — Move's resource-oriented programming model is unique. Abilities (copy, drop, store, key) control how structs behave. The module system and global storage model differ from mainstream languages. Move on Sui adds object-centric model. Move on Aptos uses account-centric model. Both require understanding blockchain-specific concepts.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Move is a resource-oriented language for smart contracts. Originally created by Diem (Meta). Two major platforms: Sui (object-centric) and Aptos (account-centric). Resource safety via abilities. Deterministic execution. Move Prover for formal verification. Growing ecosystem (Sui DeFi, Aptos DeFi). Competing with Solidity (EVM), Rust (Solana), and Cairo (StarkNet).",
      "common_use_cases": [
        "Blockchain (Aptos/Sui)",
        "Digital assets",
        "Smart contracts"
      ],
      "docs_url": "https://move-language.github.io/move/",
      "best_for": [
        "secure digital asset smart contract development",
        "Aptos and Sui blockchain application programming",
        "resource-oriented blockchain transaction logic",
        "Diem/Aptos/Sui smart contracts with resource-oriented safety guarantees"
      ],
      "weak_at": [
        "General web backends without blockchain state and gas model constraints",
        "Teams avoiding smart contract audit cycles and on-chain upgrade politics",
        "Relational OLTP workloads better served by conventional SQL databases"
      ],
      "official_url": "https://move-language.github.io/move/",
      "paradigm": [
        "resource-oriented",
        "static",
        "blockchain"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static with resource abilities (copy, drop, store, key)",
        "runtime": "Executed on the Move VM (Aptos, Sui, and other Move-based chains)",
        "memory": "Managed by the Move VM (gas-metered global storage; linear resource safety)"
      }
    },
    {
      "id": "vyper",
      "name": "Vyper",
      "color": "#2b247c",
      "description": "A Pythonic smart-contract language for Ethereum — simpler and more auditable than Solidity. No inheritance, no inline assembly, just clean code that's easy to verify.",
      "whoItIsFor": "Smart-contract developers who prefer Python syntax and explicit security — designed for auditable Ethereum contracts with no hidden control flow.",
      "commonUses": [
        "Ethereum contracts",
        "DeFi",
        "Auditable on-chain code"
      ],
      "patterns": [
        {
          "title": "Contract",
          "code": "count: public(uint256)\n\n@external\ndef increment():\n    self.count += 1",
          "explanation": "State variable + function — Vyper contracts are simple class-like structures with no hidden magic."
        },
        {
          "title": "Contract",
          "code": "@external\ndef withdraw():\n    send(msg.sender, self.balance)\n",
          "explanation": "State variable + function — Vyper contracts are simple class-like structures with no hidden magic."
        },
        {
          "title": "Public state variable",
          "code": "name: public(String[32])",
          "explanation": "Storage variables are declared at contract level; public(String[N]) exposes a getter but the value remains mutable storage."
        },
        {
          "title": "ABI/external call boundary - Vyper's polyglot bridge",
          "code": "# Vyper's polyglot boundary is the ABI/external call:\n# contracts communicate via typed ABI calls.\n\ninterface IDEX:\n    def swap(token: address, amount: uint256) -> uint256: nonpayable\n\n@external\ndef trade(token: address, amount: uint256) -> uint256:\n    # External call to another contract\n    result: uint256 = IDEX(self.dex_address).swap(\n        token, amount\n    )\n    return result\n\n# Called from TypeScript (ethers.js):\n# const tx = await contract.trade(\n#   tokenAddress,\n#   amount,\n#   { gasLimit: 100000 }\n# );\n#\n# ABI is the typed boundary between contracts.\n# All calls are type-checked at compile time.\n# No dynamic dispatch (security by design).",
          "explanation": "Vyper's polyglot boundary is the ABI/external call interface: contracts communicate via typed ABI calls (no dynamic dispatch). External calls are the bridge between on-chain contracts, and SDKs (ethers.js, web3.py) are the bridge to off-chain code. Vyper's design eliminates unsafe patterns (no unbounded loops, no dynamic jumps, no recursion) making the boundary secure by construction. This makes Vyper a safety-first blockchain bridge."
        }
      ],
      "libraries": [
        {
          "name": "Vyper docs",
          "url": "https://docs.vyperlang.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Vyper documentation",
          "url": "https://docs.vyperlang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# Vyper variables\ncount: uint256 = 0\nname: String[10] = \"Vyper\"   # bounded string\nis_active: bool = True\n\n# State variables (contract storage)\ntotal_supply: uint256\nowner: address\n\n# Constants\nDECIMALS: constant(uint256) = 18\n\n# Immutable (set in constructor)\nADMIN: immutable(address)\n\n@deploy\ndef __init__():\n    ADMIN = msg.sender\n\n# Mappings\nbalances: HashMap[address, uint256]\n\n# Structs (no struct keyword; use struct-like)\nstruct User:\n    name: String[32]\n    age: uint8\n\nusers: HashMap[address, User]",
          "difficulty": "intermediate"
        },
        "conditionals": {
          "code": "# Vyper conditionals\nif score > 100:\n    # high score\n    pass\nelif score > 0:\n    # normal\n    pass\nelse:\n    # invalid\n    pass\n\n# Ternary (inline if)\nlabel: String[3] = \"on\" if active else \"off\"\n\n# assert (reverts on failure)\nassert balance >= amount, \"Insufficient balance\"\n\n# No switch/match in Vyper\n# Use if/elif chains for multi-way",
          "difficulty": "basic"
        },
        "loops": {
          "code": "# Vyper loops\n# for (bounded iteration only)\nfor i in range(10):\n    # i goes 0 to 9\n    pass\n\n# Iterate over array\nfor item in self.items:\n    pass\n\n# Range with start\nfor i in range(1, 11):\n    # i goes 1 to 10\n    pass\n\n# break and continue are supported inside bounded loops\n# Unbounded while loops are not allowed (gas predictability)",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "# Vyper functions\n@external\ndef greet(name: String[32]) -> String[64]:\n    return concat(\"Hello, \", name, \"!\")\n\n# View (read-only)\n@view\ndef get_balance(account: address) -> uint256:\n    return self.balances[account]\n\n# Internal\n@internal\ndef _transfer(from: address, to: address, amount: uint256):\n    self.balances[from] -= amount\n    self.balances[to] += amount\n\n# Constructor\n@deploy\ndef __init__():\n    self.owner = msg.sender\n\n# Payable\n@payable\ndef deposit():\n    self.balances[msg.sender] += msg.value",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "# Vyper performance:\n# 1. Compiles to EVM bytecode\n# 2. Gas costs are predictable (by design)\n# 3. No dynamic jumps (security feature)\n# 4. No unbounded loops (gas safety)\n# 5. No recursion (prevents stack depth attacks)\n# 6. Bounds checking on all array access\n# 7. Integer overflow protection built-in\n# 8. Trade-off: safety over raw performance",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "# Vyper has no class/OOP system.\n# Vyper contracts are the unit of organization.\n# Structs provide data grouping (not behavior).\n# Inheritance is limited to interfaces.\n\nstruct Token:\n    name: String[32]\n    symbol: String[8]\n    decimals: uint8\n    supply: uint256\n\n# Interface (like abstract class)\ninterface IERC20:\n    def transfer(to: address, amount: uint256) -> bool: nonpayable\n    def balanceOf(account: address) -> uint256: view\n\n# Implements is not a keyword in Vyper;\n# use interface types for type checking.\n# These are NOT classes in the OOP sense.\n# Use contracts, structs, and interfaces.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# Vyper strings\n# Strings are bounded (max length required)\nname: String[10] = \"Vyper\"\n\n# Concatenation via concat()\nfull: String[20] = concat(\"Hello, \", name, \"!\")\n\n# String comparison\nif name == \"Vyper\":\n    pass\n\n# String methods are minimal\n# Use convert() for type conversion\nlength: uint256 = len(name)\n\n# Bytes vs String\n# String[N] = UTF-8 string (max N bytes)\n# bytes[N] = raw bytes (max N bytes)\n\n# Conversion\ndata: Bytes[10] = convert(name, Bytes[10])",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# Vyper error handling\n# assert (reverts transaction on failure)\nassert balance >= amount, \"Insufficient balance\"\n\n# raise (revert with message)\nraise \"Unauthorized\"\n\n# No try/catch. Errors revert the entire transaction.\n# This is by design — transactions are atomic.\n\n# Custom error messages\nassert msg.sender == self.owner, \"Only owner can call\"\n\n# Range checks\nassert amount > 0, \"Amount must be positive\"\nassert amount <= MAX_AMOUNT, \"Amount too large\"\n\n# All state changes revert on error.\n# This guarantees atomicity.",
          "difficulty": "N/A"
        },
        "imports": {
          "code": "# Vyper imports\n# Import interface or contract\nfrom vyper.interfaces import ERC20\n\n# Import specific\nfrom ethereum.erc20 import ERC20 as Token\n\n# Interface import\nimport contracts.ERC20 as IERC20\n\n# Built-in imports\nfrom vyper.interfaces import ERC20\nfrom vyper.interfaces import ERC721\n\n# Note: Vyper uses Python-style imports\n# but the module system is minimal.\n# Most contracts are self-contained.\n# No package manager (yet).",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "vyper-tip-bounds",
          "title": "Bounds and immutability are the pitch",
          "body": "Vyper trades expressiveness for safer defaults. Pin the compiler and target EVM; prefer audited patterns over cleverness.",
          "tag": "contracts",
          "status": "curated"
        }
      ],
      "categories": [
        "blockchain"
      ],
      "overview": "A Pythonic smart-contract language for Ethereum — simpler and more auditable than Solidity. No inheritance, no inline assembly, just clean code that's easy to verify. Smart-contract developers who prefer Python syntax and explicit security — designed for auditable Ethereum contracts with no hidden control flow.\n\nTypical projects include Ethereum contracts, DeFi, Auditable on-chain code.",
      "learning_curve": "Moderate — Vyper's syntax is Python-like and easy to read. The learning curve is in understanding EVM concepts (gas, storage, msg.sender), bounded strings, and the restrictions (no unbounded loops, no recursion, no inheritance). The restrictions make it simpler than Solidity but require different design patterns.",
      "good_for_teaching": "good",
      "ecosystem_notes": "Vyper is a Python-styled smart contract language for the EVM. Created by Vitalik Buterin and others. Security-first design (no unbounded loops, no recursion, no dynamic jumps, overflow protection). Compiles to EVM bytecode. Growing adoption for DeFi (Curve, Yearn). Competing with Solidity (EVM mainstream) and Move (non-EVM).",
      "common_use_cases": [
        "Ethereum contracts",
        "DeFi",
        "Auditable on-chain code"
      ],
      "docs_url": "https://docs.vyperlang.org/",
      "best_for": [
        "simple audit-friendly smart contracts",
        "Ethereum contract security review",
        "pythonic blockchain application development",
        "Ethereum smart contracts preferring Python-like readability over Solidity"
      ],
      "weak_at": [
        "Off-chain data pipelines without EVM deployment and gas cost modeling",
        "Multi-chain products requiring Solidity ecosystem library compatibility",
        "Compute-heavy algorithms where gas limits make Vyper contracts impractical"
      ],
      "official_url": "https://docs.vyperlang.org/",
      "paradigm": [
        "imperative",
        "contract-oriented",
        "Python-like"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Static in mainstream smart-contract toolchains",
        "runtime": "Executed on the Ethereum Virtual Machine (EVM)",
        "memory": "Managed by the EVM (gas-metered contract storage; not a general-purpose OS heap)"
      }
    },
    {
      "id": "pkl",
      "name": "Pkl",
      "color": "#f5a623",
      "description": "Apple's configuration-as-code language — typed, validated configs that generate JSON/YAML/etc. Catch config errors at validation time, not deploy time.",
      "whoItIsFor": "DevOps and platform engineers wanting type-safe configuration — validates configs at generation time, produces JSON, YAML, and property lists.",
      "commonUses": [
        "Typed configs",
        "Kubernetes manifests",
        "App settings"
      ],
      "patterns": [
        {
          "title": "Config",
          "code": "name = \"myapp\"\nport = 8080",
          "explanation": "Simple typed config with constraints — Pkl validates values against types before generating output."
        },
        {
          "title": "Amends",
          "code": "amends \"base.pkl\"\n\nappName = \"my-service\"",
          "explanation": "`amends` layers overrides on another module — common for config variants."
        },
        {
          "title": "Listing",
          "code": "ports = List<Int>()\nports { 8080; 8443 }",
          "explanation": "Pkl uses declarative objects; listings build collections."
        },
        {
          "title": "Module/resolve boundary - Pkl's polyglot bridge",
          "code": "// Pkl's polyglot boundary is the module/resolve system:\n// Pkl config schemas resolve to typed output\n// in multiple languages (Kotlin, Java, Swift, Go).\n\n// Pkl schema\nclass Database {\n  host: String\n  port: Int = 5432\n  name: String\n}\n\ndatabase: Database = new {\n  host = \"localhost\"\n  name = \"myapp\"\n}\n\n// Generated Kotlin:\n// data class Database(\n//   val host: String,\n//   val port: Int = 5432,\n//   val name: String\n// )\n\n// Generated JSON:\n// {\"host\": \"localhost\", \"port\": 5432, \"name\": \"myapp\"}\n\n// Generated YAML:\n// host: localhost\n// port: 5432\n// name: myapp\n\n// One Pkl schema -> many output formats.",
          "explanation": "Pkl's polyglot boundary is the module/resolve system: one Pkl schema can be resolved to typed output in Kotlin, Java, Swift, Go, JSON, YAML, and more. Pkl is Apple's configuration-as-code language — it defines config schemas with types and constraints, then generates type-safe code in multiple languages. This makes Pkl a universal config bridge that connects a single schema definition to multiple language ecosystems."
        }
      ],
      "libraries": [
        {
          "name": "Pkl docs",
          "url": "https://pkl-lang.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Pkl language",
          "url": "https://pkl-lang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// Pkl variables\nname = \"Pkl\"\ncount = 0\npi = 3.14159\n\n// Type annotations\nname: String = \"Pkl\"\ncount: Int = 0\n\n// Nullable\nnickname: String? = null\n\n// Collections\nitems: Listing<String> = List(\"a\", \"b\", \"c\")\nscores: Map<String, Int> = Map(\"Alice\", 100, \"Bob\", 90)\n\n// Module output\noutput {\n  value = \"Hello\"\n}",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// Pkl conditionals\nif (score > 100) \"High\" else if (score > 0) \"Normal\" else \"Invalid\"\n\n// When (when-is for pattern matching)\nresult = when {\n  score > 100 -> \"High\"\n  score > 0 -> \"Normal\"\n  else -> \"Invalid\"\n}\n\n// If-let (nullable check)\nresult = let (name = nickname) name else \"default\"\n\n// Null-safe access\nresult = nickname?.toUpperCase()",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Pkl loops\n// For-generator (iteration via comprehension)\nnumbers = new List {\n  for (i in 0..10) {\n    i * 2\n  }\n}\n\n// For-each\nitems = new List {\n  for (name in names) {\n    name.toUpperCase()\n  }\n}\n\n// For with filter\nevens = new List {\n  for (i in 0..10) {\n    if (i % 2 == 0) i\n  }\n}\n\n// Mapping iteration\nentries = new Map {\n  [\"a\"] = 1\n  [\"b\"] = 2\n}",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "// Pkl functions\n// Function definition\nfunction greet(name: String): String =\n  \"Hello, \" + name + \"!\"\n\n// Lambda\ndouble = (x: Int) -> x * 2\n\n// Function in module\nfunction configure(title: String, timeout: Int = 30): String =\n  title + \" (\" + timeout.toString() + \"s)\"\n\n// Method on class\nclass Person {\n  name: String\n  age: Int\n\n  function greet(): String =\n    \"Hi, I'm \" + name\n}\n\n// Function application\ngreeting = greet(\"World\")",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "// Pkl performance:\n// 1. Interpreted/evaluated at build time\n// 2. Not a runtime language — config generation only\n// 3. Schema validation is compile-time\n// 4. Output generation is the main work\n// 5. No JIT or AOT compilation needed\n// 6. Good for config, not computation\n// 7. Kotlin/Java/Swift code generation\n// 8. Type checking prevents config errors",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "// Pkl classes (real class syntax for schemas)\nclass Database {\n  host: String\n  port: Int = 5432\n  name: String\n\n  function url(): String =\n    \"jdbc:postgresql://\" + host + \":\" + port.toString() + \"/\" + name\n}\n\nclass AppConfig {\n  database: Database\n  cache: CacheConfig\n  timeout: Int = 30\n}\n\n// Open class (extensible)\nopen class Animal {\n  name: String\n  sound: String\n}\n\n// These are schema classes, not OOP classes.\n// They define data structure, not behavior hierarchy.\n// Pkl classes are primarily for config schema definition.",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "// Pkl strings\nname: String = \"Pkl\"\ngreeting: String = \"Hello, \" + name + \"!\"\n\n// String interpolation (no backticks)\nmessage = \"Value: \" + 42.toString()\n\n// Multi-line string\nmulti = \"\"\"Multiple\nlines\n\"\"\"\n\n// String methods\nname.length           // 3\nname.toUpperCase()    // \"PKL\"\nname.toLowerCase()    // \"pkl\"\nname.substring(0, 1) // \"P\"\nname.contains(\"kl\")   // true\n\n// Trim\ntrimmed = \"  hello  \".trim()",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Pkl error handling\n// Type mismatches are caught at evaluation time\n// No try/catch mechanism — Pkl is declarative\n\n// Type constraints enforce valid config\nport: Int(this >= 1 && this <= 65535) = 5432\n\n// Null-safe access\nresult = nickname?.toUpperCase() ?? \"DEFAULT\"\n\n// Require (assertion)\nclass Positive {\n  value: Int(this > 0)\n}\n\n// Default on null\nname = nickname ?? \"anonymous\"\n\n// Pkl is designed to fail early\n// with clear error messages,\n// not to recover at runtime.",
          "difficulty": "N/A"
        },
        "imports": {
          "code": "// Pkl imports\n// Import module\nimport \"@app/AppConfig.pkl\"\n\n// Import with alias\nimport \"@app/Database.pkl\" as Db\n\n// Amends (extend existing config)\namends \"base.pkl\"\n\n// Local import\nimport \"./utils.pkl\"\n\n// Package imports\nimport \"@package/name/Module.pkl\"\n\n// Relative import\nimport \"../common/config.pkl\"\n\n// Pkl's module system is path-based,\n// similar to ES-style imports.\n// Package registry is pkl-lang.org.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "pkl-tip-typed-config",
          "title": "Prefer typed Pkl modules over free-form maps",
          "body": "Pkl’s value is typed configuration. Define classes for your config surface and fail closed on unknown properties.",
          "tag": "data",
          "status": "curated"
        }
      ],
      "categories": [
        "devops"
      ],
      "overview": "Apple's configuration-as-code language — typed, validated configs that generate JSON/YAML/etc. Catch config errors at validation time, not deploy time. DevOps and platform engineers wanting type-safe configuration — validates configs at generation time, produces JSON, YAML, and property lists.\n\nTypical projects include Typed configs, Kubernetes manifests, App settings. Open source since 2024 with IntelliJ and VS Code extensions.",
      "learning_curve": "Gentle for config, moderate for schemas — Pkl's syntax is similar to Kotlin/Swift. The learning curve is in understanding Pkl's type system, class constraints, and the module/amends system. Developers familiar with typed config (Terraform, Cue, Dhall) will find it familiar. Apple's documentation is excellent.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Pkl (pronounced 'Pickle') is Apple's configuration-as-code language. Released 2024. Strong type system for config validation. Generates Kotlin, Java, Swift, Go, JSON, YAML, and more. Open source (Apache 2.0). IntelliJ and VS Code extensions. Good documentation. Competing with CUE, Dhall, and Jsonnet for typed configuration.",
      "common_use_cases": [
        "Typed configs",
        "Kubernetes manifests",
        "App settings"
      ],
      "docs_url": "https://pkl-lang.org/main/current/",
      "best_for": [
        "configuration as code with IDE support",
        "generated config for multiple formats",
        "type-safe configuration schema definition",
        "Apple Pkl configuration with schema validation and rich templating"
      ],
      "weak_at": [
        "Teams standardized on Helm and YAML without new config language appetite",
        "Legacy XML enterprise buses without Pkl evaluator in CI pipelines",
        "Quick bash env exports without structured schema validation requirements"
      ],
      "official_url": "https://pkl-lang.org/",
      "paradigm": [
        "configuration",
        "typed",
        "schema-first"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative configuration or build DSL (not a general-purpose programming language)",
        "runtime": "Evaluated by a host tool (Ansible, Terraform, Make, Nix, etc.) — no standalone VM",
        "memory": "Managed by the host tool running the configuration or build"
      }
    },
    {
      "id": "jsonnet",
      "name": "Jsonnet",
      "color": "#0064a5",
      "description": "A data templating language — JSON with variables, functions, and imports. Remove duplication from Kubernetes manifests, Terraform state, and any JSON-heavy config workflow.",
      "whoItIsFor": "DevOps teams templating complex JSON configs for Kubernetes, Grafana, and more — overrides and imports reduce YAML repetition and errors.",
      "commonUses": [
        "Kubernetes configs",
        "Grafana dashboards",
        "CI/CD templates"
      ],
      "patterns": [
        {
          "title": "Template",
          "code": "local greeting = 'Hello';\n{ message: greeting }",
          "explanation": "Evaluates to JSON — Jsonnet templates blend data with logic to generate clean output."
        },
        {
          "title": "Local and object",
          "code": "local name = \"Ada\";\n{\n  greeting: \"Hello, \" + name,\n  nums: [1, 2, 3],\n}",
          "explanation": "Jsonnet generates JSON; locals avoid repetition in large configs."
        },
        {
          "title": "Mixin",
          "code": "local base = { a: 1 };\nbase { b: 2 }",
          "explanation": "Object `+` or overlay merges fields for layered configuration."
        },
        {
          "title": "Import/manifest boundary - Jsonnet's polyglot bridge",
          "code": "// Jsonnet's polyglot boundary is the import/manifest system:\n// Jsonnet evaluates to JSON, bridging config to any system.\n\n// Kubernetes config generation\nlocal k8s = import \"k8s.libsonnet\";\n\nlocal deployment = k8s.apps.v1.deployment.new(\n  name=\"my-app\",\n  replicas=3,\n  image=\"myapp:1.0\",\n  ports=[8080],\n);\n\n// Manifest to multiple outputs\n{\n  deployment: deployment,\n  service: k8s.core.v1.service.new(\n    \"my-app-service\",\n    deployment.spec.selector.matchLabels,\n    [{name: \"http\", port: 80, targetPort: 8080}]\n  ),\n}\n\n// Evaluates to JSON:\n// {\"deployment\": {...}, \"service\": {...}}\n// Consumed by kubectl apply -f -",
          "explanation": "Jsonnet's polyglot boundary is the import/manifest system: Jsonnet evaluates to JSON, bridging typed configuration to any system that consumes JSON (Kubernetes, Terraform, Grafana, etc.). The import system brings in external templates and libraries. The manifest boundary outputs multi-document JSON streams. This makes Jsonnet a universal config bridge — write DRY configuration once, manifest to many JSON-consuming systems."
        }
      ],
      "libraries": [
        {
          "name": "Jsonnet docs",
          "url": "https://jsonnet.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Jsonnet reference",
          "url": "https://jsonnet.org/ref/language.html"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// Jsonnet variables\nlocal name = \"Jsonnet\";  // local binding\nlocal count = 0;\nlocal pi = 3.14159;\n\n// Collections\nlocal items = [\"a\", \"b\", \"c\"];\nlocal scores = { Alice: 100, Bob: 90 };\n\n// Computed fields\nlocal config = {\n  host: \"localhost\",\n  port: 5432,\n  url: self.host + \":\" + std.toString(self.port),\n};\n\n// Self and super\nlocal base = { name: \"app\" };\nlocal extended = base + { version: \"1.0\" };",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// Jsonnet conditionals\n// Ternary\nlocal label = if active then \"on\" else \"off\";\n\n// Conditional object field\nlocal config = {\n  name: \"app\",\n  [if production then \"replicas\"]: 3,\n};\n\n// Conditional field with null\nlocal config = {\n  name: \"app\",\n  cache: if enableCache then { ttl: 300 } else null,\n};\n\n// Switch-like via object selection\nlocal env = \"prod\";\nlocal config = {\n  dev: { replicas: 1 },\n  staging: { replicas: 2 },\n  prod: { replicas: 3 },\n}[env];",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Jsonnet loops\n// List comprehension\nlocal doubled = [x * 2 for x in [1, 2, 3, 4, 5]];\n\n// Object comprehension\nlocal ports = { [k]: v for k, v in [{name:\"http\",port:80},{name:\"https\",port:443}]};\n\n// With filter\nlocal evens = [x for x in std.range(0, 10) if x % 2 == 0];\n\n// std.range for numeric iteration\nlocal numbers = std.range(1, 10);  // [1, 2, ..., 10]\n\n// Nested comprehension\nlocal grid = [[i * 10 + j for j in std.range(0, 9)] for i in std.range(0, 9)];\n\n// Map over list\nlocal upper = std.map(function(x) x.upperAscii(), [\"hello\", \"world\"]);",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "// Jsonnet functions\n// Local function\nlocal greet(name) = \"Hello, \" + name + \"!\";\n\n// Function with default argument\nlocal configure(title, timeout=30) =\n  title + \" (\" + std.toString(timeout) + \"s)\";\n\n// Anonymous function\nlocal double = function(x) x * 2;\n\n// Function in object\nlocal utils = {\n  add(a, b): a + b,\n  multiply(a, b): a * b,\n};\n\n// std library functions\nstd.join(\"-\", [\"a\", \"b\", \"c\"])   // \"a-b-c\"\nstd.length([1, 2, 3])             // 3\nstd.toString(42)                   // \"42\"\nstd.map(function(x) x * 2, [1,2,3])  // [2,4,6]",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "// Jsonnet performance:\n// 1. Evaluated at build/config time, not runtime\n// 2. Lazy evaluation (fields computed on access)\n// 3. No JIT or compilation needed\n// 4. Large configs can be slow to evaluate\n// 5. Use ext_vars for external values\n// 6. TLA (top-level arguments) for parametrization\n// 7. Good for config generation, not computation\n// 8. C++ and Go implementations available",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "// Jsonnet has no class/OOP system.\n// Objects + inheritance provide reuse.\n\n// Mixin pattern (like class)\nlocal Server = {\n  name: \"\",\n  port: 8080,\n  host: \"localhost\",\n};\n\n// Inheritance via +\nlocal HttpsServer = Server + {\n  port: 443,\n  tls: true,\n};\n\n// These are NOT classes in the OOP sense.\n// They are objects with merge semantics.\n// Use objects, local functions, and + for reuse.\n\n// Hidden fields (like private)\nlocal Config = {\n  :: hidden: \"not in output\",  // hidden from output\n  name: \"app\",\n};",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "// Jsonnet strings\nlocal name = \"Jsonnet\";\nlocal greeting = \"Hello, \" + name + \"!\";\n\n// String functions (std library)\nstd.length(name)           // 7\nstd.asciiUpper(name)       // \"JSONNET\"\nstd.asciiLower(name)       // \"jsonnet\"\nstd.substring(0, 3, name)  // \"Json\"\nstd.startsWith(name, \"Json\") // true\nstd.endsWith(name, \"net\")    // true\n\n// Split and join\nstd.split(\"a,b,c\", \",\")     // [\"a\", \"b\", \"c\"]\nstd.join(\"-\", [\"a\", \"b\"])    // \"a-b\"\n\n// Format\nstd.format(\"Hello, %s!\", name)  // \"Hello, Jsonnet!\"\n\n// Heredoc\nlocal multi = |||\n  Multiple\n  lines\n|||;",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Jsonnet error handling\n// assert (validation)\nlocal config = {\n  local port = super.port,\n  port: 443,\n  [if port < 1 || port > 65535 then error \"Invalid port: \" + std.toString(port)]: null,\n};\n\n// std.assert\nstd.assert(std.length(items) > 0, \"Items must not be empty\")\n\n// Error function\nif port < 0 then error \"Port must be positive\" else port\n\n// No try/catch. Errors halt evaluation.\n// Jsonnet is declarative — errors are\n// validation failures, not runtime exceptions.\n\n// Type checking via std.*\nstd.isString(x)\nstd.isNumber(x)\nstd.isArray(x)\nstd.isObject(x)",
          "difficulty": "N/A"
        },
        "imports": {
          "code": "// Jsonnet imports\n// import (replaces self)\nlocal config = import \"config.jsonnet\";\n\n// importstr (raw string)\nlocal template = importstr \"template.txt\";\n\n// importbin (binary)\nlocal data = importbin \"data.bin\";\n\n// Relative import\nlocal utils = import \"../lib/utils.libsonnet\";\n\n// Jsonnet library pattern\n// local lib = import \"lib/libsonnet.libsonnet\";\n\n// Note: Jsonnet uses import/importstr/importbin,\n// similar to ES-style but evaluated at build time.\n// No package manager; use file paths.",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "jsonnet-tip-imports",
          "title": "Imports and functions replace copy-paste YAML",
          "body": "Use Jsonnet functions and imports for DRY config, but pin import paths and avoid unbounded object comprehensions that explode rendered size.",
          "tag": "data",
          "status": "curated"
        }
      ],
      "categories": [
        "devops"
      ],
      "overview": "A data templating language — JSON with variables, functions, and imports. Remove duplication from Kubernetes manifests, Terraform state, and any JSON-heavy config workflow. DevOps teams templating complex JSON configs for Kubernetes, Grafana, and more — overrides and imports reduce YAML repetition and errors.\n\nTypical projects include Kubernetes configs, Grafana dashboards, CI/CD templates.",
      "learning_curve": "Moderate — Jsonnet's syntax is a superset of JSON with variables, functions, and comprehensions. The learning curve is in understanding lazy evaluation, self/super references, and the merge (+) semantics. Good for developers already using Kubernetes or Terraform. The std library is well-documented.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Jsonnet is a data templating language created by Google. Superset of JSON with functions, conditionals, and comprehensions. Used for Kubernetes config, Grafana dashboards, and Terraform integration. C++ and Go implementations. jsonnet-bundler for package management. Growing adoption in cloud-native ecosystem. Competing with CUE, Dhall, and Pkl for typed configuration.",
      "common_use_cases": [
        "Kubernetes configs",
        "Grafana dashboards",
        "CI/CD templates"
      ],
      "docs_url": "https://jsonnet.org/learning/tutorial.html",
      "best_for": [
        "templated Kubernetes configuration generation",
        "Grafana dashboard definition reuse",
        "DRY JSON and YAML generation for CI/CD",
        "Kubernetes and Grafana config templating with functions and imports"
      ],
      "weak_at": [
        "Simple flat config files where TOML or YAML human editing suffices",
        "Teams allergic to additional evaluation languages in CI pipelines",
        "Runtime hot-reload configs without pre-rendered JSON artifact steps"
      ],
      "official_url": "https://jsonnet.org/",
      "paradigm": [
        "functional",
        "configuration",
        "JSON"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative configuration or build DSL (not a general-purpose programming language)",
        "runtime": "Evaluated by a host tool (Ansible, Terraform, Make, Nix, etc.) — no standalone VM",
        "memory": "Managed by the host tool running the configuration or build"
      }
    },
    {
      "id": "dhall",
      "name": "Dhall",
      "color": "#dfafff",
      "description": "A programmable configuration language that is total (always terminates) and typed. Guarantees no infinite loops in configs; its type system catches errors before runtime.",
      "whoItIsFor": "Developers wanting guaranteed-terminating, importable config — a functional language for type-safe, hashable configs without Turing-completeness.",
      "commonUses": [
        "Typed configuration",
        "Kubernetes",
        "CI/CD"
      ],
      "patterns": [
        {
          "title": "Config",
          "code": "let port = 8080\nin { name = \"app\", port }",
          "explanation": "Record expression — Dhall configs are typed records that the language validates before evaluation."
        },
        {
          "title": "Function",
          "code": "λ(name : Text) → \"Hello, \" ++ name ++ \"!\"",
          "explanation": "Dhall is typed and total — functions are ordinary values."
        },
        {
          "title": "Import",
          "code": "./common.dhall",
          "explanation": "Imports fetch other expressions; hashes can pin integrity."
        },
        {
          "title": "Nix/JSON/YAML export boundary - Dhall's configuration bridge",
          "code": "-- Dhall exports to multiple config formats:\n-- dhall-to-yaml, dhall-to-json, dhall-to-nix\n\n-- Generate Kubernetes YAML\nlet Prelude = https://prelude.dhall-lang.org/package.dhall\n\nlet deployment =\n      { apiVersion = \"apps/v1\"\n      , kind       = \"Deployment\"\n      , metadata   = { name = \"myapp\" }\n      , spec       = { replicas = 3 }\n      }\n\nin  deployment\n\n-- $ dhall-to-yaml <<< './deployment.dhall'\n-- apiVersion: apps/v1\n-- kind: Deployment\n-- ...",
          "explanation": "Dhall's polyglot boundary is its export pipeline: dhall-to-yaml, dhall-to-json, dhall-to-nix, and dhall-to-bash. Dhall evaluates type-safe, hash-verified configuration and produces YAML, JSON, or Nix expressions consumed by other tools. Import integrity (sha256 hashes) ensures reproducibility. This makes Dhall a configuration-type-safe layer in polyglot CI/CD pipelines — it verifies types and hashes before exporting to whatever format the next tool needs."
        }
      ],
      "libraries": [
        {
          "name": "Dhall docs",
          "url": "https://dhall-lang.org/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "Dhall language",
          "url": "https://dhall-lang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "-- Dhall variables (let bindings)\nlet x = 42\nlet name = \"Dhall\"\n\n-- Type annotations\nlet port : Natural = 8080\n\n-- Let without 'in' is a toplevel binding\nlet greeting = \"Hello, \" ++ name\n\nin  greeting",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "-- Dhall conditionals\nif True then \"yes\" else \"no\"\n\n-- merge for sum types (more common)\nlet Status = < Running | Stopped | Error : Text >\n\nlet show = merge\n  { Running  = \"running\"\n  , Stopped  = \"stopped\"\n  , Error    = \\(msg : Text) -> \"error: \" ++ msg\n  }\n\nin  show Status.Running",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "-- Dhall has no loops; use recursion or built-ins\n-- Natural fold\nNatural/fold 5 Text (\\(x : Text) -> x ++ \"!\") \"start\"\n\n-- List operations\nlet items = [1, 2, 3, 4, 5]\n\nlet doubled = List/map Natural Natural (\\(n : Natural) -> n * 2) items\n\nlet total = List/fold Natural items Natural (\\(n : Natural) -> \\(acc : Natural) -> n + acc) 0\n\nin  total",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "-- Dhall functions\nlet add = \\(a : Natural) -> \\(b : Natural) -> a + b\n\nin  add 3 5  -- 8\n\n-- Function with type annotation\nlet greet : Text -> Text = \\(name : Text) -> \"Hello, \" ++ name\n\n-- Higher-order\nlet apply = \\(f : Natural -> Natural) -> \\(x : Natural) -> f x\n\nin  apply (\\(n : Natural) -> n + 1) 41",
          "difficulty": "basic"
        },
        "performance": {
          "code": "-- Dhall performance:\n-- 1. Type checking is the main cost (slow for large configs)\n-- 2. Evaluation is lazy and hash-consed\n-- 3. Imports are fetched and cached by hash\n-- 4. No runtime -- Dhall evaluates to JSON/YAML/etc.\n-- 5. dhall freeze locks imports to content hashes\n-- 6. Large configs (>10MB) can be slow to type-check\n\n-- Freeze imports for reproducibility\ndhall freeze --all config.dhall",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "-- Dhall uses record types, not classes\nlet Point = { x : Double, y : Double }\n\nlet origin : Point = { x = 0.0, y = 0.0 }\n\n-- Union types (sum types)\nlet Shape = < Circle : { r : Double } | Rect : { w : Double, h : Double } >\n\n-- Pattern match with merge\nlet area = \\(s : Shape) ->\n      merge\n        { Circle = \\(c : { r : Double }) -> 3.14159 * c.r * c.r\n        , Rect   = \\(r : { w : Double, h : Double }) -> r.w * r.h\n        }\n        s",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "-- Dhall strings\nlet greeting = \"Hello, Dhall!\"\n\n-- String interpolation\nlet name = \"World\"\nlet msg = \"Hello, ${name}!\"\n\n-- Multiline strings\nlet desc = ''\n    This is a\n    multiline string\n    in Dhall\n    ''\n\n-- No Text/length builtin — use List/length on Text/toList if needed",
          "difficulty": "basic"
        },
        "errors": {
          "code": "-- Dhall errors are type errors, caught at check time\n-- No runtime exceptions: if it type-checks, it won't crash\n\n-- Optional values for potential absence\nlet maybe : Optional Natural = Some 42\nlet none : Optional Natural = None Natural\n\n-- Handle Optional with merge\nlet show = \\(m : Optional Natural) ->\n      merge\n        { Some = Natural/show\n        , None = \"N/A\"\n        }\n        m",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "-- Dhall imports (fetched by hash)\nlet Prelude = https://prelude.dhall-lang.org/package.dhall\n\nlet map = Prelude.List.map\n\n-- Local file imports\nlet config = ./config.dhall\n\n-- Import integrity check (hash pinning)\nlet safe = https://example.com/lib.dhall\n        sha256:abc123...\n\nin  map Natural Natural (\\(n : Natural) -> n * 2) [1, 2, 3]",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "dhall-tip-purity",
          "title": "Dhall is pure — side effects belong outside",
          "body": "Keep Dhall configs total and import-safe. Push IO and secrets to the deployment layer so configs stay reproducible.",
          "tag": "data",
          "status": "curated"
        }
      ],
      "categories": [
        "devops"
      ],
      "overview": "A programmable configuration language that is total (always terminates) and typed. Guarantees no infinite loops in configs; its type system catches errors before runtime. Developers wanting guaranteed-terminating, importable config — a functional language for type-safe, hashable configs without Turing-completeness.\n\nTypical projects include Typed configuration, Kubernetes, CI/CD.",
      "learning_curve": "Moderate for developers familiar with Haskell — the syntax and type system are similar. The key shift is thinking in total functions (no exceptions, no IO). Import hashing and the lack of Turing-completeness can feel restrictive. Gentle once the paradigm clicks.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Dhall is a configuration language, not a general-purpose language. dhall-lang.org hosts the standard library. Integrates with Kubernetes, Terraform, Nix, and CI/CD. dhall-to-yaml, dhall-to-json, dhall-to-nix converters. Growing adoption in infrastructure-as-code. Small but principled community.",
      "common_use_cases": [
        "Typed configuration",
        "Kubernetes",
        "CI/CD"
      ],
      "docs_url": "https://docs.dhall-lang.org/",
      "best_for": [
        "typed programmable configuration",
        "safe configuration reuse patterns",
        "policy-as-code replacement for YAML",
        "Total functional configuration importing typed Dhall expressions safely"
      ],
      "weak_at": [
        "Imperative ops teams preferring Ansible variables without FP learning",
        "Windows-centric workflows without Dhall binary distribution familiarity",
        "Ad hoc shell exports where Dhall import graph feels heavyweight"
      ],
      "official_url": "https://dhall-lang.org/",
      "paradigm": [
        "functional",
        "configuration",
        "total"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative configuration or build DSL (not a general-purpose programming language)",
        "runtime": "Evaluated by a host tool (Ansible, Terraform, Make, Nix, etc.) — no standalone VM",
        "memory": "Managed by the host tool running the configuration or build"
      }
    },
    {
      "id": "cue",
      "name": "CUE",
      "color": "#3e8ed0",
      "description": "A constraint-based configuration language — validates and generates data. Unifies types, schemas, and values into a single coherent model for configuration management.",
      "whoItIsFor": "Platform engineers validating Kubernetes YAML and API schemas — unifies validation, templating, and data into one declarative constraint system.",
      "commonUses": [
        "Config validation",
        "Schema definition",
        "Kubernetes"
      ],
      "patterns": [
        {
          "title": "Constraint",
          "code": "name: string\nport: int & >0 & <65536\nname: \"myapp\"\nport: 8080",
          "explanation": "Types plus constraints plus values — CUE merges validation and data generation in one language."
        },
        {
          "title": "Constraints",
          "code": "port: int & >0 & <65536\nname: string",
          "explanation": "Types plus constraints plus values — CUE merges validation and data generation in one language."
        },
        {
          "title": "List comprehension",
          "code": "[1, 2, 3]\n\nnums: [ string ]",
          "explanation": "Types describe allowed shapes; lists and structs compose."
        },
        {
          "title": "Go API / validation boundary - CUE's polyglot bridge",
          "code": "// CUE's boundary is its Go API and export formats\n// CUE evaluates configs and exports to multiple formats\n\n// From Go code:\n//   inst, _ := runtime.Compile(\"\", cfg)\n//   result, _ := inst.Value().MarshalJSON()\n\n// Export to different formats:\ncue export config.cue --out yaml\n    cue export config.cue --out json\n    cue export config.cue --out toml\n\n// Validate Kubernetes configs:\ncue vet deployment.yaml schema.cue\n\n// Generate Go types from CUE:\ncue generate go config.cue",
          "explanation": "CUE's polyglot boundary is twofold: (1) the Go API, which lets Go programs load, evaluate, and extract CUE values at runtime; and (2) multi-format export, which converts CUE constraints to YAML, JSON, or TOML for consumption by Kubernetes, Terraform, and other tools. The `cue vet` command validates existing configs against CUE schemas. `cue generate` creates Go types from CUE definitions. This makes CUE the validation and configuration layer in polyglot pipelines."
        }
      ],
      "libraries": [
        {
          "name": "CUE docs",
          "url": "https://cuelang.org/docs/",
          "type": "Docs"
        }
      ],
      "docs": [
        {
          "name": "CUE language",
          "url": "https://cuelang.org/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// CUE variables (fields in structs)\npackage myapp\n\n// Unification: values are constraints, not assignments\nname: \"hello\"\ncount: int\npi: 3.14159\n\n// Default values with constraints\nport: int | *8080  // defaults to 8080\n\n// Let expressions\nlet x = 42\nresult: x + 8",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// CUE conditionals via comprehensions and defaults\n// No if/else; use disjunctions and defaults\n\nsize: \"large\" if count > 100\ncount: int & >0\n\n// Default with priority\nlabel: string | *\"default\"\n\n// Discriminated by field value\nconfig: {\n    if env == \"prod\" {\n        replicas: 3\n    }\n    if env == \"dev\" {\n        replicas: 1\n    }\n}",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "// CUE comprehensions (not traditional loops)\nitems: [1, 2, 3, 4, 5]\n\ndoubled: [for x in items {x * 2}]\nevens: [for x in items if x mod 2 == 0 {x}]\n\n// Dictionary comprehension\nnames: [\"Alice\", \"Bob\"]\nnameMap: {for n in names {n: len(n)}}\n\n// No while/for loops -- CUE is declarative\n// All iteration is via comprehensions",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "CUE has no user-defined functions.\n// The closest concept is parameterized definitions (#Template):\n//   #Deployment: { name: string, image: string, port: int | *8080 }\n//   myapp: #Deployment & { name: \"myapp\" }\n//\n// Built-in functions exist: len(), strings.ToLower(), math.Max(), etc.\n// But users cannot define their own functions.\n// Use constraints and defaults instead of function calls.",
          "difficulty": "N/A"
        },
        "performance": {
          "code": "// CUE performance:\n// 1. Evaluation (unification) is the main cost\n// 2. CUE compiles to a DAG for efficient merging\n// 3. No runtime -- CUE evaluates at config time\n// 4. Designed for large Kubernetes configs\n// 5. Much faster than raw JSON/YAML validation\n// 6. cue eval --out yaml for final output\n\n// Bulk eval\ncue eval ./... --out yaml",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "// CUE uses definitions (like types), not classes\n#Person: {\n    name:  string\n    age:   int & >=0\n    email?: string  // optional\n}\n\n// Instantiate\nalice: #Person & {\n    name: \"Alice\"\n    age:  30\n}\n\n// Closed definitions (no extra fields)\n#Point: close({\n    x: float\n    y: float\n})",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": "// CUE strings\nname: \"Hello, CUE!\"\n\n// Interpolation\nmsg: \"Hello, \\(name)!\"\n\n// Multiline strings\ndescription: \"\"\"\n  This is a multiline\n  string in CUE.\n  \"\"\"\n\n// String operations via builtins\nlower: strings.ToLower(name)\nhas: strings.Contains(name, \"Hello\")",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// CUE errors are validation failures, not exceptions\n// The type system catches errors at eval time\n\n// Required field missing → error\nalice: #Person & {\n    name: \"Alice\"\n    // age is required → error!\n}\n\n// Constraint violation → error\nbob: #Person & {\n    name: \"Bob\"\n    age: -5  // violates int & >=0\n}\n\n// Run: cue eval to see errors\n// cue vet for validation",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// CUE imports\nimport \"strings\"\nimport \"math\"\nimport \"list\"\n\n// Use imported packages\nlower: strings.ToLower(\"HELLO\")\nmax: math.Max(10, 20)\nlength: list.Sort([3, 1, 2])\n\n// Import local files\npackage myapp\n\n// cue.mod/pkg for external packages\ncue get go k8s.io/api/apps/v1",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "cue-tip-unify-not-eval",
          "title": "Unify constraints; do not treat Cue like a general language",
          "body": "Cue unifies values and constraints. Prefer closed schemas and explicit defaults over ad-hoc evaluation that recreates a programming language.",
          "tag": "data",
          "status": "curated"
        }
      ],
      "categories": [
        "devops"
      ],
      "overview": "A constraint-based configuration language — validates and generates data. Unifies types, schemas, and values into a single coherent model for configuration management. Platform engineers validating Kubernetes YAML and API schemas — unifies validation, templating, and data into one declarative constraint system.\n\nTypical projects include Config validation, Schema definition, Kubernetes.",
      "learning_curve": "Moderate for developers familiar with JSON/YAML — the syntax is familiar. The key shift is thinking in constraints (unification), not assignments. Understanding definitions (#), optional fields (?), and closed structs takes practice. The Go API requires Go knowledge.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Developed by Marcel van Loo (ex-Google, ex-Borg). Used by Istio, Docker, and Kubernetes communities for configuration validation. cue command-line tool is the primary interface. Integration with Go via cuelang.org/go/cue. Growing adoption in cloud-native ecosystem. Small but active community.",
      "common_use_cases": [
        "Config validation",
        "Schema definition",
        "Kubernetes"
      ],
      "docs_url": "https://cuelang.org/docs/",
      "best_for": [
        "data validation and schema definition",
        "configuration policy enforcement",
        "large-scale configuration sanity checking",
        "Unified configuration and schema validation with CUE constraints"
      ],
      "weak_at": [
        "Quick JSON editing without schema language investment or cue eval steps",
        "Legacy XML SOAP stacks without CUE tooling in existing CI chains",
        "Teams mandating JSON Schema exclusively for contract compatibility"
      ],
      "official_url": "https://cuelang.org/",
      "paradigm": [
        "declarative",
        "constraint-based",
        "schema"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative configuration or build DSL (not a general-purpose programming language)",
        "runtime": "Evaluated by a host tool (Ansible, Terraform, Make, Nix, etc.) — no standalone VM",
        "memory": "Managed by the host tool running the configuration or build"
      }
    },
    {
      "id": "regex",
      "name": "Regular Expressions",
      "color": "#4b8bbe",
      "description": "A pattern-matching mini-language embedded in nearly every programming language and tool. Not a standalone language, but a universal skill: every developer needs regex fluency.",
      "whoItIsFor": "Every developer who searches, validates, or transforms text — essential for log parsing, data cleaning, form validation, and search across languages.",
      "commonUses": [
        "Text search",
        "Input validation",
        "Log parsing",
        "Find-and-replace"
      ],
      "patterns": [
        {
          "title": "Email-ish",
          "code": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}",
          "explanation": "Simplified email pattern — a practical example of character classes, anchors, and repetition."
        },
        {
          "title": "Character class",
          "code": "[A-Za-z][A-Za-z0-9_]*",
          "explanation": "Matches identifiers: letter first, then letters, digits, or underscore."
        },
        {
          "title": "Non-greedy repeat",
          "code": "<tag[^>]*?>.*?</tag>",
          "explanation": "`?` after `*` or `+` prefers the shortest match — useful for XML-like text."
        },
        {
          "title": "Engine/host boundary - Regex's polyglot bridge",
          "code": "# Regex's polyglot boundary is the engine/host interface:\n# regex patterns run inside a host language engine.\n\n# Python\nimport re\nmatch = re.search(r'(?P<email>[\\w.]+@[\\w.]+)', text)\nif match:\n    print(match.group('email'))\n\n# JavaScript\nconst match = text.match(/(?<email>[\\w.]+@[\\w.]+)/);\nif (match) console.log(match.groups.email);\n\n# PCRE (C)\n# pcre2_match(compiled_pattern, subject, ...)\n\n# The boundary bridges:\n# Regex (pattern description) <-> Host language (execution)\n# Different engines have different features:\n# PCRE: named groups, conditionals, recursion\n# JavaScript: limited features (ES2024+ improving)\n# Python: re module (PCRE-like)\n# Rust: fancy-regex (no lookbehind in basic)\n# Go: RE2 (no backtracking, no backreferences)",
          "explanation": "Regex's polyglot boundary is the engine/host interface: regex patterns are embedded in host languages (Python, JavaScript, Go, Rust, etc.) and evaluated by engine-specific implementations. Each engine has different capabilities (PCRE: conditionals, recursion; JavaScript: limited; RE2: no backtracking; Rust: varied). This makes regex a universal pattern bridge — the same pattern language adapts to different engines with different feature sets and performance characteristics."
        }
      ],
      "libraries": [
        {
          "name": "Regexr",
          "url": "https://regexr.com/",
          "type": "Tester"
        }
      ],
      "docs": [
        {
          "name": "Regular-Expressions.info",
          "url": "https://www.regular-expressions.info/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# Regex has no variables.\n# Regular expressions are pattern descriptions,\n# not programs with mutable state.\n#\n# Capture groups act like \"variables\":\n#   (\\d+) captures a digit sequence\n#   \\1 backreferences the first capture\n#\n# Named captures (PCRE/Python):\n#   (?P<name>\\w+) captures into 'name'\n#   (?<email>[\\w.]+@[\\w.]+) captures into 'email'\n#\n# In a host language (Python example):\n#   match = re.search(r'(?P<name>\\w+)', text)\n#   name = match.group('name')\n#\n# Regex itself has no variable declaration,\n# assignment, or scoping mechanism.",
          "difficulty": "N/A"
        },
        "conditionals": {
          "code": "# Regex conditionals\n# Alternation (like if/else)\ncat|dog           # matches \"cat\" OR \"dog\"\n\n# Conditional groups (PCRE)\n(?(1)yes|no)     # if group 1 matched, match 'yes'; else 'no'\n\n# Lookahead (positive)\nfoo(?=bar)       # \"foo\" only if followed by \"bar\"\n\n# Lookahead (negative)\nfoo(?!bar)       # \"foo\" only if NOT followed by \"bar\"\n\n# Lookbehind (positive)\n(?<=foo)bar      # \"bar\" only if preceded by \"foo\"\n\n# Lookbehind (negative)\n(?<!foo)bar      # \"bar\" only if NOT preceded by \"foo\"\n\n# Character class conditionals\n[aeiou]          # matches any vowel (like 'in')\n[^aeiou]         # matches any non-vowel",
          "difficulty": "N/A"
        },
        "loops": {
          "code": "# Regex loops (quantifiers)\n# These are the closest thing to loops in regex:\n\na*        # zero or more 'a' (like while loop)\na+        # one or more 'a'\na?        # zero or one 'a' (like if-optional)\na{3}      # exactly 3 'a' (like for loop)\na{3,5}    # between 3 and 5 'a'\na{3,}     # 3 or more 'a'\n\n# Greedy vs lazy\na.*b      # greedy (matches as much as possible)\na.*?b     # lazy (matches as little as possible)\n\n# Possessive (no backtracking)\na++b      # matches 'a' greedily, never gives back\n\n# Recursive patterns (PCRE)\n(\\((?:[^()]|(?1))*\\))  # matches nested parentheses",
          "difficulty": "N/A"
        },
        "functions": {
          "code": "# Regex has no user-defined functions.\n# Regex provides built-in constructs:\n#\n# Character classes (like type checks)\n\\d       # digit [0-9]\n\\w       # word char [a-zA-Z0-9_]\n\\s       # whitespace\n\\b       # word boundary\n\n# Anchors (like assertions)\n^        # start of string/line\n$        # end of string/line\n\\A       # absolute start\n\\Z       # absolute end\n\n# Groups (like sub-expressions)\n(pattern)           # capturing group\n(?:pattern)         # non-capturing group\n(?P<name>pattern)   # named capture\n\n# Flags (like global config)\n(?i)     # case-insensitive\n(?m)     # multiline\n(?s)     # dotall (dot matches newline)\n(?x)     # verbose (allow comments)",
          "difficulty": "N/A"
        },
        "performance": {
          "code": "# Regex performance:\n# 1. Compiled regex is faster than interpreted\n# 2. Catastrophic backtracking is the main risk\n# 3. Use possessive quantifiers to prevent\n# 4. Atomic groups (?>pattern) prevent backtracking\n# 5. Anchors (^$) reduce search space\n# 6. Non-capturing groups are faster\n# 7. Specific character classes > dot (.)\n# 8. Pre-compile regex when used repeatedly\n# 9. Avoid nested quantifiers: (a+)+\n# 10. Use regex debugger for complex patterns",
          "difficulty": "N/A"
        },
        "classes": {
          "code": "# Regex has no class/OOP system.\n# Regex is a pattern language, not a programming language.\n# It describes text patterns using a declarative syntax.\n#\n# There are no objects, inheritance, or methods.\n# Character classes like [a-z] are the closest\n# concept, but they represent character sets,\n# not OOP classes.\n#\n# Named groups provide a form of labeling:\n#   (?P<email>[\\w.]+@[\\w.]+)\n# But this is data capture, not class definition.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# Regex operates ON strings (its primary purpose).\n# It does not have its own string type.\n#\n# Metacharacters (special characters):\n. \\ ^ $ | ? * + ( ) [ ] { }\n\n# Escaping\n\\.       # literal dot\n\\\\       # literal backslash\n\\n       # newline\n\\t       # tab\n\n# Unicode\n\\p{L}    # any letter (Unicode category)\n\\p{N}    # any number\n\\p{Script=Hiragana}  # Hiragana script\n\n# Character classes\n[a-z]    # lowercase letters\n[A-Za-z] # all letters\n[^0-9]   # non-digits",
          "difficulty": "N/A"
        },
        "errors": {
          "code": "# Regex error handling\n# Regex has no try/catch mechanism.\n# Errors are syntax errors reported by the engine:\n#\n# - Unbalanced parentheses\n# - Invalid escape sequence\n# - Invalid character class\n# - Invalid quantifier\n# - Recursion limit exceeded\n#\n# Runtime failures:\n# - Catastrophic backtracking (timeout)\n# - Stack overflow (recursive patterns)\n# - Invalid backreference\n#\n# In a host language (Python example):\n# try:\n#     re.compile(r'(unclosed')\n# except re.error as e:\n#     print(f'Regex error: {e}')\n#\n# Regex errors are always host-language errors.",
          "difficulty": "N/A"
        },
        "imports": {
          "code": "# Regex has no import/module system.\n# A regex pattern is a self-contained expression.\n#\n# Some engines support:\n# - Subpattern definitions (PCRE): (?(DEFINE)...)\n# - Regex composition in host language:\n#   Python: r'(' + YEAR + r')-(' + MONTH + r')'\n#   JavaScript: new RegExp(year + '-' + month)\n#   PCRE: (?&name) for subpattern calls\n#\n# No package manager, no file imports.\n# Regex patterns are embedded in host code\n# or stored in configuration files.",
          "difficulty": "N/A"
        }
      },
      "tips": [
        {
          "id": "regex-tip-flavor",
          "title": "Regex flavors are incompatible",
          "body": "PCRE, JS, Python, and POSIX disagree on lookbehind, Unicode, and greediness. State the engine before debugging the pattern.",
          "tag": "language",
          "status": "curated"
        }
      ],
      "categories": [
        "text",
        "pattern"
      ],
      "overview": "Regular expressions are a pattern-matching mini-language embedded in many host languages — not a standalone application programming language.",
      "learning_curve": "Moderate for basics, very steep for advanced — basic regex (literal match, character classes, quantifiers) is learnable in hours. Lookahead/lookbehind, backreferences, conditional patterns, recursive patterns, and catastrophic backtracking prevention require significant study. Each engine (PCRE, JavaScript, RE2, etc.) has different features, adding complexity.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "Regex (regular expressions) is a pattern-matching language, not a programming language. Originated in formal language theory (1950s). Standardized in POSIX and PCRE. Every major language has regex support. PCRE2 is the most feature-rich engine. RE2 (Google) guarantees linear time. JavaScript regex is improving (ES2024+). Used for validation, parsing, search-and-replace, and log analysis.",
      "common_use_cases": [
        "Text search",
        "Input validation",
        "Log parsing",
        "Find-and-replace"
      ],
      "docs_url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions",
      "best_for": [
        "pattern-based text search and extraction",
        "input validation and sanitisation",
        "log parsing and text replacement automation",
        "Log parsing, input validation, and search-and-replace in many host languages"
      ],
      "weak_at": [
        "General application architecture replacing readable code with opaque patterns",
        "Complex hierarchical parsing better handled by parser generators",
        "Teams without regex testing discipline leading to catastrophic backtracking"
      ],
      "official_url": "https://www.regular-expressions.info/",
      "paradigm": [
        "pattern-matching",
        "declarative",
        "text"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Pattern notation (not a standalone general-purpose language)",
        "runtime": "Evaluated by a host regex engine (language, tool, or library specific)",
        "memory": "Managed by the host tool executing the pattern"
      }
    },
    {
      "id": "rego",
      "name": "Rego",
      "color": "#6C8EBF",
      "description": "Policy-as-code language used with Open Policy Agent. Rego lets you write authorization, admission, and compliance rules as queries over structured data.",
      "whoItIsFor": "Platform, security, and DevOps teams that need versioned policies for services, Kubernetes, and CI guardrails.",
      "commonUses": [
        "Authorization policies",
        "Kubernetes admission control",
        "Compliance checks",
        "CI guardrails"
      ],
      "patterns": [
        {
          "title": "Deny traffic that is not HTTPS",
          "code": "package example\n\ndefault allow := false\n\nallow if {\n  input.request.scheme == \"https\"\n}",
          "explanation": "Rego rules read like queries over input data; here the policy only allows HTTPS requests."
        },
        {
          "title": "Allow admins in production",
          "code": "package example\n\ndefault allow := false\n\nallow if {\n  input.env == \"prod\"\n  \"admin\" in input.user.roles\n}",
          "explanation": "Set membership and field checks are common in OPA policies."
        },
        {
          "title": "Check membership in a requested scope",
          "code": "package example\n\nallowed if {\n  some group in input.user.groups\n  group == \"security\"\n}",
          "explanation": "Rules can quantify over arrays and bind temporary variables with some."
        }
      ],
      "libraries": [
        {
          "name": "Open Policy Agent",
          "url": "https://www.openpolicyagent.org/",
          "type": "Policy engine"
        }
      ],
      "docs": [
        {
          "name": "OPA policy language docs",
          "url": "https://www.openpolicyagent.org/docs/latest/policy-language/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "package example\n\n# Bind values in rule bodies with :=\nadmin if {\n  some role in input.user.roles\n  role == \"admin\"\n}\n\n# Default when no other rule matches\ndefault allow := false",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "package example\n\ndefault allow := false\n\nallow if {\n  input.method == \"GET\"\n  input.path == \"/health\"\n}\n\ndeny if {\n  not allow\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": "package example\n\n# some iterates array elements\ngroups_contains[g] if {\n  some g in input.user.groups\n}\n\n# Comprehension builds a set from matches\nviolations[msg] if {\n  some r in input.resources\n  r.public == true\n  msg := sprintf(\"resource %v is public\", [r.id])\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "package example\n\n# Reusable rule (function-like)\nis_admin if {\n  \"admin\" in input.user.roles\n}\n\nallow if {\n  is_admin\n}\n\n# Built-ins: count, contains, json.marshal, ...\nallow if {\n  count(input.user.permissions) > 0\n}",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Policy evaluation is declarative — OPA evaluates rules against input JSON. Latency depends on bundle size, rule count, and how much external data you load, not on imperative tuning tricks.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "# Rego has no classes or OOP.\n# Organize logic with packages and rules:\n\npackage authz\n\ndefault allow := false\n\nallow if {\n  data.rbac[input.user.role].permissions[_] == input.action\n}\n\n# data.* reads bundled JSON; input.* is the request document.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "package example\n\nallow if {\n  input.env == \"prod\"\n  startswith(input.path, \"/api/\")\n  input.user.email != \"\"\n}\n\n# String ops: contains, sprintf, concat, split, ...\ndeny[msg] if {\n  not endswith(input.host, \".internal\")\n  msg := \"external host not allowed\"\n}",
          "difficulty": "basic"
        },
        "errors": {
          "code": "package example\n\n# Undefined results are common — use default rules\ndefault allow := false\n\n# A rule body that cannot be satisfied simply does not match\nallow if {\n  input.signed == true\n  input.token != \"\"\n}\n\n# Test with opa test and explicit input fixtures; failures usually mean input shape mismatch.",
          "difficulty": "basic"
        },
        "imports": {
          "code": "package example\n\nimport data.kubernetes.admission\nimport data.authz.is_admin\n\nimport future.keywords.if\nimport future.keywords.in\n\nallow if {\n  is_admin\n}",
          "difficulty": "basic"
        }
      },
      "categories": [
        "policy"
      ],
      "overview": "Policy-as-code language used with Open Policy Agent. Rego lets you write authorization, admission, and compliance rules as queries over structured data. Platform, security, and DevOps teams that need versioned policies for services, Kubernetes, and CI guardrails.\n\nTypical projects include Authorization policies, Kubernetes admission control, Compliance checks.",
      "learning_curve": "Moderate. The syntax is compact, but the set-oriented way of thinking is different from imperative languages.",
      "good_for_teaching": "challenging",
      "ecosystem_notes": "OPA evaluates Rego against JSON-like input. It shows up in Kubernetes, API gateways, and CI policy checks.",
      "docs_url": "https://www.openpolicyagent.org/docs/",
      "tips": [
        {
          "id": "rego-tip-default-rules-are-your-fallback",
          "title": "Default rules are your fallback",
          "body": "In Rego, default rules return a fallback value when no other rule fires. Use them to avoid undefined results and make intent explicit: write default allow := false so that denial is the safe baseline.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "rego-tip-input-is-your-only-data-source",
          "title": "input is your only data source",
          "body": "Rego policies read from the input document and external data — there are no databases, network calls, or side effects. If a test fails, check that the input JSON has the shape the policy expects, not that some hidden state changed.",
          "tag": "systems",
          "status": "curated"
        },
        {
          "id": "rego-tip-test-with-opa-test-and-conftest",
          "title": "Test policies with opa test and conftest",
          "body": "Run opa test . to verify Rego rules against example inputs before deploying. conftest can test Kubernetes manifests or Terraform plans against your policies. Small, targeted test inputs beat large, fragile data files.",
          "tag": "data",
          "status": "curated"
        }
      ],
      "best_for": [
        "Policy as code with OPA",
        "Kubernetes admission control rules",
        "cross-service authorisation policy enforcement",
        "Open Policy Agent rules enforcing Kubernetes admission and RBAC policies"
      ],
      "weak_at": [
        "Imperative business logic better expressed in application languages",
        "Teams without policy-as-code operational maturity or OPA sidecar appetite",
        "Legacy mainframe security models without JSON-shaped decision inputs"
      ],
      "official_url": "https://www.openpolicyagent.org/docs/latest/policy-language/",
      "paradigm": [
        "declarative",
        "policy",
        "logic"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative configuration or build DSL (not a general-purpose programming language)",
        "runtime": "Evaluated by a host tool (Ansible, Terraform, Make, Nix, etc.) — no standalone VM",
        "memory": "Managed by the host tool running the configuration or build"
      }
    },
    {
      "id": "promql",
      "name": "PromQL",
      "color": "#E6522C",
      "description": "Prometheus Query Language for time-series metrics. You use it to aggregate, rate, and alert on operational signals.",
      "whoItIsFor": "SRE, DevOps, and platform teams that need to ask questions of metrics without exporting data into another system first.",
      "commonUses": [
        "Metrics dashboards",
        "Alerting rules",
        "SLO burn-rate checks",
        "Capacity planning"
      ],
      "patterns": [
        {
          "title": "Request rate over five minutes",
          "code": "rate(http_requests_total[5m])",
          "explanation": "rate() turns a counter into a per-second trend over a time window."
        },
        {
          "title": "Error ratio for an alert",
          "code": "sum(rate(http_requests_total{status=~\"5..\"}[5m])) / sum(rate(http_requests_total[5m]))",
          "explanation": "Combine rates with label filters to build an error budget or alert threshold."
        },
        {
          "title": "95th percentile latency",
          "code": "histogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))",
          "explanation": "Histogram buckets plus histogram_quantile are the standard Prometheus latency pattern."
        }
      ],
      "libraries": [
        {
          "name": "Prometheus docs",
          "url": "https://prometheus.io/docs/prometheus/latest/querying/basics/",
          "type": "Monitoring docs"
        }
      ],
      "docs": [
        {
          "name": "PromQL basics",
          "url": "https://prometheus.io/docs/prometheus/latest/querying/basics/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# PromQL has no assignable variables.\n# Use label matching and range vectors instead of binding names.\n\n# Instant vector — one sample per series\nhttp_requests_total{job=\"api\", status=\"200\"}\n\n# Range vector — window for rate()/increase()\nrate(http_requests_total{job=\"api\"}[5m])",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# Comparison operators filter series at query time\nhttp_requests_total > 100\n\n# Boolean logic (both sides must align on labels)\n(http_errors_total / http_requests_total) > 0.05\n\n# unless drops series that match the right-hand side\nnode_cpu_seconds_total unless on(cpu) node_cpu_seconds_total{mode=\"idle\"}",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "# Set-based language — aggregate over matching series\nsum by (instance) (rate(http_requests_total[5m]))\n\n# Count matching time series\ncount(http_requests_total{status=~\"5..\"})\n\n# Group aggregation preserves label groups\navg by (job, instance) (node_memory_Active_bytes)",
          "difficulty": "basic"
        },
        "functions": {
          "code": "# Counter trend — per-second rate over a range\nrate(http_requests_total[5m])\n\n# Histogram quantile from bucketed series\nhistogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))\n\n# Time shift for comparisons\nhttp_requests_total offset 1d",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "Query cost depends on label cardinality, scrape interval, lookback range, and how many series match selectors. High-cardinality labels and long ranges over many metrics can slow dashboards and alerts.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "# PromQL has no classes or user-defined types.\n# Metrics are identified by name plus label sets;\n# types are counter, gauge, histogram, or summary at instrumentation time.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# Label values are strings — match with = or regex =~\nhttp_requests_total{status=\"200\"}\nhttp_requests_total{status=~\"5..\"}\nhttp_requests_total{method!~\"GET|HEAD\"}\n\n# Escape regex metacharacters in label values when needed",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# Division by zero or missing data yields NaN — it propagates through math\na_metric / b_metric\n\n# Empty vector if no series match — easy to misread as \"zero\"\nnonexistent_metric{job=\"missing\"}\n\n# Use or vector(0) only when you truly mean \"treat missing as zero\"",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "# PromQL has no imports.\n# Reference metrics by name and label selectors in the query text:\n\nsum(rate(http_requests_total{job=\"api\"}[5m])) by (status)\n\n# Recording rules can predefine reusable expressions in Prometheus config (outside the query language itself).",
          "difficulty": "N/A"
        }
      },
      "categories": [
        "data",
        "query",
        "observability"
      ],
      "overview": "Prometheus Query Language for time-series metrics. You use it to aggregate, rate, and alert on operational signals. SRE, DevOps, and platform teams that need to ask questions of metrics without exporting data into another system first.\n\nTypical projects include Metrics dashboards, Alerting rules, SLO burn-rate checks.",
      "learning_curve": "Moderate. The syntax is short, but label matching, ranges, and aggregation semantics take practice.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "PromQL is the operational language you reach for when the question is “what did the system do over time?”",
      "docs_url": "https://prometheus.io/docs/prometheus/latest/querying/basics/",
      "tips": [
        {
          "id": "promql-tip-labels",
          "title": "Label matching and range vectors",
          "body": "PromQL bugs are usually label mismatch, rate() over wrong ranges, or NaN propagation — not dependency drift.",
          "tag": "query",
          "status": "curated"
        }
      ],
      "best_for": [
        "Prometheus metrics querying",
        "SLO burn-rate alerting rules",
        "real-time infrastructure monitoring dashboards",
        "Prometheus metrics querying for SRE dashboards and alert rule authoring"
      ],
      "weak_at": [
        "Business reporting on relational warehouses without Prometheus scrape model",
        "Ad hoc CSV analysis outside time-series label cardinality constraints",
        "Teams without metrics instrumentation culture or Prometheus operational stack"
      ],
      "official_url": "https://prometheus.io/docs/prometheus/latest/querying/basics/",
      "paradigm": [
        "declarative",
        "time-series",
        "functional"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative query or policy notation (schema- or engine-driven)",
        "runtime": "Executed by a database, API server, or policy engine (product-specific)",
        "memory": "Managed by the host system running the query or policy"
      }
    },
    {
      "id": "kql",
      "name": "KQL",
      "color": "#4A79D8",
      "description": "Kusto Query Language for logs, telemetry, and analytics in the Microsoft/Azure ecosystem. Pipe data through operators like where, summarize, and join to slice large datasets interactively.",
      "whoItIsFor": "Data platform and security teams that live in Azure Monitor, Defender, Sentinel, or Kusto-backed analytics systems.",
      "commonUses": [
        "Log analytics",
        "Security investigations",
        "Telemetry analysis",
        "Incident triage"
      ],
      "patterns": [
        {
          "title": "Filter recent failures",
          "code": "AppTraces\n| where Timestamp > ago(15m)\n| where SeverityLevel >= 3\n| project Timestamp, Message, SeverityLevel",
          "explanation": "Pipe operators move rows through a query pipeline; where filters rows and project picks columns."
        },
        {
          "title": "Summarise events by minute",
          "code": "AzureDiagnostics\n| summarize Count = count() by bin(TimeGenerated, 1m), Category\n| order by TimeGenerated desc",
          "explanation": "summarize and bin are the bread-and-butter operators for operational dashboards."
        },
        {
          "title": "Join sign-in records to users",
          "code": "SigninLogs\n| join kind=inner (IdentityInfo) on $left.UserPrincipalName == $right.AccountUPN\n| project TimeGenerated, UserPrincipalName, DisplayName",
          "explanation": "KQL joins feel database-like, but the pipe-first style keeps the query readable."
        }
      ],
      "libraries": [
        {
          "name": "Azure Data Explorer / Kusto docs",
          "url": "https://learn.microsoft.com/azure/data-explorer/kusto/query/",
          "type": "Query docs"
        }
      ],
      "docs": [
        {
          "name": "Kusto query language overview",
          "url": "https://learn.microsoft.com/azure/data-explorer/kusto/query/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// let binds a name for reuse later in the pipeline\nlet failed = AppTraces\n| where Success == false;\nfailed\n| summarize count() by bin(Timestamp, 5m)\n\n// Columns are row context after each pipe stage\n| extend duration_s = DurationMs / 1000.0",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "AppTraces\n| where SeverityLevel >= 3\n| where isempty(UserId) == false\n\n// Inline conditional column\n| extend bucket = iff(SeverityLevel >= 4, \"high\", \"low\")",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// Expand array columns into one row per element\nOrders\n| mv-expand item = Items\n| where item.Price > 100\n\n// summarize loops over groups\nAppTraces\n| summarize Count=count(), AvgMs=avg(DurationMs) by bin(Timestamp, 1m), OperationName",
          "difficulty": "basic"
        },
        "functions": {
          "code": "AppTraces\n| extend host = tolower(Cloud_RoleName)\n| where strlen(Message) > 0\n| summarize dcount(UserId), percentile(DurationMs, 95) by OperationName\n\n// Common: ago(), bin(), strcat(), parse_json(), extract()\n| where Timestamp > ago(15m)",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Cost depends on time range, table scan size, joins, and how many columns you project early. Filter and project soon after the table name; wide joins over huge tables are the usual surprise.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "// KQL has no classes or user-defined types.\n// Tables have schemas; operators work on typed columns.\n// Use materialized views or cluster functions for reusable logic — not OOP.",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "AppTraces\n| where Message contains \"timeout\"\n| extend area = extract(@\"region=(\\w+)\", 1, Message)\n| project strcat(Cloud_RoleName, \":\", OperationName), Message",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// NULL compares differently — be explicit\nAppTraces\n| where isnotnull(UserId)\n| extend safeName = coalesce(UserName, \"<unknown>\")\n\n// Failed parses can yield null depending on operator\n| extend j = parse_json(RawPayload)",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// KQL has no import statement.\n// Start from a table, function, or externaldata():\n\nSigninLogs\n| join kind=inner IdentityInfo on $left.UserPrincipalName == $right.AccountUPN\n\n// Reusable fragments: saved functions in ADX or .create function in the cluster.",
          "difficulty": "basic"
        }
      },
      "categories": [
        "data",
        "query"
      ],
      "overview": "Kusto Query Language for logs, telemetry, and analytics in the Microsoft/Azure ecosystem. Pipe data through operators like where, summarize, and join to slice large datasets interactively. Data platform and security teams that live in Azure Monitor, Defender, Sentinel, or Kusto-backed analytics systems.\n\nTypical projects include Log analytics, Security investigations, Telemetry analysis. Most decision-relevant when Azure or Microsoft-native observability is in the stack.",
      "learning_curve": "Moderate. The operators are approachable, but the Azure data model and query idioms take a bit of time.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "KQL is most decision-relevant when Azure or Microsoft-native observability is in the stack.",
      "docs_url": "https://learn.microsoft.com/kusto/query/",
      "tips": [
        {
          "id": "kql-tip-use-query-timeslices-not-walls",
          "title": "Use timeslices, not wall-clock ranges",
          "body": "KQL queries over ago() and between() are idempotent; queries over datetime() literals are not. Prefer ago(15m) and bin(TimeGenerated, 1m) so the query always refers to a relative window, regardless of when you run it.",
          "tag": "data",
          "status": "curated"
        }
      ],
      "best_for": [
        "Azure Monitor log querying",
        "Kusto database time-series analysis",
        "large-scale telemetry data investigation",
        "Azure Monitor and Data Explorer log analytics at petabyte scale"
      ],
      "weak_at": [
        "Non-Azure observability stacks standardized on PromQL or LogQL exclusively",
        "OLTP transactional updates inside KQL read-only analytics engine model",
        "Open-source-first teams avoiding Azure Data Explorer cluster costs"
      ],
      "official_url": "https://learn.microsoft.com/kusto/query/",
      "paradigm": [
        "declarative",
        "analytics",
        "tabular"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative query or policy notation (schema- or engine-driven)",
        "runtime": "Executed by a database, API server, or policy engine (product-specific)",
        "memory": "Managed by the host system running the query or policy"
      }
    },
    {
      "id": "jq",
      "name": "jq",
      "color": "#5A67D8",
      "description": "A tiny command-line query language for filtering, reshaping, and pretty-printing JSON in scripts, CI jobs, and shell one-liners.",
      "whoItIsFor": "Engineers and operators who need to inspect, filter, or reshape JSON in scripts, CI jobs, and shell one-liners.",
      "commonUses": [
        "JSON filtering",
        "API debugging",
        "CLI automation",
        "Report shaping"
      ],
      "patterns": [
        {
          "title": "Extract one nested field",
          "code": "jq ' .user.profile.name ' data.json",
          "explanation": "jq can project nested JSON fields with concise dot-path expressions."
        },
        {
          "title": "Filter objects by status",
          "code": "jq ' .items[] | select(.status == \"active\") ' data.json",
          "explanation": "select() keeps only the objects that match a predicate."
        },
        {
          "title": "Turn arrays into compact summaries",
          "code": "jq -r ' .items[] | [.id, .name] | @tsv ' data.json",
          "explanation": "jq can reshape objects into tables, TSV, CSV-style output, or plain text."
        }
      ],
      "libraries": [
        {
          "name": "jq manual",
          "url": "https://jqlang.org/manual/",
          "type": "CLI manual"
        }
      ],
      "docs": [
        {
          "name": "jq manual",
          "url": "https://jqlang.org/manual/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# Binding with as saves a sub-expression result\n.data.users[] | select(.active) | .name\n\n# Variable assignment inside a filter\n[.items[] | .price * 1.2] as $with_tax | $with_tax | add",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "# if/then/else\n.items[] | if .status == \"active\" then .name else empty end\n\n# select keeps matching elements\n.users[] | select(.age >= 18 and .role == \"admin\")",
          "difficulty": "basic"
        },
        "loops": {
          "code": "# map applies a filter to every array element\n.items | map({id, name, total: (.price * .qty)})\n\n# foreach-style pipeline\nrange(3) | . * 2\n\n# Recursive walk\n.. | objects | select(has(\"id\")) | .id",
          "difficulty": "basic"
        },
        "functions": {
          "code": "# User-defined function with def\ndef total: map(.price * .qty) | add;\n\n.items | total\n\n# Built-ins: length, keys, group_by, sort_by, ...\n.group_by(.category) | map({category: .[0].category, count: length})",
          "difficulty": "intermediate"
        },
        "performance": {
          "code": "Whole-input filters load JSON into memory. For very large payloads, prefer streaming with jq --stream or process chunks upstream; deeply nested walks over megabyte files can be slow in plain mode.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "# jq has no classes.\n# JSON objects are the data model — build them with object construction:\n{id: .id, label: .name, tags: [.tags[]?]}",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# JSON strings use double quotes inside the jq program\n.items[] | .name\n\n# Interpolation filter\n\"Hello, \\(.name)!\"\n\n# @tsv, @csv, @uri for encoding\n[.id, .name] | @tsv",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# try/catch returns alternate value on failure\ntry .items[] catch \"no items\"\n\n# Errors stop the pipeline unless caught\n(.value / .count) | if . == null then 0 else . end\n\n# Check shape before drilling in: type, length, keys",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "# include pulls another jq file (jq 1.6+)\ninclude \"helpers\";\n\n# CLI: jq -f filter.jq data.json\n# Most one-liners are self-contained; split reusable defs into included files.",
          "difficulty": "basic"
        }
      },
      "categories": [
        "data",
        "query",
        "cli"
      ],
      "overview": "A tiny command-line query language for filtering, reshaping, and pretty-printing JSON in scripts, CI jobs, and shell one-liners. Engineers and operators who need to inspect, filter, or reshape JSON in scripts, CI jobs, and shell one-liners.\n\nTypical projects include JSON filtering, API debugging, CLI automation.",
      "learning_curve": "Easy to moderate. The syntax is small, but quoting and shell escaping can be tricky at first.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "jq is a great glue layer between APIs, shell scripts, and automation pipelines.",
      "docs_url": "https://jqlang.github.io/jq/manual/",
      "tips": [
        {
          "id": "jq-tip-quote-your-keys-and-values-carefully",
          "title": "Quote your keys and values carefully",
          "body": "jq merges JSON parsing with its own expression language — single quotes delimit jq programs, double quotes delimit JSON strings inside them, and backslash escapes apply at both layers. Use single quotes around the whole expression and double quotes for JSON strings inside.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "jq-tip-pipe-step-by-step-dont-nest",
          "title": "Pipe step by step, don't nest",
          "body": "Deeply nested jq expressions are hard to read. Build pipelines by adding one pipe stage at a time and checking each with -c. If a stage gives unexpected output, strip what follows and debug the stage that produces the wrong shape.",
          "tag": "systems",
          "status": "curated"
        },
        {
          "id": "jq-tip-use-length-and-keys-to-inspect-shape",
          "title": "Use length and keys to inspect shape",
          "body": "Before writing a complex filter, pipe data through length, keys, or type to confirm the structure. Many jq bugs come from assuming an array when the input is an object, or vice versa — a quick shape check saves time.",
          "tag": "data",
          "status": "curated"
        }
      ],
      "best_for": [
        "CLI-based JSON transformation",
        "API response debugging and shaping",
        "JSON processing in automation scripts",
        "CLI JSON transformation in shell pipelines and CI artifact processing"
      ],
      "weak_at": [
        "Complex business logic spanning modules better authored in Python or Go",
        "Binary protobuf payloads without JSON conversion preprocessing steps",
        "Teams needing statically typed schema evolution without jq filter fragility"
      ],
      "official_url": "https://jqlang.github.io/jq/",
      "paradigm": [
        "functional",
        "JSON",
        "filter"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative query or policy notation (schema- or engine-driven)",
        "runtime": "Executed by a database, API server, or policy engine (product-specific)",
        "memory": "Managed by the host system running the query or policy"
      }
    },
    {
      "id": "jsonpath",
      "name": "JSONPath",
      "color": "#7A8CC7",
      "description": "A compact path notation for selecting nested values inside JSON documents in tests, API clients, and automation scripts.",
      "whoItIsFor": "Developers and testers who need a compact way to point at nested JSON values in scripts, APIs, and assertions.",
      "commonUses": [
        "API responses",
        "Test assertions",
        "Data extraction",
        "Config inspection"
      ],
      "patterns": [
        {
          "title": "Select all ids",
          "code": "$.items[*].id",
          "explanation": "A path can walk arrays with wildcards and return matching leaf values."
        },
        {
          "title": "Read a deeply nested value",
          "code": "$.spec.template.metadata.labels.app",
          "explanation": "Dots navigate nested objects; the path stays readable even for larger payloads."
        },
        {
          "title": "Filter array members by status",
          "code": "$.items[?(@.status == \"active\")].name",
          "explanation": "Many JSONPath dialects support predicates for selection inside arrays."
        }
      ],
      "libraries": [
        {
          "name": "JSONPath reference",
          "url": "https://goessner.net/articles/JsonPath/",
          "type": "Query notation"
        }
      ],
      "docs": [
        {
          "name": "JSONPath reference",
          "url": "https://goessner.net/articles/JsonPath/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "# JSONPath has no variables — only path expressions.\n# Root document is $ ; current node in filters is @\n\n$.store.book[*].author\n$..price",
          "difficulty": "N/A"
        },
        "conditionals": {
          "code": "# Filter predicates select array elements\n$.items[?(@.status == \"active\")].name\n\n# Comparison operators depend on the implementation — test your engine\n$.products[?(@.price < 10)]",
          "difficulty": "intermediate"
        },
        "loops": {
          "code": "# Wildcards walk children or descendants\n$.items[*].id\n$..labels[*]\n\n# Slice notation on arrays\n$.items[0:3].name",
          "difficulty": "basic"
        },
        "functions": {
          "code": "# Core JSONPath has no user-defined functions.\n# Some engines add extensions (length(), keys()) — not portable.\n\n# Stick to dot paths and wildcards for broad compatibility:\n$.metadata.name",
          "difficulty": "N/A"
        },
        "performance": {
          "code": "Performance depends on the host library and document size. Deep recursive descent ($..) over large JSON can be slower than targeted dot paths; filter expressions vary widely by implementation.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "# JSONPath has no classes or schema types.\n# Paths address nodes in a JSON tree — objects, arrays, scalars.\n$.spec.template.metadata.labels.app",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "# String literals in filters use single or double quotes per engine\n$.users[?(@.email == 'ada@example.com')].name\n\n# Bracket notation for keys with special characters\n$['weird-key'].value",
          "difficulty": "basic"
        },
        "errors": {
          "code": "# No try/catch — missing paths typically return false/empty, not an exception\n$.does.not.exist\n\n# Host application handles parse errors from invalid JSON input\n# Dialect differences on filters are a common source of silent wrong results",
          "difficulty": "basic"
        },
        "imports": {
          "code": "# JSONPath has no imports.\n# Embed paths in your test framework, API client, or config:\n\n# Python: jsonpath-ng\n# JavaScript: jsonpath-plus\n# Kubernetes: custom field paths in some tools\n\n$.items[*].id",
          "difficulty": "N/A"
        }
      },
      "categories": [
        "data",
        "query"
      ],
      "overview": "A compact path notation for selecting nested values inside JSON documents in tests, API clients, and automation scripts. Developers and testers who need a compact way to point at nested JSON values in scripts, APIs, and assertions.\n\nTypical projects include API responses, Test assertions, Data extraction.",
      "learning_curve": "Easy. The basic path syntax is short, though implementations differ a bit.",
      "good_for_teaching": "good",
      "ecosystem_notes": "JSONPath is useful anywhere JSON is a control surface: tests, APIs, config, and quick inspection.",
      "docs_url": "https://www.rfc-editor.org/rfc/rfc9535",
      "tips": [
        {
          "id": "jsonpath-tip-implementations-differ-on-filters",
          "title": "Implementations differ on filters",
          "body": "Not every JSONPath engine supports filter expressions like [?(@.price < 10)]. If you need portable queries, stick to dot notation and wildcards; test filter syntax against each engine you target.",
          "tag": "frontend",
          "status": "curated"
        }
      ],
      "best_for": [
        "JSON data extraction in API tests",
        "config inspection from CI pipelines",
        "assertion notation for JSON responses",
        "Extracting fields from JSON documents in testing and ETL tooling"
      ],
      "weak_at": [
        "General-purpose programming replacing readable code with path expressions",
        "Graph queries over linked data better served by JSON-LD and SPARQL",
        "Teams without jsonpath standardization facing implementation dialect drift"
      ],
      "official_url": "https://goessner.net/articles/JsonPath/",
      "paradigm": [
        "declarative",
        "JSON",
        "query"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative query or policy notation (schema- or engine-driven)",
        "runtime": "Executed by a database, API server, or policy engine (product-specific)",
        "memory": "Managed by the host system running the query or policy"
      }
    },
    {
      "id": "cel",
      "name": "CEL",
      "color": "#5B6BD5",
      "description": "Common Expression Language — a compact, embeddable expression language for policies and validation. Used in Kubernetes RBAC, Google APIs, and authorization decisions where full languages are overkill.",
      "whoItIsFor": "Platform teams, API designers, and policy authors who want safe expressions without a full general-purpose language.",
      "commonUses": [
        "Policy checks",
        "Validation rules",
        "Admission control",
        "Feature gating"
      ],
      "patterns": [
        {
          "title": "Require a minimum age",
          "code": "request.age >= 18",
          "explanation": "CEL expressions are intentionally small and embeddable."
        },
        {
          "title": "Allow only admins or owners",
          "code": "request.user.role in ['admin', 'owner']",
          "explanation": "Membership checks are common when CEL is used for policy or configuration validation."
        },
        {
          "title": "Time-limited access window",
          "code": "request.expires_at > timestamp('2026-12-31T00:00:00Z')",
          "explanation": "CEL often appears as a safe rule language inside products and APIs."
        }
      ],
      "libraries": [
        {
          "name": "CEL specification",
          "url": "https://cel.dev/",
          "type": "Expression language"
        }
      ],
      "docs": [
        {
          "name": "CEL docs",
          "url": "https://cel.dev/"
        }
      ],
      "compareData": {
        "variables": {
          "code": "// Variables come from the host environment\nrequest.user == \"ada\"\nrequest.metadata[\"region\"] == \"eu-west\"\n\n// Local bindings in comprehensions\n[pair in pairs : pair.key + \"=\" + pair.value]",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "// Boolean logic and ternary\nrequest.age >= 18 && request.country in [\"GB\", \"IE\"]\n\nrequest.role == \"admin\" ? \"allow\" : \"deny\"\n\n// has() checks optional fields\nhas(request.claims) && request.claims.scope == \"read\"",
          "difficulty": "basic"
        },
        "loops": {
          "code": "// all, exists, map over lists\nrequest.scopes.all(s, s.startsWith(\"read:\"))\n\nrequest.tags.exists(t, t == \"prod\")\n\n[user in request.users : user.email]\n\n// Filter/map style on collections\nrequest.items.filter(i, i.quantity > 0).size() > 0",
          "difficulty": "intermediate"
        },
        "functions": {
          "code": "// Built-ins: size, matches, startsWith, timestamp, duration, ...\nrequest.path.matches('/api/v[0-9]+/users/.*')\n\ntimestamp(request.expires_at) > timestamp('2026-01-01T00:00:00Z')\n\n// Host may register custom functions — portable CEL sticks to the standard library",
          "difficulty": "basic"
        },
        "performance": {
          "code": "CEL is designed for fast, sandboxed evaluation with bounded cost. Expression size and list sizes matter; hosts compile and cache programs. It is not meant for heavy data processing — keep expressions short.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "// CEL has no classes.\n// Values are bool, int, uint, double, string, bytes, list, map, null, and types for type-checking.\n\ntype(request) == map\nrequest.user in [\"admin\", \"owner\"]",
          "difficulty": "N/A"
        },
        "strings": {
          "code": "request.email.endsWith(\"@company.com\")\nrequest.message.contains(\"error\")\n\n// Raw strings for regex\nrequest.host.matches(r'.*\\.internal$')\n\n// Concatenation\nrequest.first + \" \" + request.last",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Type errors fail at compile/check time\n// request.age + \"1\"  // invalid — types must match\n\n// Runtime: divide by zero, out-of-range index\n// Host returns error to caller — no try/catch in CEL\n\n// Test with cel-go, cel-java, or your platform's policy debugger",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// CEL has no import statement.\n// Macros and standard functions are provided by the host:\n\nhas(request.sub) && request.sub.endsWith(\"@corp\")\n\n// Kubernetes CEL: optional library for CRD validation\n// Google APIs: host-defined variables and extensions only",
          "difficulty": "N/A"
        }
      },
      "categories": [
        "policy",
        "expression"
      ],
      "overview": "Common Expression Language — a compact, embeddable expression language for policies and validation. Used in Kubernetes RBAC, Google APIs, and authorization decisions where full languages are overkill. Platform teams, API designers, and policy authors who want safe expressions without a full general-purpose language.\n\nTypical projects include Policy checks, Validation rules, Admission control.",
      "learning_curve": "Easy to moderate. The syntax is small, but the host environment determines which functions and variables are available.",
      "good_for_teaching": "okay",
      "ecosystem_notes": "CEL is common in control planes, config validation, and policy systems where you do not want arbitrary code execution.",
      "docs_url": "https://github.com/google/cel-spec",
      "tips": [
        {
          "id": "cel-tip-keep-expressions-small-and-testable",
          "title": "Keep expressions small and testable",
          "body": "CEL is designed for short expressions, not programs. If your CEL policy is longer than a few lines, split it into named macros or move complex logic into the host application. Test expressions in isolation with cel-doc examples before embedding them.",
          "tag": "beginner",
          "status": "curated"
        },
        {
          "id": "cel-tip-check-your-environment-variables",
          "title": "Check your environment variables",
          "body": "CEL expressions only see what the host application passes as variables. If a policy behaves unexpectedly, log the input variables — missing or wrong-typed variables are the most common cause, not expression syntax errors.",
          "tag": "systems",
          "status": "curated"
        }
      ],
      "best_for": [
        "safe embeddable policy expressions",
        "Kubernetes validation rules",
        "feature flag and admission control logic",
        "Kubernetes validation rules and API authorization policies using CEL"
      ],
      "weak_at": [
        "Complex orchestration workflows needing Turing-complete script engines",
        "Legacy XPath/XSLT stacks without CEL evaluator integration paths",
        "Teams requiring rich standard libraries beyond CEL intentionally limited surface"
      ],
      "official_url": "https://cel.dev/",
      "paradigm": [
        "expression",
        "typed",
        "sandboxed"
      ],
      "review_notes": "Verification 2026-07-23: official/docs URLs and categories checked against known canonical homes. Re-verify after major upstream releases.",
      "technical_profile": {
        "typing": "Declarative configuration or build DSL (not a general-purpose programming language)",
        "runtime": "Evaluated by a host tool (Ansible, Terraform, Make, Nix, etc.) — no standalone VM",
        "memory": "Managed by the host tool running the configuration or build"
      }
    },
    {
      "id": "nurl",
      "name": "NURL",
      "aliases": [
        "NURL",
        "Neural Unified Representation Language"
      ],
      "color": "#3D8B7A",
      "description": "A small LLVM-backed systems language with fixed-arity prefix notation, single-owner memory, and a default-on borrow checker. The project aims the grammar at LLM-assisted coding; not a latent-space / activation encoding.",
      "whoItIsFor": "Systems programmers and LLM-assisted tool builders who want a compact, regular grammar that compiles to native code or WebAssembly.",
      "commonUses": [
        "Systems tools",
        "LLM-generated programs",
        "Cross-compiled binaries",
        "WebAssembly / embedded targets"
      ],
      "patterns": [
        {
          "title": "Hello World",
          "code": "@ main → v {\n  ( nurl_print `Hello, world\\n` )\n}",
          "explanation": "Entry point `main` returns void (`v`). `nurl_print` writes a string; backtick literals are strings."
        },
        {
          "title": "Fixed-arity prefix add",
          "code": "@ add i a i b → i { ^ + a b }\n\n( add 3 4 )  // → 7",
          "explanation": "Every operator has fixed arity: `+` takes two args, calls use `( fn args )`, and `^` returns a value. No infix precedence table."
        },
        {
          "title": "Immutable and mutable bindings",
          "code": ": i x 42\n: ~ i y 0\n= y + y 1",
          "explanation": "`:` binds; bindings are immutable by default. `: ~` opts into mutation; `=` assigns."
        },
        {
          "title": "Conditional print",
          "code": ": i n 15\n? == 0 % n 3 {\n  ( nurl_print `Fizz\\n` )\n} {\n  ( nurl_println_int n )\n}",
          "explanation": "`?` is the conditional form; `%` is remainder. Branches are blocks, not infix `if`."
        }
      ],
      "libraries": [
        {
          "name": "NURL standard library",
          "url": "https://docs.nurl-lang.org/",
          "type": "Standard library"
        },
        {
          "name": "nurlpkg registry",
          "url": "https://reg.nurl-lang.org/",
          "type": "Package registry"
        }
      ],
      "docs": [
        {
          "name": "NURL language reference",
          "url": "https://docs.nurl-lang.org/"
        },
        {
          "name": "GitHub repository",
          "url": "https://github.com/nurl-lang/nurl"
        }
      ],
      "compareData": {
        "variables": {
          "code": ": i x 10\n: f y 3.14\n: ~ i z 0\n= z + z 1",
          "difficulty": "basic"
        },
        "conditionals": {
          "code": "? > x 5 {\n  ( nurl_print `big\\n` )\n} {\n  ( nurl_print `small\\n` )\n}",
          "difficulty": "basic"
        },
        "loops": {
          "code": ": ~ i i 0\n~ < i 5 {\n  ( nurl_println_int i )\n  = i + i 1\n}",
          "difficulty": "basic"
        },
        "functions": {
          "code": "@ add i a i b → i { ^ + a b }\n( add 2 3 )",
          "difficulty": "basic"
        },
        "performance": {
          "code": "Compiled via LLVM to native code or wasm32-wasi; no GC. Deterministic compiler aims for identical IR across bootstrap rounds.",
          "difficulty": "basic"
        },
        "classes": {
          "code": "// Struct-like product types and sum types (`|`), not class inheritance.\n: | Shape { Circle f  Rect f f }",
          "difficulty": "intermediate"
        },
        "strings": {
          "code": ": s msg `hello`\n( nurl_print msg )",
          "difficulty": "basic"
        },
        "errors": {
          "code": "// Result-style / `!` and try forms — see language reference.\n// Prefer compiler diagnostics; borrow checker catches use-after-move by default.",
          "difficulty": "intermediate"
        },
        "imports": {
          "code": "// $ import form — module path depends on stdlib layout\n// $ std/json",
          "difficulty": "basic"
        }
      },
      "tips": [
        {
          "id": "nurl-tip-not-neuralese",
          "title": "“Neural” names the audience, not the encoding",
          "body": "NURL is human- and LLM-writable source with a public grammar and LLVM toolchain. It is not a latent-vector interlingua or a dump of model hidden states.",
          "tag": "beginner",
          "status": "curated"
        }
      ],
      "categories": [
        "systems",
        "ai"
      ],
      "overview": "NURL (Neural Unified Representation Language) is a public, LLVM-backed systems language with a fixed-arity prefix grammar, single-owner memory, and a default-on borrow checker. The project states LLM-friendliness as a design goal (regular grammar, local errors, compiler-as-teacher diagnostics) — CacheSphere does not assert that LLMs generate or check NURL reliably in practice. Despite the “Neural” name, it is ordinary programmer-facing source (.nu), not latent-vector “neuralese” or hidden model activations.",
      "learning_curve": "Moderate to steep — prefix arity, single-letter types, and borrow-checked ownership feel unfamiliar if you come from C-like infix languages. The grammar itself is small.",
      "good_for_teaching": "hard",
      "ecosystem_notes": "Young but self-hosting: nurlc, nurlpkg, LSP, playground, and an MCP endpoint. Registry and stdlib are growing; still far smaller than Rust or Go.",
      "common_use_cases": [
        "Systems tools",
        "LLM-generated programs",
        "Cross-compiled binaries",
        "WebAssembly / embedded targets"
      ],
      "docs_url": "https://docs.nurl-lang.org/",
      "paradigm_primary": "imperative",
      "paradigm": [
        "imperative",
        "structured",
        "prefix"
      ],
      "best_for": [
        "LLM-assisted systems coding with a regular, locally parseable grammar (project design aim — verify on your models)",
        "Native and WebAssembly targets from one LLVM pipeline",
        "Single-owner memory with a default-on static borrow checker"
      ],
      "weak_at": [
        "Mainstream IDE muscle memory and large third-party ecosystems",
        "Teams that need decades-stable language guarantees",
        "Infix / C-family syntax familiarity for teaching beginners"
      ],
      "official_url": "https://nurl-lang.org/",
      "review_notes": "Invent-nothing pass 2026-09-19: softened LLM “reliably generate/check” claim to project design goal; kept .nu ≠ neuralese clarification. Re-verify URLs and syntax after major releases.",
      "technical_profile": {
        "typing": "Static, strong, inferred at let-bindings; algebraic sum/product types; no implicit conversions",
        "runtime": "Compiled ahead-of-time via LLVM (native and wasm32-wasi); self-hosting nurlc",
        "memory": "Single-owner with auto-drop; default-on static borrow checker; no GC",
        "abstraction": "Prefix-arity systems language with traits, generics, and a grammar aimed at LLM-assisted generation"
      }
    }
  ]
}
