From 6ebdb16c91ca28a08352942f64f1b758ac16f289 Mon Sep 17 00:00:00 2001 From: "Mr. Algorithm" <148683640+ravixalgorithm@users.noreply.github.com> Date: Tue, 9 Jul 2024 23:18:22 +0530 Subject: [PATCH] Create cognate.scroll resolves issue #534 --- concepts/cognate.scroll | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 concepts/cognate.scroll diff --git a/concepts/cognate.scroll b/concepts/cognate.scroll new file mode 100644 index 000000000000..bdfbb88148ff --- /dev/null +++ b/concepts/cognate.scroll @@ -0,0 +1,36 @@ +import ../code/conceptPage.scroll + +id cognate +name Cognate +appeared 2020 +creators Finn Barber +tags pl +description A human readable quasi-concatenative programming language +paper https://cognate-lang.github.io/learn.html + +compliesTo C +githubRepo https://github.com/cognate-lang/cognate + +conceptDescription Cognate is a small, dynamic, 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. + +website https://cognate-lang.github.io/ + +example + ~~ Prime numbers in Cognate + + Def Factor (Zero? Modulo Swap); + + Def Primes ( + Let U is upper bound; + initially List (); + For Range 2 to U ( + Let P is potential prime; + Let Found be list of found primes; + Let To-check be Take-while (<= Sqrt P) Found; + When All (Not Factor of P) To-check ( + Append P + ) to Found + ) + ); + + Print Primes up to 1000;