90 lines
1.0 KiB
Markdown
90 lines
1.0 KiB
Markdown
|
|
Grass Mud Horse in Rust
|
|
|
|
# Intrduction
|
|
|
|
Grass Mud Horse Language Spec - [https://playsecurity.org/rawfile/grass_mud_horse_language_specification.md](https://playsecurity.org/rawfile/grass_mud_horse_language_specification.md)
|
|
|
|

|
|
|
|
# Compile
|
|
|
|
compile grassmudhorse.rs:
|
|
```shell
|
|
$ cargo b
|
|
|
|
OR
|
|
|
|
$ cargo b --release
|
|
```
|
|
|
|
# Usage
|
|
|
|
help:
|
|
```shell
|
|
$ grassmudhorse -h
|
|
grassmudhorse.rs v0.1
|
|
```
|
|
|
|
execute from file:
|
|
```shell
|
|
$ grassmudhorse print-110.gmh
|
|
1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
```
|
|
|
|
execute from stdin:
|
|
```shell
|
|
$ cat print-110.gmh | grassmudhorse
|
|
1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
```
|
|
|
|
compile:
|
|
```shell
|
|
$ cat plus11.gmh.source
|
|
push 1
|
|
push 2
|
|
add
|
|
stdoutnum
|
|
push 10
|
|
stdoutchar
|
|
end
|
|
|
|
|
|
$ grassmudhorse --compile plus11.gmh.source
|
|
草草草泥马
|
|
草草草泥草马
|
|
泥草草草
|
|
泥马草泥
|
|
草草草泥草泥草马
|
|
泥马草草
|
|
马马马
|
|
|
|
|
|
$ grassmudhorse --compile plus11.gmh.source | grassmudhorse
|
|
3
|
|
```
|
|
|
|
compile and execute:
|
|
```shell
|
|
$ grassmudhorse --compile plus1100.gmh.source | grassmudhorse
|
|
5050
|
|
```
|