Skip to content

MarcosAndradeV/chs-lang

Repository files navigation

CHS Programming Language

CHS is a statically typed, native programming language for experimentation.

Current Status

The CHS compiler is currently functional, allowing for basic program compilation and execution. However, the language is still under active development.

Design Goals

  • Simplicity: CHS aims to be easy to learn and use.
  • Explicitness: The language promotes clear and explicit programming practices, making code more readable and maintainable.
  • Extensibility: CHS provides a foundation for experimentation and allows for the development of domain-specific extensions.

Key Features

  • Statically Typed: CHS incorporates a robust static type system with type inference, inspired by the ML family of languages, enhancing code safety and reliability.
  • Metaprogramming (Planned): CHS aims to support metaprogramming capabilities, allowing developers to generate code at compile time, enabling powerful code generation and optimization techniques.
  • Compile-Time Memory Management (Planned): CHS plans to integrate a compile-time memory management system, similar to Rust, to improve memory safety and performance.

Limitations

  • Limited Practicality: The current version lacks a module system and a standard library, which limits its practical usability.
  • Metaprogramming: The metaprogramming system is currently planned and not yet implemented.

Roadmap

  • Native code compiler (x86_64-linux)
  • Statically typed and type inference
  • Module System: Implement a robust module system to support code organization and reusability.
  • Standard Library: Develop a comprehensive standard library providing essential functions and data structures.
  • Metaprogramming System: Implement the planned metaprogramming capabilities, enabling code generation and optimization.

Getting Started

Building from Source:

Install Rust and fasm make sure it's available in $PATH.

$ make release
$ cp -v target/release/chs .

Testing:

  • No support yet

Usage:

$ ./chs
USAGE: target/debug/chs <COMMAND> [OPTIONS]
COMMANDS:
      help         Print this message
      compile      Compile a program: chs compile <file.chs>

Editor Support:

  • No support yet

Language Reference

Examples

  • Hello, World:
fn main()
  msg := "Hello, World\n"
  syscall(1, 1, msg, len(msg))
end

Description

TODO

Type system overview

TODO

License

This project is licensed under the MIT License - see the LICENSE file for details.

References & Inspirations

About

A experimental programming language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages