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;