{"id":26659844,"url":"https://github.com/toma400/tribalify","last_synced_at":"2025-03-25T11:15:37.174Z","repository":{"id":190890092,"uuid":"683528239","full_name":"Toma400/Tribalify","owner":"Toma400","description":"Nim library that adds sugar syntax from indev programming language Tribal, trying to make Nim feel more like Tribal language.","archived":false,"fork":false,"pushed_at":"2023-09-24T15:13:16.000Z","size":193,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"tribalify","last_synced_at":"2025-03-25T11:15:33.591Z","etag":null,"topics":["nim","nim-lang","nim-library","syntax-sugar","utilities-library"],"latest_commit_sha":null,"homepage":"","language":"Nim","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/Toma400.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-08-26T21:23:53.000Z","updated_at":"2023-09-01T18:25:44.000Z","dependencies_parsed_at":"2023-09-24T18:13:43.408Z","dependency_job_id":null,"html_url":"https://github.com/Toma400/Tribalify","commit_stats":null,"previous_names":["toma400/tribalify"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Toma400%2FTribalify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Toma400%2FTribalify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Toma400%2FTribalify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Toma400%2FTribalify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Toma400","download_url":"https://codeload.github.com/Toma400/Tribalify/tar.gz/refs/heads/tribalify","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245449675,"owners_count":20617190,"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":["nim","nim-lang","nim-library","syntax-sugar","utilities-library"],"created_at":"2025-03-25T11:15:36.486Z","updated_at":"2025-03-25T11:15:37.123Z","avatar_url":"https://github.com/Toma400.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](tribalify.png)\n\n**Tribalify** is syntax sugar library aimed on creating Nim interface for \nindev programming language called Tribal.  \nTribalify offers Tribal features by adding them onto Nim experience by use of macros,\ntemplates and other procedures. They are all available under `tribalify` file.\n\nTake in mind that Tribalify's syntax may differ from pure Tribal. This is because\nthe library tries to incorporate itself into current Nim language.\n\n### Contents\n- [Why Tribalify](#why-tribalify)\n- [Installation \u0026 usage](#installation--usage)\n- Features\n  - [New types](#new-types)\n  - [Aliases](#aliases)\n  - [Functionalities](#functionalities)\n  - [Syntax sugar](#syntax-sugar)\n- [Experimental features](#experimental)\n\n### Why Tribalify?\nJust because I love Nim, but there are some things from Tribal language ideas that\nI wanted to see there as well. Tribalify is actually heavily inspired by other few\nlibraries that bring my beloved languages into Nim:\n  - classes      - introducing Python-like OOP with class type\n  - questionable - introducing Kotlin-like syntax sugar for Option\n  - results      - introducing Rust-like Result type\n  - with         - introducing JS-like deprecated 'with' feature\n\nSo, with such legacy, Tribalify was made as final step. It will try to be as small\nas possible, yet trying to add as many Tribal-like features as it can.\n\n### Installation \u0026 usage\nWrite following command in your terminal to install Tribalify using Nimble:\n```commandline\nnimble install https://github.com/Toma400/Tribalify\n```\nOnce it is done, you can use Tribalify features simply after importing:\n```nim\nimport tribalify\n\nvar i = newPair(\"Tom\", \"Parker\")\nwhisper(\"Name of your son is: \" \u0026 i.first)\n```\nNimble by default installs latest release of Tribalify, so you may not be able to\nuse currently indev features (marked with ⚙️ emoji).  \nIf you want to play with new features before library updates, you can also use\nthis command in terminal instead:\n```\nnimble install https://github.com/Toma400/Tribalify@#HEAD\n```\n\n### New types\n- `pair(F, S)` - convenience type for double values:\n  - initialise with `newPair()` proc\n  - can be stringified (`$`) to get string repr\n  - use `.first` and `.second` to get specific field\n  - use `.toPair` to convert tuple of 2 values to pair ⚙️\n- `triad(F, S, T)` - convenience type for triple values:\n  - initialise with `newTriad()` proc\n  - can be stringified (`$`) to get string repr\n  - use `.first`, `.second` and `.third` to get specific field\n  - use `.toTriad` to convert tuple of 3 values to triad ⚙️\n\n### Aliases\n- Types:\n  - `str` - alias for `string` type\n- Operators:\n  - `\u0026\u0026` - alias for `and`\n  - `||` - alias for `or`\n  - `\u003c\u003e` - alias for `xor` (exclusive OR)\n- Procs:\n  - `whisper(str)` - proc imitating `echo`. Also aliased as `puts(str)`\n  - `scribe(str)` - proc imitating `readLine(stdin)` but with additional string evoking\n  echo. Also aliased as `gets(str)`\n\n### Functionalities\n- `tab` - key used to separate sections of code aesthetically. Similar to Nim's `block`,\nbut does not create new scope. Example code:\n```nim\nblock:\n  var i = 5\necho i # will result in error, 'i' declared in different scope\n\ntab:\n  var y = 5\necho y # will work nicely, 'y' is in the same scope\n```\n- `end` - key used to optionally signify end of the identation. Aimed mostly at Ruby\ncoders or those who like such system. Tribalify's `end` has several variations:\n```nim\nif 1 == 1:     # endIf for conditions\n  discard\nendIf\n\nwhile true:    # endLoop for loops\n  discard\nendLoop\n\nproc x(): string =   # endProc for procs\n  \"Hello world\"\nendProc\n\nblock:\n  tab:\n    echo \"It supports Tribalify's tab too!\"\n  endTab\nendBlock\n```\n\n### Syntax sugar\n- `\u003c!` and `!\u003e`\n  - append elements to mutable collection-like types. Works on every type that\n  implements `.add` function, as it basically uses it in template\n- `isAny(T, varargs[T])` ⚙️\n  - let you check if first argument is any of next args. Equivalent of\n  `if T == A or T == B or T == C ... `.\n- `isAll(T, varargs[T])` ⚙️\n  - let you check if first argument is all of next args. Equivalent of\n  `if T == A and T == B and T == C ... `.\n\n---\nIf you don't know how any of those concepts should be written, look at `examples.nim`\nfile to see code references.\n\n---\n### Experimental\nYou can use `import tribalify/experimental` to import features that are experimental\nand not ready to use yet. Check `experimental.nim` file for further details.\n\n\u003c!-- CHANGELOG:\n- 0.1.0:\n  - Added pair/triad types\n  - Added several aliases (str, or/and/xor operators, echo/readLine)\n  - Added `tab` key\n  - Added `\u003c!` and `!\u003e` sugar\n- 0.1.1:\n  - Added `isAny` and `isAll` functions\n  - Added tuple conversions to pair/triad\n  - Added `end` templates\n--\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoma400%2Ftribalify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoma400%2Ftribalify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoma400%2Ftribalify/lists"}