{"id":21806857,"url":"https://github.com/roguh/core","last_synced_at":"2025-04-13T20:23:00.773Z","repository":{"id":26241595,"uuid":"29688527","full_name":"roguh/CORE","owner":"roguh","description":"Implementation of SPJ's Tutorial Core compilers in modern Haskell (unfinished)","archived":false,"fork":false,"pushed_at":"2021-09-08T05:41:19.000Z","size":1424,"stargazers_count":5,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T10:51:17.280Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roguh.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}},"created_at":"2015-01-22T16:37:48.000Z","updated_at":"2021-10-03T15:56:04.000Z","dependencies_parsed_at":"2022-09-09T02:11:19.411Z","dependency_job_id":null,"html_url":"https://github.com/roguh/CORE","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/roguh%2FCORE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roguh%2FCORE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roguh%2FCORE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roguh%2FCORE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roguh","download_url":"https://codeload.github.com/roguh/CORE/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248776217,"owners_count":21159745,"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-27T12:30:59.519Z","updated_at":"2025-04-13T20:23:00.733Z","avatar_url":"https://github.com/roguh.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CORE\nSPJ's Tutorial Core compilers written using circa 2015 Haskell\nprogramming practices. Big changes include Monadic error handling and parsing\nusing Parsec.\n\nThe template instantiation machine was partially implemented and the GMachine is\nentirely implemented (up to Mk6).\n\nSimply run Main.hs. You can change the compiler used in this simple REPL,\nthough it doesn't have multiline editing or a nice file-loading interface (yet).\n```\nrunhaskell Main.hs\ncore \u003e\u003e\u003e main = fac 20 ; fac n = if (n \u003c= 0) 1 (n * (fac (n - 1)))\n2432902008176640000\n\ncore \u003e\u003e\u003e .compiler gmachinemk1\nchanging compiler to gmachinemk1\n\ncore \u003e\u003e\u003e main = 4 * 10\nundeclared global: *\n\ncore \u003e\u003e\u003e .compiler gmachinemk4\nchanging compiler to gmachinemk4\n\ncore \u003e\u003e\u003e main = 4 * 10\nNNum 40\n```\n\nCan also run through GHCi\n```haskell\nghci Main.hs\n\u003e\u003e\u003e runCore gmachineMk5\n\"NNum 2432902008176640000\"\n\n\u003e\u003e\u003e runCore gmachineMk6 \"main = fac 20 ; fac n = if (n \u003c= 0) 1 (n * (fac (n - 1)))\"\n\"2432902008176640000 \"\n```\n\n\u003c!--\nUPDATE: Didn't happen. Things have been going well though.\n\nI'll be working through the 3 other compilers in the tutorial. I want to learn\nhow Haskell works, and this tutorial seems like a good rock-bottom starting\npoint. I'll be done once I implement a [STG machine](http://research.microsoft.com/apps/pubs/default.aspx?id=67083), a more updated version of which is used in the current Haskell compilation process.\n--\u003e\n\n\n\nAlso, I mainly used NixOS for this (Cabal file broken, atm). Sandboxed installation is easy with\n```\nnix-shell shell.nix\n```\n\nReferencing [Implementing functional languages: a tutorial](http://research.microsoft.com/en-us/um/people/simonpj/Papers/pj-lester-book/i).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froguh%2Fcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froguh%2Fcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froguh%2Fcore/lists"}