🍺 BREW Explorer

← all formulae

interface99

brew install interface99 v1.0.2 MIT

Full-featured interfaces for C99

30-day installs
90-day
5
365-day · #21363
354
★ GitHub stars · updated 1y ago

Runtime dependencies

GitHub topics

c99 dynamic-dispatch generic-programming macros metalang99 metaprogramming object-oriented oop polymorphism type-system typeclasses

Links

Raw metadata
{
  "aliases": [],
  "alternatives": [],
  "build_dependencies": [],
  "categories": [],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [
    "metalang99"
  ],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Full-featured interfaces for C99",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:38:52+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "interface99",
  "github_default_branch": "master",
  "github_last_commit_at": "2025-03-17T03:23:21Z",
  "github_readme_excerpt": "\u003cdiv align=\"center\"\u003e\n\u003ch1\u003eInterface99\u003c/h1\u003e\n\u003ca href=\"https://github.com/hirrolot/interface99/actions\"\u003e\n\u003cimg src=\"https://github.com/hirrolot/interface99/workflows/C/C++%20CI/badge.svg\"\u003e\n\u003c/a\u003e\n\nFull-featured interfaces inspired by Rust and Golang. Multiple inheritance, superinterfaces, and default implementations supported. No external tools required, pure C99.\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cdiv align=\"center\"\u003e\u003cb\u003eShape\u003c/b\u003e\u003c/div\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e\n\u003cdiv align=\"left\"\u003e\n\n```c\n#include \u003cinterface99.h\u003e\n\n#include \u003cstdio.h\u003e\n\n#define Shape_IFACE                      \\\n    vfunc( int, perim, const VSelf)      \\\n    vfunc(void, scale, VSelf, int factor)\n\ninterface(Shape);\n```\n\n\u003c/div\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cdiv align=\"center\"\u003e\u003cb\u003eRectangle\u003c/b\u003e\u003c/div\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cdiv align=\"center\"\u003e\u003cb\u003eTriangle\u003c/b\u003e\u003c/div\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\u003cdiv align=\"left\"\u003e\n\n```c\ntypedef struct {\n    int a, b;\n} Rectangle;\n\nint Rectangle_perim(const VSelf) {\n    VSELF(const Rectangle);\n    return (self-\u003ea + self-\u003eb) * 2;\n}\n\nvoid Rectangle_scale(VSelf, int factor) {\n    VSELF(Rectangle);\n    self-\u003ea *= factor;\n    self-\u003eb *= factor;\n}\n\nimpl(Shape, Rectangle);\n```\n\n\u003c/div\u003e\n\u003c/td\u003e\n\u003ctd\u003e\n\u003cdiv align=\"left\"\u003e\n\n```c\ntypedef struct {\n    int a, b, c;\n} Triangle;\n\nint Triangle_perim(const VSelf) {\n    VSELF(const Triangle);\n    return self-\u003ea + self-\u003eb + self-\u003ec;\n}\n\nvoid Triangle_scale(VSelf, int factor) {\n    VSELF(Triangle);\n    self-\u003ea *= factor;\n    self-\u003eb *= factor;\n    self-\u003ec *= factor;\n}\n\nimpl(Shape, Triangle);\n```\n\n\u003c/div\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cdiv align=\"center\"\u003e\u003cb\u003eTest\u003c/b\u003e\u003c/div\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\u003cdiv align=\"left\"\u003e\n\n```c\nvoid test(Shape shape) {\n    printf(\"perim = %d\\n\", VCALL(shape, perim));\n    VCALL(shape, scale, 5);\n    printf(\"perim = %d\\n\", VCALL(shape, perim));\n}\n\nint main(void) {\n    Shape r = DYN_LIT(Rectangle, Shape, {5, 7});\n    Shape t = DYN_LIT(Triangle, Shape, {10, 20, 30});\n\n    test(r);\n    test(t);\n}\n```\n\n\u003c/div\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c/div\u003e\n\n(Based on [`examples/shape.c`](e",
  "github_repo": "Hirrolot/interface99",
  "github_stars": 354,
  "github_topics": [
    "c99",
    "dynamic-dispatch",
    "generic-programming",
    "macros",
    "metalang99",
    "metaprogramming",
    "object-oriented",
    "oop",
    "polymorphism",
    "type-system",
    "typeclasses"
  ],
  "homepage": "https://github.com/Hirrolot/interface99",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": null,
  "installs_365d": 5,
  "installs_90d": null,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "MIT",
  "llm_generated_at": null,
  "llm_model": null,
  "name": "interface99",
  "oldnames": [],
  "one_liner": null,
  "optional_dependencies": [],
  "rank_30d": null,
  "rank_365d": 21363,
  "rank_90d": null,
  "raw_hash": "7efce9e8ce61ca5c",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/i/interface99.rb",
  "tap": "homebrew/core",
  "test_dependencies": [],
  "uses_from_macos": [],
  "version_head": "HEAD",
  "version_stable": "1.0.2",
  "versioned_formulae": [],
  "why_use_this": null
}