Skip to content
/ lys Public

The Lys purely functional programming language.

Notifications You must be signed in to change notification settings

lyslang/lys

Repository files navigation


Lys


The Lys purely functional programming language.
VS Code ExtensionUsageInstallationContributingLicense

Features

  • Purely functional
    • No side effects
    • Pattern matching
    • Polymorphism
  • Practical syntax
    • Concise
    • Elegant
    • Seamless currying support
  • Type infered (WIP)
    • Robust
    • Fast
  • VS Code language support
    • Syntax highlighting
    • Formatting
    • Parsing
  • Helpful error messages
  • Unicode support

Examples

Summation

def sum lst =
  match lst {
    [] -> 0;
    [hd, tl...] -> hd + sum tl;
  }

Fibonacci

def fib n : Int -> Int =
  if n <= 1 then n else fib (n - 1) + fib (n - 2)

Grammar

For a detailed presentation of the Lys syntax and features, please have a look at our sample grammar file.

Usage

You can skip installation when running from source.

The expected file extension of the Lys programming language is .lys.

Following docopt conventions:

Command Description
lys Parse standard input and display the AST.
lys <file> Parse a file and display the AST.
lys fmt Format standard input and output it.
lys fmt <file> Format a file and overwrite it.
lys transpile Transpile standard input and output it.
lys transpile <file> Transpile a file and write its OCaml counterpart.

You can run transpiled files using:

ocaml <file.ml>

Installation

If you are using NixOS, please follow these steps.

Or, download the latest executable for your system and add it to your PATH.

On Unix-like operating systems, you will then need to run the following command:

chmod +x /path/to/lys/executable

Contributing

We welcome contributions to Lys! If you’re interested in helping improve the language, fix bugs, or add new features, please check out our contributing guide for detailed information on how to get started, set up your development environment, and submit your contributions.

Key areas where you can contribute include:

  • Improving the back-end
  • Enhancing language features
  • Writing documentation
  • Creating examples and tutorials
  • Reporting and fixing bugs
  • Suggesting and implementing new features

Whether you’re a seasoned OCaml developer or just getting started with functional programming, there are many ways to contribute. We appreciate all forms of contribution and look forward to collaborating with you!

License

This project is licensed under multiple licenses in accordance with the recommendations of the REUSE Initiative. Please refer to the individual files for more information.

About

The Lys purely functional programming language.

Topics

Resources

Stars

Watchers

Forks

Languages