{"id":13500999,"url":"https://github.com/skalamark/gl","last_synced_at":"2025-03-29T07:32:15.017Z","repository":{"id":217442042,"uuid":"341393800","full_name":"skalamark/gl","owner":"skalamark","description":"Language of script GLanguage","archived":false,"fork":false,"pushed_at":"2021-11-13T21:06:47.000Z","size":14,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-31T19:37:43.425Z","etag":null,"topics":["git-submodules","language","repl","rust-crate","rust-lang","scripting-language"],"latest_commit_sha":null,"homepage":"","language":null,"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/skalamark.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":"2021-02-23T01:47:06.000Z","updated_at":"2023-08-30T02:22:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"4f6d1a88-51d2-4276-bd0a-4c2a798e4482","html_url":"https://github.com/skalamark/gl","commit_stats":null,"previous_names":["skalamark/gl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skalamark%2Fgl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skalamark%2Fgl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skalamark%2Fgl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skalamark%2Fgl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skalamark","download_url":"https://codeload.github.com/skalamark/gl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246155998,"owners_count":20732355,"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":["git-submodules","language","repl","rust-crate","rust-lang","scripting-language"],"created_at":"2024-07-31T22:01:22.142Z","updated_at":"2025-03-29T07:32:15.004Z","avatar_url":"https://github.com/skalamark.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# GLanguage\n\n\u003e GLanguage Scripting Language written in Rust.\n\n### Install `cli`\n\nBuild from source using cargo:\n\n```bash\n$ git submodule init\n$ git submodule update\n\n$ cargo build --release\n```\n\n### Getting Started\n\n`REPL` (Read Eval Print Loop)\n\n```bash\n$ gl repl\n```\n\n`Eval` (Evaluate source from the command line)\n\n```bash\n$ gl eval \"42\"\n```\n\n`Run` (Run program from a script file)\n\n```bash\n$ gl run script.gl\n```\n\n`Fmt` (Format a script file)\n\n```bash\n$ gl fmt script.gl\n```\n\n## Documentation\n\n- [Syntax overview](#syntax-overview)\n    - [Operators](#operators)\n- [Variable bindings](#variable-bindings)\n- [Literals](#literals)\n    - [Integer](#integer)\n    - [Float](#float)\n    - [Boolean](#boolean)\n    - [String](#string)\n    - [Vec](#vec)\n    - [Tuple](#tuple)\n    - [HashMap](#hashmap)\n    - [Function](#function)\n\n\n### Syntax overview\n\n#### Operators\n\nIt supports the general operations.\n\n```rust\n1 + 2 + (3 * 4) - (10 / 5)\n!true\n!false\n+10\n-5\n\"Hello\" + \" \" + \"World\"\n```\n\n### Variable bindings\n\nVariable bindings, such as those supported by many programming languages, are implemented. Variables can be defined using the `let` keyword.\n\n**Format:**\n\n```rust\nlet \u003cidentifier\u003e = \u003cexpression\u003e\n```\n\n**Example:**\n\n```rust\nlet x = 0\nlet y = 10\nlet function = fn(x) { x }\n```\n\n### Literals\n\nLiterals implemented.\n\n#### Integer\n\n`Integer` represents an integer value.\n\n**Format:**\n\n```rust\n42\n200\n```\n\n#### Float\n\n`Float` represents an float value.\n\n**Format:**\n\n```rust\n3.1415\n```\n\n#### Boolean\n\n`Boolean` represents a general boolean types.\n\n**Format:**\n\n```rust\ntrue | false\n```\n\n**Example:**\n\n```rust\ntrue\nfalse\n\nlet truthy = !false\nlet falsy = !true\n```\n\n#### String\n\n`String` represents a string. Only double quotes can be used.\n\n**Format:**\n\n```rust\n\"\u003cvalue\u003e\"\n```\n\n**Example:**\n\n```rust\n\"GLanguage\"\n\"Hello\" + \" \" + \"World\"\n```\n\n#### Vec\n\n`Vec` represents an ordered contiguous element. Each element can contain different data types.\n\n**Format:**\n\n```rust\n[\u003cexpression\u003e, \u003cexpression\u003e, ...]\n```\n\n**Example:**\n\n```rust\n[1, 2, 3 + 3, fn(x) { x }, add(2, 2), true]\n```\n\n```rust\nlet vec = [1, true, fn(x) { x }]\n\nvec[0]\nvec[1]\nvec[2](10)\nvec[1 + 1](10)\n```\n\n\n#### Tuple\n\n`Tuple` represents an ordered contiguous element. Each element can contain different data types.\n\n**Format:**\n\n```rust\n(\u003cexpression\u003e, \u003cexpression\u003e, ...)\n```\n\n**Example:**\n\n```rust\n(1, 2, 3 + 3, fn(x) { x }, add(2, 2), true)\n```\n\n#### HashMap\n\n`HashMap` represents data associating keys with values.\n\n**Format:**\n\n```rust\n{\u003cexpression\u003e: \u003cexpression\u003e, \u003cexpression\u003e: \u003cexpression\u003e, ...}\n```\n\n**Example:**\n\n```rust\nlet hashmap = {\n  \"name\": \"José Carlos\",\n  \"age\": 17,\n  true: \"a boolean\",\n  42: \"an integer\"\n  3.1415: \"an float\",\n  fn (){}: \"an function\",\n}\n\nhashmap[\"name\"]\nhashmap[\"a\" + \"ge\"]\nhashmap[true]\nhashmap[42]\nhashmap[4.1415 - 1]\nhashmap[fn (){}]\n```\n\n#### Function\n\n`Function` supports functions like those supported by other programming languages.\n\n**Format:**\n\n```rust\nfn (\u003cparameter one\u003e, \u003cparameter two\u003e, ...) { \u003cblock statement\u003e };\n```\n\n**Example:**\n\n```rust\nlet add = fn(x, y) {\n  x + y\n}\n\nadd(10, 20)\n```\n\n```rust\nfn add(x, y) {\n  x + y\n};\n\nadd(10, 20)\n```\n\nIf `return` does not exist, it returns the result of the last evaluated expression.\n\n```rust\nlet add_three = fn(x) { x + 3 }\nlet call_two_times = fn(x, f) { f(f(x)) }\n\ncall_two_times(3, add_three)\n```\n\n## License\n\n[MIT © Skalamark](./LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskalamark%2Fgl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskalamark%2Fgl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskalamark%2Fgl/lists"}