{"id":13831040,"url":"https://github.com/maelswarm/nymph","last_synced_at":"2026-04-18T19:07:36.374Z","repository":{"id":78763903,"uuid":"97721507","full_name":"maelswarm/nymph","owner":"maelswarm","description":"🧚 A slightly different version of C.","archived":false,"fork":false,"pushed_at":"2023-07-17T16:19:22.000Z","size":2876,"stargazers_count":181,"open_issues_count":0,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-08-05T10:15:25.824Z","etag":null,"topics":["c","language","nymph","preprocessor","programming-language"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maelswarm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-07-19T13:48:41.000Z","updated_at":"2024-05-02T03:34:38.000Z","dependencies_parsed_at":"2024-01-13T16:23:09.264Z","dependency_job_id":"e2ec1773-b398-42c3-90c8-b110ae8fd523","html_url":"https://github.com/maelswarm/nymph","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maelswarm%2Fnymph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maelswarm%2Fnymph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maelswarm%2Fnymph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maelswarm%2Fnymph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maelswarm","download_url":"https://codeload.github.com/maelswarm/nymph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225553289,"owners_count":17487293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","language","nymph","preprocessor","programming-language"],"created_at":"2024-08-04T10:01:16.067Z","updated_at":"2026-04-18T19:07:36.341Z","avatar_url":"https://github.com/maelswarm.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/maelswarm/nymph/assets/6314185/f0f5d03f-0e69-42f5-a070-d33e1e13cab7\" width=\"auto\" height=\"200\" /\u003e\u003c/p\u003e\n\n\u003ch1 align=center\u003eNymph\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003eLet's see what we can achieve by reworking C syntax.\u003c/p\u003e\n\n## Overview\n\nNymph is a simple C like programming language.\n\nNymph acts as a preprocessor, converting Nymph files (extension \\*.n) into C files.\n\nThis project is very much in development... It is not production ready.\n\n## What's New\n\nNothing right now\n\n## Goals\n\n### Completed\n\n* Class-Based OOP\n\n* Subtyping\n\n### In Progress\n\n* TBD\n\n### Pending\n\n* Destructors?\n\n* Type Inference?\n\n* Reflection?\n\n* Default function arguments?\n\n* Lambdas?\n\n## Example\n\nmammal.n\n```\n#include \u003cstdio.h\u003e\n#include \u003cstdlib.h\u003e\n\nclass Mammal {\n\n    + int population = 0;             // Class Variable (+)\n    - int height = 0, weight = 100;   // Object Variable (-)\n\n    + Mammal *init(int height, int weight) {  // Class Method (+) Constructor\n        this-\u003eheight = height;\n        this-\u003eweight = weight;\n        Mammal-\u003epopulation++;\n        return this;\n    }\n\n    - void print() {                          // Object Method (-)\n        printf(\"print instance properties...\\n\");\n    }\n}\n```\n\nhuman.n\n```\n#include \"mammal.n\"\n#include \u003cstdio.h\u003e\n#include \u003cstdlib.h\u003e\n\nclass Human : Mammal {\n\n    - char *name = NULL; // Object Variable (-)\n\n    + Human *init(char *name, int height, int weight) { // Class Method (+) Constructor\n        this = super-\u003einit(height, weight);\n        this-\u003ename = name;\n        return this;\n    }\n\n    - void died() {                                     // Object Method (-) Constructor\n        free(this-\u003ename);\n        free(this);\n        Mammal-\u003epopulation--;\n    }\n}\n\nint main(void) {\n\n    char *name = malloc(5);\n    memset(name, 0, sizeof(name));\n    strcpy(name, \"Fred\");\n    Human *person1 = Human-\u003einit(name, 76, 146); // Class Method Constructor Call\n    person1-\u003eprint();                            // Object Method Call\n    person1-\u003edied();                             // Object Method Call\n\n    return 0;\n}\n```\n\n```\nnymph -r human.n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaelswarm%2Fnymph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaelswarm%2Fnymph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaelswarm%2Fnymph/lists"}