7个版本
使用旧的Rust 2015
0.2.1 | 2019年10月23日 |
---|---|
0.2.0 | 2019年10月22日 |
0.1.4 | 2019年10月21日 |
1170 在 编程语言 中
30KB
567 行
ashpaper-bin
ashpaper crate的命令行界面,由William Hicks构想的Esopo语言解释器,现在您可以从命令行运行诗歌程序!
用法
以下是一个名为 'lovely-poem.eso' 的“poegram”(在这个仓库的诗歌目录中)
lovely poem
it is a calculator, like a
poem, is a poem, and finds
factori-
als
The input is the syllAbles
in the title, count them, as one counts
(q) what other poem, programs can be writ
(a) anything a Turing
machine-machine-machine
would do
re/cur
sion works too, in poems, programs, and this
a lovely.
poem or a calculator or nothing
how lovely can it be?
您可以使用以下命令运行它
ashpaper lovely-poem.eso
它将打印以下内容到标准输出
24
当设置 RUST_LOG=info
时(即运行 RUST_LOG=info ashpaper lovely-poem.eso
),您可以获取程序评估信息。以下是lovely-poem.eso的样子。
instruction | r0 | r1 | stack
--------------------------------------------------- | ---- | ---- | -------
lovely poem | 4 | 0 | []
| 4 | 0 | []
it is a calculator, like a | 4 | 4 | []
poem, is a poem, and finds | 4 | 4 | []
factori- | 4 | 4 | [4]
als | 4 | 1 | [4]
The input is the syllAbles | 4 | -1 | [4]
in the title, count them, as one counts | 3 | -1 | [4]
(q) what other poem, programs can be writ | 3 | 4 | []
(a) anything a Turing | 3 | 12 | []
machine-machine-machine | 3 | 12 | [12]
would do | 3 | 2 | [12]
it is a calculator, like a | 3 | 5 | [12]
poem, is a poem, and finds | 3 | 12 | []
factori- | 3 | 12 | [12]
als | 3 | 1 | [12]
The input is the syllAbles | 3 | -1 | [12]
in the title, count them, as one counts | 2 | -1 | [12]
(q) what other poem, programs can be writ | 2 | 12 | []
(a) anything a Turing | 2 | 24 | []
machine-machine-machine | 2 | 24 | [24]
would do | 2 | 2 | [24]
re/cur | 2 | 2 | [24]
sion works too, in poems, programs, and this | 2 | 24 | []
a lovely. | 2 | 24 | []
poem or a calculator or nothing | 10 | 24 | []
how lovely can it be? | 10 | 24 | []
问题
目前这个项目非常基础,如果您发现有问题,请提出问题 ❤️ ❤️
依赖关系
~5–14MB
~161K SLoC