Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [compiler]

Tasks involving writing compilers for various languages or formalisms.

6
votes
0answers
139 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
5answers
1k 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 ...
7
votes
1answer
260 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 ...
4
votes
0answers
194 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 ...
7
votes
5answers
640 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 ...
7
votes
1answer
146 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 ...
14
votes
7answers
1k 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
13answers
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 ...
12
votes
3answers
1k 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: ...
33
votes
7answers
3k views

Self-compiling compiler

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 ...