{"id":24845919,"url":"https://github.com/flarelang/flare","last_synced_at":"2025-10-14T17:31:11.794Z","repository":{"id":274861344,"uuid":"923187299","full_name":"bndrmrtn/zexlang","owner":"bndrmrtn","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-29T19:15:28.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T20:26:43.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/bndrmrtn.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":"2025-01-27T19:35:17.000Z","updated_at":"2025-01-29T19:15:31.000Z","dependencies_parsed_at":"2025-01-29T20:26:59.967Z","dependency_job_id":"2e884bde-d43e-4ee8-b2cf-ca6daeb0d721","html_url":"https://github.com/bndrmrtn/zexlang","commit_stats":null,"previous_names":["bndrmrtn/zexlang"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bndrmrtn%2Fzexlang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bndrmrtn%2Fzexlang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bndrmrtn%2Fzexlang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bndrmrtn%2Fzexlang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bndrmrtn","download_url":"https://codeload.github.com/bndrmrtn/zexlang/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236496058,"owners_count":19158144,"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":"2025-01-31T10:17:17.991Z","updated_at":"2025-10-14T17:31:11.790Z","avatar_url":"https://github.com/bndrmrtn.png","language":"Go","funding_links":["https://www.paypal.me/instasiteshu","https://ko-fi.com/bndrmrtn"],"categories":[],"sub_categories":[],"readme":"# Flare ✨\n\nFlare is a simple programming language\nthat is designed to be easy to use and understand. [Examples](https://github.com/orgs/flarelang/repositories).\n\n# IMPORTANT\n\nFlare will be replaced by Nubo, a new interpreter language with a much better interpreter and language features. If you are interested, here is the new repo:\nhttps://github.com/nubolang/nubo. It will be a powerful real-time programming language.\n\n## About\n\nFlare is a weakly-typed, interpreted language that is designed to be easy to use and understand.\nFlare is built in Go as a learning project and is not intended to be used in production.\n\n## Features\n\n- Weakly-typed\n- Interpreted\n- Flare Blocks\n- Threads and Concurrency\n\n# Syntax Highlihting\n\nFlare now has a `VSCode` plugin for highlighting code (no LSP currently). [Download now](https://marketplace.visualstudio.com/items/?itemName=flarelang.flarelang)\n\n## Installation\n\nTo install Flare, you need to have Go installed on your system.\n\n```bash\ngo install github.com/flarelang/flare@latest\n```\n\n## Usage\n\nTo run a Flare program, you can use the `flare` command.\n\n```bash\nflare run \u003cfile\u003e\n```\n\nFlags can be used to cache or debug the program.\n\n```bash\nflare run \u003cfile\u003e --cache --debug\n```\n\n## Examples\n\n#### Basic Hello World program:\n\n```flare\nprintln(\"Hello, World!\");\n```\n\n#### Define a variable and print it:\n\n```flare\nlet x = 10;\nprintln(x);\n```\n\n#### Define a function and call it:\n\n```flare\nfn add(a, b) {\n  return a + b;\n}\n\nlet result = add(10, 20);\nprintln(result);\n```\n\n### Error handling:\n\n```flare\nerror err: fail(\"This is a helper to throw an error\");\nif err != nil {\n  println(\"error occurred:\", err);\n}\n```\n\n```flare\nerror otherErr {\n  const x = 5;\n  x = 6; // an error will happen\n}\n\nif otherErr != nil {\n  println(\"error occurred:\", otherErr);\n}\n\nprintln(x); // x is in the same scope as global so it will print 5, because\n            // thats the value of x before the error occurred\n```\n\n#### Define a block and use it:\n\n```flare\ndefine MyBlock {\n  let x = 10;\n\n  fn construct(value) {\n    this.x = value;\n  }\n}\n\nlet block = MyBlock(20);\nprintln(block.x);\n```\n\n### Using namespaces:\n\nFile `main.fl`:\n```flare\nnamespace main;\n\nimport(\"other.fl\");\nother.printHello();\n```\n\nFile `other.fl`:\n```flare\nnamespace other;\n\nfn printHello() {\n  println(\"Hello from other.fl!\");\n}\n```\n\n### Loops\n\n```flare\nfor i in range(10) {\n  println(i);\n}\n\nfor i in range([10, 20]) {\n  println(i);\n}\n\nfor i in range([10, 20, 2]) {\n  println(i);\n}\n\nfor letter in \"Hello\" {\n  println(letter);\n}\n\nfor i in 7 {\n  println(i);\n}\n\nfor i in [5, 6, 7] {\n  println(i);\n}\n\nlet i = 0;\nwhile i \u003c 10 {\n  println(i);\n  i = i + 1;\n}\n```\n\n### Arrays\n\n```flare\nuse iter;\n\nlet myArr = array {\n  name: \"John\",\n  \"age\": 30,\n  city: \"New York\",\n};\n\nfor row in iter.Array(myArr) {\n    println(row.key + \":\", row.value);\n}\n```\n\n### Concurrency\n\n```flare\nuse thread;\n\nfn doLater() {\n  // some task\n}\n\nthread.spawn(doLater);\nthread.sleep(1000); // Wait one second\n```\n\n### Usage of Portals\n\n```flare\nuse thread;\n\ndefine User {\n  let name;\n  let age;\n  let portal;\n\n  fn construct(name, age) {\n    this.name = name;\n    this.age = age;\n  }\n\n  fn intro() {\n    println(\"Hello, I am \", this.name, \"and I am \", this.age, \" years old.\");\n    this.portal.send(true);\n  }\n}\n\nlet users = [];\nusers.append(User(\"John\", 25));\nusers.append(User(\"Jane\", 23));\nusers.append(User(\"Emily\", 21));\n// ...\n\n// create a portal for communication between threads\nconst portal = thread.portal(users.length);\n// create a custom spawner with users.length async threads\nconst spawner = thread.spawner(users.length);\n\n// spawn all async methods\nfor user in users {\n  user.portal = portal;\n  spawner.spawn(user.intro);\n}\n\n// wait for all async methods to finish\nfor i in (users.length) {\n  // portal.receive() waits until any async method sends a message to it\n  portal.receive();\n}\n\n// close the portal and spawner\nportal.close();\nspawner.close();\n```\n\n## Support\n\nSupport my work by giving this project a star.\n\n- [PayPal](https://www.paypal.me/instasiteshu)\n- [Ko-Fi](https://ko-fi.com/bndrmrtn)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflarelang%2Fflare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflarelang%2Fflare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflarelang%2Fflare/lists"}