{"id":18658360,"url":"https://github.com/shime/tiny-ruby-compiler","last_synced_at":"2025-11-05T23:30:32.197Z","repository":{"id":142443013,"uuid":"117003678","full_name":"shime/tiny-ruby-compiler","owner":"shime","description":"Super tiny compiler, written in Ruby, using TDD.","archived":false,"fork":false,"pushed_at":"2018-01-10T19:56:41.000Z","size":20,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T15:26:20.640Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/shime.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-01-10T19:52:17.000Z","updated_at":"2018-01-15T05:56:58.000Z","dependencies_parsed_at":"2023-04-10T18:48:28.179Z","dependency_job_id":null,"html_url":"https://github.com/shime/tiny-ruby-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/shime%2Ftiny-ruby-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shime%2Ftiny-ruby-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shime%2Ftiny-ruby-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shime%2Ftiny-ruby-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shime","download_url":"https://codeload.github.com/shime/tiny-ruby-compiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239475962,"owners_count":19645041,"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-07T07:32:39.699Z","updated_at":"2025-11-05T23:30:32.136Z","avatar_url":"https://github.com/shime.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tiny Ruby Compiler\n\nSuper tiny compiler, written in Ruby, using TDD.\n\n100% covered with tests.\n\nConverts Lispy expressions to C-like expressions like so:\n\n| Operation       | Lisp                   | C                      |\n| ----------------| -----------------------|------------------------|\n| 1 + 1           | (add 1 1)              | add(1, 1)              |\n| 4 - 2           | (subtract 4 2)         | subtract(4, 2)         |\n| 2 + (4 - 2)     | (add 2 (subtract 4 2)) | add(2, subtract(4, 2)) |\n\nCompilers generally consist of 3 main parts:\n* Parsing\n* Transformation\n* Code Generation\n\n## Description\n\n### Parsing\nParsing consists of two parts:\n\n* Lexical Analysis - takes raw code and splits it apart into tokens (check out `Tokenizer`)\n* Syntactic Analysis - takes the tokens and reformats them into AST (check out `Parser`)\n\n### Transformation\nTransformation consists of two parts:\n\n* Traverser - traverseres the original AST and operates on it (check out `Traverser`)\n* Transformer - transforms the original AST to another, suited for destination lanaguage (check out `Transformer`)\n\n### Code Generation\n\nCode generation consists of:\n* Code Generator - converts the destination AST to runnable destination code (check out `Generator`)\n\n## Development\n\nInstall dependencies\n\n```\nbundle install\n```\n\nRun tests with\n```\nrake\n```\n\n## Attributions\n\nThis repo is basically a port of [thejameskyle/the-super-tiny-compiler](https://github.com/thejameskyle/the-super-tiny-compiler) to Ruby.\nDefinitely check it out for more thorough deep dive into compilers.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshime%2Ftiny-ruby-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshime%2Ftiny-ruby-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshime%2Ftiny-ruby-compiler/lists"}