Skip to content

Commit

Permalink
Create cognate.scroll (#545)
Browse files Browse the repository at this point in the history
resolves issue #534
  • Loading branch information
ravixalgorithm authored Jul 9, 2024
1 parent 8f453ff commit be0a569
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions concepts/cognate.scroll
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit be0a569

Please sign in to comment.