{"id":29420073,"url":"https://github.com/esoterra/claw-lang","last_synced_at":"2025-07-12T01:15:37.173Z","repository":{"id":57672400,"uuid":"328819637","full_name":"esoterra/claw-lang","owner":"esoterra","description":"The compiler for the Claw language","archived":false,"fork":false,"pushed_at":"2024-09-28T01:46:41.000Z","size":1454,"stargazers_count":118,"open_issues_count":7,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-02T06:47:26.385Z","etag":null,"topics":["compiler","programming-language","webassembly"],"latest_commit_sha":null,"homepage":"https://claw-lang.dev","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/esoterra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","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-01-11T23:39:58.000Z","updated_at":"2025-06-03T07:40:19.000Z","dependencies_parsed_at":"2023-11-27T21:28:24.897Z","dependency_job_id":"dba9fbf5-b18c-48ec-8ad8-73f43df495b4","html_url":"https://github.com/esoterra/claw-lang","commit_stats":null,"previous_names":["wrought-lang/wrought","esoterra/wrought","wrought-lang/wrought-rs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/esoterra/claw-lang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esoterra%2Fclaw-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esoterra%2Fclaw-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esoterra%2Fclaw-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esoterra%2Fclaw-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esoterra","download_url":"https://codeload.github.com/esoterra/claw-lang/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esoterra%2Fclaw-lang/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264731185,"owners_count":23655274,"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":["compiler","programming-language","webassembly"],"created_at":"2025-07-12T01:15:31.182Z","updated_at":"2025-07-12T01:15:37.146Z","avatar_url":"https://github.com/esoterra.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\r\n  \u003ch1\u003e\u003ccode\u003eclaw-cli\u003c/code\u003e\u003c/h1\u003e\r\n\r\n  \u003cp\u003e\r\n    \u003cstrong\u003eThe compiler for the Claw programming language\u003c/strong\u003e\r\n  \u003c/p\u003e\r\n\r\n  \u003cp\u003e\r\n    \u003ca href=\"https://github.com/esoterra/claw-lang/actions?query=workflow%3ACI\"\u003e\u003cimg src=\"https://github.com/esoterra/claw-lang/workflows/CI/badge.svg\" alt=\"build status\" /\u003e\u003c/a\u003e\r\n    \u003ca href=\"https://crates.io/crates/claw-cli\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/claw-cli.svg?style=flat-square\" alt=\"Crates.io version\" /\u003e\u003c/a\u003e\r\n    \u003ca href=\"https://crates.io/crates/claw-cli\"\u003e\u003cimg src=\"https://img.shields.io/crates/d/claw-cli.svg?style=flat-square\" alt=\"Download\" /\u003e\u003c/a\u003e\r\n    \u003ca href=\"https://docs.rs/claw-cli\"\u003e\u003cimg src=\"https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square\" alt=\"docs.rs docs\" /\u003e\u003c/a\u003e\r\n  \u003c/p\u003e\r\n\r\n  \u003cp\u003e\r\n    \u003ca href=\"https://techforpalestine.org/learn-more\"\u003e\u003cimg src=\"https://badge.techforpalestine.org/default\" alt=\"build status\" /\u003e\u003c/a\u003e\r\n  \u003c/p\u003e\r\n\u003c/div\u003e\r\n\r\nClaw is a programming language that compiles to Wasm Components.\r\nValues in Claw have the exact same types as Component model values and the imports/exports of a Claw source file represent a Component \"World\".\r\n\r\nThis means that there's no bindings generators or indirection required.\r\nYou can receive component values as arguments, operate on them, create them, and return them.\r\n\r\n```js\r\nlet mut counter: s64 = 0;\r\n\r\nexport func increment() -\u003e s64 {\r\n    counter = counter + 1;\r\n    return counter;\r\n}\r\n\r\nexport func decrement() -\u003e s64 {\r\n    counter = counter - 1;\r\n    return counter;\r\n}\r\n```\r\n\r\n(support for the full range of component model values is still a WIP)\r\n\r\n## Use Cases \u0026 Goals\r\n\r\n### Component Testing\r\n\r\nClaw's ability to define component imports and simple logic easily will be well suited for writing Component tests.\r\n\r\n```js\r\nimport add: func(lhs: s32, rhs: s32) -\u003e s32;\r\n\r\nexport func test() -\u003e result\u003c(), string\u003e {\r\n    if add(1, 1) == 2 {\r\n        return ok(());\r\n    } else {\r\n        return err(\"test failed\");\r\n    }\r\n}\r\n```\r\n\r\nBy adding a `check!(...)` builtin that returns `ok(())` when the condition is true and `err(\"\u003cnice message\u003e\")` when its false\r\nand a Rust-style `?` early return operator, we can make writing these tests a lot easier and make the output much better.\r\n\r\n```js\r\nimport add: func(lhs: s32, rhs: s32) -\u003e s32;\r\n\r\nexport tests: interface {\r\n    func test() -\u003e result\u003c(), string\u003e {\r\n        check!(add(1, 1) == 2)?;\r\n        ...\r\n        return ok(());\r\n    }\r\n\r\n    ...\r\n}\r\n```\r\n\r\n### Adapters \u0026 Polyfills\r\n\r\nSometimes users will have components written for one world but want to run them in another.\r\n\r\nClaw could make it easy to write simple adapters or polyfills so that users can run their existing code more places.\r\n\r\n### Virtualizations \u0026 Mocks\r\n\r\nWith components, we can achieve an incredible local dev experience where resources like message buses and key value stores\r\ncan be implemented as simple components and used to run applications for testing and development.\r\n\r\nClaw can be well suited to writing simple in-memory virtualizations that make testing and development easy.\r\n\r\n### Extensions\r\n\r\nSome applications (e.g. [database](https://docs.singlestore.com/cloud/reference/code-engine-powered-by-wasm/create-wasm-udfs/))\r\ncan already be extended using Wasm and as this becomes more common users may want to write small pieces of logic that act as filters or policy,\r\ndefine how to process events, or implement missing math or domain functions.\r\n\r\nClaw can make writing these extensions easy while still generating really small Components that can stored, transmitted, and instantiated quickly.\r\n\r\n### Simple Services\r\n\r\nTODO\r\n\r\n## Relationship with Other Projects\r\n\r\nThere are several projects for representing different aspects of the Component Model\r\n\r\n* [WIT](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md) - The official IDL for the Component Model\r\n* [WAC](https://github.com/peterhuene/wac/) - An extension of WIT that adds the ability to define how to wire components together\r\n* [WAVE](https://github.com/lann/wave) - A format for encoding Component-Model values in an idiomatic json-like way\r\n\r\nClaw will use WIT syntax for defining types, WAC syntax for defining composition, and WAVE syntax for literal expressions\r\ncombining them all together so that it's intuitive to use these different tools.\r\n\r\n![image](https://github.com/esoterra/claw-lang/assets/3458116/de0673f1-7b92-48c6-b1c3-e52479797778)\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesoterra%2Fclaw-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesoterra%2Fclaw-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesoterra%2Fclaw-lang/lists"}