Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolves issue #534 - created cognate.scroll #545

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Loading