Giter Site home page Giter Site logo

rustfuck's Introduction

Rustfuck

A brainfuck to x86_64 assembly or C Compiler written in rust.

Currently, it required libc and needs to be compiled and linked with as and gcc.

This readme is currently a bit outdated

Usage

Brainfuck to x86_64 assembly or C Compiler

Usage: rustfuck [OPTIONS] <INPUT_PATH>

Arguments:
  <INPUT_PATH>  Brainfuck source file

Options:
  -o, --output-path <OUTPUT_PATH>  Output path
  -O                               Enable optimizations
  -S, --assembly                   Output generated assembly
  -C                               Output generated C code
      --keep-files                 Keep intermediate files
      --ast                        Print generated AST
  -h, --help                       Print help
  -V, --version                    Print version

Compile brainfuck to executable

rustfuck brainfucks/hello_world.bf

this will output an executable called a.out

rustfuck brainfucks/hello_world.bf --keep-files

this will output an executable called a.out, an assembly file called a.S and an object file called a.o.

rustfuck brainfucks/hello_world.bf -o hello_world

this will output an executable called hello_world

rustfuck brainfucks/hello_world.bf -o hello_world --keep-files

this will output an executable called hello_world, an assembly file call hello_world.S and an object file called hello_world.o

Compile brainfuck to x86_64 assembly

rustfuck brainfucks/hello_world.bf -S

this will output an assembly file called a.S

rustfuck brainfucks/hello_world.bf -S -o hello_world

this will output an assembly file called hello_world

rustfuck brainfucks/hello_world.bf -o hello_world.s

this will output an assembly file called hello_world.s

Dump AST

rustfuck brainfucks/hello_world.bf --ast

this will dump the generated AST to stdout

TODO

  • Better error handling
  • Unit tests and CI
  • Use linux syscalls instead of libc
  • Remove as and gcc dependancies and start using nasm or fasm
  • Allow outputting as object file

rustfuck's People

Contributors

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