{"id":13616959,"url":"https://github.com/sdiehl/kaleidoscope","last_synced_at":"2025-05-15T17:03:53.270Z","repository":{"id":12812440,"uuid":"15487422","full_name":"sdiehl/kaleidoscope","owner":"sdiehl","description":"Haskell LLVM JIT Compiler Tutorial","archived":false,"fork":false,"pushed_at":"2020-04-21T09:09:58.000Z","size":531,"stargazers_count":1038,"open_issues_count":9,"forks_count":129,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-04-07T22:07:36.223Z","etag":null,"topics":["compiler","haskell","kaleidoscope","llvm-bindings","llvm-tutorial","tutorial"],"latest_commit_sha":null,"homepage":"http://www.stephendiehl.com/llvm","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sdiehl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-LLVM","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-28T05:12:52.000Z","updated_at":"2025-03-14T09:30:35.000Z","dependencies_parsed_at":"2022-07-15T14:47:52.038Z","dependency_job_id":null,"html_url":"https://github.com/sdiehl/kaleidoscope","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdiehl%2Fkaleidoscope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdiehl%2Fkaleidoscope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdiehl%2Fkaleidoscope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdiehl%2Fkaleidoscope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdiehl","download_url":"https://codeload.github.com/sdiehl/kaleidoscope/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254384983,"owners_count":22062422,"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","haskell","kaleidoscope","llvm-bindings","llvm-tutorial","tutorial"],"created_at":"2024-08-01T20:01:35.308Z","updated_at":"2025-05-15T17:03:53.254Z","avatar_url":"https://github.com/sdiehl.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://dev.stephendiehl.com/fun/\"\u003e\n    \u003cimg src=\"https://github.com/sdiehl/kaleidoscope/raw/master/img/dragon.png\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cem\u003eA short guide to building a tiny programming language in Haskell with LLVM.\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://twitter.com/smdiehl\"\u003eStephen Diehl\u003c/a\u003e\n\u003c/p\u003e\n\nHaskell LLVM Tutorial\n=====================\n\n[![Build Status](https://travis-ci.org/sdiehl/kaleidoscope.svg)](https://travis-ci.org/sdiehl/kaleidoscope)\n[![MIT License](http://img.shields.io/badge/license-mit-blue.svg)](https://github.com/sdiehl/kaleidoscope/blob/master/LICENSE-MIT)\n\nRead Online:\n\n* [**HTML**](http://www.stephendiehl.com/llvm)\n* [**PDF**](http://www.stephendiehl.com/llvm/tutorial.pdf)\n* [**Source Code**](https://github.com/llvm-hs/llvm-hs-kaleidoscope)\n* [**Condensed Code**](https://github.com/llvm-hs/llvm-hs-kaleidoscope)\n\n\nSetup\n-----\n\nYou will need GHC 7.8 or newer as well as LLVM 4.0. For information on installing LLVM 4.0 (not 3.9 or earlier)\non your platform of choice, take a look at the\n[instructions posted by the llvm-hs maintainers](https://github.com/llvm-hs/llvm-hs/blob/llvm-4/README.md#installing-llvm).\n\nWith Haskell and LLVM in place, you can use either Stack or Cabal to install the necessary Haskell\nbindings and compile the source code from each chapter.\n\n### Building with Stack (Recommended)\n\n```bash\n$ stack build\n```\n\nYou can then run the source code from each chapter (starting with chapter 2) as follows:\n\n```bash\n$ stack exec chapter2\n```\n\n### Building with Cabal\n\nEnsure that ``llvm-config`` is on your ``$PATH``, then run:\n\n```bash\n$ cabal sandbox init\n$ cabal configure\n$ cabal install --only-dependencies\n```\n\nThen to run the source code from each chapter (e.g. chapter 2):\n\n```bash\n$ cabal run chapter2\n```\n\n### Building with make\n\nThe source code for the example compiler of each chapter is included in the ``/src`` folder. With the dependencies\ninstalled globally, these can be built using the Makefile at the root level:\n\n```bash\n$ make chapter2\n$ make chapter6\n```\n\nA smaller version of the code without the parser frontend can be found in the\n[llvm-tutorial-standalone](https://github.com/sdiehl/llvm-tutorial-standalone)\nrepository. The LLVM code generation technique is identical.\n\nEditing\n-------\n\nThis is an open source project, patches and corrections always welcome.\n\nTo generate the HTML page:\n\n```bash\n$ make tutorial.html\n```\n\nA standalone PDF can also be generated with:\n\n```bash\n$ make tutorial.pdf\n```\n\nLicense\n-------\n\nText is adapted from the LLVM tutorial and is subsequently licensed under the\nLLVM license.\n\nThe Haskell source files are released under the MIT license. Copyright (c)\n2013-2016, Stephen Diehl\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdiehl%2Fkaleidoscope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdiehl%2Fkaleidoscope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdiehl%2Fkaleidoscope/lists"}