{"id":30325724,"url":"https://github.com/yairm210/purity","last_synced_at":"2025-08-17T23:07:22.265Z","repository":{"id":298345323,"uuid":"981601394","full_name":"yairm210/Purity","owner":"yairm210","description":" Kotlin Compiler Plugin for validating Pure and Readonly functions","archived":false,"fork":false,"pushed_at":"2025-08-11T17:40:54.000Z","size":951,"stargazers_count":18,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-11T19:36:55.968Z","etag":null,"topics":["compiler-plugin","kotlin","pure"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/yairm210.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-11T13:34:40.000Z","updated_at":"2025-08-11T17:40:09.000Z","dependencies_parsed_at":"2025-07-04T14:51:03.761Z","dependency_job_id":"0200aff4-fb55-4a45-a652-846b8aa29bc6","html_url":"https://github.com/yairm210/Purity","commit_stats":null,"previous_names":["yairm210/puritykotlincompilerplugin","yairm210/purity"],"tags_count":49,"template":false,"template_full_name":"Foso/KotlinCompilerPluginExample","purl":"pkg:github/yairm210/Purity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairm210%2FPurity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairm210%2FPurity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairm210%2FPurity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairm210%2FPurity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yairm210","download_url":"https://codeload.github.com/yairm210/Purity/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairm210%2FPurity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270918404,"owners_count":24667679,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"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":["compiler-plugin","kotlin","pure"],"created_at":"2025-08-17T23:07:21.701Z","updated_at":"2025-08-17T23:07:22.257Z","avatar_url":"https://github.com/yairm210.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  \u003cimg src=\"docs/img/Purity.svg\" width=\"24\"\u003e Purity\n\n![Gradle Plugin Portal Version](https://img.shields.io/gradle-plugin-portal/v/io.github.yairm210.purity-plugin)\n[![Build status](https://github.com/yairm210/Purity/actions/workflows/gradle.yml/badge.svg)](https://github.com/yairm210/Purity/actions/workflows/gradle.yml)\n\n## What is this?\n\nA Kotlin Compiler Plugin for determining and enforcing Pure and Readonly functions.\n\n### Why?\n\n- Communicating and enforcing function intent\n- Determining parallelizable calls (Pure functions are parallelizable with anything; Readonly are parallelizable with each other)\n\n## Installation + Basic Usage\n\nInstall the plugin by adding the following to your `build.gradle.kts`:\n\n```kotlin\nplugins {\n    id(\"io.github.yairm210.purity-plugin\") version \"1.2.2\"\n}\n\ndependencies {\n  implementation(\"io.github.yairm210:purity-annotations:1.2.2\")\n}\n```\n\n\nMark pure functions using `@Pure`, and readonly functions using `@Readonly`:\n\n```kotlin\nimport yairm210.purity.annotations.Pure\nimport yairm210.purity.annotations.Readonly\n\n@Pure\nfun pureFunction(x: Int): Int {\n    return x * 2\n}\n\n@Readonly\nfun readonlyFunction(list: List\u003cString\u003e): Int {\n    return list.size\n}\n```\n\n### Advanced usage\n\nFurther details are available in the [documentation](https://yairm210.github.io/Purity/usage/advanced-usage/)\n\n### Rules\n\n- Pure functions may not:\n  - Get or set external vars (vars created outside the function)\n  - Call other non-pure functions\n\n- Readonly functions may not:\n  - Set external vars\n  - Call other non-readonly functions (pure functions are considered readonly as well)\n\nAny violation of these rules creates a compilation error.\n\n### Limitations\n\n- All getters are assumed to not be state-changing\n- All constructors are assumed to be pure - to change state only of the instance being created\n\n## Acknowledgments\n\nProjects that helped me understand how to setup the project:\n* [Foso/KotlinCompilerPluginExample](https://github.com/Foso/KotlinCompilerPluginExample)\n* [bnorm/kotlin-power-assert](https://github.com/bnorm/kotlin-power-assert)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyairm210%2Fpurity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyairm210%2Fpurity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyairm210%2Fpurity/lists"}