#language #scripting

clover

A scripting language

6 releases

0.1.3 Jul 16, 2022
0.1.2 Aug 8, 2021
0.1.1 Jun 13, 2021
0.0.2 Jun 12, 2021
0.0.1 Oct 4, 2020

#32 in #script

Download history 8/week @ 2023-10-21 19/week @ 2023-10-28 16/week @ 2023-11-04 9/week @ 2023-11-11 11/week @ 2023-11-18 29/week @ 2023-11-25 17/week @ 2023-12-02 8/week @ 2023-12-09 14/week @ 2023-12-16 20/week @ 2023-12-23 4/week @ 2023-12-30 8/week @ 2024-01-06 10/week @ 2024-01-13 15/week @ 2024-01-20 22/week @ 2024-01-27 11/week @ 2024-02-03

60 downloads per month
Used in 2 crates

MIT license

165KB
3.5K SLoC

Clover

crates.io CI Crates.io

a scripting language created in Rust

still in development~

Features

  • bytecode
  • first class function
  • error handling

Example

You can go to examples directory for more examples

Hello World

function main()
    print("hello world!")
end

Include other file

rectangle.luck

public model Rectangle
    width
    height
end

implement Rectangle
    function area(this)
        this.width * this.height
    end
end

main.luck

include Rectangle from "./rectangle.luck"

function main()
    local rect = Rectangle(20, 30)
    print(rect.area())
end

Editor support

Visual Studio Code

Use Clover VSCode Support for code highlighting in Visual Studio Code

Integrate to your project

Example

let result = create_state_by_filename("example/main.luck");

match result {
  Ok(mut state) => {
    state.execute();
  }
}

Export native function/struct to Clover

see clover-std

CLI

Install

use Cargo to install the clover-cli

cargo install clover-cli

Usage

clover examples/main.luck

Dependencies

~120KB