bfy

所属分类:编译器/解释器
开发工具:Rust
文件大小:0KB
下载次数:0
上传日期:2023-08-17 21:26:05
上 传 者sh-1993
说明:  Brainfu*k解释器和用Rust编写的REPL,
(Brainfu*k interpreter and REPL written in Rust ,)

文件列表:
.idea/ (0, 2023-09-27)
.idea/bf-interpreter.iml (425, 2023-09-27)
.idea/compilerexplorer.settings.xml (194, 2023-09-27)
.idea/discord.xml (238, 2023-09-27)
.idea/inspectionProfiles/ (0, 2023-09-27)
.idea/inspectionProfiles/Project_Default.xml (272, 2023-09-27)
.idea/jpa-buddy.xml (187, 2023-09-27)
.idea/misc.xml (142, 2023-09-27)
.idea/modules.xml (280, 2023-09-27)
.idea/runConfigurations/ (0, 2023-09-27)
.idea/runConfigurations/Run_bf_interpreter.xml (964, 2023-09-27)
.idea/vcs.xml (180, 2023-09-27)
.mergify.yml (156, 2023-09-27)
Cargo.toml (978, 2023-09-27)
LICENSE-MIT.txt (1073, 2023-09-27)
LICENSE.txt (483, 2023-09-27)
assets/ (0, 2023-09-27)
assets/cover.jpg (38971, 2023-09-27)
assets/cover.png (80474, 2023-09-27)
assets/cover.xcf (191554, 2023-09-27)
renovate.json (107, 2023-09-27)
screenshots/ (0, 2023-09-27)
screenshots/like_cat_output.png (12773, 2023-09-27)
screenshots/repl_print_at_and_A_0.1.0.png (94292, 2023-09-27)
src/ (0, 2023-09-27)
src/arguments.rs (1903, 2023-09-27)
src/bf_interpreter/ (0, 2023-09-27)
src/bf_interpreter/cell.rs (7821, 2023-09-27)
src/bf_interpreter/error.rs (3835, 2023-09-27)
src/bf_interpreter/interpreter.rs (11195, 2023-09-27)
src/bf_interpreter/mod.rs (50, 2023-09-27)
src/main.rs (2030, 2023-09-27)
... ...

brainfuc*k interpreter

# brainfuc*k interpreter: a simple brainfuc*k interpreter and REPL writen in rust #### *Read this in other languages.* [AR Arabic-](https://github.com/0x61nas/bfy/blob/master/README-ar.md) ## Features - Run brainfuc*k code from a file - Run brainfuc*k live code from the REPL - Support utf-8 characters including emojis (optional) - You can control in the array size ## Install - from crates.io ```shell cargo install bfy ``` - From aur: ```shell yay -S bfy ``` ## Options and arguments
Options table
Option Description Default
-h, --help Prints help information
-V, --version Prints version information
-f, --features The extra features to enable
Possible values:
  • no-reverse-value:
    If the value is you want decrement the value and the value is 0, don't set the value to 255, otherwise decrement the value.
    If the value is you want increment the value and the value is 255, don't set the value to 0, otherwise increment the value. The alias are: `nrv`
  • reverse-pointer:
    If the pointer at the end of the array, set the pointer to 0, otherwise increment the pointer.
    If the pointer at the beginning of the array, set the pointer to the end of the array, otherwise decrement the pointer. The alias are: `rp`
  • allow-utf8:
    Allow the use of utf8 characters (32 bit), otherwise only 8 bit characters are allowed.
    Use this feature with caution because it increases the cell size from 8 bits to 32 bits.
    It also allow you to use the emoji in your brainfuck code :D, This is if you can preserve your mind so that you can access their digital value :).
    The `u32` in rust can only store values from 0 to 4294967295, but we can only use 0 to 1114111 (0x10FFFF) for now. The alias are: `utf8`
n/a
-a, --array-size The size of the array 30000
-w, --without-tiles Dont print the tiles (e.g. exit code, file name, etc)
Help option output ```shell bfy --help ``` ```text Brainfu*k interpreter and REPL written in Rust Usage: bfy [OPTIONS] [SOURCE] Arguments: [SOURCE] The brainfuck source code file to run (if not will be entered in REPL mode) Options: -f, --features Possible values: - no-reverse-value: If the value is you want decrement the value and the value is 0, don't set the value to 255, otherwise decrement the value. If the value is you want increment the value and the value is 255, don't set the value to 0, otherwise increment the value. The alias are: `nrv` - reverse-pointer: If the pointer at the end of the array, set the pointer to 0, otherwise increment the pointer. If the pointer at the beginning of the array, set the pointer to the end of the array, otherwise decrement the pointer. The alias are: `rp` - allow-utf8: Allow the use of utf8 characters (32 bit), otherwise only 8 bit characters are allowed. Use this feature with caution because it increases the cell size from 8 bits to 32 bits. It also allow you to use the emoji in your brainfuck code :D, This is if you can preserve your mind so that you can access their digital value :). The `u32` in rust can only store values from 0 to 4294967295, but we can only use 0 to 1114111 (0x10FFFF) for now. The alias are: `utf8` -a, --array-size The brainfuck array size [default: 30000] -w, --without-tiles Dont print the tiles (e.g. exit code, file name, etc) -h, --help Print help information (use `-h` for a summary) -V, --version Print version information ```
### Examples ```bash bfy test_code/hello_world.bf ``` ```text Hello world! Successfully ran brainfuck source code from file: test_code/hello_world.bf Exiting with code: 0 ``` ```bash bfy -w test_code/hello_world.bf ``` ```text Hello world! ``` ```bash bfy test_code/print_hi_yooo.bf ``` ```text Hi yoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo!Successfully ran brainfuck source code from file: test_code/print_hi_yooo.bf Exiting with code: 0 ``` ```bash bfy -w test_code/print_hi_yooo.bf ``` ```text Hi yoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! ``` ```bash bfy test_code/like_cat.bf ``` ![output](https://github.com/0x61nas/bfy/blob/master/./screenshots/like_cat_output.png) > Note: The output is not the same as the current version of the interpreter, but it is the same as the output of the interpreter when I wrote the code. ## REPL ```bash bfy # REPL mode ``` ![print @ and A in the repl](https://github.com/0x61nas/bfy/blob/master/./screenshots/repl_print_at_and_A_0.1.0.png) ## TODO - [ ] Add more tests - [ ] Add more examples - [ ] Create the brainfuck formatter - [ ] Add syntax highlighting in the REPL - [ ] Add auto completion in the REPL - [ ] Support dynamic array size feature ## Resources - [Brainfuck in wikipedia](https://github.com/0x61nas/bfy/blob/master/https://en.wikipedia.org/wiki/Brainfuck) - [Programming in Brainfuck](https://github.com/0x61nas/bfy/blob/master/http://cydathria.com/bf/brainfuck.html) - [Brainfuck: An Eight-Instruction Turing-Complete Programming Language](https://github.com/0x61nas/bfy/blob/master/http://www.muppetlabs.com/~breadbox/bf) - [brainfuck-visualizer](https://github.com/0x61nas/bfy/blob/master/https://github.com/usaikiran/brainfuck-visualizer) - [Basics of BrainFuck](https://github.com/0x61nas/bfy/blob/master/https://gist.github.com/roachhd/dce54bec8ba55fb17d3a) - [An elegant programming language: Brainfuck](https://github.com/0x61nas/bfy/blob/master/https://www.neperos.com/article/raqehg6b24ceadba)

近期下载者

相关文件


收藏者