{"id":22821973,"url":"https://github.com/zavvdev/elise-lang","last_synced_at":"2025-10-24T07:52:22.611Z","repository":{"id":229512590,"uuid":"776858204","full_name":"zavvdev/elise-lang","owner":"zavvdev","description":"Mini programming language.","archived":false,"fork":false,"pushed_at":"2025-01-04T09:48:47.000Z","size":246,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-24T07:52:21.066Z","etag":null,"topics":["interpreter","language","lexer","parser","programming-language","rust","semantic-analysis","semantic-analyzer","tokenizer","tokenizer-parser"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/zavvdev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-24T16:35:30.000Z","updated_at":"2025-04-22T20:32:41.000Z","dependencies_parsed_at":"2024-04-18T13:56:37.395Z","dependency_job_id":"dbfbb38f-1d23-4378-8efb-9992962984bb","html_url":"https://github.com/zavvdev/elise-lang","commit_stats":null,"previous_names":["zavvdev/elise-lang"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zavvdev/elise-lang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zavvdev%2Felise-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zavvdev%2Felise-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zavvdev%2Felise-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zavvdev%2Felise-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zavvdev","download_url":"https://codeload.github.com/zavvdev/elise-lang/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zavvdev%2Felise-lang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280761857,"owners_count":26386245,"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","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["interpreter","language","lexer","parser","programming-language","rust","semantic-analysis","semantic-analyzer","tokenizer","tokenizer-parser"],"created_at":"2024-12-12T16:09:59.697Z","updated_at":"2025-10-24T07:52:22.580Z","avatar_url":"https://github.com/zavvdev.png","language":"Rust","readme":"# elise-lang\n\n### ToDo\n\n- [x] number\n- [x] print function\n- [x] basic arithmetics\n- [x] value binding\n- [x] nil\n- [x] boolean\n- [x] strings\n- [x] conditions\n- [x] nil? function\n- [x] custom function\n- [x] add source code to error message with error highlighting\n    - [x] lexer\n    - [x] parser\n    - [x] semanalyzer (static)\n    - [x] interpreter\n- [x] disallow to define identifiers with the name of known function (add, sum, nil? etc.)\n- [x] function closure (use data from lexical scope during function execution)\n- [ ] runtime optimizations (get rid of redundant allocations)\n\n## Boolean\n\nBoolean literals: `true` and `false`\n\n## String\n\nUse `\"` to create string literals. Example:\n\n```\n\"Hello, World\"\n\"Hello\\nWorld\"\n```\n\n## Number\n\nNumber literals: `1`, `1.2`\n\n## .print\n\nPrints result of expressions\n\n```\n.print(\u0026 more)\n```\n\n## .println\n\nLike `.print` but with `\\n` at the end\n\n```\n.println(\u0026 more)\n```\n\n## .add\n\nReturns the sum of numbers. `.add()` returns `0`\n\n```\n.add()\n.add(x)\n.add(x y)\n.add(x y \u0026 more)\n```\n\n## .sub\n\nIf no ys are supplied, returns the negation of `x`, else subtracts the ys from `x` and returns the result\n\n```\n.sub(x)\n.sub(x y)\n.sub(x y \u0026 more)\n```\n\n## .mul\n\nReturns the product of nums. `.mul()` returns `1`\n\n```\n.mul()\n.mul(x)\n.mul(x y)\n.mul(x y \u0026 more)\n```\n\n## .div\n\nIf no denominators are supplied, returns result of `1/numerator`, else returns numerator divided by all of the denominators\n\n```\n.div(x)\n.div(x y)\n.div(x y \u0026 more)\n```\n\n## .let\n\nEvaluates the exprs in a lexical context in which the symbols in the binding-forms are bound to their respective init-exprs\n\n```\n.let([binding-form init-expr] exprs*)\n```\n\nExample:\n\n```\n.let([x 2, y 10]\n    .println(.add(x y)))\n```\n\nAlso, `.let` function returns the result of the last expression:\n\n```\n.print(.let([x 1] x))\n```\n\nResult: `1`\n\n## .greatr\n\nReturns `true` if nums are in monotonically decreasing order, otherwise `false`.\n\n```\n.greatr(x)\n.greatr(x y)\n.greatr(x y \u0026 more)\n```\n\n## .greatr-eq\n\nReturns `true` if nums are in monotonically non-increasing order, otherwise `false`.\n\n```\n.greatr-eq(x)\n.greatr-eq(x y)\n.greatr-eq(x y \u0026 more)\n```\n\n## .less\n\nReturns `true` if nums are in monotonically increasing order, otherwise `false`.\n\n```\n.less(x)\n.less(x y)\n.less(x y \u0026 more)\n```\n\n## .less-eq\n\nReturns `true` if nums are in monotonically non-decreasing order, otherwise `false`.\n\n```\n.less-eq(x)\n.less-eq(x y)\n.less-eq(x y \u0026 more)\n```\n\n## .eq\n\nEquality. Returns `true` if `x` equals `y`, `false` if not.\n\n```\n.eq(x)\n.eq(x y)\n.eq(x y \u0026 more)\n```\n\n## .not\n\nReturns `true` if `x` is logical `false`, `false` otherwise.\n\n```\n.not(x)\n```\n\n## .not-eq\n\nSame as `.not(.eq(x))`.\n\n```\n.not-eq(x)\n.not-eq(x y)\n.not-eq(x y \u0026 more)\n```\n\n## .and\n\nEvaluates exprs one at a time, from left to right. If a form returns logical `false` (`nil` or `false`), `.and` returns that value and doesn't evaluate any of the other expressions, otherwise it returns the value of the last expr. `.and()` returns `true`.\n\n```\n.and()\n.and(x)\n.and(x \u0026 next)\n```\n\n## .or\n\nEvaluates exprs one at a time, from left to right. If a form returns a logical `true` value, `.or` returns that value and doesn't evaluate any of the other expressions, otherwise it returns the value of the last expression. `.or()` returns `nil`.\n\n```\n.or()\n.or(x)\n.or(x \u0026 next)\n```\n\n## .bool\n\nCoerce to boolean. Everything except `false` and `nil` is `true` in boolean context.\n\n```\n.bool(x)\n```\n\n## .if\n\nEvaluates the first argument and performs boolean coercion of the result. If it results to `true` evaluates the second argument and returns result. Otherwise, evaluates the third argument and returns the result. If the third argument is absent - returns `nil`.\n\n```\n.if(condition then)\n.if(condition then else)\n```\n\n## .nil?\n\nReturns `true` if `x` is `nil`, false otherwise\n\n```\n.nil?(x)\n```\n\n## .fn\n\n```\n.fn (name [\u0026 args] body)\n```\n\nCreates an identifier labeled with `name` that holds a function declaration record that can be invoked with `args` (if declared) to execute its `body`. Body has access to `args` identifiers that are bound to the values passed during invocation as well as identifiers in outer (parent) scope where it's created. Function can be invoked only after declaration.\n\nExample:\n\n```\n.fn (fact [n]\n    .if(.eq(n, 0)\n      1\n      .mul(n, .fact(.sub(n 1)))))\n\n.println(.fact(3))\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzavvdev%2Felise-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzavvdev%2Felise-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzavvdev%2Felise-lang/lists"}