{"id":13678577,"url":"https://github.com/chermehdi/comet","last_synced_at":"2026-01-30T19:13:32.117Z","repository":{"id":52811906,"uuid":"268861958","full_name":"chermehdi/comet","owner":"chermehdi","description":" A programming language implementation in Go.","archived":false,"fork":false,"pushed_at":"2021-04-18T15:11:30.000Z","size":168,"stargazers_count":31,"open_issues_count":8,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-29T15:32:21.562Z","etag":null,"topics":["educational","golang","interpreter","programming-language"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chermehdi.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":"2020-06-02T17:11:33.000Z","updated_at":"2024-09-01T22:09:23.000Z","dependencies_parsed_at":"2022-08-23T05:51:54.355Z","dependency_job_id":null,"html_url":"https://github.com/chermehdi/comet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chermehdi/comet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chermehdi%2Fcomet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chermehdi%2Fcomet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chermehdi%2Fcomet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chermehdi%2Fcomet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chermehdi","download_url":"https://codeload.github.com/chermehdi/comet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chermehdi%2Fcomet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28917563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T19:10:10.838Z","status":"ssl_error","status_checked_at":"2026-01-30T19:06:40.573Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["educational","golang","interpreter","programming-language"],"created_at":"2024-08-02T13:00:55.455Z","updated_at":"2026-01-30T19:13:32.087Z","avatar_url":"https://github.com/chermehdi.png","language":"Go","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"![Comet build status](https://github.com/chermehdi/comet/workflows/Go/badge.svg?branch=master)\n\n# Comet programming language \n\n![comet programming language](./comet.png)\n\n- A simple programming language aimed to be used for educational purposes, and to teach how programming language interpreters\ncan be made.\n\n- Since it's made for educational purposes, all the parts that make a lexer are made from scratch `lexer`, `parser` and `evaluator`.\n\n## Language Example \n\n- The language is a `C` derived language, with the ability to create `structs` as complex types, and declare functions as First class values.\n- The language is dynamically typed, to make it easier to implement\n\n```\n// variable declarations\nvar a = 10\nvar c = \"some string\"\nvar arrayValue = [1, 2, 3]\n\nfunc add(a, b) {\n    return a + b\n}\n\nfunc isBigger(a, b) {\n    return a \u003e b\n}\n\nstruct Data { \n    func init(a, b, c) {\n        this.a = a\n        this.c = a + b\n    }\n    \n    func doSomething() {\n        return a + c \n    } \n}\n// STRUCT_DECL: struct Identifier BLOCK\n// BLOCK: { functions* } \n\n// \n// var data = new Data(a, b, c)\n\n// data.doSomething()\n\n// Object declaration\nvar object = new()\nobject.field = \"field value\"\n\nobject.method = func(a) {\n    return a * 2\n}\n\nvar value = object.call()\n\nvar loopConstruct = func(a, b) {\n    var sum = 0\n    for i = 1; i \u003c 10; i += 1 {\n        sum += i\n    }\n    return sum\n}\n\nvar conditional = func(a, b) {\n}\n// a program entrypoint\nfunc main() {\n    var c = a + add(1, 4)\n    // builtin functions\n    println(c)\n}\n```\n\n## Grammar\n\n- Below are the grammar rules for the language (it can be left recursive, we will deal with it at some point)\n\n```\n// Parser rules\ngrammar Comet;\n\ncomet:\n    function_declaration+ EOF\n    ;\n\nfunction_declaration:\n    'func' IDENTIFIER'('parameterless')' '{' statements '}' # functionDeclaration\n    ;\n\nparameterless:\n    parameters*\n    ;\n\nparameters:\n    IDENTIFIER(','IDENTIFIER)* | expression (','expression)*\n    ;\n\nstatements:\n    statement*\n    ;\n\nstatement:\n    assignment_statement                      # assignment\n    | if_statement                            # ifStatement\n    | return_statement                        # returnStatement\n    | for_loop                                # forLoop\n    ;\n\nassignment_statement:\n    IDENTIFIER '=' expression\n    ;\n\nif_statement:\n    'if' '('expression')' '{' statements '}' ('else' '{' statements '}')?\n    ;\n\nreturn_statement:\n    'return' expression\n    ;\n\nfor_loop:\n    'for' '('expression')' '{' statements '}'\n    ;\n\n# struct and object declaration to be defined later\n# struct_statement:\n#    'struct' IDENTIFIER '{' FIELD* '}'\n\nexpression:\n    function_call\n    | IDENTIFIER\n    | STRING \n    | NUMBER \n    | BOOL \n    | string_concat\n    | math_expression\n    | array_declaration\n    ;\n\narray_declaration:\n    '['(expression (','expression)*)?']'\n\nfunction_call:\n    IDENTIFIER '('parameterless')'\n    ;\n\nstring_concat:\n    STRING ('+' STRING)*\n    ;\n\nmath_expression:\n    term (('+' | '-') term)*\n    ;\n\nterm:\n    factor (('*' | '/') factor)*\n    ;\n\nfactor:\n    IDENTIFIER\n    | string\n    | number\n    | '('expression')'\n    ;\n\n// Lexer rules\n\nWS : [ \\t\\r\\n\\u000C]+ -\u003e skip;\nCOMMENT : '/*' .*? '*/' -\u003e skip;\nLINE_COMMENT : '//' ~[\\r\\n]* -\u003e skip;\nIDENTIFIER: ('_'|LETTER)(LETTER|DIGIT|'_')*;\nNUMBER: ('-' | '+')? (([1-9][0-9]*) | ([0-9]));\nOPERATOR: '+' | '-' | '*' | '/' | '%' | '!';\nfragment DIGIT: [0-9];\nBOOL: 'true' | 'false';\nLETTER: [a-zA-Z];\nSTRING: '\"' ~('\\r' | '\\n' | '\"')* '\"' ;\n```\n\n## Tasks\n\nThese are the list of the tasks that I think should be done before having the first release:\n\n- [x] Add variable declarations\n- [x] Add conditionals\n- [ ] Add Proper scoping\n- [ ] Add support for loops \n- [ ] Add Arrays support\n- [ ] Add Comments support\n- [ ] Add Hash support\n- [ ] Add import modules support\n- [ ] Add testing framework \n- [ ] Add build system\n- [ ] Add a standard library\n\n## Contribution\n\n- Feel free to submit new issues, or pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchermehdi%2Fcomet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchermehdi%2Fcomet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchermehdi%2Fcomet/lists"}