{"id":19910001,"url":"https://github.com/aitoroses/toy-vm-go","last_synced_at":"2025-06-25T00:08:26.026Z","repository":{"id":67181718,"uuid":"56992466","full_name":"aitoroses/toy-vm-go","owner":"aitoroses","description":"A toy VM implementation in Go","archived":false,"fork":false,"pushed_at":"2016-04-29T09:18:51.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T08:29:18.978Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/aitoroses.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-24T20:22:46.000Z","updated_at":"2016-04-24T21:54:14.000Z","dependencies_parsed_at":"2023-06-10T05:15:40.392Z","dependency_job_id":null,"html_url":"https://github.com/aitoroses/toy-vm-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aitoroses/toy-vm-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitoroses%2Ftoy-vm-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitoroses%2Ftoy-vm-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitoroses%2Ftoy-vm-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitoroses%2Ftoy-vm-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aitoroses","download_url":"https://codeload.github.com/aitoroses/toy-vm-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitoroses%2Ftoy-vm-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261777695,"owners_count":23208127,"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-12T21:17:14.875Z","updated_at":"2025-06-25T00:08:25.958Z","avatar_url":"https://github.com/aitoroses.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A toy VM implemented in Go\n\n A VM implemented in Go with a purely education purpose\n\n# Status\n- [x] Bytecode interpreter\n- [ ] Program to bytecode compiler\n- [ ] CLI tool\n- [ ] Implement a higher level language compiler with this VM bytecode as backend\n- [ ] Explore some other VM features\n\n# Currently implemented instruction set\n\n* **PSH [value]**, pushes a value into the stack\n* **ADD**, takes 2 values from the stack and adds them together\n* **POP [register]**, pops a value from the stack to a register \n* **SET [memory address]**, sets the program pointer to the memory address\n* **PRINT [register]**, takes to stdout the value of a register\n* **MOV [register A] [register B]**, moves a value from A to B\n* **HLT**, ends the program\n\n# Program example\n\n```\nPSH 5         // Push 5 to the stack, [5]\nPSH 6         // Push 6 to the stack, [5,6]\nADD           // Add two values, [11]\nPOP A         // Push 6 to the stack, [] A{11}\nPRINT A       // Prints 11\nHLT           // Finishes\n```\n\n# Roadmap\n\n* CLI Support\n    * `toy-vm-go --compile ./program.ext`, compile a program to bytecode, which will be just \n    the int[] hexadecimal version of the text program (`program.o`)\n    \n    * `toy-vm-go ./program.o`, run the bytecode in the virtual machine\n    \n    * `toy-vm-go -i ./program.ext`, compile and run the program like an interpreter\n    \n* Compiler\n* Bytecode Interpreter\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faitoroses%2Ftoy-vm-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faitoroses%2Ftoy-vm-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faitoroses%2Ftoy-vm-go/lists"}