{"id":16941336,"url":"https://github.com/msiemens/rustiny","last_synced_at":"2025-03-22T12:32:43.616Z","repository":{"id":46896150,"uuid":"31766062","full_name":"msiemens/RusTiny","owner":"msiemens","description":"A Rust-like language compiling to x86-64 assembler","archived":false,"fork":false,"pushed_at":"2022-06-17T16:12:18.000Z","size":467,"stargazers_count":53,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-18T11:11:46.790Z","etag":null,"topics":["compiler","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/msiemens.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}},"created_at":"2015-03-06T11:15:50.000Z","updated_at":"2024-06-22T21:09:59.000Z","dependencies_parsed_at":"2022-08-28T11:23:02.094Z","dependency_job_id":null,"html_url":"https://github.com/msiemens/RusTiny","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/msiemens%2FRusTiny","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msiemens%2FRusTiny/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msiemens%2FRusTiny/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msiemens%2FRusTiny/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msiemens","download_url":"https://codeload.github.com/msiemens/RusTiny/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959442,"owners_count":20538625,"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","rust"],"created_at":"2024-10-13T21:09:17.382Z","updated_at":"2025-03-22T12:32:43.319Z","avatar_url":"https://github.com/msiemens.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RusTiny\n\nThis is an educational compiler for a Rust-like language that was originally\nplanned to target the fictional [Tiny architecture](https://github.com/msiemens/rust-tinyasm). But due to Tiny's limitations, RusTiny now targets x86-64 machines.\nThe syntax is based on Rust, but there are numerous semantic differences:\n\n- The only datatype is `int`. There also are `bool` and `char`, but these are\n  actually `int`s in disguise.\n- No structs/classes, no modules, only functions. This keeps the whole\n  language managable for me.\n- No `mut`, no borrow checker. Again: keep it simple.\n\n**NOTE:** This project is currently on hold as the current approach for SSA register allocation doesn't really pan out. I hope I'll find time to revisit project this sometime in the future.\n\n## Goal\n\nMy goal is to get the compiler so far that I can write a program that\n[approximates Pi](https://blog.m-siemens.de/exploring-computers-tiny-assembler/#approximatingdpid).\n\n## Architecture\n\nThe general data flow looks something like this:\n\n    Source File -(front)-\u003e AST -(middle)-\u003e IR -(back)-\u003e Assembler\n\n- `front`: Translates the source file into an Abstract Syntax Tree representation\n- `middle`: Checks the AST for correctness, transforms it to an Intermediate Representation\n  and performs optimizations\n- `back`: Translates the IR to ~~Tiny Assembly code~~ x86-64 assembly\n\n## Helpful Resources\n\nResources I found helpful:\n\n- [**Introduction to Compiler Design** by Torben Ægidius Mogensen](http://www.springer.com/us/book/9780857298287)\n- [**Engineering a Compiler** by Keith D. Cooper \u0026 Linda Torczon](http://store.elsevier.com/product.jsp?isbn=9780120884780)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsiemens%2Frustiny","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsiemens%2Frustiny","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsiemens%2Frustiny/lists"}