You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/_index.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,7 @@ Def Primes (
74
74
Print Primes up to 1000;
75
75
```
76
76
77
+
77
78
Cognate borrows from other concatenative languages, but also adds unique features of its own.
78
79
79
80
- Point-free functions
@@ -84,5 +85,8 @@ Cognate borrows from other concatenative languages, but also adds unique feature
84
85
- Natural language programming
85
86
86
87
87
-
Interested? Read the [tutorial](/learn/), check out the [interactive web playground](https://cognate-playground.hedy.dev/), or visit our [GitHub repository](https://github.com/cognate-lang/cognate).
88
+
Interested? Read the [tutorial](/learn/), and check out one of Cognate's implementations:
88
89
90
+
-[CognaC](https://github.com/cognate-lang/cognate) is the original compiler -- it performs type inference and produces efficient binaries.
91
+
-[Cognate Playground](https://cognate-playground.hedy.dev/) (developed by [hedyhli](https://github.com/hedyhli)) runs Cognate programs in a web browser.
92
+
-[Cogni](https://github.com/dragoncoder047/cogni) (developed by [dragoncoder047](https://github.com/dragoncoder047)) interprets Cognate programs and is optimised to run on microcontrollers.
Copy file name to clipboardExpand all lines: content/learn.md
+6-10Lines changed: 6 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,27 +8,23 @@ title = 'Learn Cognate'
8
8
## A brief introduction to the language
9
9
10
10
11
-
## Install
11
+
## Setup
12
12
13
+
First get hold of one of Cognate's implementations; installation and invocation instructions are on the respective pages.
13
14
14
-
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 -- native Windows support is planned.
15
-
16
-
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.
17
-
15
+
-[CognaC](https://github.com/cognate-lang/cognate) is the original compiler -- it performs type inference and produces efficient binaries.
16
+
-[Cognate Playground](https://cognate-playground.hedy.dev/) (developed by [hedyhli](https://github.com/hedyhli)) runs Cognate programs in a web browser, requiring no installation.
17
+
-[Cogni](https://github.com/dragoncoder047/cogni) (developed by [dragoncoder047](https://github.com/dragoncoder047)) interprets Cognate programs and is optimised to run on microcontrollers.
18
18
19
+
If you're using `CognaC`, you can compile a Cognate file named `foo.cog` into an executable named `foo` with the following command.
19
20
```
20
21
cognac foo.cog
21
22
```
22
23
23
-
24
24
To compile a debug executable, which will run slower but give a nice backtrace if there's an error, you can use the `-debug` flag.
25
25
26
-
Alternatively, you can use the interactive web playground [here](https://cognate-playground.hedy.dev/) which runs Cognate programs client-side in the browser. It also has intelligent syntax highlighting, code folding, and error reporting in the editor
<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>
</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
+
<divclass="code"><pre><code><spanstyle='font-style: italic;color: #969896'>~~ Towers of Hanoi in Cognate</span>
<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>
</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
+
<divclass="code"><pre><code><spanstyle='font-style: italic;color: #969896'>~~ Square numbers in Cognate</span>
58
53
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>
</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
+
<divclass="code"><pre><code><spanstyle='font-style: italic;color: #969896'>~~ Prime numbers in Cognate</span>
</code></pre></div><p>Cognate borrows from other concatenative languages, but also adds unique features of its own.</p>
82
74
<ul>
83
75
<li>Point-free functions</li>
84
76
<li>Operation chaining</li>
@@ -87,7 +79,12 @@ <h2 id="readable-and-concise-concatenative-programming">Readable and concise con
87
79
<li>Predicate pattern matching</li>
88
80
<li>Natural language programming</li>
89
81
</ul>
90
-
<p>Interested? Read the <ahref="/learn/">tutorial</a>, check out the <ahref="https://cognate-playground.hedy.dev/">interactive web playground</a>, or visit our <ahref="https://github.com/cognate-lang/cognate">GitHub repository</a>.</p>
82
+
<p>Interested? Read the <ahref="/learn/">tutorial</a>, and check out one of Cognate’s implementations:</p>
83
+
<ul>
84
+
<li><ahref="https://github.com/cognate-lang/cognate">CognaC</a> is the original compiler – it performs type inference and produces efficient binaries.</li>
85
+
<li><ahref="https://cognate-playground.hedy.dev/">Cognate Playground</a> (developed by <ahref="https://github.com/hedyhli">hedyhli</a>) runs Cognate programs in a web browser.</li>
86
+
<li><ahref="https://github.com/dragoncoder047/cogni">Cogni</a> (developed by <ahref="https://github.com/dragoncoder047">dragoncoder047</a>) interprets Cognate programs, and is optimised to run on microcontrollers.</li>
0 commit comments