{"id":17013186,"url":"https://github.com/kariaro/ampleprogramminglanguage","last_synced_at":"2025-04-12T08:42:41.902Z","repository":{"id":38077938,"uuid":"282259454","full_name":"Kariaro/AmpleProgrammingLanguage","owner":"Kariaro","description":"Creating a compiler for my own programming language","archived":false,"fork":false,"pushed_at":"2025-04-01T18:10:56.000Z","size":1989,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-04-01T18:50:39.377Z","etag":null,"topics":["compiler","lexical-analysis","programming-language"],"latest_commit_sha":null,"homepage":"","language":"Java","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/Kariaro.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-24T15:49:12.000Z","updated_at":"2025-04-01T18:11:00.000Z","dependencies_parsed_at":"2025-04-01T18:35:06.881Z","dependency_job_id":"03d51c19-6752-42a5-9b49-825f64fe6679","html_url":"https://github.com/Kariaro/AmpleProgrammingLanguage","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kariaro%2FAmpleProgrammingLanguage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kariaro%2FAmpleProgrammingLanguage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kariaro%2FAmpleProgrammingLanguage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kariaro%2FAmpleProgrammingLanguage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kariaro","download_url":"https://codeload.github.com/Kariaro/AmpleProgrammingLanguage/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248543682,"owners_count":21121836,"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":["compiler","lexical-analysis","programming-language"],"created_at":"2024-10-14T06:12:37.035Z","updated_at":"2025-04-12T08:42:41.876Z","avatar_url":"https://github.com/Kariaro.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ample Programming Language\n\nThe main idea of this compiler is to play around with lexers, optimizations and solving problems that comes with large\nprojects.\n\nThe programming language is still under construction and is not be suitable for any real uses outside of exporting to\ninteresting instruction sets.\n\n## Exporting\n\nThe compiler currently exports to four different languages:\n\n* Ir **Compiler instructions*\n* Spooky **Not stable*\n* Assembly x64\n* Chockintosh I\n\n## Usage\n\n\u003e The compiler cli has not been tested\n\n```\nUsage: [options]\n\noptions:\n    --format-list               displays a list of available output formats\n\n    --project, -p \u003cxml\u003e         compile the project from an xml file\n\n    --target, -t \u003cvalue\u003e        set the target output of the compiler\n\n    --format, -f \u003cvalue\u003e        set the format of the compiler\n\n    --use-cache \u003cboolean\u003e       change how the compiler deals with cache files\n\n    -i \u003csource\u003e                 specify the input file to compile\n\n    -o \u003coutputFolder\u003e           specify the output folder\n```\n\n## Compiler\n\nHere is an example of the language syntax:\n\n```c\nfunc printhex (i64: number) {\n    u8[]: hex_data = stack_alloc\u003cu8, 16\u003e(\"0123456789abcdef\");\n    u8[]: hex_strs = stack_alloc\u003cu8, 17\u003e(\"................\\n\");\n\n    for (i32: i = 15; i \u003e= 0; i = i - 1) {\n        hex_strs[i] = hex_data[number \u0026 cast\u003ci64\u003e(15)];\n        number = number \u003e\u003e cast\u003ci64\u003e(4);\n        continue;\n    }\n\n    printstr(hex_strs, 17L);\n    ret;\n}\n```\n\n## Lexer\n\nThe lexer is located in the directory `src/main/java/me/hardcoded/lexer`\n\nThe compiler lexer is used to take combine a list of characters into bigger groups. One example of a group is numbers\nwhich could be combined using the simple regex `[1-9][0-9]+`\n\nAll tokens returned by the lexer contains information about where the token started and ended, file location, content\nand group information.\n\nHere is an example of what the lexer does.\n\n```\nInput: \"char hello ='a'\"\n\nOutput:\nList\u003cToken\u003e = [\n    { type: TYPE,   value: \"char\" , index: 0  },\n    { type: SPACE,  value: \" \",     index: 4  },\n    { type: NAME,   value: \"hello\", index: 5  },\n    { type: SPACE,  value: \" \",     index: 10 },\n    { type: EQUALS, value: \"=\",     index: 11 },\n    { type: STRING, value: \"'a'\",   index: 12 }\n];\n```\n\n## Visualization\n\nThe visualization classes are located inside the directory `src/main/java/me/hardcoded/visualization`\n\nVisualizations are used to debug how the compiler works and can help a developer identify errors made by the compiler\nand make it easier to fix them.\n\nCurrently, there exists three visualization.\n\n* Source Code Viewer\n* Parse Tree Viewer\n* Instruction Viewer","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkariaro%2Fampleprogramminglanguage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkariaro%2Fampleprogramminglanguage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkariaro%2Fampleprogramminglanguage/lists"}