A Brainheck compiler written in Rust.

Related tags

Embedded brainhecc
Overview

Brainhecc

A compiler for Brain[hecc] programs, written in Rust with Cranelift.

It compiles any valid Brainhecc program into an executable binary.

Installation

Prerequisites

  • Cargo/Rust, to install & build the Brainhecc program.
  • GCC (or any other linker), required to link Brainhecc programs.

Note: to compile Brainhecc programs, any linker may be used, but Brainhecc programs must be linked with the C standard library, otherwise compiled programs won't work.

Setting Up

Cargo can automatically download and build the Brainhecc program:

cargo install brainhecc

Hello World

The Hello, World! example can be compiled an ran with the following commands:

brainhecc examples/hello_world.brainhecc hello_world.o # compile the program
gcc hello_world.o -o hello_world # link the program with the C standard library
./hello_world # run the program
              # => Hello, world!
You might also like...
C-like language compiler, the final project of ZJU Compiler Principle course
C-like language compiler, the final project of ZJU Compiler Principle course

cc99 cc99 (not cc98.org) is a C-like language compiler, which is the final project of ZJU Compiler Principle course. It supports many of the C99 langu

An esoteric language/compiler written with Rust and Rust LLVM bindings

MeidoLang (メイドラング) A not so useful and esoteric language. The goal of this project was to contain some quirky or novel syntax in a stack-style program

The Rust Compiler Collection is a collection of compilers for various languages, written with The Rust Programming Language.

rcc The Rust Compiler Collection is a collection of compilers for various languages, written with The Rust Programming Language. Compilers Language Co

ttvm is a runtime and compiler infrastructure written in Rust.

ttvm - Runtime and compiler infrastructure ttvm is a runtime and compiler infrastructure written in Rust. Usage Add the following to your Cargo.toml:

gors is an experimental go toolchain written in rust (parser, compiler).

gors gors is an experimental go toolchain written in rust (parser, compiler). Install Using git This method requires the Rust toolchain to be installe

swc is a super-fast compiler written in rust; producing widely-supported javascript from modern standards and typescript.
swc is a super-fast compiler written in rust; producing widely-supported javascript from modern standards and typescript.

Make the web (development) faster. SWC (stands for Speedy Web Compiler) is a super-fast TypeScript / JavaScript compiler written in Rust. It's a libra

My 'Lugli' language compiler for learning purposes, written in rust. 🥰🤠

Lugli language compiler My 'Lugli' language compiler for learning purposes, written in rust. This language is to be a subset for other purposes, for e

A parser, compiler, and virtual machine evaluator for a minimal subset of Lua; written from scratch in Rust.

lust: Lua in Rust This project implements a parser, compiler, and virtual machine evaluator for a minimal subset of Lua. It is written from scratch in

(Toy) Compiler Infrastructure influenced by LLVM written in Rust

Sericum Compiler Infrastructure influenced by LLVM written in Rust Do not expect too much stuff! To Do Implement basic block parameters Make it possib

An optimising Brainf*ck to x86-64 assembly compiler written in Rust

brainfrsk 2 An optimising Brainf*ck to x86-64 assembly compiler. This compiler can produce optimised binaries for macOS (Sytem V calling convention) b

A WIP minimal C Compiler written in Rust 🦀

_ _ ____ ____ | | __ _ _ __ | | __ / ___/ ___| _ | |/ _` | '_ \| |/ / | | | | | |_| | (_| | | | | | |__| |___

Discord-to-Cohost compiler written in Rust using Tera
Discord-to-Cohost compiler written in Rust using Tera

Cohoard - Post formatted chatlogs to Cohost! Cohoard is a tool for turning chatlogs into formatted posts on Cohost. You can use Cohoard to easily form

⚡ Blazing ⚡ fast ⚡ compiler for Cairo, written in 🦀 Rust 🦀

Cairo 1.0 🐺 ⚡ Blazing ⚡ fast ⚡ compiler for Cairo, written in 🦀 Rust 🦀 Report a Bug - Request a Feature - Ask a Question Getting Started Prerequisi

ArbOS operating system, to run at Layer 2 on Arbitrum chains. Also a compiler for Mini, the language in which ArbOS is written.

ArbOS and Mini compiler ArbOS is the "operating system" that runs at Layer 2 on an Arbitrum chain, to manage the chain's operation, maintain security,

rust-analyzer is a modular compiler frontend for the Rust language
rust-analyzer is a modular compiler frontend for the Rust language

rust-analyzer is a modular compiler frontend for the Rust language. It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust.

A additional Rust compiler pass to detect memory safe bugs of Rust programs.

SafeDrop A additional Rust compiler pass to detect memory safe bugs of Rust programs. SafeDrop performs path-sensitive and field-sensitive inter-proce

This rust compiler backend emmits valid CLR IR, enambling you to use Rust in .NET projects

What is rustc_codegen_clr? NOTE: this project is a very early proof-of-concept This is a compiler backend for rustc which targets the .NET platform an

Take your first step in writing a compiler. Implemented in Rust.

first-step-rust Take your first step in writing a compiler, using Rust. Building from Source Make sure the Rust toolchain is installed on your compute

A Python compiler targeting JS, implemented in Rust.

A Python compiler targeting JavaScript, implemented in Rust.

Owner
Zack
- Canadian - Programmer
Zack
Very overengineered Brainfuck compiler tools

BFVM - The overengineered brainfuck compiler tool Why? just learning about some codegen stuff Why so pathetic? The whole concept is pathetic. This is

MD Gaziur Rahman Noor 11 Jun 5, 2022
zkSnark circuit compiler

Quickstart ==> Get started here ℹ Important deprecation note The old circom compiler written in Javascript will be frozen, but it can still be downloa

iden3 679 Jan 9, 2023
The Lune Compiler

Lune A small C like programming language with the goal of compiling to C. Progress: Lexing Parsing AST generation Type checking Codegen Syntax # A com

null 2 Dec 1, 2021
Example of a Baremetal program written for the Rasperry Pi 1 (BCM2845). Both the UART and the Framebuffer graphics working

This repository is aimed to provide a starting point to whoever is trying to build a BCM2835 program from scratch. This repository contains linker scr

Pietro 4 Nov 10, 2022
Everything you need to know about cross compiling Rust programs!

rust-cross Everything you need to know about cross compiling Rust programs! If you want to set up your Rust toolchain as a cross compiler, you have co

Jorge Aparicio 2.3k Jan 2, 2023
[OUTDATED] Instructions for how to cross compile Rust projects for the Raspberry Pi

Cross Compiling for Raspberry Pi This guide will show how Rust programs can be cross compiled for the Raspberry Pi using Cargo. These instructions may

Erik Hedvall 297 Jul 22, 2022
Operating System development tutorials in Rust on the Raspberry Pi

Operating System development tutorials in Rust on the Raspberry Pi

Rust Embedded 10k Jan 9, 2023
A LED Christmas Tree controlled by Rust. Contribute your own renderers!

Rusty Christmas Tree This is code that draws on the LED Christmas Tree made by @aidancrowther. You can see his 3D design files and Pi Pico setup code

Forest Anderson 43 May 15, 2022
Raspberry PI library for Rust. GPIO controller, L298N motors, sockets and "i2clib" integrated

raslib Raspberry PI library for Rust. GPIO controller, L298N motors, sockets and "i2clib" integrated All tests are made on Raspberry PI 4B+ on Raspbia

Anтo 5 Apr 12, 2022