Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoSign in
Socket

github.com/classpythonaddike/brainfcompiler

Package Overview
Dependencies
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/classpythonaddike/brainfcompiler

Source
Go Modules
Version
v0.0.0
Version published
Created
Source

BrainF Compiler

This is a BrainF Compiler written in Golang. It converts BrainF code to C++ code, and then finally machine language, thus generating an executable. My aim is for it to be the fastest BrainF executor I've written yet.

As of now, this compiler is able to draw a mandelbrot set in 11 seconds. take a look at mandelbrot.bf for the program

Usage

Setup

  • If you are on windows, you can go to the Releases tab to download the latest release.

  • If you are on a different operating system, you will need to compile it on your machine (hopefully I will be able to do it for you in a few days). Create a file named main.go and paste the following code into it:

package main

import (
  "flag"
  bfcompiler "github.com/classPythonAddike/brainfcompiler"
)

func main() {

  compiler := flag.String("compiler", "gcc", "Compiler to use at runtime")
  file := flag.String("filename", "", "BrainF file to compile")
  output := flag.String("out", "", "Output file")

  flag.Parse()

  bfcompiler.Compile(*file, *compiler, *output)
}
  • If you don't want to use the CLI, you can always invoke it from a script! You just need to download this package with go get https://github.com/classPythonAddike/brainfcompiler and then use the Compile function to compile a BrainF program.

Usage

You can invoke the script like this:

> brainfcompiler.exe -file=filename.bf -out=filename.exe [-compiler="g++"]

The compiler used by default is gcc. Supported compilers are gcc and g++

FAQs

Package last updated on 28 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts