/cognition

Primary LanguageCMIT LicenseMIT

Cognition

An unopinionated programming language which offers full publicity of syntax and tokenizing.

Introduction

Cognition is a fully introspective system designed so that the syntax and hierarchy structure of the language is fully public; that is, a file that contains cognition code can alter the way that it is being parsed, in real time. Cognition allows for this because the language is completely postfix with extremely minimal syntax, and what exists of the syntax can be changed at will. Because the language never reads more than it has to, and because the language allows for metaprogramming (talking about symbols as if they are data, as well as code), the syntax of the language is made fluid. This allows for the advanced manipulation of how the next token is tokenized, and how these tokens are arranged into something like the AST without having to explicitly program a rigid syntax.

Features

  • Native UTF-8 support for words and strings
  • A foreign language interface (FLI), allowing programmers to write word definitions in C
  • Better-than-metaprogramming (see the paper)

Install

On Unix-likes:

git clone --recurse-submodules https://github.com/metacrank/cognition
cd cognition/
make
sudo make install

With Nix:

git clone --recurse-submodules https://github.com/metacrank/cognition
cd cognition/
nix-build # or nix-shell if you want to hack on it