Skip to content

Commit 1410e76

Browse files
nicer serif and sans-serif fonts
1 parent eb65f28 commit 1410e76

File tree

11 files changed

+583
-797
lines changed

11 files changed

+583
-797
lines changed

public/categories/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
<!doctype html>
33
<html>
4-
<head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
4+
<head>
55
<meta charset="UTF-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<link rel="stylesheet" href="/main.min.css" />

public/categories/index.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
33
<channel>
44
<title>Categories on Cognate: Readable and concise concatenative programming</title>
5-
<link>http://localhost:1313/categories/</link>
5+
<link>https://cognate-lang.github.io/categories/</link>
66
<description>Recent content in Categories on Cognate: Readable and concise concatenative programming</description>
77
<generator>Hugo</generator>
88
<language>en-us</language>
9-
<atom:link href="http://localhost:1313/categories/index.xml" rel="self" type="application/rss+xml" />
9+
<atom:link href="https://cognate-lang.github.io/categories/index.xml" rel="self" type="application/rss+xml" />
1010
</channel>
1111
</rss>

public/index.html

Lines changed: 48 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!doctype html>
33
<html>
44
<head>
5-
<meta name="generator" content="Hugo 0.130.0"><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
5+
<meta name="generator" content="Hugo 0.130.0">
66
<meta charset="UTF-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88
<link rel="stylesheet" href="/main.min.css" />
@@ -17,71 +17,63 @@
1717

1818
<h1 id="cognate">Cognate</h1>
1919
<h2 id="readable-and-concise-concatenative-programming">Readable and concise concatenative programming</h2>
20-
<!--cognate--><div class="code"><pre><code>
21-
~~ Fizzbuzz in Cognate
20+
<div class="code"><pre><code><span style='font-style: italic;color: #969896'>~~ Fizzbuzz in Cognate</span>
2221

23-
Def Fizzbuzz (
24-
Let N be Of (Integer?);
25-
Def Multiple as (Zero? Modulo Swap N);
26-
Print
27-
If Multiple of 15 then "fizzbuzz"
28-
If Multiple of 3 then "fizz"
29-
If Multiple of 5 then "buzz"
30-
else N
31-
);
22+
<span style='color: #0086b3'>Def</span> <span style='color: #795da3'>Fizzbuzz</span> <span style='color: #4e4e4e'>(</span>
23+
<span style='color: #0086b3'>Let</span> <span style='color: #795da3'>N</span> <span style='color: #333333'>be</span> <span style='color: #183691'>Of</span> <span style='color: #4e4e4e'>(</span><span style='color: #183691'>Integer?</span><span style='color: #4e4e4e'>)</span>;
24+
<span style='color: #0086b3'>Def</span> <span style='color: #795da3'>Multiple</span> <span style='color: #333333'>as</span> <span style='color: #4e4e4e'>(</span><span style='color: #183691'>Zero?</span> <span style='color: #183691'>Modulo</span> <span style='color: #183691'>Swap</span> <span style='color: #795da3'>N</span><span style='color: #4e4e4e'>)</span>;
25+
<span style='color: #183691'>Print</span>
26+
<span style='color: #a71d5d'>If</span> <span style='color: #795da3'>Multiple</span> <span style='color: #333333'>of</span> <span style='color: #0086b3'>15</span> <span style='color: #333333'>then</span> <span style='color: #183691'>&quot;fizzbuzz&quot;</span>
27+
<span style='color: #a71d5d'>If</span> <span style='color: #795da3'>Multiple</span> <span style='color: #333333'>of</span> <span style='color: #0086b3'>3</span> <span style='color: #333333'>then</span> <span style='color: #183691'>&quot;fizz&quot;</span>
28+
<span style='color: #a71d5d'>If</span> <span style='color: #795da3'>Multiple</span> <span style='color: #333333'>of</span> <span style='color: #0086b3'>5</span> <span style='color: #333333'>then</span> <span style='color: #183691'>&quot;buzz&quot;</span>
29+
<span style='color: #333333'>else</span> <span style='color: #795da3'>N</span>
30+
<span style='color: #4e4e4e'>)</span>;
3231

33-
For each in Range 1 to 100 (Print Fizzbuzz)
34-
</code></pre></div>
35-
<p>Cognate is a project aiming to create a human readable programming language with as little syntax as possible. Where natural language programming usually uses many complex syntax rules, instead Cognate takes them away. What it adds is simple, a way to embed comments into statements.</p>
36-
<!--cognate--><div class="code"><pre><code>
37-
~~ Towers of Hanoi in Cognate
32+
<span style='color: #a71d5d'>For</span> <span style='color: #333333'>each</span> <span style='color: #333333'>in</span> <span style='color: #183691'>Range</span> <span style='color: #0086b3'>1</span> <span style='color: #333333'>to</span> <span style='color: #0086b3'>100</span> <span style='color: #4e4e4e'>(</span><span style='color: #183691'>Print</span> <span style='color: #795da3'>Fizzbuzz</span><span style='color: #4e4e4e'>)</span>
33+
</code></pre></div><p>Cognate is a project aiming to create a human readable programming language with as little syntax as possible. Where natural language programming usually uses many complex syntax rules, instead Cognate takes them away. What it adds is simple, a way to embed comments into statements.</p>
34+
<div class="code"><pre><code><span style='font-style: italic;color: #969896'>~~ Towers of Hanoi in Cognate</span>
3835

39-
Def Move discs as (
36+
<span style='color: #0086b3'>Def</span> <span style='color: #795da3'>Move</span> <span style='color: #333333'>discs</span> <span style='color: #333333'>as</span> <span style='color: #4e4e4e'>(</span>
4037

41-
Let N be number of discs;
42-
Let A be first rod;
43-
Let B be second rod;
44-
Let C be third rod;
38+
<span style='color: #0086b3'>Let</span> <span style='color: #795da3'>N</span> <span style='color: #333333'>be</span> <span style='color: #333333'>number</span> <span style='color: #333333'>of</span> <span style='color: #333333'>discs</span>;
39+
<span style='color: #0086b3'>Let</span> <span style='color: #795da3'>A</span> <span style='color: #333333'>be</span> <span style='color: #333333'>first</span> <span style='color: #333333'>rod</span>;
40+
<span style='color: #0086b3'>Let</span> <span style='color: #795da3'>B</span> <span style='color: #333333'>be</span> <span style='color: #333333'>second</span> <span style='color: #333333'>rod</span>;
41+
<span style='color: #0086b3'>Let</span> <span style='color: #795da3'>C</span> <span style='color: #333333'>be</span> <span style='color: #333333'>third</span> <span style='color: #333333'>rod</span>;
4542

46-
Unless Zero? N (
47-
Move - 1 N discs from A via C to B;
48-
Prints ("Move disc " N " from " A " to " C);
49-
Move - 1 N discs from B via A to C;
50-
)
51-
);
43+
<span style='color: #a71d5d'>Unless</span> <span style='color: #183691'>Zero?</span> <span style='color: #795da3'>N</span> <span style='color: #4e4e4e'>(</span>
44+
<span style='color: #795da3'>Move</span> <span style='font-weight: bold;color: #4e4e4e'>-</span> <span style='color: #0086b3'>1</span> <span style='color: #795da3'>N</span> <span style='color: #333333'>discs</span> <span style='color: #333333'>from</span> <span style='color: #795da3'>A</span> <span style='color: #333333'>via</span> <span style='color: #795da3'>C</span> <span style='color: #333333'>to</span> <span style='color: #795da3'>B</span>;
45+
<span style='color: #183691'>Prints</span> <span style='color: #4e4e4e'>(</span><span style='color: #183691'>&quot;Move disc &quot;</span> <span style='color: #795da3'>N</span> <span style='color: #183691'>&quot; from &quot;</span> <span style='color: #795da3'>A</span> <span style='color: #183691'>&quot; to &quot;</span> <span style='color: #795da3'>C</span><span style='color: #4e4e4e'>)</span>;
46+
<span style='color: #795da3'>Move</span> <span style='font-weight: bold;color: #4e4e4e'>-</span> <span style='color: #0086b3'>1</span> <span style='color: #795da3'>N</span> <span style='color: #333333'>discs</span> <span style='color: #333333'>from</span> <span style='color: #795da3'>B</span> <span style='color: #333333'>via</span> <span style='color: #795da3'>A</span> <span style='color: #333333'>to</span> <span style='color: #795da3'>C</span>;
47+
<span style='color: #4e4e4e'>)</span>
48+
<span style='color: #4e4e4e'>)</span>;
5249

53-
Move 5 discs from "a" via "b" to "c"
54-
</code></pre></div>
55-
<p>As you can see, Cognate ignores words starting with lowercase letters, allowing them to be used to describe functionality and enhance readability. This makes Cognate codebases intuitive and maintainable.</p>
56-
<!--cognate--><div class="code"><pre><code>
57-
~~ Square numbers in Cognate
50+
<span style='color: #795da3'>Move</span> <span style='color: #0086b3'>5</span> <span style='color: #333333'>discs</span> <span style='color: #333333'>from</span> <span style='color: #183691'>&quot;a&quot;</span> <span style='color: #333333'>via</span> <span style='color: #183691'>&quot;b&quot;</span> <span style='color: #333333'>to</span> <span style='color: #183691'>&quot;c&quot;</span>
51+
</code></pre></div><p>As you can see, Cognate ignores words starting with lowercase letters, allowing them to be used to describe functionality and enhance readability. This makes Cognate codebases intuitive and maintainable.</p>
52+
<div class="code"><pre><code><span style='font-style: italic;color: #969896'>~~ Square numbers in Cognate</span>
5853

59-
Def Square as (* Twin);
60-
Map (Square) over Range 1 to 10;
61-
Print
62-
</code></pre></div>
63-
<p>Cognate is a stack-oriented programming language similar to Forth or Factor, except statements are evaluated right to left. This gives the expressiveness of concatenative programming as well as the readability of prefix notation. Statements can be delimited at arbitrary points, allowing them to read as sentences would in English.</p>
64-
<!--cognate--><div class="code"><pre><code>
65-
~~ Prime numbers in Cognate
54+
<span style='color: #0086b3'>Def</span> <span style='color: #795da3'>Square</span> <span style='color: #333333'>as</span> <span style='color: #4e4e4e'>(</span><span style='font-weight: bold;color: #4e4e4e'>*</span> <span style='color: #183691'>Twin</span><span style='color: #4e4e4e'>)</span>;
55+
<span style='color: #183691'>Map</span> <span style='color: #4e4e4e'>(</span><span style='color: #795da3'>Square</span><span style='color: #4e4e4e'>)</span> <span style='color: #333333'>over</span> <span style='color: #183691'>Range</span> <span style='color: #0086b3'>1</span> <span style='color: #333333'>to</span> <span style='color: #0086b3'>10</span>;
56+
<span style='color: #183691'>Print</span>
57+
</code></pre></div><p>Cognate is a stack-oriented programming language similar to Forth or Factor, except statements are evaluated right to left. This gives the expressiveness of concatenative programming as well as the readability of prefix notation. Statements can be delimited at arbitrary points, allowing them to read as sentences would in English.</p>
58+
<div class="code"><pre><code><span style='font-style: italic;color: #969896'>~~ Prime numbers in Cognate</span>
6659

67-
Def Factor (Zero? Modulo Swap);
60+
<span style='color: #0086b3'>Def</span> <span style='color: #795da3'>Factor</span> <span style='color: #4e4e4e'>(</span><span style='color: #183691'>Zero?</span> <span style='color: #183691'>Modulo</span> <span style='color: #183691'>Swap</span><span style='color: #4e4e4e'>)</span>;
6861

69-
Def Primes (
70-
Let U is upper bound;
71-
initially List ();
72-
For Range 2 to U (
73-
Let P is potential prime;
74-
Let Found be list of found primes;
75-
Let To-check be Take-while (<= Sqrt P) Found;
76-
When All (Not Factor of P) To-check (
77-
Append P
78-
) to Found
79-
)
80-
);
62+
<span style='color: #0086b3'>Def</span> <span style='color: #795da3'>Primes</span> <span style='color: #4e4e4e'>(</span>
63+
<span style='color: #0086b3'>Let</span> <span style='color: #795da3'>U</span> <span style='color: #333333'>is</span> <span style='color: #333333'>upper</span> <span style='color: #333333'>bound</span>;
64+
<span style='color: #333333'>initially</span> <span style='color: #794da3'>List</span> <span style='color: #4e4e4e'>(</span><span style='color: #4e4e4e'>)</span>;
65+
<span style='color: #a71d5d'>For</span> <span style='color: #183691'>Range</span> <span style='color: #0086b3'>2</span> <span style='color: #333333'>to</span> <span style='color: #795da3'>U</span> <span style='color: #4e4e4e'>(</span>
66+
<span style='color: #0086b3'>Let</span> <span style='color: #795da3'>P</span> <span style='color: #333333'>is</span> <span style='color: #333333'>potential</span> <span style='color: #333333'>prime</span>;
67+
<span style='color: #0086b3'>Let</span> <span style='color: #795da3'>Found</span> <span style='color: #333333'>be</span> <span style='color: #333333'>list</span> <span style='color: #333333'>of</span> <span style='color: #333333'>found</span> <span style='color: #333333'>primes</span>;
68+
<span style='color: #0086b3'>Let</span> <span style='color: #795da3'>To-check</span> <span style='color: #333333'>be</span> <span style='color: #a71d5d'>Take-while</span> <span style='color: #4e4e4e'>(</span><span style='font-weight: bold;color: #4e4e4e'>&lt;=</span> <span style='color: #183691'>Sqrt</span> <span style='color: #795da3'>P</span><span style='color: #4e4e4e'>)</span> <span style='color: #795da3'>Found</span>;
69+
<span style='color: #a71d5d'>When</span> <span style='color: #183691'>All</span> <span style='color: #4e4e4e'>(</span><span style='font-weight: bold;color: #4e4e4e'>Not</span> <span style='color: #795da3'>Factor</span> <span style='color: #333333'>of</span> <span style='color: #795da3'>P</span><span style='color: #4e4e4e'>)</span> <span style='color: #795da3'>To-check</span> <span style='color: #4e4e4e'>(</span>
70+
<span style='color: #183691'>Append</span> <span style='color: #795da3'>P</span>
71+
<span style='color: #4e4e4e'>)</span> <span style='color: #333333'>to</span> <span style='color: #795da3'>Found</span>
72+
<span style='color: #4e4e4e'>)</span>
73+
<span style='color: #4e4e4e'>)</span>;
8174

82-
Print Primes up to 1000;
83-
</code></pre></div>
84-
<p>Cognate borrows from other concatenative languages, but also adds unique features of its own.</p>
75+
<span style='color: #183691'>Print</span> <span style='color: #795da3'>Primes</span> <span style='color: #333333'>up</span> <span style='color: #333333'>to</span> <span style='color: #0086b3'>1000</span>;
76+
</code></pre></div><p>Cognate borrows from other concatenative languages, but also adds unique features of its own.</p>
8577
<ul>
8678
<li>Point-free functions</li>
8779
<li>Operation chaining</li>

public/index.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
33
<channel>
44
<title>About on Cognate: Readable and concise concatenative programming</title>
5-
<link>http://localhost:1313/</link>
5+
<link>https://cognate-lang.github.io/</link>
66
<description>Recent content in About on Cognate: Readable and concise concatenative programming</description>
77
<generator>Hugo</generator>
88
<language>en-us</language>
9-
<atom:link href="http://localhost:1313/index.xml" rel="self" type="application/rss+xml" />
9+
<atom:link href="https://cognate-lang.github.io/index.xml" rel="self" type="application/rss+xml" />
1010
<item>
1111
<title>Learn Cognate</title>
12-
<link>http://localhost:1313/learn/</link>
12+
<link>https://cognate-lang.github.io/learn/</link>
1313
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
14-
<guid>http://localhost:1313/learn/</guid>
14+
<guid>https://cognate-lang.github.io/learn/</guid>
1515
<description>Learn Cognate A brief introduction to the language Install First install CognaC the Cognate Compiler from here using the provided instructions. Currently CognaC will run on recent Linux or Mac systems. Windows users can install it onto the Windows Subsystem for Linux &amp;ndash; native Windows support is planned.&#xA;Invoking CognaC is simple. If you have a file named foo.cog containing a Cognate program, it can be compiled into an executable named foo with the following command.</description>
1616
</item>
1717
<item>
1818
<title>Prelude</title>
19-
<link>http://localhost:1313/reference/prelude/</link>
19+
<link>https://cognate-lang.github.io/reference/prelude/</link>
2020
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
21-
<guid>http://localhost:1313/reference/prelude/</guid>
21+
<guid>https://cognate-lang.github.io/reference/prelude/</guid>
2222
<description>Prelude Drop Discard the top stack item.&#xA;Print Drop &#34;foo&#34; &#34;bar&#34;; Source Def Drop as ( Let X ); Swap Swaps the top two stack items.&#xA;Print Swap 1 2; Source Def Swap as ( Let X ; Let Y ; Y X ); Do Execute a block.&#xA;Do ( Print &#34;hello world!&#34; ); Source Def Do as ( Def F ; F ); Any? Takes a parameter of any type and returns True</description>
2323
</item>
2424
</channel>

0 commit comments

Comments
 (0)