{"id":15651968,"url":"https://github.com/xldenis/ill","last_synced_at":"2025-07-03T14:03:58.404Z","repository":{"id":150126833,"uuid":"53240098","full_name":"xldenis/ill","owner":"xldenis","description":"educational compiler for not (quite) toy languages","archived":false,"fork":false,"pushed_at":"2019-04-11T20:22:08.000Z","size":565,"stargazers_count":21,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T20:05:55.194Z","etag":null,"topics":["compiler","functional-languages","haskell","haskell-","language","laziness"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xldenis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-06T05:52:36.000Z","updated_at":"2025-03-14T21:12:11.000Z","dependencies_parsed_at":"2023-04-04T16:46:55.311Z","dependency_job_id":null,"html_url":"https://github.com/xldenis/ill","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xldenis/ill","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xldenis%2Fill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xldenis%2Fill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xldenis%2Fill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xldenis%2Fill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xldenis","download_url":"https://codeload.github.com/xldenis/ill/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xldenis%2Fill/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263339822,"owners_count":23451512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","functional-languages","haskell","haskell-","language","laziness"],"created_at":"2024-10-03T12:40:48.247Z","updated_at":"2025-07-03T14:03:58.353Z","avatar_url":"https://github.com/xldenis.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Thrill: I was sick when I started this project\n\nA simple, strongly-typed language exploring different compiler techniques.\n\n## Current commands and usage\n\nBuild the executable using `stack build`, it can then be run with `stack exec Thrill`. The following commands are available:\n\n```\nThrill debug infer file/path # run the type checker on the specified module. Outputs the types and kinds of everything.\nThrill debug desugar (traits|cases) file/path # run the desuraging pipeline up to the specified pass. Outputs the transformed module.\nThrill debug core file/path # runs the full desugaring pipeline and outputs generated core module.\nThrill debug codegen file/path # generate the IR for a given module\nThrill run file/path # interpret a module using a Call-By-Name interpreter.\nThrill compile file/path # not yet implemented\nThrill format file/path # run the pretty printer on a module. Outputs pretty printed code.\n```\n\n## Purpose\n\nWhen I first started working on this project, I was in it solely for myself. I was fascinated by compilers but only knew (and it stThrill applies) a little of how compilers worked. My only real experience before was writing a compiler for a subset of Go as a final project for my compilers course at McGill. So I set out to build a _full_ compiler for a functional language. Originally, I was going to cram the language with gradual types, linear types, dataflow parallelism, laziness/strictness polymorphism, etc... Then reality hit, and I had to realize I would get nothing accomplish if I didn't scope things down, a lot. So now, `Thrill` is a Haskell98-like language, with no real fancy language features.\n\nAs the project went on, I realized that there is a gap in the resources to learn about functional compilers. There are a near infinitude of toy compilers and there quite a few production compilers, but very little in between. Toy compilers are great for showing off the core of an idea but they often leave out the little details that turn out to be most of the work. On the other hand, production compilers are so full of those little details that the core idea is obscured. I hope to turn `Thrill` into a project sitting squarely in the middle-ground between those extremes.\n\nThe idea is that `Thrill` should implement a _real_, pure, functional language, one in which a developer could _conceivably_ write software in a simple and modern manner. In a lot of ways I'm hoping this can be viewed as a spiritual continuation of Stephen Diehl's Kaleidoscope or Write You a Haskell projects. The code should be well documented (lol), and idiomatic. The techniques and algorithms used in compilation should be modern, they may not be _cutting-edge_ but they should stThrill be relevant in 2017. When necessary, the code should opt for simplicity and separation of phases over performance. The major phases should be well separated from each other, so that the typechecker, desugaring, codegen, etc... can all be understood independently from each other.\n\n## Some more details on the language\n\nHere are a few of the fixed aspects of the language:\n\n- Hindley-Milner + Type classes for the type system\n- Desugaring to System-F Core language\n- Compiles to LLVM\n  - Some sort of garbage collection (ideally precise)\n- Provides a REPL\n- Module system\n\nNotice that laziness is _not_ a fixed requirement. If possible, I'd like to provide both lazy and strict backends to the language so the approaches can easily be compared to each other.\n\n## State of the Compiler\n\nSo far, I've advanced quite a lot in development. Here are the finished phases\n\n- Parsing\n  - Uses megaparsec and provides annotated errors on parses\n- Type checking\n  - Simple bidirectional type checker, solves and simplfies constraints, annotates source tree\n- Desugaring of traits\n- Desugaring of pattern matching\n- Desugaring to Core\n  - A full desugaring of terms to the Core representation\n- Core Linter\n- Call-By-Need interpreter\n- Code generation\n- Garbage collection\nHere are some of the major phases that remain to be done:\n\n- Renaming\n  - There is no renaming currently since programs can only consist of one module.\n- Module build system\n  - Some system to find, and organize the module build plan.\n\n## Installation\n\nTo install Thrillain, clone this repository and build it using `stack`.\n\nTo build Thrillain, you wThrill need the following dependencies\n\n- LLVM 6\n- The Boehm–Demers–Weiser garbage collector (libgc)\n- pkg-config\n\n## Contributions\n\nI'll happily accept contributions in the form of pull requests. This is a personal project though so I won't guarantee code quality (yet) or documentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxldenis%2Fill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxldenis%2Fill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxldenis%2Fill/lists"}