{"id":23764438,"url":"https://github.com/chaqchase/matz","last_synced_at":"2025-09-05T08:33:32.835Z","repository":{"id":196198356,"uuid":"694405792","full_name":"chaqchase/matz","owner":"chaqchase","description":"An Experimental Programming Langauge Written With Bun.sh","archived":false,"fork":false,"pushed_at":"2023-09-23T00:10:12.000Z","size":1003,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-29T00:24:38.258Z","etag":null,"topics":["bun","bun-cli","bun-js","experimental","linear-algebra","matrix","programming-language","typescript","vector"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/chaqchase.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}},"created_at":"2023-09-21T00:06:23.000Z","updated_at":"2023-11-23T00:43:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"5e58b947-b60b-451d-8491-a02b59e639f9","html_url":"https://github.com/chaqchase/matz","commit_stats":null,"previous_names":["triyanox/matz","chaqchase/matz"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Fmatz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Fmatz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Fmatz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Fmatz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaqchase","download_url":"https://codeload.github.com/chaqchase/matz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232032225,"owners_count":18462986,"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":["bun","bun-cli","bun-js","experimental","linear-algebra","matrix","programming-language","typescript","vector"],"created_at":"2024-12-31T22:18:08.980Z","updated_at":"2024-12-31T22:18:10.098Z","avatar_url":"https://github.com/chaqchase.png","language":"TypeScript","readme":"# `matz` - An Experimental Linear Algebra Langauge Written With Bun.sh\n\n\u003cimg src=\"https://raw.githubusercontent.com/triyanox/matz/main/assets/banner.png\" alt=\"matz banner\"\ntitle=\"matz\" align=\"center\" height=\"auto\" width=\"100%\"/\u003e\n\nThis is a toy programming language that I'm building with Bun.sh to learn more about intrepreters. It's inspired by the syntax of python and javascript and it's meant to be used for linear algebra operations.\n\n## Syntax\n\n\u003cimg src=\"https://raw.githubusercontent.com/triyanox/matz/main/assets/hello-world.png\" alt=\"matz banner\"\ntitle=\"matz\" align=\"center\" height=\"auto\" width=\"100%\"/\u003e\n\nThis is the syntax it's inspired by the synatax of python and javascript.\n\n```\n# declare scaler\nscaler B = 2\n\n# declare vector\nvector A = [21, 24, 12]\nvector L = [24, 12, 24]\n\n# declare matrix\nmatrix D = [[23, 12, 11], [12, 23, 12], [12, 12, 23]]\n\n# declare in one line\nscaler K = 2, scaler O = 2, scaler P = 2\nvector F = [2, 2, 2], vector G = [2, 2, 2], vector H = [2, 2, 2]\nmatrix Z = [[23, 12, 11], [12, 23, 12], [12, 12, 23]] matrix Y = [[23, 12, 11], [12, 23, 12], [12, 12, 23]]\n\n# declare a computed vector\ncomputeVector C = [A, A,D]\nprint(\"print C\", C) # print the vector\n\n# declare a computed matrix\ncomputeMatrix E = [D, D]\nprint(\"print E\", E) # print the matrix\n\n# print the values\nprint(\"print A\", A) # print the vector\n\n# vector operations\ncalcVec SUM = A + A\ncalcVec SUB = A - A\ncalcVec MUL = A * A\ncalcVec DIV = A / A\ncalcVec CROSS = A x A\ncalcVec SCALE = A _ 4 # scale a vector\n\n# vector builtins operations\ncalc norm = norm(A)  # calculate the norm of the vector\ncalc normalize = normalize(A)  # normalize the vector\ncalc angle = angle(A, A)  # calculate the angle between two vectors\ncalc distance = distance(A, A)  # calculate the distance between two vectors\ncalc midpoint = midpoint(A, A)  # calculate the midpoint between two vectors\n# calculate the projection of a vector on another vector\ncalc projection = project(A, A)\n# calculate the rejection of a vector on another vector\ncalc rejection = reject(A, A)\n# calculate the reflection of a vector on another vector\ncalc reflection = reflect(A, A)\n# calculate the refraction of a vector on another vector\ncalc refraction = refract(A, L, 4) # scale a matrix\n\n# matrix operations\ncalcMat SUM2 = D + D\ncalcMat SUB2 = D - D \ncalcMat MUL2 = D * D   \ncalcMat SCALE2 = D _ 6   \n\n# matrix builtins operations\ncalc INVERSE2 = inverse(D)  # calculate the inverse of a matrix\ncalc TRANSPOSE2 = transpose(D)  # calculate the transpose of a matrix\ncalc DETERMINANT2 = determinant(D)  # calculate the determinant of a matrix\n\n# also you can the js context and access the built-in methods inside the print string args\nprint(\" \")\nprint(\"print A\", \"*A.values\")\nprint(\" \")\nprint(\"print A scaled by 2\", \"*D.scale(2).values\")\n\n# declare a function to compute a matrix from a vector\nfunction matFromVecs(vector A)-\u003e matrix {\n    computeMatrix B = [A, A, A]\n    return B\n}\n\n# declare a function to compute the norm of a vector\nfunction getNorm(vector A)-\u003e scaler {\n    calc B = norm(A)\n    return B # function can return only values for the moement\n}\n\n# call the functions\nresult mat = matFromVecs(A) # result is a keyword to return a value from a function\nresult n = getNorm(A)\n\nprint(\"print mat\", \"*mat.values\") # print the matrix\nprint(\"print n\", n) # print the norm\n```\n\n## Roadmap\n\nThis is just a toy project to learn more about intrepreters so it's not meant to be used in production. But this is the roadmap for the future:\n\n- [x] Comments\n- [x] Vectors\n- [x] Matrices\n- [x] Operations\n- [x] Builtins\n- [x] Functions\n- [ ] Custom JS code\n- [ ] Accessors \n- [ ] Conditionals\n- [ ] Loops\n- [ ] Error handling \n- [ ] Modules\n- [ ] Async/Await\n\n## Installation\n\n```bash\ndocker pull ghcr.io/triyanox/matz:main\n```\n\n## Usage\n\n### Basic usage\n\n```bash\ndocker run -it --rm ghcr.io/triyanox/matz:main run \u003cfile\u003e\n```\n\n### Additional commands\n\n```\nUsage: matz [options] [command]\n\nOptions:\n  -V, --version            output the version number\n  -h, --help               display help for command\n\nCommands:\n  run \u003cfile\u003e               Run a matz file\n  transpile \u003cfile\u003e \u003cpath\u003e  Transpile a matz file to javascript\n  ast \u003cfile\u003e               Print the AST of a matz file\n  help [command]           display help for command\n```\n\n## Install vscode extension\n\nYou can install the vscode extension [here](https://marketplace.visualstudio.com/items?itemName=matz.matz-vscode).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaqchase%2Fmatz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaqchase%2Fmatz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaqchase%2Fmatz/lists"}