{"id":19396402,"url":"https://github.com/soheil-01/eva","last_synced_at":"2025-02-24T22:09:01.839Z","repository":{"id":232023942,"uuid":"783260514","full_name":"soheil-01/eva","owner":"soheil-01","description":"A Programming Language for Learning Purposes","archived":false,"fork":false,"pushed_at":"2024-04-16T20:55:20.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-17T00:40:18.709Z","etag":null,"topics":["interpreter","parser","programming-language","recursive-descent-parser","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/soheil-01.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}},"created_at":"2024-04-07T11:51:25.000Z","updated_at":"2024-05-07T15:50:26.901Z","dependencies_parsed_at":"2024-04-17T00:40:21.754Z","dependency_job_id":"47905d89-ef84-4817-8c3c-93f4f681b395","html_url":"https://github.com/soheil-01/eva","commit_stats":null,"previous_names":["soheil-01/zig-rdp","soheil-01/eva"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soheil-01%2Feva","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soheil-01%2Feva/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soheil-01%2Feva/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soheil-01%2Feva/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soheil-01","download_url":"https://codeload.github.com/soheil-01/eva/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240564595,"owners_count":19821422,"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","parser","programming-language","recursive-descent-parser","zig"],"created_at":"2024-11-10T10:34:59.661Z","updated_at":"2025-02-24T22:09:01.819Z","avatar_url":"https://github.com/soheil-01.png","language":"Zig","readme":"# Eva\n\nEva is a simple, interpreted programming language designed for educational purposes. It is implemented in Zig and aims to provide a clear and understandable syntax for beginners learning about programming concepts.\n\n## Run\n\n```bash\nzig build run -- example/basic.eva\n```\n\n## Examples\n\n### Math Operations\n\n```\n1 + 2 * 3 - 4 / 2; // Result: 5\n```\n\n### Variables\n\n```\nlet x = 1;\nx; // Result: 1\n\n{\n  let y = x + 2;\n  y; // Result: 3\n}\n\nx = 2;\nx; // Result: 2\n```\n\n### Relational Operators\n\n```\n3 \u003e 2; // Result: true\n1 \u003c 2; // Result: true\n2 \u003e 4; // Result: false\n2 \u003e= 2; // Result: true\n1 \u003c= 1; // Result: true\n```\n\n### Equality Operators\n\n```\n2 + 1 == 3; // Result: true\n2 + 3 != 1 + 4; // Result: false\n```\n\n## IF Statement\n\n```\nlet x = 1;\nif (x \u003c 2) {\n  x = x + 2;\n}\n// Result: x is now 3\n\nx = 2;\nif (x \u003c 2) {\n  // do nothing\n} else {\n  x = 10;\n}\n// Result: x is now 10\n```\n\n### While Loop\n\n```\nlet i = 0;\nwhile (i \u003c 10) {\n  i = i + 1;\n}\ni; // Result: 10\n```\n\n### Do While Loop\n\n```\ni = 0;\ndo {\n  i = i + 1;\n} while (i \u003c 1);\n// Result: i is 1\n```\n\n### For Loop\n\n```\nlet x = 0;\nfor (let i = 0; i \u003c 10; i = i + 1) {\n  x = x + 1;\n}\n// Result: x is 10\n```\n\n### Unary Operators\n\n```\n!(2 \u003e 1); // Result: false\n6 / -2; // Result: -3\n```\n\n### Functions\n\n```\nlet value = 100;\ndef calc(x, y){\n  let z = x + y;\n  def inner(foo){\n    return foo + z + value;\n  }\n  return inner;\n}\nlet fn = calc(10, 20);\nfn(30); // Result: 160\n```\n\n### Lambda Functions\n\n```\ndef onClick(callback) {\n  let x = 10;\n  let y = 20;\n  return callback(x+y);\n}\nonClick(lambda (data) data * 10); // Result: 300\n\n(lambda (x) x * 2)(2); // Result: 4\n\nlet square = lambda (x) x * x;\nsquare(4); // Result: 16\n```\n\n### Recursive Functions\n\n```\ndef fact(num) {\n  if(num == 1) { return 1; }\n  return num * fact(num - 1);\n}\nfact(5); // Result: 120\n```\n\n### Switch Statement\n\n```\nlet x = 10;\nlet answer = \"\";\nswitch(x){\ncase 10 {\n  answer = \"x is 10\";\n}\ncase 20 {\n  answer = \"x is 20\";\n}\ndefault {\n  answer = \"x is neither 10 nor 20\";\n}\n}\nanswer; // Result: \"x is 10\"\n```\n\n### Classes\n\n```\nclass Point {\n  def constructor(self, x, y){\n    self.x = x;\n    self.y = y;\n  }\n  def calc(self){\n    return self.x + self.y;\n  }\n}\nlet p = new Point(10,20);\np.calc(p); // Result: 30\n\nclass Point3D extends Point {\n  def constructor(self, x, y, z){\n    super(Point3D).constructor(self, x, y);\n    self.z = z;\n  }\n  def calc(self){\n    return super(Point3D).calc(self) + self.z;\n  }\n}\nlet p = new Point3D(10, 20, 30);\np.calc(p); // Result: 60\n```\n\n### Logical Operators\n\n```\n5 \u003e 3 \u0026\u0026 4 \u003c 3 || 5 \u003e 2; // Result: true\n```\n\n### Imports\n\n```\nlet Math = import(\"math\");\nMath.abs(-10); // Result: 10\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoheil-01%2Feva","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoheil-01%2Feva","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoheil-01%2Feva/lists"}