Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
brainfucker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Taddeüs Kroes
brainfucker
Commits
25bcd246
Commit
25bcd246
authored
10 years ago
by
Taddeüs Kroes
Browse files
Options
Downloads
Patches
Plain Diff
Added README
parent
2eafc343
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+37
-0
37 additions, 0 deletions
README.md
with
37 additions
and
0 deletions
README.md
0 → 100644
+
37
−
0
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
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment