{"id":19596867,"url":"https://github.com/cdiggins/peacock","last_synced_at":"2025-07-31T03:38:23.430Z","repository":{"id":79180806,"uuid":"449023238","full_name":"cdiggins/peacock","owner":"cdiggins","description":"A Functional UI Library written in C#","archived":false,"fork":false,"pushed_at":"2022-06-21T20:25:11.000Z","size":979,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-09T07:31:44.751Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdiggins.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}},"created_at":"2022-01-17T19:29:51.000Z","updated_at":"2022-10-12T15:09:10.000Z","dependencies_parsed_at":"2023-03-12T07:15:05.056Z","dependency_job_id":null,"html_url":"https://github.com/cdiggins/peacock","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/cdiggins%2Fpeacock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdiggins%2Fpeacock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdiggins%2Fpeacock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdiggins%2Fpeacock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdiggins","download_url":"https://codeload.github.com/cdiggins/peacock/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240876832,"owners_count":19871904,"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":"2024-11-11T08:56:58.506Z","updated_at":"2025-02-26T14:46:51.239Z","avatar_url":"https://github.com/cdiggins.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Peacock\n\nPeacock is a pure functional UI library written in C#.\n\nIt is being developed to validate the hypothesis that pure functional programming \nis a valid approach for building an entire UI component library from the ground up. \n\nThe current implementation is built on top of WPF, but it is done so using a thin layer,\nthat in theory can be easily ported to different platforms (e.g., Unity, HTML, et.) \n\n# Inspiration\n\nThe Elm programming language is a big inspiration for Peacock, as are many of the UI\nframeworks and best practices being developed by the JavaScript community. \n\n# How does it work\n\n## Control and IControl\n\nCentral to Peack is the `IControl` interface, and the generic `Control` class.\nA control is parameterized on a class derived from `IView` which represents \nthe current view state. A view the underlying data model\nplus some styling and layout information). \n\nA control also recieves in its constructor two functions:\n\n1. How to render (draw) that particular state type to a canvas\n2. A function for converting the state type to child-controls\n3. Optionally: zero or more behaviors\n\n## IBehavior\n\nA Behavior is a class that holds its own state object and can provide additional drawing logic for a control,\ncan transform its state object in response to input events, and can aggregate proposed changes to the views. \n\n## IUpdates \n\nThe `IUpdates` class aggregates a set of proposed changes to all views managed by a control. \nThese changes are managed as a list of functions associated with a particular view ID. \n\n# A Platonic C# Library \n\nPeacock is being written as a *Platonic* C# library. This means that it \nis designed to be compliant with the [Plato Language](https://github.com/cdiggins/plato)\nand compatible with the Plato tools (optimizer, translators).\n\nPeacock is a key part of validating the design and implementation of Plato as a \ngeneral purpose programming language. \n\n# Peacock in Action \n\nTo validate the Peacock language I am building a visual programming language editor called \nBohr. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdiggins%2Fpeacock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdiggins%2Fpeacock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdiggins%2Fpeacock/lists"}