{"id":20132515,"url":"https://github.com/aherrmann/simply_llvm","last_synced_at":"2025-04-09T16:53:33.934Z","repository":{"id":71967726,"uuid":"74694393","full_name":"aherrmann/simply_llvm","owner":"aherrmann","description":null,"archived":false,"fork":false,"pushed_at":"2017-07-02T16:05:49.000Z","size":103,"stargazers_count":41,"open_issues_count":0,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-23T19:04:15.260Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aherrmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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},"funding":{"open_collective":"bazel-rules-authors-sig"}},"created_at":"2016-11-24T17:47:53.000Z","updated_at":"2023-09-15T07:53:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce116d64-8a66-4146-8f53-91a762699c32","html_url":"https://github.com/aherrmann/simply_llvm","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/aherrmann%2Fsimply_llvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aherrmann%2Fsimply_llvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aherrmann%2Fsimply_llvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aherrmann%2Fsimply_llvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aherrmann","download_url":"https://codeload.github.com/aherrmann/simply_llvm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248073718,"owners_count":21043474,"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":[],"created_at":"2024-11-13T20:53:52.658Z","updated_at":"2025-04-09T16:53:33.920Z","avatar_url":"https://github.com/aherrmann.png","language":"Haskell","funding_links":["https://opencollective.com/bazel-rules-authors-sig"],"categories":[],"sub_categories":[],"readme":"# Simply LLVM\n\nCompiling a simple functional language with LLVM and Haskell\n\nExample code to the presentation given at the HaskellerZ Zurich Haskell meetup.\nPorted to use the [`llvm-hs`](https://github.com/llvm-hs/llvm-hs)\nLLVM Haskell bindings.\n\n\n## Setup\n\nIf you have the Nix package manager installed on your machine,\nthen you just need to execute the following command in the top-level\ndirectory of this repository:\n\n``` sh\n$ nix-shell\n```\n\n\n## Usage\n\nOnce the environment is set up you can enter an interactive GHCi session with either:\n\n``` sh\n$ cabal repl\n$ stack repl\n```\n\nand start exploring the code:\n\n``` hs\nλ\u003e ex01a_factorial \u0026 Surface.prettyPrint\nλ\u003e ex01a_factorial \u0026 Simply.typeCheck' \u0026 fmap Intermediate.fromSurface \u003e\u003e= prettyPrint\nλ\u003e ex01a_factorial \u0026 Simply.typeCheck' \u0026 fmap Intermediate.fromSurface \u0026 fmap LLVM.fromIntermediate \u003e\u003e= printLLVM\nλ\u003e ex01a_factorial \u0026 Simply.typeCheck' \u0026 fmap Intermediate.fromSurface \u0026 fmap LLVM.fromIntermediate \u003e\u003e= printLLVMOpt optInline\nλ\u003e ex01a_factorial \u0026 Simply.typeCheck' \u0026 fmap Intermediate.fromSurface \u0026 fmap LLVM.fromIntermediate \u003e\u003e= printAssemblyOpt optInline\nλ\u003e ex01b_factorial \u0026 Simply.typeCheck' \u0026 fmap Intermediate.fromSurface \u0026 fmap LLVM.fromIntermediate \u003e\u003e= exec [5]\n```\n\nThe examples can be loaded by in the interactive session with:\n\n``` sh\nλ\u003e :load Example.hs\nλ\u003e ex5\n```\n\nExample programs in the language *Simply* are provided in [`simply_examples`](simply_examples).\nYou can compile and run them as follows:\n\n``` sh\n$ cabal run simply simply_examples/factorial.simply factorial\n$ ./factorial\n$ ./factorial 5\n```\n\nYou should have a look at the [slides](slides/slides.md)\nto get an overview over the code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faherrmann%2Fsimply_llvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faherrmann%2Fsimply_llvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faherrmann%2Fsimply_llvm/lists"}