Code Monkey home page Code Monkey logo

brainfucks's Introduction

Brainfucks

This repository contains a bunch of brainfuck implementations in rust.

They are:

  • a simple AST based interpreter.
  • a naïve brainfuck-to-c transpiler.
  • a compiler using cranelift.

None of these implementations are particularily well opimized.

Prerequisites

To run these programs one only needs:

  • a working rust installation and
  • a C-compiler/linker to turn the C-file from the transpiler and the object-file from the compiler into executables, as they both require libc to be linked.

Building

$ pwd
/path/to/brainfucks
$ cargo build --release

Usage

Interpreter

cargo run --release -p interpreter -- <source.bf> [--verbose]

Transpiler

cargo run --release -p comp2c -- <source.bf> [-o <main.c>] [--verbose]
gcc main.c -o main
./main

Compiler

cargo run --release -p craneliftcomp -- <source.bf> [-o <main.o>] [--verbose]
gcc main.o -o main
./main

brainfucks's People

Contributors

burniintree avatar

Watchers

 avatar  avatar  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.