{"id":16871590,"url":"https://github.com/phase/granite","last_synced_at":"2025-08-25T05:13:05.755Z","repository":{"id":78127619,"uuid":"45360962","full_name":"phase/granite","owner":"phase","description":":dragon_face: Granite Programming Language","archived":false,"fork":false,"pushed_at":"2015-11-01T23:52:26.000Z","size":114,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-24T22:29:37.295Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"D","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-01T22:53:11.000Z","updated_at":"2023-09-05T12:18:46.000Z","dependencies_parsed_at":"2023-03-12T03:37:11.152Z","dependency_job_id":null,"html_url":"https://github.com/phase/granite","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/phase%2Fgranite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phase%2Fgranite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phase%2Fgranite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phase%2Fgranite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phase","download_url":"https://codeload.github.com/phase/granite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244296899,"owners_count":20430336,"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":[],"created_at":"2024-10-13T15:09:12.130Z","updated_at":"2025-03-18T19:53:04.795Z","avatar_url":"https://github.com/phase.png","language":"D","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Granite\r\nThe Granite Programming Language \u0026 other stuff relating to it.\r\n\r\n\r\n##Why another language?\r\nCompilers are fun to make.\r\n\r\n\r\n##Ideas\r\nIt will transcompile to C, and compiler will be written in D. \r\n\r\n\r\n###Data Types\r\ntype|size|range\r\n----|----|-----\r\nbyte | 1 byte  | -128 to 127\r\nubyte | 1 byte | 0 to 255\r\nshort | 2 bytes | -32,768 to 32,767\r\nushort | 2 bytes | 0 to 65,535\r\nint | 4 bytes | -2,147,483,648 to 2,147,483,647\r\nuint | 4 bytes | 0 to 4,294,967,295\r\n\r\n###Hello World\r\n```c\r\n//imports take local files over installed headers\r\n    //i.e. search through local files for this, if found\r\n    //use \"\"; if not found, use \u003c\u003e\r\nimport stdio\r\n\r\n//return void is implied\r\nmain() {\r\n    //optional semicolons\r\n    printf(\"Hello, World!\")\r\n}\r\n```\r\nGets compiled to\r\n```c\r\n#include \u003cstdio.h\u003e\r\n\r\nvoid main() {\r\n    printf(\"Hello, World!\");\r\n}\r\n```\r\n\r\n###Mixins\r\nMixins allow you to specify new tokens that add in code.\r\n\r\n```c\r\n#mixin TOKEN printf(\"This is in a token\")\r\nmain() {\r\n    TOKEN\r\n}\r\n```\r\nYou can access local and global variables by name, because the compiler just inlines the code.\r\n```c\r\n#mixin W printf(\"%d\",w);\r\n\r\nmain() {\r\n    W //throws error\r\n    int w = 7;\r\n    W //prints 7\r\n}\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphase%2Fgranite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphase%2Fgranite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphase%2Fgranite/lists"}