{"id":13608882,"url":"https://github.com/cognate-lang/cognate","last_synced_at":"2025-04-12T17:33:20.138Z","repository":{"id":38028975,"uuid":"268766652","full_name":"cognate-lang/cognate","owner":"cognate-lang","description":"A human readable quasi-concatenative programming language","archived":false,"fork":false,"pushed_at":"2024-01-19T17:21:17.000Z","size":4028,"stargazers_count":204,"open_issues_count":3,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-05-18T23:18:23.287Z","etag":null,"topics":["based-stack-based-language","c","closures","combinatorics","compiler","forth","forth-like","functional-programming","interpreter","lambda-calculus","language","natural-language","prefix-notation","proglangs-discord","programming-language","stack-based-language","stack-language"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cognate-lang.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":"2020-06-02T10:08:40.000Z","updated_at":"2024-06-15T18:51:46.818Z","dependencies_parsed_at":"2023-12-23T12:15:24.133Z","dependency_job_id":"bc3d3bd7-9dff-4d74-beaf-c13db1893a06","html_url":"https://github.com/cognate-lang/cognate","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cognate-lang%2Fcognate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cognate-lang%2Fcognate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cognate-lang%2Fcognate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cognate-lang%2Fcognate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cognate-lang","download_url":"https://codeload.github.com/cognate-lang/cognate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248605412,"owners_count":21132165,"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":["based-stack-based-language","c","closures","combinatorics","compiler","forth","forth-like","functional-programming","interpreter","lambda-calculus","language","natural-language","prefix-notation","proglangs-discord","programming-language","stack-based-language","stack-language"],"created_at":"2024-08-01T19:01:30.745Z","updated_at":"2025-04-12T17:33:15.128Z","avatar_url":"https://github.com/cognate-lang.png","language":"C","funding_links":[],"categories":["Uncategorized","C"],"sub_categories":["Uncategorized"],"readme":"\n\u003ch1 align=\"center\"\u003e The Cognate programming language \u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/cognate-lang/cognate/actions/workflows/test-debian-gcc.yml/badge.svg\"\u003e\n\u003cimg src=\"https://github.com/cognate-lang/cognate/actions/workflows/test-debian-clang.yml/badge.svg\"\u003e\n\u003cimg src=\"https://github.com/cognate-lang/cognate/actions/workflows/test-debian-tcc.yml/badge.svg\"\u003e\n\u003cimg src=\"https://github.com/cognate-lang/cognate/actions/workflows/test-macos-clang.yml/badge.svg\"\u003e\n\u003cimg src=\"https://img.shields.io/github/license/cognate-lang/cognate.svg\"\u003e\n\u003c/p\u003e\n\nCognate is a small dynamic quasi-concatenative language for functional programming. Cognate aims to express complex programs in a simple and readable way through its unique syntax, which emphasises embedding comments into statements. This makes programs very readable and helps a programmer better express their intentions.\n\n\u003cimg src=\"screenshots/fizzbuzz.png\" width=\"100%\" title=\"Fizzbuzz in Cognate (font is Hermit)\"\u003e\n\n\u003cimg src=\"screenshots/hanoi.png\" width=\"100%\" title=\"Towers of Hanoi in Cognate (font is Hermit)\"\u003e\n\n### Cognate is readable\nCognate's compiler ignores words beginning with lowercase letters, allowing comments and code to be interwoven. This 'informal syntax' being optional allows Cognate to be verbose where detail is needed and concise where it isn't.\n\n\u003cimg src=\"screenshots/comparison.png\" width=\"100%\" title=\"Map function in Python and Cognate (font is Hermit)\"\u003e\n\n### Cognate is efficient\nCognaC (the Cognate Compiler) compiles Cognate sources directly into C. This produces very small and rather fast binaries, allowing Cognate to outperform most dynamic languages. This also makes Cognate a candidate for scripting in embedded environments, such as microcontrollers.\n\n### Cognate is simple\nCognate has only a handful of syntax elements. This makes the language very consistent and easy to learn. In future this will allow me to elegantly introduce metaprogramming constructs.\n\n### Cognate is functional\nCognate is designed for functional programming - but does not require a PhD in discrete mathematics to use. While Cognate is oriented around first-class functions, no restrictions are placed on IO - making debugging and refactoring less headache-inducing.\n\n### Cognate is powerful\nCognate is a stack-oriented programming language. This means that all intermediary values reside in a stack data structure. This allows powerful features such as:\n\n* Multiple return values\n* Point-free functions\n* Operation chaining\n\n### Web playground\nCheck out the interactive web playground - it runs Cognate programs client-side in the browser. It also has intelligent syntax highlighting, code folding, and error reporting in the editor.\n\nPlayground: [https://cognate-playground.hedy.dev](https://cognate-playground.hedy.dev)\n\nSource: [https://github.com/hedyhli/cognate-playground](https://github.com/hedyhli/cognate-playground)\n\n### Building Cognate\nCurrently, Cognate will run on Linux and MacOS systems. If you use Windows, then you can install Cognate on the Windows Subsystem for Linux. To build Cognate, you will need `make`, `flex`, `bison`, and a C compiler (currently supported are GCC, Clang, and TCC). After installing these, simply run:\n```\nmake\n```\nIf that succeeds, install the compiler with:\n```\nmake install\n```\nThis installs cognate to the `.local` prefix. To install to a different directory:\n```\nmake PREFIX=/my/prefix/dir install\n```\nYou should then run the test script to test Cognate's functionality. This should work regardless of operating system.\n```\nmake test -j\n```\nIf the tests all pass (they should!), you can then try running some of the included demo programs:\n```\ncognac examples/fizzbuzz.cog\n./examples/fizzbuzz\n```\n\n[Here](https://cognate-lang.github.io/learn.html) is an work-in-progress introduction to the language.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcognate-lang%2Fcognate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcognate-lang%2Fcognate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcognate-lang%2Fcognate/lists"}