Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ippan/clover
a scripting language created in Rust~
https://github.com/ippan/clover
clover language rust rust-lang script scripting-language
Last synced: about 2 months ago
JSON representation
a scripting language created in Rust~
- Host: GitHub
- URL: https://github.com/ippan/clover
- Owner: ippan
- License: mit
- Created: 2014-03-25T07:26:14.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-07-24T09:09:29.000Z (over 2 years ago)
- Last Synced: 2024-10-13T14:29:21.455Z (2 months ago)
- Topics: clover, language, rust, rust-lang, script, scripting-language
- Language: Rust
- Homepage:
- Size: 309 KB
- Stars: 13
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Clover
| clover | clover-std | clover-cli |
| ----------- | ------- | ----------- |
| [![crates.io](https://img.shields.io/crates/v/clover.svg)](https://crates.io/crates/clover) | [![crates.io](https://img.shields.io/crates/v/clover-std.svg)](https://crates.io/crates/clover-std) | [![crates.io](https://img.shields.io/crates/v/clover-cli.svg)](https://crates.io/crates/clover-cli) |[![CI](https://github.com/ippan/clover/actions/workflows/build_and_test.yml/badge.svg)](https://github.com/ippan/clover/actions/workflows/build_and_test.yml)
![Crates.io](https://img.shields.io/crates/l/clover)a scripting language created in Rust
still in development~
## Features
* bytecode
* first class function
* error handling## Example
You can go to [examples](https://github.com/ippan/clover/tree/master/examples) directory for more examples
### Hello World
```ruby
function main()
print("hello world!")
end
```### Include other file
rectangle.luck
```ruby
public model Rectangle
width
height
endimplement Rectangle
function area(this)
this.width * this.height
end
end
```main.luck
```ruby
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](https://github.com/ippan/vscode-clover) for code highlighting in [Visual Studio Code](https://code.visualstudio.com/)
## Integrate to your project
### Example
```rust
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](https://github.com/ippan/clover/tree/master/crates/clover-std)
## CLI
### Install
use [Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html) to install the clover-cli
```shell
cargo install clover-cli
```### Usage
```shell
clover examples/main.luck
```