Did you know ... Search Documentation:
Pack cosmos -- docs/index.md


Cosmos is a modern object-oriented logic programming language with a modern scripting syntax.

rel main()
    x = io.read()
    io.writeln("hello, "+x+'!')

Cosmos explictly allow for a functional--or perhaps even imperative-style of code.

However, it's a fully logic programming language.

In fact, we borrow from many schools-of-thought. Cosmos has a...

  • Fully procedural, whitespace-sensitive syntax...
  • Functional features... (immutability, closures, type inference)
  • All while being a logic programming language... (relations, non-determinism)
  • ...with objects! Cosmos is still in-development. Documentation is provided for development.

    Documentation --

    See at the Quickstart or the full Guide*.

    The guide is meant to be more comprehensive and eventually provide a full documentation of the language. It may still need some proof-reading. The Quickstart is a quicker intro that assumes you have prior experience with procedural or functional languages.

    Download --

    See the Download section.

    Other --

  • Comparison to Prolog, etc.
  • A few more notes (Quickstart 2.0)

Why Cosmos?

Cosmos is a simple language that combines procedural, functional, logic programming and more.

It's simple --

It's a simple, minimal and user-friendly language.

It can be quickly learned and has typical syntax conventions.

It's safe --

The language is checked for type, mode and runtime errors.

Programming with relations --

> s='asd' and s[x]=x

Functional and pseudo-Imperative programming --

Cosmos™ is not an opinionated language and supports a variety of styles.

If relational programming is too much, one can fall back from it. The keyword fun essentially turns a relation into a regular programming function.

Transpilers --

Cosmos™ is currently a transpiler language.

See how it works.