三体编程语言 Three Body Language written in Rust
Playground: https://rustq.github.io/3body-lang/
Base on monkey-lang
Working with Wasm!! 主很在乎 🤔
https://rustq.github.io/3body-lang/
Variable bindings, such as those supported by many programming languages, are implemented. Variables can be defined using the let keyword.
给 <identifier> 以 <expression>;
```rust 给 岁月 以 "文明";
给 时光 以 "生命"; ```
```rust 给 自然选择 以 0;
自然选择 前进 4
// > 4 ```
```rust 给 宇宙 以 { "维度": 10 };
宇宙["维度"] 降维 7
// > 3 ```
```rust return 这是计划的一部分
// > true ```
```rust return 主不在乎
// > false ```
法则 (<parameter one>, <parameter two>, ...) { <block statement> };
```rust 给 黑暗森林 以 法则() { 给 文明的需要 以 ["生存", "不断增长和扩张"]; !!文明的需要 }
黑暗森林() ```
广播(<arg1>, <arg2>, ...): void
```rust 给 三体世界坐标 以 "半人马星系";
广播(三体世界坐标);
// > "半人马星系" ```
冬眠(<arg1>): void
rust
冬眠(1000);
rust
二向箔清理();
|Monkey|3body-lang|Explanation| |---|---|---| |let|给|"give"| |=|以|"as"| |+|前进|"go forward"| |-|降维|"dimension reduction"| |true|这是计划的一部分|"It's part of the plan."| |false|主不在乎|"The Lord doesn't care."| |fn|法则|"rule"| |print|广播|"broadcast"| |sleep|冬眠|"hibernation"| |clear|二向箔清理|"two-way foil cleaning"| |exit|破壁|"break the wall"|
```bash $ git clone https://github.com/rustq/3body-lang.git
$ cd 3body-lang
$ make repl ```
$ make build_wasm
$ make test
| Author |
| ----------- |
| |
| meloalright |