{"id":23843612,"url":"https://github.com/pthorpe92/ayc","last_synced_at":"2026-02-28T17:04:12.762Z","repository":{"id":270542372,"uuid":"910572801","full_name":"PThorpe92/ayc","owner":"PThorpe92","description":"speedrun programming language with bytecode register vm","archived":false,"fork":false,"pushed_at":"2025-01-02T02:12:37.000Z","size":33,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T03:45:12.675Z","etag":null,"topics":["bytecode","go","interpreter","learning","toy-language","vm"],"latest_commit_sha":null,"homepage":"","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/PThorpe92.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,"zenodo":null}},"created_at":"2024-12-31T17:14:01.000Z","updated_at":"2025-04-07T12:10:49.000Z","dependencies_parsed_at":"2025-01-01T07:17:19.823Z","dependency_job_id":"5436b5be-5837-44a2-886d-f441a6038845","html_url":"https://github.com/PThorpe92/ayc","commit_stats":null,"previous_names":["pthorpe92/ayc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PThorpe92/ayc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PThorpe92%2Fayc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PThorpe92%2Fayc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PThorpe92%2Fayc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PThorpe92%2Fayc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PThorpe92","download_url":"https://codeload.github.com/PThorpe92/ayc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PThorpe92%2Fayc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29943686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T13:49:17.081Z","status":"ssl_error","status_checked_at":"2026-02-28T13:48:50.396Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bytecode","go","interpreter","learning","toy-language","vm"],"created_at":"2025-01-02T19:50:16.665Z","updated_at":"2026-02-28T17:04:12.612Z","avatar_url":"https://github.com/PThorpe92.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Ayc**. A simple, buggy language to keep a promise.\n\n\n\u003eNew Years' Eve 2023\nI wrote down a list of things in a `.md` document that I wanted to accomplish by the end of the following year.\n\nAt that point, I had probably started maybe 3 or 4 attempts to write a compiler that each eventually ended up in the dreaded, but well populated `Side-Project Graveyard`. I remember thinking how upset I would be if I didn't make good on my #1 item, which was to actually finish a language.\n\nSo **for the last 4 days of 2024**, I decided to make good on my promise to myself. This will double as a teaching project at work, so here we have it... 3.5 days worth of writing a language, while also hacking on other things.\n\n\nIt's not the greatest language, and there are lots (**LOTS**) of bugs, with many, many unfinished edge-cases. But it has a `REPL`, it can output bytecode to\na binary file, which it can execute later. It makes an attempt to evaluate `constexpr`'s, and output optimized bytecode.\n\n\n```\nUsage of ./ayc:\n  -O    Enable optimizations\n  -d    Enable debug mode\n  -e    Start REPL\n  -i string\n        Input file\n  -o string\n        Output bytecode file\n  -r string\n        Run bytecode file\n```\n\n### Syntax:\n\n\"python, with type hints, `let`, and braces\"\n\n![image](https://github.com/user-attachments/assets/03b40d4d-6198-438c-8e4e-9ea7c1be9b11)\n\nMakes some attempt at error messages. Although they are most likely the parser's fault and not the users ;)\n\n![image](https://github.com/user-attachments/assets/94f2be7f-83e0-4f5f-8ffb-81723406f67c)\n\n\nCurrently only supports `input` + `print` for stdin/out\n\n\n### Recursive fizzbuzz:\n(because functional reasons... not because I'm too lazy to implement `for` loops)\n\n```python\n\ndef fizz(n: int, acc: int) -\u003e int {\n\tif (acc == 0) {\n\t\treturn 0\n\t}\n  if ((n % 3) == 0) {\n      print(\"fizz\")\n   }\n   if ((n % 5) == 0) {\n\t  print(\"buzz\")\n  } else {\n\tprint(\"fizzbuzz\")\n  }\n\tfizz(n + 1, acc - 1)\n}\n\nlet in = input(\"enter a number to print fizzbuzz to: \")\nfizz(in, in)\n```\n\nOUTPUTS:\n\n```py\n0: LABEL [__begin%_]\n1: MOV [0xc00002d4e0 1]\n2: SYSCALL [INPUT 1 2]\n3: PUSH [2]\n4: PUSH [2]\n5: FCALL [__func%_fizz]\n6: HALT [0]\n7: LABEL [__func%_fizz]\n8: POP [3]\n9: POP [4]\n10: MOV [0xc00002d5c0 5]\n11: JMP_IF [3 5 0x3]\n12: MOV [0xc00002d5e0 6]\n13: JMP [0x4]\n14: LABEL [0x3]\n15: MOV [0xc00002d630 6]\n16: LABEL [0x4]\n17: JNT [6 0x1]\n18: MOV [0xc00002d670 7]\n19: MOV [7 0]\n20: RET []\n21: JMP [0x2]\n22: LABEL [0x1]\n23: LABEL [0x2]\n24: MOV [0xc00002d6e0 8]\n25: MOD [4 8 9]\n26: MOV [0xc00002d6f0 10]\n27: JMP_IF [9 10 0x7]\n28: MOV [0xc00002d710 11]\n29: JMP [0x8]\n30: LABEL [0x7]\n31: MOV [0xc00002d760 11]\n32: LABEL [0x8]\n33: JNT [11 0x5]\n34: MOV [0xc00002d7a0 12]\n35: SYSCALL [PRINT 12]\n36: JMP [0x6]\n37: LABEL [0x5]\n38: LABEL [0x6]\n39: MOV [0xc00002d820 13]\n40: MOD [4 13 14]\n41: MOV [0xc00002d830 15]\n42: JMP_IF [14 15 0xb]\n43: MOV [0xc00002d850 16]\n44: JMP [0xc]\n45: LABEL [0xb]\n46: MOV [0xc00002d8a0 16]\n47: LABEL [0xc]\n48: JNT [16 0x9]\n49: MOV [0xc00002d8e0 17]\n50: SYSCALL [PRINT 17]\n51: JMP [0xa]\n52: LABEL [0x9]\n53: MOV [0xc00002d940 18]\n54: SYSCALL [PRINT 18]\n55: LABEL [0xa]\n56: MOV [0xc00002d980 19]\n57: ADD [4 19 20]\n58: PUSH [20]\n59: MOV [0xc00002d9a0 21]\n60: SUB [3 21 22]\n61: PUSH [22]\n62: FCALL [__func%_fizz]\n63: LOAD [0xc00002d9e0 0]\n64: RET []\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpthorpe92%2Fayc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpthorpe92%2Fayc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpthorpe92%2Fayc/lists"}