Git Product home page Git Product logo

bfpy's Introduction

bfpy

Python to Brainfuck transpiler

What is BFPY

BFPY is an alternative Python runtime that uses Brainfuck as a bytecode.

How does BFPY works ?

BFPY uses the standard dis module to disassemble a given Python function, and translates one by one each bytecode instruction. It uses the Brainfuck memory as a stack like a virtual machine would.

Why BFPY ?

Boredom.

What is currently implemented ?

For instance, BFPY can only translate arithmetic operations (addition, subtraction, multiplication, floor division and power). There is still a lot of features to implement for it to be a proper Python runtime alternative

What remains to be implemented ?

I still have to translate more bytecode instruction to Brainfuck, but most can't be translated as long as I don't allow Brainfuck to deal with more types (not just bytes, but also characters, integers, lists, and maybe dictionaries).

I plan on implementing those types by loading the memory with a bytearray given by a serialization of the said object, using marshal, but I don't know yet how to expand a single stack element size to support multiple bytes.

bfpy's People

Contributors

myrma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bfpy's Issues

Instructions for use

How do I actually transpile an application? There are no instructions and I can't quite figure it out on my own.

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.