{"id":13632230,"url":"https://github.com/IUCompilerCourse/public-student-support-code","last_synced_at":"2025-04-18T02:32:11.428Z","repository":{"id":43276859,"uuid":"145449207","full_name":"IUCompilerCourse/public-student-support-code","owner":"IUCompilerCourse","description":"Public helper code for p423/p523 students (Racket)","archived":false,"fork":false,"pushed_at":"2024-12-09T00:39:27.000Z","size":311,"stargazers_count":156,"open_issues_count":19,"forks_count":78,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-12-09T01:25:51.947Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Racket","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IUCompilerCourse.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":"2018-08-20T17:26:01.000Z","updated_at":"2024-12-09T00:39:32.000Z","dependencies_parsed_at":"2023-02-09T02:00:38.477Z","dependency_job_id":"8bb6852b-1c53-4b86-9512-3b99f995369a","html_url":"https://github.com/IUCompilerCourse/public-student-support-code","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/IUCompilerCourse%2Fpublic-student-support-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IUCompilerCourse%2Fpublic-student-support-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IUCompilerCourse%2Fpublic-student-support-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IUCompilerCourse%2Fpublic-student-support-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IUCompilerCourse","download_url":"https://codeload.github.com/IUCompilerCourse/public-student-support-code/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249414252,"owners_count":21267724,"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-08-01T22:02:56.918Z","updated_at":"2025-04-18T02:32:10.980Z","avatar_url":"https://github.com/IUCompilerCourse.png","language":"Racket","readme":"## Homework instructions\n\nFor your homework exercises, you will be expected to implement various\ncompiler passes. It will ultimately be up to you how exactly to do\nthis, but for the first assignment you are given code templates in\n`compiler.rkt` to fill out.\n\nTo start out, you must \"clone\" this repository:\n\n```\n   git clone https://github.com/IUCompilerCourse/public-student-support-code.git course-compiler\n```\n\nThis creates a new folder `course-compiler`, which you can enter with:\n\n```\n   cd course-compiler\n```\n\nBefore each assignment (and when told to by the instructor), you may need to update\nthis code by pulling updates from GitHub by running this command from inside the folder:\n\n```\n   git pull\n```\n\nAs you fill out the functions in `compiler.rkt`, tests are run with the\n`run-tests.rkt` module. You can run these tests either from the command\nline with:\n\n```\n   racket run-tests.rkt\n```\n\nOr by opening and running `run-tests.rkt` in DrRacket.\n\nBefore running the compiler tests, you need to compile\n`runtime.c` (see below).\n\n## Public student code\n\nUtility code, test suites, etc. for the compiler course.\n\nThis code will be described in the Appendix of the book.\n\nThe `runtime.c` file needs to be compiled and linked with the assembly\ncode that your compiler produces. To compile `runtime.c`, do the\nfollowing\n```\n   gcc -c -g -std=c99 runtime.c\n```\nThis will produce a file named `runtime.o`. The -g flag is to tell the\ncompiler to produce debug information that you may need to use\nthe gdb (or lldb) debugger.\n\nOn a Mac with an M1 (ARM) processor, use the `-arch x86_64` flag to\ncompile the runtime:\n```\n   gcc -c -g -std=c99 -arch x86_64 runtime.c\n```\n\n\nNext, suppose your compiler has translated the Racket program in file\n`foo.rkt` into the x86 assembly program in file `foo.s` (The .s filename\nextension is the standard one for assembly programs.) To produce\nan executable program, you can then do\n```\n  gcc -g runtime.o foo.s\n```\nwhich will produce the executable program named a.out.\n\nThere is an example \"compiler\" in the file `compiler.rkt`.  That\nfile defines two passes that translate R_0 programs to R_0 programs\nand tests them using the `interp-tests` function from `utilities.rkt`. It\ntests the passes on the three example programs in the tests\nsubdirectory. You may find it amusing (I did!) to insert bugs in the\ncompiler and see the errors reported. Note that `interp-tests` does not\ntest the final output assembly code; you need to use `compiler-tests`\nfor that purpose. The usage of `compiler-tests` is quite similar to\n`interp-tests`. Example uses of these testing procedures appear in\n`run-tests.rkt`.\n\nAs new languages are added, `run-tests.rkt` will be extended to\ntest new passes. You will be provided with new iterations of\nthe script for each assignment.\n","funding_links":[],"categories":["Racket"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIUCompilerCourse%2Fpublic-student-support-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIUCompilerCourse%2Fpublic-student-support-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIUCompilerCourse%2Fpublic-student-support-code/lists"}