write-you-a-haskell/README.md

118 lines
3.8 KiB
Markdown
Raw Normal View History

2015-01-05 10:54:15 +03:00
<p align="center">
<a href="http://dev.stephendiehl.com/fun/">
2015-01-07 16:40:38 +03:00
<img src="https://github.com/sdiehl/write-you-a-haskell/raw/master/img/Haskell-Logo.png"/>
2015-01-05 10:54:15 +03:00
</a>
</p>
<p align="center">
<a href="http://dev.stephendiehl.com/fun/">
2015-01-07 16:40:38 +03:00
<img src="https://github.com/sdiehl/write-you-a-haskell/raw/master/img/cover.png"/>
2015-01-05 10:54:15 +03:00
</a>
<br/>
<em>Building a modern functional compiler from first principles.</em>
</p>
<p align="center">
<a href="https://twitter.com/smdiehl">Stephen Diehl</a>
</p>
2015-01-08 05:57:37 +03:00
[![Build Status](https://travis-ci.org/sdiehl/write-you-a-haskell.svg)](https://travis-ci.org/sdiehl/write-you-a-haskell)
2015-01-13 21:00:52 +03:00
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sdiehl/write-you-a-haskell?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge)
Squashed commit of the following: commit 41ba8c36a90cc11723b14ce6c45599eabdcfaa53 Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Sun Jan 18 21:02:57 2015 -0500 type provenance commit be5eda941bb4c44b4c4af0ddbbd793643938f4ff Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Sun Jan 18 20:13:06 2015 -0500 provenance prototype commit 7aa958b9c279e7571f7c4887f6aa19443e16f6fb Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Sun Jan 18 19:35:08 2015 -0500 fix misc typos commit 52d60b3b2630e50ef0cd6ea5f0fa1f308d92e26d Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Sun Jan 18 15:15:58 2015 -0500 license badge commit 7d34274afe6f05a0002c8f87e5077b6a130b42b4 Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Sun Jan 18 15:07:28 2015 -0500 fix resolution for llvm cfg graphs commit 14d9bc836ecc64f8e9acc60bcbd2da02335255b9 Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Sun Jan 18 13:12:39 2015 -0500 added codegen dsl stub commit 0f74cdd6f95d0a1fe1cafd73e45cb1407709efd8 Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Sun Jan 18 13:01:14 2015 -0500 llvm cfg graphs commit a199d721503985954060e7670c1d2f5e1a65dd11 Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Sun Jan 18 10:56:54 2015 -0500 source code font commit c7db0c5d67b73d8633f08be093971877e2d6ede0 Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Sun Jan 18 09:59:37 2015 -0500 change phrasing around recursion commit 6903700db482524233262e722df54b1066218250 Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Sat Jan 17 18:20:06 2015 -0500 contributors.md commit 14d90a3f2ebf7ddf1229c084fe4a1e9fa13f2e41 Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Sat Jan 17 17:35:41 2015 -0500 added llvm logo commit d270df6d94cbf1ef9eddfdd64af5aabc36ebca72 Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Sat Jan 17 15:50:28 2015 -0500 initial llvm chapter commit e71b189c057ea9e399e90e47d9d49bb4cf12cda8 Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Sat Jan 17 12:21:00 2015 -0500 system-f typing rules commit 2a7d5c7f137cf352eeae64836df634c98118f594 Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Thu Jan 15 15:21:14 2015 -0500 flesh out system-f commit 7b3b2f0a2aea5e1102abe093cf5e0559090720aa Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Wed Jan 14 22:22:14 2015 -0500 started on extended parser commit cdeaf1a2658f15346fe1dc665ca09e954cce6c2e Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Wed Jan 14 17:25:02 2015 -0500 creative commons license commit f09d210be253a05fc8ad0827cd72ffa32404e2ba Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Wed Jan 14 16:54:10 2015 -0500 higher res images commit 8555eadfea8843f5683621e6652857e4259fa896 Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Wed Jan 14 14:48:44 2015 -0500 cover page commit e5e542e92610f4bb4c5ac726ffa86cd1e07753e3 Author: Stephen Diehl <stephen.m.diehl@gmail.com> Date: Tue Jan 13 17:31:01 2015 -0500 initial happy/alex parser
2015-01-19 05:04:01 +03:00
[![MIT License](http://img.shields.io/badge/license-mit-blue.svg)](https://github.com/sdiehl/write-you-a-haskell/blob/master/LICENSE)
2015-01-08 05:57:37 +03:00
2015-01-09 08:23:46 +03:00
Read Online:
2015-01-09 08:24:12 +03:00
* [**HTML**](http://dev.stephendiehl.com/fun/)
* [**PDF**](http://dev.stephendiehl.com/fun/WYAH.pdf)
2015-01-09 08:23:46 +03:00
2015-01-05 10:54:15 +03:00
Releases
--------
2015-12-31 09:29:11 +03:00
This is a work in progress.
2015-01-09 07:53:20 +03:00
* [Chapter 1: Introduction](http://dev.stephendiehl.com/fun/000_introduction.html)
* [Chapter 2: Haskell Basics](http://dev.stephendiehl.com/fun/001_basics.html)
* [Chapter 3: Parsing](http://dev.stephendiehl.com/fun/002_parsers.html)
* [Chapter 4: Lambda Calculus](http://dev.stephendiehl.com/fun/003_lambda_calculus.html)
* [Chapter 5: Type Systems](http://dev.stephendiehl.com/fun/004_type_systems.html)
* [Chapter 6: Evaluation](http://dev.stephendiehl.com/fun/005_evaluation.html)
* [Chapter 7: Hindley-Milner Inference](http://dev.stephendiehl.com/fun/006_hindley_milner.html)
* [Chapter 8: Design of ProtoHaskell](http://dev.stephendiehl.com/fun/007_path.html)
2015-01-19 19:04:03 +03:00
* [Chapter 9: Extended Parser](http://dev.stephendiehl.com/fun/008_extended_parser.html)
2015-12-12 21:42:06 +03:00
* [Chapter 10: Custom Datatypes](http://dev.stephendiehl.com/fun/009_datatypes.html)
2015-12-31 09:29:11 +03:00
* [Chapter 11: Renamer] (http://dev.stephendiehl.com/fun/010_renamer.html)
2015-01-05 10:54:15 +03:00
* Chapter 12: Pattern Matching & Desugaring
* Chapter 13: System-F
* Chapter 14: Type Classes
* Chapter 15: Core Language
* Chapter 16: Kinds
* Chapter 17: Haskell Type Checker
* Chapter 18: Core Interpreter
* Chapter 19: Prelude
* Chapter 20: Design of Lazy Evaluation
* Chapter 21: STG
* Chapter 22: Compilation
* Chapter 23: Design of the Runtime
* Chapter 24: Imp
* Chapter 25: Code Generation ( C )
* Chapter 26: Code Generation ( LLVM )
* Chapter 27: Row Polymorphism & Effect Typing
* Chapter 28: Future Work
2015-11-21 17:52:39 +03:00
Building
--------
To generate the build scripts provision a cabal sandbox with pandoc in it. This
2015-12-14 06:16:16 +03:00
is done by the ``write-you-a-haskell.cabal`` and ``stack.yaml`` files.
2015-11-21 17:55:41 +03:00
2015-11-27 03:16:46 +03:00
**Stack**
```bash
2015-12-14 06:16:16 +03:00
$ stack exec make
2015-11-27 03:16:46 +03:00
```
2016-01-19 19:09:55 +03:00
To generate the pdf, the LaTeX packages must be installed on the
2015-11-21 17:55:41 +03:00
system.
```bash
$ sudo apt-get install texlive-xetex texlive-latex-extra
2015-12-11 19:24:55 +03:00
$ sudo apt-get install xzdec
$ sudo tlmgr install zapfding
2015-12-11 23:20:06 +03:00
$ stack exec make pdf
2015-11-21 17:52:39 +03:00
```
2016-01-19 19:09:55 +03:00
Generation of the epub is also supported.
```bash
$ stack exec make epub
```
2015-12-14 06:16:16 +03:00
**Cabal**
```bash
$ cabal sandbox init
$ cabal install --only-dependencies
$ cabal exec bash
$ make
```
2015-01-05 10:54:15 +03:00
Contributing
------------
Any and all contributions are always welcome. As always, I rely on the
perpetual kindness and goodwill of Haskellers (like you!) to help correct
grammar, clarify, and fix errors.
* [Contributing](http://dev.stephendiehl.com/fun/contributing.html)
License
-------
2015-01-06 20:16:33 +03:00
This written work is licensed under a <a rel="license"
href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons
Attribution-NonCommercial-ShareAlike 4.0 International License</a>. You may
reproduce and edit this work with attribution for all non-commercial purposes.
The included source is released under the terms of the [MIT License](http://opensource.org/licenses/MIT).