Crates.io | typed-sf |
lib.rs | typed-sf |
version | 2.0.0 |
source | src |
created_at | 2022-05-17 18:51:17.235584 |
updated_at | 2022-06-02 16:18:08.455773 |
description | Typed ready-to-use implementation of SmallF*ck language in Rust. |
homepage | |
repository | https://github.com/Zote-the-Mighty-4o2/typed-sf.rs |
max_upload_size | |
id | 588559 |
size | 21,347 |
Simple, ready-to-use typed realization of SmallF*ck esoteric language. Highly inspired by this article.
use typed_sf::*;
type SetTrue<Next = EOF> = Cycle<Flip, Flip<Next>>;
// [*<<[*]*>>>] // Move any-sized chunk of True's 2 cells left
#[allow(non_camel_case_types)]
type prog = Cycle<Flip<Left<Left<SetTrue<Right<Right<Right>>>>>>>;
#[allow(non_camel_case_types)]
type result = Run<
prog,
State<Nil, True, Cons<True, Nil>>
>;
assert_eq!(
<result as StateTrait>::val(),
(vec![true, true, false, false], false, Vec::new())
);
Github repo: https://github.com/Zote-the-Mighty-4o2/typed-sf.rs
Documentation: https://docs.rs/typed-sf/