{"id":18738642,"url":"https://github.com/dantevg/oblock","last_synced_at":"2025-04-12T19:33:02.077Z","repository":{"id":110855684,"uuid":"357158146","full_name":"Dantevg/Oblock","owner":"Dantevg","description":"Prototype-based object-oriented language about generalisation","archived":false,"fork":false,"pushed_at":"2025-02-21T09:41:18.000Z","size":345,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T14:08:30.002Z","etag":null,"topics":["oop","programming-language","prototype-based"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/Dantevg.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}},"created_at":"2021-04-12T10:55:17.000Z","updated_at":"2025-02-21T09:41:22.000Z","dependencies_parsed_at":"2023-03-22T10:18:04.753Z","dependency_job_id":"7b960803-809b-4b7c-9463-0c63b28a0572","html_url":"https://github.com/Dantevg/Oblock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dantevg%2FOblock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dantevg%2FOblock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dantevg%2FOblock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dantevg%2FOblock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dantevg","download_url":"https://codeload.github.com/Dantevg/Oblock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248621432,"owners_count":21134852,"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":["oop","programming-language","prototype-based"],"created_at":"2024-11-07T15:29:52.365Z","updated_at":"2025-04-12T19:33:01.712Z","avatar_url":"https://github.com/Dantevg.png","language":"Lua","readme":"# Oblock\nOblock is a prototype-based object-oriented language about generalisation.\n\n## Features\nInspired by [Lua] and [Io], Oblock seeks to further reduce the number of\ndifferent concepts in a language by (over)generalising features together. These\nare Oblock's main features / selling points:\n\n### Blocks are objects\nThis unifies the creation of objects and the assignment of variables. Now you\ncan perform computations when creating objects!\n```lua\na = {\n    x = 21\n    y = 2*x\n}\nprint(a.y) --\u003e 42\n```\nList literals are also blocks: (although assignment syntax works a little\ndifferently)\n```lua\na = [16, x = 42, (if true: -x), 32]\nprint(a.1, a.x) --\u003e 16, 42\nprint(a) --\u003e [16, -42, 32]\n```\nIf you were wondering, this is what led to the name (object + block = Oblock).\n\n### Prototypal OOP\nAlso notice the easy operator overloading by just assigning a function to the\nstring field `\"+\"`.\n```lua\nVector = {\n    \"+\" that =\u003e this.clone {\n        x = this.x + that.x\n        y = this.y + that.y\n    }\n}\n\nv = Vector.clone {\n    x = 10\n    y = 20\n}\n\nprint(v + v) --\u003e { x = 20; y = 40 }\n```\n\n### A grain of FP\nDefinitions are constant by default and are separate from assignments. Use\n`var` to define a new variable and `:=` to assign to an existing one.\n```lua\nmap = fn =\u003e list =\u003e {\n    new = []\n    for x in list: new.append(fn x)\n    return new\n}\n\nl = map (x =\u003e x+1) [10, 20, 30]\nprint l --\u003e [11, 21, 31]\n```\n\n## Examples\n### Reading input\n```lua\nIO = import \"Io\"\nfor word in IO.stdin.splitAt \" \": print(word.toString().length)\n```\n\nFor more examples of Oblock, have a look at the files in the\n[`src/test/`](src/test/) directory.\n\n## Installation\nYou can give Oblock a spin:\n1. Clone the repository (`git clone https://github.com/Dantevg/Oblock`)\n2. Install Lua if you haven't already\n3. From the [`src/lua/`](src/lua/) directory, run `./oblock.lua` and type away!\n\n### VS Code language extension\nThere is a VS Code extension that provides syntax highlighting. You can find it\nhere: https://github.com/Dantevg/Oblock-vscode. It's not yet on the marketplace,\nbut you can install it manually by downloading the latest version from the\n[releases page](https://github.com/Dantevg/Oblock-vscode/releases) and running\n`code --install-extension  oblock-language-0.0.3.vsix`.\n\n## REPL\nTo enable the REPL, run Oblock with the `--interactive` or `-i` parameter. Each\nline is interpreted as an expression. To assign variables at the top-level, you\ncan wrap assignments in parentheses:\n```\n\u003e (hey := \"hello\")\n\u003e hey\nhello\n```\n\n## Status and roadmap\nOblock is currently still very much in development and the design is not yet\nfinal. Most basic features are complete, but the language is missing some key\nfeatures. These are the features that are still to come, roughly in order:\n- I/O with streams\n- proper module system\n- standard library\n- error handling\n- coroutines\n- parallelism\n\nThe [`notes/`](notes/) directory contains some files with notes. Please keep in\nmind that most of those files are old and I haven't updated them in a while.\n[`notes.md`](notes/notes.md) is the most active notes file, but that also still\nhas some old ideas and out-of-date information the further down you go.\nThese notes were also primarily meant for my later self (this repo was private\nuntil very recent, depending on when you read this), so some may not even make\nsense to you. They may also show you how much I don't know what I'm doing, but\noh well!\n\n[Lua]: https://www.lua.org/\n[Io]: https://iolanguage.org/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdantevg%2Foblock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdantevg%2Foblock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdantevg%2Foblock/lists"}