19 releases

0.3.8 Sep 6, 2024
0.3.7 Aug 6, 2024
0.3.6 Jul 28, 2024
0.3.1 Jun 24, 2024
0.1.5 Jun 10, 2024

#559 in Data structures

Download history 223/week @ 2024-07-27 123/week @ 2024-08-03 12/week @ 2024-08-10 1/week @ 2024-08-17 62/week @ 2024-08-31 57/week @ 2024-09-07 83/week @ 2024-09-14 16/week @ 2024-09-21 74/week @ 2024-09-28 7/week @ 2024-10-05 1/week @ 2024-10-12

1,857 downloads per month
Used in roussillon-memory

MIT license

55KB
1.5K SLoC

Roussillon : Type System

This crate is an incomplete library with a clear goal of helping create a programming language.

This crate provides some structs and traits to manage types and typed values.

This crate goal IS NOT to manage memory allocation.

Type system

Types module

This module offers a way to mark some data with a type.

Primitive types

These are the necessary types to construct any other meaningful type. Usually, these are "machine types" :

  • Boolean
  • Byte
  • Bytes
  • Float
  • Integer
  • Reference
  • List

The "tuple" type

  • Tuple

Algebraic Data Types

  • SumType
  • ProductType

Custom types (ADT with an Identifier)

  • Enumeration (values are called unions)
  • Structure

Functional

  • FunctionType

Value module

The value module provides ways to create values from all types in the types module.

The provided constructible values are :

  • Boolean
  • Bytes (arbitrarily size)
    • Byte (8 bits)
    • Word (16)
    • Quad (32)
    • Long (64)
    • Wide (128)
  • Integer
  • Float
  • Reference
  • List
  • Sequence (Tuple values)
  • Sum (SumpType values)
  • Product (ProductType values)
  • Union (Enumeration values)
  • Record (Structure values)
  • FunctionBody

License

(c) 2024 Sébastien Geldreich

This work is published under the MIT License.

No runtime deps

Features