{"id":13647127,"url":"https://github.com/decaf-lang/decaf","last_synced_at":"2025-04-21T21:32:49.662Z","repository":{"id":55461440,"uuid":"208590586","full_name":"decaf-lang/decaf","owner":"decaf-lang","description":"The new Decaf compiler, rewritten in \"modern\" Java","archived":false,"fork":false,"pushed_at":"2020-07-21T16:49:55.000Z","size":435,"stargazers_count":60,"open_issues_count":4,"forks_count":28,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-08-02T01:26:53.837Z","etag":null,"topics":["compiler","decaf","mips","object-oriented"],"latest_commit_sha":null,"homepage":"","language":"Java","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}},"created_at":"2019-09-15T12:26:15.000Z","updated_at":"2024-08-02T01:26:53.838Z","dependencies_parsed_at":"2022-08-15T00:50:30.038Z","dependency_job_id":null,"html_url":"https://github.com/decaf-lang/decaf","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","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decaf-lang%2Fdecaf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decaf-lang%2Fdecaf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decaf-lang%2Fdecaf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/decaf-lang","download_url":"https://codeload.github.com/decaf-lang/decaf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223880466,"owners_count":17219128,"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"],"created_at":"2024-08-02T01:03:21.314Z","updated_at":"2024-11-09T20:31:07.652Z","avatar_url":"https://github.com/decaf-lang.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# The New Decaf Compiler\n\n\u003cimg src=\"https://github.com/decaf-lang/decaf/wiki/images/decaf-logo-h.svg?sanitize=true\" width=\"300\" align=center\u003e\u003c/img\u003e\n\n[![](https://github.com/decaf-lang/decaf/workflows/Java%20CI%20with%20Gradle/badge.svg?branch=master)](https://github.com/decaf-lang/decaf/actions)\n\nDecaf is a Java-like, but much smaller programming language mainly for educational purpose.\nWe now have at least three different implementations of the compiler in Java, Scala and Rust.\nSince the standard language has quite a limited set of language features, students are welcome to add their own new features.\n\n## Getting Started\n\nThis project requires\n* JDK 14\n* Gradle 6.5.1\n\nOther dependencies will be automatically downloaded from the maven central repository by the build script.\n\nAfter git clone, you need to setup submodules by\n```\ngit submodule update --recursive --init\n```\n\n## Build\n\nType the standard Gradle build command in your CLI:\n\n```sh\ngradle build\n```\n\nThe built jar will be located at `build/libs/decaf.jar`.\n\nOr, import the project in a Java IDE (like IDEA or Eclipse, or your favorite VS Code) and use gradle plugin, if available.\n\n## Run\n\nIn your CLI, type\n\n```sh\njava -jar build/libs/decaf.jar -h\n```\n\nto display the usage help.\n\nPossible targets/tasks are:\n\n- PA1: parse source code and output the pretty printed tree, or error messages\n- PA1-LL: like PA1, but use hand-coded LL parsing algorithm, with the help of a LL table generator [ll1pg](https://github.com/paulzfm/ll1pg)\n- PA2: type check and output the pretty printed scopes, or error messages\n- PA3: generate TAC (three-address code), dump it to a .tac file, and then output the execution result using our built-in simulator\n- PA4: currently same with PA3, will be reserved for students to do a bunch of optimizations on TAC\n- PA5: (default target) allocate registers and emit assembly code, currently we are using a very brute-force algorithm and only generates MIPS assembly code (with pseudo-ops, and no delayed branches)\n\nTo run the MIPS assembly code, you may need [spim](http://spimsimulator.sourceforge.net), a MIPS32 simulator.\nFor Mac OS users, simply install `spim` with `brew install spim` and run with `spim -file your_file.s`.\n\n## Releases\n\nSee https://github.com/decaf-lang/decaf/releases for releases, including separate frameworks for PA1 -- PA3.\n\n## Materials\n\nWe have a couple of Chinese documents on the language specification and implementation outlines:\n\n- https://decaf-lang.gitbook.io\n- https://decaf-project.gitbook.io\n\n## Development \u0026 Contribution\n\nIn future, we will develop on (possibly variates of) development branches,\nand only merge release versions into the master branch.\n\nIssues and pull requests for fixing bugs are welcome. However, adding new language features will not be considered, because that's students' work!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecaf-lang%2Fdecaf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecaf-lang%2Fdecaf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecaf-lang%2Fdecaf/lists"}