{"id":17494546,"url":"https://github.com/thakeenathees/carbon","last_synced_at":"2025-07-24T07:37:23.491Z","repository":{"id":46748820,"uuid":"225682612","full_name":"ThakeeNathees/carbon","owner":"ThakeeNathees","description":"An object-oriented programming language","archived":false,"fork":false,"pushed_at":"2021-05-11T16:17:17.000Z","size":1340,"stargazers_count":27,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-17T13:32:49.854Z","etag":null,"topics":["interpreter","object-oriented","programming-language","scriptable"],"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/ThakeeNathees.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}},"created_at":"2019-12-03T17:53:38.000Z","updated_at":"2024-10-23T18:32:31.000Z","dependencies_parsed_at":"2022-09-24T07:40:36.714Z","dependency_job_id":null,"html_url":"https://github.com/ThakeeNathees/carbon","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/ThakeeNathees%2Fcarbon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThakeeNathees%2Fcarbon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThakeeNathees%2Fcarbon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThakeeNathees%2Fcarbon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThakeeNathees","download_url":"https://codeload.github.com/ThakeeNathees/carbon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250333246,"owners_count":21413355,"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":["interpreter","object-oriented","programming-language","scriptable"],"created_at":"2024-10-19T13:27:42.646Z","updated_at":"2025-04-22T22:26:44.008Z","avatar_url":"https://github.com/ThakeeNathees.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cp align=\"center\" \u003e\n\u003cimg src=\"https://raw.githubusercontent.com/carbon-org/carbon/master/extra/images/logo.png\" width=\"300\" alt=\"Carbon Programming Language\" title=\"Carbon Programming Language\"\u003e\n\u003c/p\u003e\n\nCarbon is a simple embeddable, object-oriented, dynamic-typed, bytecode-interpreted, scripting language written in C++11 with smart pointers for safe memory deallocation. Carbon is syntactically similar to C/C++, it's analyzer and backend written using \u003ca href=\"https://docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_basics.html\"\u003eGDScript\u003c/a\u003e  as a reference.\n\n## What Carbon looks like\n```swift\n\nclass Vector {\n\t// non-static members\n\tvar x = 0, y = 0;\n\n\t// constructor\n\tfunc Vector (x = 0, y = 0) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\t// built-in operator overriding\n\tfunc __add(v) {\n\t\treturn Vector(x + v.x, y + v.y);\n\t}\n\n\t// built-in String conversion overriding\n\tfunc to_string() {\n\t\treturn \"Vector(%s, %s)\" % [x, y];\n\t}\n}\n\nfunc main() {\n\t// construct a new vector object\n\tvar v1 = Vector(1,2);\n\t\n\t// construct a new vector object\n\tvar v2 = Vector(3,4);\n\t\n\t// call '__add' function in the vector object\n\tvar v3 = v1 + v2;\n\t\n\t// prints \"Vector(4, 6)\"\n\tprintln(v3);\n}\n```\n\n## Features\n* Minimal setup\n* Embeddable\n* Dynamic typing\n* Reference counting\n* Object-oriented\n* Enums and switch statements\n* Reference, default argument\n* Static, non-static members\n* Operator overriding\n* First class types, functions\n* Callables and Iterables\n\n## Building from source\nFor a non-development install/embedding with a single header use \u003ca href=\"https://raw.githubusercontent.com/ThakeeNathees/carbonUI/master/include/carbon.h\"\u003ecarbon.h\u003c/a\u003e header, you only need a C++11 compiler. For more details. read usage in `carbon.h`.\n\n### Requirenment\n* C++11 compiler (Compiler that supports C++11 are GCC version 4.6+ and \u003ca href=\"https://visualstudio.microsoft.com/vs/community/\"\u003eMicrosoft Visual Studio 2017\u003c/a\u003e or newer.)\n* \u003ca href=\"https://git-scm.com/downloads\"\u003egit\u003c/a\u003e (version control)\n* \u003ca href=\"https://www.scons.org/\"\u003escons 3.0\u003c/a\u003e (python based build system. for Visual Studio 2019 required v3.1.1+)\n* \u003ca href=\"https://www.python.org/downloads/\"\u003epython 3.6+\u003c/a\u003e (3.6+ for f-string)\n\n### Install scons\n```\npython -m pip install scons\n```\nIn Linux if scons using python2 instead of 3  you'll have to edit `/usr/local/bin/scons` or `~/.local/bin/scons` to ensure that it points to `/usr/bin/env python3` and not `python`\n\n### Clone \u0026 Build\n```\ngit clone https://github.com/ThakeeNathees/carbon.git\ncd carbon\nscons\n```\nYou can specify the number of jobs scons to use to speed up the building process using the `-j` flag (`-j6`, `-j8`). To generate Visual Studio project files add `vsproj=true` argument when building. To compile using mingw in windows use `use_mingw=true` argument. If your build failed feel free to open \u003ca href=\"https://github.com/ThakeeNathees/carbon/issues\"\u003ean issue\u003c/a\u003e. Once a successful compile the bytecode-interpreter and unit-test binaries are found in `bin/` directory of the carbon root directory.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthakeenathees%2Fcarbon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthakeenathees%2Fcarbon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthakeenathees%2Fcarbon/lists"}