typed-sf

Crates.iotyped-sf
lib.rstyped-sf
version2.0.0
sourcesrc
created_at2022-05-17 18:51:17.235584
updated_at2022-06-02 16:18:08.455773
descriptionTyped ready-to-use implementation of SmallF*ck language in Rust.
homepage
repositoryhttps://github.com/Zote-the-Mighty-4o2/typed-sf.rs
max_upload_size
id588559
size21,347
Xenia (uwuzote)

documentation

README

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())
);

Links:

Github repo: https://github.com/Zote-the-Mighty-4o2/typed-sf.rs
Documentation: https://docs.rs/typed-sf/

Commit count: 24

cargo fmt