Skip to content

The Language Specification

Sofia Rodrigues edited this page Apr 8, 2023 · 18 revisions

This is a draft for the 0.4 version of the Kind language specification, it's made to be a "formal" informal specification that is the basis for a real world implementation but the compiler can make some slight modifications to it in order to make it more performant.

This document is influenced by the Ferrocene Specification, The Ada Reference Manual, the Rust language reference and the Haskell 2010 Reference guide.

1.1. Scope

  • This document specifies the syntax and the semantics of programs written in the programming language Kind and it's implemented as a whole with some modifications by the kindc compiler that is on hosted on GitHub under the HIgherOrderCO organization.
  • This document does not specifies how programs are compiled to any particular backend, how they're interpreted in this specific backend, how things are translated to any specific IR, just how they're equivalent to some other constructions of the language.
  • This document does not specifies how external effects interacts with the underlying machine in order to make it independent of a machine and just an abstract specification.

1.2. Structure

  • Introduction
  • Chapter 1. General
    • 1.1. Scope
    • 1.2. Structure
  • Chapter 2. Lexical Grammar
    • 2.1. Character Set
    • 2.2. Identifiers
    • 2.3. Literals
    • 2.4. Comments
    • 2.5. Reserved Words
  • Chapter 3. Syntax Grammar
    • 3.1. Module
      • 3.1.1 Shebang
      • 3.1.2 Use aliases
    • 3.2. Declarations
      • 3.2.1. Arguments
      • 3.2.1. Functions Rules and Signatures
      • 3.2.2. Types and Records
      • 3.3.3. Attributes
      • 3.3.4. Commands
    • 3.3. Literals
    • 3.4. Expressions
      • Function calls
      • Lightweight lambdas
      • Pi type
      • Sigma type
      • Let binding
      • Type annotation
      • Binary operations
      • Substitutions
      • Field accessor
      • Syntax sugars
        • Open expression
        • Match expression
        • If expression
        • Do expression
          • Return statement
          • Ask statement
        • List expression
        • Pair expression
        • Sigma expression
    • 3.5 Patterns
      • Constructor pattern
      • Variable pattern
      • Absurd pattern
      • List pattern
      • Pair pattern
Clone this wiki locally