Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrjameshamilton/bf-jep457
A Brainf*ck JVM compiler using the JEP 457 Class-File API
https://github.com/mrjameshamilton/bf-jep457
brainfuck brainfuck-compiler compiler jep457
Last synced: about 2 months ago
JSON representation
A Brainf*ck JVM compiler using the JEP 457 Class-File API
- Host: GitHub
- URL: https://github.com/mrjameshamilton/bf-jep457
- Owner: mrjameshamilton
- Created: 2024-01-20T14:27:00.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-03-20T19:24:20.000Z (9 months ago)
- Last Synced: 2024-03-20T20:40:56.212Z (9 months ago)
- Topics: brainfuck, brainfuck-compiler, compiler, jep457
- Language: Java
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Brainf*ck JVM Compiler
A compiler that compiles Brainf*ck input to Java bytecode that can be executed on a
JVM, using the JEP457 Class-File API.The compiler is simple and does no optimizations. For an optimizing compiler [see here](https://github.com/mrjameshamilton/bf).
# Building
You'll need JDK 22. The easiest way to install this, on Linux, is with [SDK man](https://sdkman.io/):
```shell
sdk install java 22-open
```You can then compile the `Main` class with `--release 22` and `--enable-preview` flags:
```shell
$ javac --release 22 --enable-preview src/BfCompiler.java -d build
```# Run
Compile a Brainf*ck program by passing the input file path and the output jar path
to the compiler.You can execute the compiled class, or simply run `BfCompiler.java`
directly from source with the `--source 22` parameter:```shell
$ java --enable-preview --source 22 src/BfCompiler.java examples/hellojvm.bf build/out.jar
```The compiled jar can then be executed:
```shell
$ java -jar build/out.jar
```