Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
brainfucker
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
brainfucker
Commits
25bcd246
Commit
25bcd246
authored
Jan 08, 2015
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added README
parent
2eafc343
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
README.md
README.md
+37
-0
No files found.
README.md
0 → 100644
View file @
25bcd246
About
=====
This is a minimal compiler for the
[
Brainfuck
](
https://en.wikipedia.org/wiki/Brainfuck
)
language, written for the
purpose of practicing Ocaml LLVM bindings and seeing how well LLVM optimizes
arrays. Brainfuck commands are transformed to LLVM IR, which is generated in
such a way that it is easy to optimize for LLVM's
`opt`
utility.
Building and usage
==================
Building the
`bf`
compiler (Debian dependencies):
$ sudo apt-get install ocaml llvm-3.4 libllvm-3.4-ocaml-dev
$ make
Building a brainfuck program (plain and optimized):
$ make hello hello-opt # compile file "hello.b" to binaries
$ ./hello
Hello World!
$ ./hello-opt
Hello World!
Quick compilation and running (deletes temporary binary after running):
$ echo ++++++++++++. | ./run.sh
$ ./run.sh < hello.b
Hello World!
Examining generated LLVM:
$ echo ++++++++++++. | ./bf
...
$ echo ++++++++++++. | ./bf | opt -O3 -S
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment