modules/lang/brainfzck.zzm

lang-brainfzck-0.0.2 documentation

Package

Name
lang-brainfzck
Version
0.0.2
Uploaded
2026-06-07 11:22:25
Repository
https://github.com/tobyink/zuzu-lang-brainfzck
Dependencies
Metadata
zuzu-distribution.json
Archive
Download .tar.gz

NAME

lang/brainfzck - Parse and run Brainf*ck programs.

SYNOPSIS

  from lang/brainfzck import brainfzck, compile_brainfzck;

  say( brainfzck("++++++++[>++++++++<-]>+.") );  # A

  let program := compile_brainfzck(",+.");
  say( program.run( { input: "A" } ) );          # B

DESCRIPTION

This pure-Zuzu module implements Brainf*ck. Non-command characters are ignored. Bracket pairing is validated before execution, and cells wrap as unsigned bytes by default.

EXPORTS

Functions

  • brainfzck(String source, Dict options?)

    Compiles and runs source. Returns captured output unless an output_callback is supplied.

  • compile_brainfzck(String source, String source_name?)

    Returns a BrainfzckProgram object.

Classes

  • BrainfzckProgram

    Compiled Brainf*ck program. Use run(options?) to execute it.

  • BrainfzckError

    Base exception type.

  • BrainfzckSyntaxError

    Thrown for unmatched brackets.

  • BrainfzckRuntimeError

    Thrown for pointer and option errors.

COPYRIGHT AND LICENCE

lang/brainfzck is copyright Toby Inkster.

It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.