Questions tagged [compiler]
Tasks involving writing compilers for various languages or formalisms.
19 questions
1
vote
1
answer
156
views
Tips for making a compiler that generates a golfed program
I would like to create a language that is specifically designed for compiling/translating to another Turing tarpit language. I want to make the program of the target language to be as short as ...
7
votes
3
answers
925
views
Golf an HQ9+ transpiler
There was a prior question about golfing an HQ9+ compiler that translates HQ9+ code into the language it is written in, but that was closed as a duplicate of the interpreter challenge because ...
10
votes
4
answers
2k
views
Build an optimizing Brainfuck compiler/interpreter
the goal
Build an optimizing Brainfuck implementation. Whether it is a compiler, an interpreter, a JIT compiler, or whatever else is up to you.
scoring
A reference implementation (...
8
votes
5
answers
556
views
Inject arbitrary code into a compiler (robbers)
This is the robbers' challenge. To post a cop, go here.
In this challenge, cops will invent a (likely simple) programming language, and write an interpreter, transpiler, or compiler that allows you to ...
15
votes
9
answers
1k
views
Inject arbitrary code into a compiler (cops)
This is the cops' challenge. To post a robber, go here.
In this challenge, cops will invent a (likely simple) programming language, and write an interpreter, transpiler, or compiler that allows you to ...
13
votes
2
answers
537
views
Translate an arithmetic expression to Brainfuck
Write a program that translates an arithmetic expression to a Brainfuck program which evaluates the expression and prints the result in decimal numbers. For example, this arithmetic expression,
...
10
votes
1
answer
365
views
CDGLF: TMN to APL
In this challenge you will remove one of my least favorite features, operator precedence from traditional math notation, to acheive the syntax of one of my favorite languages, APL. The APL subset we ...
22
votes
12
answers
2k
views
Roman Numeral-like Code Generator
Background
Roman numeral is a simple number system with the following properties:
Each symbol in the system maps to a specific value. (e.g. ...
12
votes
1
answer
436
views
Self-displaying image [closed]
Background
There are self-extracting .ZIP files. Typically they have the extension .EXE (and by executing the file they will be ...
6
votes
1
answer
229
views
Compile Quarterstaff to BF
Quarterstaff repo here with additional quarterbf interpreter: rather bereft of documentation, however, but it does contain the two interpreters
you can go to https://tio.run/#quarterstaff to run ...
26
votes
5
answers
2k
views
Same code different characters
Note: This challenge only allows answers in compiled languages
Task
Your task is pretty simple, make two different programs that when compiled result in the same output.
Scoring
Here is where the ...
6
votes
1
answer
325
views
Shortest example of code that is compiled and increasing the optimization level makes it take longer
Just curious if someone can provide a short example of code that causes a compiler's optimizer to behave incorrectly:
without optimization (or at lower optimization), code takes X seconds to run
with ...
3
votes
0
answers
276
views
λ-calculus to js arrow notation transpiler [closed]
Not an interpreter. Arguably a compiler. But I'm talking about a transpiler.
It can be in any language, but it must return js-valid arrow notation code.
The λ-calculus string would be passed as an ...
8
votes
5
answers
1k
views
Golf me an HQ9+ Compiler [duplicate]
Your task is "simple" should you choose to accept it.
Write an HQ9+ compiler in a language of your choice.
HQ9+ has four commands (as you may be able to tell) H prints "Hello, World!" Q prints out ...
9
votes
1
answer
215
views
Quiz Program Compiler
A fun programming exercise is to write a program that quizzes the user from a set list of questions and answers. However, this task goes a level beyond that.
Your task
Write a program/func/etc. that ...
16
votes
10
answers
2k
views
Brainf**k to Unary and Back
A language that is very useful in restricted source and other such challenges is Unary, a brainfuck derivative in which programs are written in with only one character. Your job is to write a program ...
17
votes
13
answers
2k
views
Create a FizzBuzz compiler
Welcome to the world of compiler golf. Your task is to write a program that generates another program to play a variant of FizzBuzz on spec.
Your compiler
Write a compiler that generates variants of ...
13
votes
3
answers
2k
views
Write a brainfuck compiler
Write a program that takes a brainfuck program and compiles it to executable machine code. You can target x86, x86_64, jvm (java bytecode) or armv6, and use one of the following executable formats: ...
38
votes
7
answers
4k
views
Self-compiling compiler [closed]
This is based on a talk on compilers I listened to a while back, but I, unfortunately, can't remember when or where.
Create the shortest compiler in any language that can compile itself. Target any ...