Cognate is a programming language created in 2020 by Finn Barber.
#1205on PLDB | 4Years Old |
git clone https://github.com/cognate-lang/cognate
A human readable quasi-concatenative programming language. 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.
~~ 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;