-
Notifications
You must be signed in to change notification settings - Fork 26
Home
Zilin Chen edited this page Mar 20, 2017
·
7 revisions
Welcome to the Cogent wiki!
Cogent is a restricted, polymorphic, higher-order and purely functional language with linear types and without the need for a trusted runtime or garbage collector.
In the context of Cogent, the adjectives above, mean the following:
- restricted: Cogent is not a general-purpose language. It omits certain features that one might come to expect from a programming language. For instance, Cogent doesn’t support general recursion.
- polymorphic: Parametrically. This is similar to templates in C++ or generics in Rust.
- higher-order: Functions are values --- they can be function arguments.
- purely functional: Functional in the sense of functional programming paradigm. Cogent is stateless, and the result of a function is deterministically defined by the arguments to the function (just like mathematical functions).
- linear types: As a means to control references, every linear object (roughly equivalent to heap-allocated object) can be referenced exactly once.
- trusted runtime: Cogent compiler generates C code, so the trusted component is limited to the C runtime system.
- garbage collector: Since Cogent compiler generates C code, we would manage memory manually, like we do in any C program.