{"id":24527157,"url":"https://github.com/terahlunah/mana-fsharp","last_synced_at":"2026-05-18T02:11:48.815Z","repository":{"id":234281288,"uuid":"783945248","full_name":"terahlunah/mana-fsharp","owner":"terahlunah","description":"An experimental minimalist scripting language for dotnet","archived":false,"fork":false,"pushed_at":"2024-05-13T21:35:41.000Z","size":134,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-16T15:42:37.634Z","etag":null,"topics":["art","dotnet","embedded","fsharp","generative","language","minimalist","scripting"],"latest_commit_sha":null,"homepage":"","language":"F#","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/terahlunah.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-08T22:13:15.000Z","updated_at":"2024-11-22T22:40:06.000Z","dependencies_parsed_at":"2025-01-21T22:10:24.393Z","dependency_job_id":"ce43fe38-bdd5-4ed7-934b-a27a3b49f00f","html_url":"https://github.com/terahlunah/mana-fsharp","commit_stats":null,"previous_names":["terahlunah/mana"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/terahlunah/mana-fsharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terahlunah%2Fmana-fsharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terahlunah%2Fmana-fsharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terahlunah%2Fmana-fsharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terahlunah%2Fmana-fsharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terahlunah","download_url":"https://codeload.github.com/terahlunah/mana-fsharp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terahlunah%2Fmana-fsharp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33162448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["art","dotnet","embedded","fsharp","generative","language","minimalist","scripting"],"created_at":"2025-01-22T06:16:57.186Z","updated_at":"2026-05-18T02:11:48.801Z","avatar_url":"https://github.com/terahlunah.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mana\n\nAn experimental minimalist yet expressive scripting language for dotnet programs.\n\nWhile meant to be embedded in a host program, it comes with a simple REPL.\n\nMana has been created to serve as the scripting language for my private generative art tools.\nHence, the language design is trying to balance the following properties:\n\n- ### Minimalist\n  - Should be simple to parse and to run.\n  - Should contain the minimum needed to be work and delegate the rest to the host.\n  - Syntax should be lightweight and consistent.\n- ### Expressive\n  - Primitives should be powerful enough to support most use cases out of the box.\n  - Changing behavior should only require minimal code changes.\n- ### Intuitive\n  - Should use common syntax.\n  - Core functions should behave as you'd expect.\n\n#### These properties aim to create a tight feedback loop so one can focus on the art and not the script.\n\nTODO: Examples\n\n# Features\n\n- [x] Primitives (Nil, Bool, Num, Str, List, Table, Functions)\n- [x] First class functions\n- [x] Implicit `it` (Kotlin style)\n- [x] Chain call syntax `x.foo.bar.print` (data first pipeline)\n- [x] Pattern matching\n  - [x] Primitives\n  - [x] List destructuring\n  - [ ] Table destructuring\n- [x] Builtin core functions\n  - [ ] for/range loop construct\n  - [ ] Documentation\n- [ ] Early return / Loop break\n- [ ] Imports\n- [ ] Error reporting\n- [ ] Reference values\n\n# Language overview\n\n---\n\n## Comments\n\nComments in mana use the `;` symbol\n\n`; This is a comment`\n\n\n---\n\n## Values\n\n### Literals\n\nThere is 4 types if literals in Mana:\n\n### Nil\nWith a single value `nil`\n### Bool\nWith 2 values `true` and `false`\n### Num\nNumbers like `42` or `3.14`\n### Str\nStrings like `\"Hello World\"`\n\n---\n\n### Lists\n\nA basic collection of values.\n\n```\n[1, 2, 3]\n```\n\n---\n\n### Tables\n\nTables are dictionaries of `value:value` pairs. Any kind of value can serve as a key.\n\n```\n#[\n  \"a\" : 1,\n  \"b\" : 2\n]\n```\n\n---\n\n## Bindings\n\nValues can be locally bound to symbols using `let` bindings.\n\n```\nlet pi = 3.14\n```\n\nThey can then be reused later (in the same scope)\n\n```\nlet tau = 2 * pi\n```\n\n---\n\n## Functions\n\nFunctions in Mana are all defined as lambdas/closures.\nThey can be passed around and bound to symbols like any other kind of value.\n\nFor example this is how you would define an `add` function.\n\n```\nlet add = {|a, b| a + b } \n```\n\nFunctions can return other functions.\n\nFor functions with a single parameter, the shorthand `it` symbol can be used directly.\n\n```\nlet adder = { |n|\n  { it + n } \n}\n\nlet add2 = adder 2\n\nadd2 3 ; = 5\n```\n\n---\n\n## Chain calls\n\nThe `.` operator allows to write a sequence of operation of a value in an ergonomic way.\n\nIt takes the expression on its left and insert it as the first parameter of the function call on its right.\n\nThese 2 snippets are equivalent:\n\n```\nhead (rev (map [1,2,3] { it + 1})) ; = 4\n```\n```\n[1,2,3].map { it + 1}.rev.head ; = 4\n```\n\nThe chain syntax makes the sequences of operations left-to-right and clearer.\n\n---\n\n## Pattern matching\n\nPattern matching and destructuring is suported on `let` and `match` expressions\n\n```\nlet [a, b] = [1, 2]\n\nmatch [1, 2, 3]\n| 0 -\u003e display \"not the right type\"\n| [] -\u003e display \"empty list\"\n| [head, ..tail] -\u003e display \"non empty list\"\n\n```\n\n---\n\n# Interop\n\nThe interpreter is written in `F#` but the language can be used from any `dotnet` language, including `C#`.\n\nSee the usage examples:\n- [F# example](Example%20Fsharp/Program.fs)\n- [C# example](Example%20Csharp/Program.cs)\n\n---\n\n# Implementation\n\nIt is composed of 3 simple and independent parts:\n- Lexer (code -\u003e tokens)\n- Parser (tokens -\u003e AST)\n- Compiler (AST -\u003e closure)\n\nThe AST is 'compiled' into a deeply nested closure. Execution simply evaluates the closure.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterahlunah%2Fmana-fsharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterahlunah%2Fmana-fsharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterahlunah%2Fmana-fsharp/lists"}