{"id":13648753,"url":"https://github.com/decaf-lang/decaf-rs","last_synced_at":"2025-04-22T11:33:13.553Z","repository":{"id":113072897,"uuid":"208974450","full_name":"decaf-lang/decaf-rs","owner":"decaf-lang","description":"The Decaf compiler, written in Rust","archived":false,"fork":false,"pushed_at":"2019-12-18T07:53:17.000Z","size":108,"stargazers_count":53,"open_issues_count":2,"forks_count":9,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-03T01:39:09.430Z","etag":null,"topics":["compiler","decaf","mips","object-oriented","rust"],"latest_commit_sha":null,"homepage":"https://mashplant.gitbook.io/decaf-doc/","language":"Rust","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/decaf-lang.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}},"created_at":"2019-09-17T06:20:22.000Z","updated_at":"2024-03-15T12:08:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"b81a1fa9-8b93-4640-acf8-4c6c599b6389","html_url":"https://github.com/decaf-lang/decaf-rs","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decaf-lang%2Fdecaf-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decaf-lang%2Fdecaf-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decaf-lang%2Fdecaf-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decaf-lang%2Fdecaf-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/decaf-lang","download_url":"https://codeload.github.com/decaf-lang/decaf-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223896472,"owners_count":17221441,"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","decaf","mips","object-oriented","rust"],"created_at":"2024-08-02T01:04:30.693Z","updated_at":"2024-11-09T23:30:31.981Z","avatar_url":"https://github.com/decaf-lang.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Introduction\n\nThe public version of decaf pa.\n\nThe code involved in pa1a, pa2, pa3 are the same as the private version of decaf pa, because in them your task is only extending language features, which are different on different years. By contrast, the code involved in pa1b, pa4, pa5 may miss necessary code, because in them your task involves completing existing code, which are the same on different years.\n\n# Testcases\n\nIt is on the way, now the `testcase` folder doesn't contain any testcase. We will later identify a set of testcases that are suitable for publication.\n\n# Documentation (experiment guide)\n\n[decaf-doc](https://mashplant.gitbook.io/decaf-doc/)\n\n# Build \u0026 Run\n\nYou need a nightly rust compiler. It is tested on `rustc 1.38.0-nightly`, there is no guarantee about any older version (I believe that a newer version won't break the code).\n\nRun:\n\n```\ncargo run --bin test # for testing your implemetation using the testcase folder\n# or\ncargo run --bin decaf # for a command line app\n```\n\nThe command line app (with name `decaf`) support the following arguments:\n\n```\n\u003cinput\u003e # required, the input decaf file path\n--target=\u003ctarget\u003e # required, \u003ctarget\u003e can be pa1a, pa1b, pa2, pa3, pa4, pa5\n--output=\u003coutput\u003e # optional, the output path; if not specified, it prints to stdout\n```\n\n# Common problems\n\n1. The color (printed by `test`) is not working properly on Windows\n\nAdd `colored::control::set_override(false);` before calling `test_all` to disable color.\n\n2. --target=pa1b/pa4/pa5 panicked at `unimplemented!()`\n\nOf course, they are simply not implemented. But there is also fallback code for the unimplemented code:\n\n- to make pa1b work, in `syntax/src/parser_ll.rs`, change the line `unimplemented!()` to `return StackItem::_Fail;` \n- to make pa4 work, in `tacopt/src/bb.rs`, remove the line `crate::aliveness::work(self);`\n- to make pa5 work, first make pa4 work, then in `driver/src/lib.rs`, change the line `let asm = FuncGen::work(\u0026fu, \u0026tp, codegen::AllocMethod::Graph);` to `let asm = FuncGen::work(\u0026fu, \u0026tp, codegen::AllocMethod::Brute);`\n\nOf course the fallback code won't have exactly the same functionality as the code we expect you to implement, but as least they can make the compiler working. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecaf-lang%2Fdecaf-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecaf-lang%2Fdecaf-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecaf-lang%2Fdecaf-rs/lists"}