GithubHelp home page GithubHelp logo

kbf's Introduction

kbf

The Korn shell BrainFuck interpreter

Contents

  1. Synopsis
  2. Install
  3. Tests
  4. Contributing
  5. License

Synopsis

kbf [-dsD] [-c size] [-o optimisation] [-t size] [-O level] file[.b]

kbf is a brainfuck interpreter written in korn shell. It is currently compatible with multiple shells, not just bash, and thus is probably the most portable implementation. The following shells are supported:

  • Public Domain Korn SHell - pdksh;
  • OpenBSD Korn SHell - oksh;
  • MirBSD Korn SHell - mksh;
  • GNU Bourne-Again SHell - bash;
  • The Z shell - zsh.

Other shells might be supported in the future in they handle extension to POSIX such as local variables and arrays. This implementation works with various cell sizes from 8 to 64 bits but default to 24 as it is the largest size handled by all supported shells.

Through the switches -O and -o it is possible to enable some optimisation strategies, such as optimised operators for some simple constructions and run length encoding.

The “bitwidth.b” torture test written by rdebath works at every cell sizes and optimisation levels :

cell size Output
8 Hello World! 255
16 Hello world! 65535
24 Hello, world!
32s Hello, world!
32u Hello, world!
64s Hello, world!

kbf can be used directly or as a library. The later can be useful to extend the brainfuck language or implement variants such as Ook! and blub (as implemented in the examples directory). The usage and behaviour of this mode is described in the man page kbf.3 while the executable command is described in kbf.1. It is possible to read them with either mandoc or groff:

$ mandoc kbf.1 | less
$ groff -m mdoc -Tascii kbf.1 | less

A mandoc version of these man pages is also provided: kbf.1.md and kbf.3.md.

Install

Requires

  • Any a-bit-more-than-POSIX shell.

Build

There is a makefile available for BSD systems, just run make install. If you use something else just use cp kbf.sh $DESTDIR/kbf.

Tests

Regression tests are available and documented in a dedicated regress/README.md.

Contributing

Either send send GitHub pull requests or send patches on SourceHut.

License

All the code is licensed under the ISC License.

kbf's People

Contributors

tleguern avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.