Ethan Reece 51d2a951e6 | ||
---|---|---|
app | ||
example | ||
.gitignore | ||
CHANGELOG.md | ||
README.md | ||
package.yaml | ||
really-bad-compiler-in-haskell.cabal | ||
stack.yaml | ||
stack.yaml.lock |
README.md
Really Bad Compiler in Haskell
A compiler written in Haskell that is really bad (I do not know what language I am going to compile yet). Built for the Introduction to Compiler Design class at The University of Texas at Dallas.
Main repo: https://git.sudoer.ch/me/really-bad-compiler-in-haskell
Build Instructions
- Install
ghcup
(for managing Haskell tools) andnix
(for managing external dependencies). - Clone the repo.
- Use
ghcup
to installstack 2.9.3
,HLS 2.2.0.0
, andcabal 3.6.2.0
(recommended versions of the time of writing). - Use
stack run <file>
to run the program (for example,stack run example/1
).
File structure
app
- contains the compiler programexample
- contains example programs that can be compiled
Credits
Learning Resources Used
- Introduction to Compiler Design class at The University of Texas at Dallas, taught by Charles Averill
- learnyouahaskell.com (for learning Haskell basics)
- https://akashagrawal.me/2017/01/19/beginners-guide-to-megaparsec.html
- https://markkarpov.com/tutorial/megaparsec.html (for help writing a Haskell equation parser)
- https://www.forth.com/starting-forth/1-forth-stacks-dictionary/ (for learning Forth)
- https://blog.josephmorag.com/posts/mcc0/ (Haskell LLVM tutorial)
Tools
- Language: Haskell
- Haskell tools: GHCup, Stack, Cabal
- Libraries: megaparsec, parser-combinators, text, llvm-hs-pure, llvm-hs-pretty
- Dependencies: llvm, clang
- IDE: VSCodium
- Git platform: Forgejo
- AI: Phind
- Search: Kagi, Stack Overflow