• Stars
    star
    314
  • Rank 133,353 (Top 3 %)
  • Language
    Haskell
  • Created about 8 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A quine generator

Quine Central

This is a Haskell program that generates a Haskell program that prints out a Perl program that prints out a Python program that prints out a Ruby program that prints out a C program that prints out a Java program that prints out a Rust program that prints out an OCaml program that prints out a Swift program that prints out a Racket program that prints out a Javascript program that prints out the first Haskell program generated.

However, you can configure it yourself to use any sequence of languages from the ones it knows. Any non-empty list of languages will do, including length one. You may start hitting language line length limits if you make your list too long. Note that you can repeat languages so you can give someone some Haskell which decays into Perl after n iterations. You can also generate ordinary single-language quines.

I've only tested it under MacOS X. I don't know if there are carriage return/linefeed issues with other OSes.

Change the list of languages in lang if you want a different sequence of languages.

Some more detailed instructions

If you're running under Linux or OSX and have interpreters for all of the relevant languages installed then you can use bash test.sh on the command line. Chances are you don't have them all installed.

To start you can install the Haskell compiler GHC. There are many websites that discuss this. Once you have that installed you should have a command runghc in your path. Then you can type runghc quineCentral.hs on the command line. The output will be the quine itself. Save that output to a file, maybe with the name quine.hs. Now you can run that with runghc quine.hs. The output will be a ruby program. Save it as quine.rb. Install ruby. Now you can run ruby quine.rb. And now just keep going. But it's easier to install compilers for all of the languages and run test.sh.

If you're having trouble installing all of the compilers and interpreters, modify lines 3 onwards in quineCentral.hs so the list only includes languages you do have installed. You can tweak test.sh to match.

More Repositories

1

Moodler

Modular softsynth
Haskell
62
star
2

Monad-Python

A toy Python interpreter with monad comprehensions
Python
54
star
3

provability

Some tools for provability logic
Haskell
31
star
4

mini_fm

Minimal fm receiver for use with rtlsdr
C++
28
star
5

Operators

Some operator abuse
TeX
28
star
6

SASL

A simple and educational compiler for the SASL programming language
C
22
star
7

formal-weyl

The algebra for formal power series in elements of the Weyl algebra
Haskell
18
star
8

Stellarator

An Atari VCS 2600 emulator written in Haskell
Haskell
17
star
9

pile

Abelian sandpiles
Swift
15
star
10

Legendre

Some notes on the relationship between the Legendre and Fourier transforms
TeX
8
star
11

caustics

Python
8
star
12

infinite-quine

An infinitely long quine
Haskell
8
star
13

Wattage

A small library for working with formal power series
Haskell
8
star
14

pifm

Minimal FM transmitter for raspberry pi
C
7
star
15

monads

A document about monads
Haskell
7
star
16

nano

Some tools to compute energy levels for atomic structures drawn with ACII art
Python
7
star
17

Egyptian

Some materials for studying Ancient Egyptian
Python
7
star
18

grafting3

TeX
6
star
19

forms

A short text on differential forms
6
star
20

photon

Something on photons
TeX
6
star
21

nn-fold

An experiment in combining folds and neural nets
Haskell
6
star
22

FunctionGenerator

Minimal audio synthesis on iOS
Swift
5
star
23

SpellCaster

A trading card game
C
5
star
24

quora_physics

Generate physics questions for Quora
HTML
4
star
25

fib

Proving a large class of identities involving Fibonacci and Lucas numbers
Haskell
4
star
26

math-vim

Some useful key bindings for mathematics
Vim Script
3
star
27

dpiponi.github.io

Can I blog on github?
HTML
3
star
28

LeanScratch

Messing with Lean
Lean
3
star
29

TextTree

3
star
30

lcfield

Implementation of Levi-Civita field
Haskell
3
star
31

em

A document that helps motivate one of the steps in deriving Expectation-Maximisation
3
star
32

Rings

C++
2
star
33

euler

Testing out target counting algorithms using Euler numbers
Haskell
2
star
34

Sport

How likely is it that team A beat team B?
Jupyter Notebook
2
star
35

hott-reloaded

My scratchpad while working through Homotopy Type Theory
2
star
36

ActiveRecall

iOS Flash Card App
Swift
2
star
37

pyvolcafm

This will eventually become a small library for working with Volca FM/DX7 patches.
Python
2
star
38

Grogulator

A simple Garmin watch face for the Forerunner 55
Monkey C
1
star
39

Scrapbook

Scrapbook. With scraps.
Mathematica
1
star
40

Agda-Snippets

Proofs I write while teaching myself Agda
1
star
41

LitterBox

A wee Haskell app to provide a local sandbox a bit like ShaderToy
GLSL
1
star
42

Epicycle

Private for the moment
Haskell
1
star
43

emu6502

6502 Emulation experiments
Haskell
1
star
44

vim-bits

Bits and pieces from my .vimrc
Vim Script
1
star
45

SketchBox

Haskell
1
star
46

Combinatorial

Combinatorial library derived from http://blog.sigfpe.com/2007/11/small-combinatorial-library.html
Haskell
1
star