{"id":20325121,"url":"https://github.com/mphe/hades-compiler","last_synced_at":"2026-05-09T08:32:53.384Z","repository":{"id":95853925,"uuid":"176131321","full_name":"mphe/HaDes-Compiler","owner":"mphe","description":"A proof-of-concept HaDes Compiler written from scratch in Python","archived":false,"fork":false,"pushed_at":"2019-03-17T16:53:04.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T14:22:50.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/mphe.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":"2019-03-17T16:49:52.000Z","updated_at":"2019-03-17T16:53:05.000Z","dependencies_parsed_at":"2023-03-13T16:44:39.035Z","dependency_job_id":null,"html_url":"https://github.com/mphe/HaDes-Compiler","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/mphe%2FHaDes-Compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mphe%2FHaDes-Compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mphe%2FHaDes-Compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mphe%2FHaDes-Compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mphe","download_url":"https://codeload.github.com/mphe/HaDes-Compiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241828423,"owners_count":20026904,"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-14T19:38:46.882Z","updated_at":"2026-05-09T08:32:48.347Z","avatar_url":"https://github.com/mphe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HaDes Compiler\n\nA proof-of-concept HaDes Compiler written from scratch in Python.\u003cbr/\u003e\nThe compiler transforms higher level code to HaDes assembly code that can then be compiled using the HaDes assembler.\n\n## Background\n\nFrom the respective university hardware design course:\n\n\u003e The HaDes Lab is about deeply understanding the internal concepts, structure, and operation of micro-\n\u003e controllers (MCU). By the end of this course, you will have implemented a specific MCU in a Hardware\n\u003e Description Language (HDL) and software for your MCU in Assembly (ASM). You will have extended\n\u003e both your skills for describing digital logic, implementing low level code, and debugging hardware and\n\u003e software using various tools. The exercises will be done in VHDL on a Xilinx ® Artix TM -7 FPGA, which will\n\u003e be provided on the BASYS3 development board from Digilent, as depicted in Figure 1.1.\n\nDialog during development of the software:\n\n\u003e Me: Do you think it's faster to write a compiler than writing this assembly code by hand?\u003cbr/\u003e\n\u003e Other Guy: Probably.\n\n\n## Features / Missing features\nThe parser accepts grammar rules in BNF-like format, as seen in `grammar.py`.\u003cbr/\u003e\nThe compiler supports basic language features as seen in `test.txt`.\n\n**Lacks**:\n\n* global variables\n* comments\n* important functions like interrupts, periphery controls, etc.\n* error detection\n* code optimization\n* ...\n\n## Notes\n\nBoth the parser and the compiler are proof-of-concept. They work and can be extended as required.\n\nThe parser becomes very slow with complex nested expressions like `(a + b * (c - d * a) + (x + f(y)))`.\nThis could be fixed by preprocessing the source code to split codeblocks and statements and then invoking the parser on single statements rather than the whole code.\n\nThe compiler generates working, but not very efficient, assembler code.\n\n## Usage\n\nInstall Python3\n\nThen run:\n```\n$ ./main.py \u003ccodefile\u003e -o \u003coutputfile\u003e\n```\n\n\n## Conclusion\nIt was not faster to write the compiler than writing assembler code by hand.\n\nBut it was an interesting experience.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmphe%2Fhades-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmphe%2Fhades-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmphe%2Fhades-compiler/lists"}