{"id":24511575,"url":"https://github.com/danielxmoore/kusanagi","last_synced_at":"2025-04-14T08:21:56.873Z","repository":{"id":54746723,"uuid":"502663944","full_name":"DanielXMoore/Kusanagi","owner":"DanielXMoore","description":"CoffeeScript style syntax for Motoko language","archived":false,"fork":false,"pushed_at":"2022-12-13T17:02:23.000Z","size":236,"stargazers_count":10,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T21:52:13.936Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","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/DanielXMoore.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}},"created_at":"2022-06-12T16:07:18.000Z","updated_at":"2023-10-01T05:45:15.000Z","dependencies_parsed_at":"2023-01-28T13:32:51.611Z","dependency_job_id":null,"html_url":"https://github.com/DanielXMoore/Kusanagi","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/DanielXMoore%2FKusanagi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielXMoore%2FKusanagi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielXMoore%2FKusanagi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielXMoore%2FKusanagi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanielXMoore","download_url":"https://codeload.github.com/DanielXMoore/Kusanagi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248844060,"owners_count":21170510,"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":[],"created_at":"2025-01-22T00:38:29.331Z","updated_at":"2025-04-14T08:21:56.832Z","avatar_url":"https://github.com/DanielXMoore.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Kusanagi\n========\n\n[![Build](https://github.com/DanielXMoore/kusanagi/actions/workflows/build.yml/badge.svg)](https://github.com/DanielXMoore/kusanagi/actions/workflows/build.yml)\n\nThe initial work on this project was funded by the [Origyn Foundation](https://origyn.ch).\n\nCoffeeScript style syntax for the Motoko language. [Try Kusanagi](https://danielx.net/kusanagi/)\n\n```motoko\nimport State \"State\"\n\nmodule\n  public class Grid(state : State.State)\n    let grid = state\n\n    let n = grid.size()\n\n    public func size() : Nat\n      n\n\n    func nextCell(i : Nat, j : Nat) : State.Cell\n      let l : Nat = living i, j\n      if get i, j\n        l == 2 or l == 3\n      else\n        l == 3\n\n    func next(dst : Grid)\n      for i in grid.keys()\n        let cool = true\n\n        for j in grid[i].keys()\n          let yo = \"wat\"\n          dst.set i, j, nextCell i, j\n\n```\n\nGet Started\n---\n\n```bash\nnpm install -g kusanagi\nkusanagi \u003c src.ku \u003e out.mo\n```\n\nFeatures\n---\n\n- Indentation based blocks\n- Let shorthand `x = 5` -\u003e `let x = 5`\n- Alternative with syntax\n  ```\n  let x = {\n    ...a\n    ...b\n  }\n  ```\n  becomes\n  ```\n  let x = {\n    a and\n    b\n  }\n  ```\n- Chained comparisons\n  ```motoke\n  x \u003c y \u003c= z\n  ```\n  Becomes\n  ```motoko\n  x \u003c y and y \u003c= z\n  ```\n- `match`\n  ```\n  match x, #nat(val), 0\n  ---\n  switch(x) {\n    case(#nat(val)) { val };\n    case(_){ 0 }\n  };\n  ```\n- `take`\n  ```\n  take x, 0\n  ---\n  switch(x) {\n    case(null) { 0 };\n    case(?val) { val }\n  };\n  ```\n- Null soaks\n  ```\n  student.classes?.get(classID)\n  ---\n  do?{student.classes!.get(classID)};\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielxmoore%2Fkusanagi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielxmoore%2Fkusanagi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielxmoore%2Fkusanagi/lists"}