{"id":21553399,"url":"https://github.com/cbebe/monkey-cpp","last_synced_at":"2025-03-18T02:35:29.408Z","repository":{"id":170903854,"uuid":"646283415","full_name":"cbebe/monkey-cpp","owner":"cbebe","description":"Follow me as I write an interpreter in C++ and cry every day 😭😭😭.","archived":false,"fork":false,"pushed_at":"2024-02-16T17:17:07.000Z","size":231,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T10:08:21.939Z","etag":null,"topics":["cpp","interpreter","monkey"],"latest_commit_sha":null,"homepage":"","language":"C++","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/cbebe.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}},"created_at":"2023-05-27T22:01:14.000Z","updated_at":"2023-05-30T07:21:43.000Z","dependencies_parsed_at":"2024-02-16T18:50:39.026Z","dependency_job_id":null,"html_url":"https://github.com/cbebe/monkey-cpp","commit_stats":null,"previous_names":["cbebe/monkey-cpp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbebe%2Fmonkey-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbebe%2Fmonkey-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbebe%2Fmonkey-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbebe%2Fmonkey-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbebe","download_url":"https://codeload.github.com/cbebe/monkey-cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244144741,"owners_count":20405513,"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":["cpp","interpreter","monkey"],"created_at":"2024-11-24T07:10:36.965Z","updated_at":"2025-03-18T02:35:29.388Z","avatar_url":"https://github.com/cbebe.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Writing An Interpreter in C++\n\nFollow me as I write an interpreter in C++ and cry every day 😭😭😭.\n\nThe project is an interpreter for the Monkey programming language from the book\n[Writing An Interpreter In Go](https://interpreterbook.com/).\n\n## My History with C++\n\nI learned C++ just like how normal CompE kids do, which is in second year\nUniversity. It was my first \"serious\" programming language when I didn't know\nany better how much easier it could be. After finishing\n[my first C++ big school project](https://github.com/cbebe/Checkers-AI), I\nlearned JavaScript and never looked back at C++.\n\nI learned more about programming fundamentals after that, and how computers work\nin general. I tried picking up C++ again in 4th year for my first Operating\nSystems assignment and quickly got overwhelmed. I ended up doing the assignment\nin C, which I found way simpler.\n\nI ended up doing the last assignment in C++ (it was the only other option for a\nprogramming language) because I was too lazy to implement my own hashtable in C,\nbut I kept it C-style with only a little bit of OOP sprinkled in.\n\n## Why C++ Now\n\n- I'm a big boy programmer now who can use StackOverflow and ChatGPT\n- To remind myself how much better \"modern\" programming languages are (EDIT:\n  modern C++ is okay too)\n- To learn new C++ features since I haven't seriously touched it in almost 3\n  years (if I'm being honest, I have never seriously touched C++)\n\n## Thoughts\n\nThis was painful. I already felt comfortable by the time I reached the start of\nthe evaluating chapter (with `std::unique_ptr`s and whatnot), but things got a\nbit hairy when I started dealing with functions. I basically just changed all\ninstances of `std::unique_ptr` and used `std::shared_ptr`. Even after finishing\nthe book, I wasn't able to fix the memory leak when binding functions to\nvariables.\n\nAs for learning C++, I think I've had enough of it. I would probably be less\nintimidated to read and write C++ now. I'd pick it for a school project if I had\nto choose between C or C++, but it definitely is still not a top choice for me.\n\nI didn't really get to learn how to use CMake and testing frameworks but it's\nnot like ~~I'll be starting new projects in C++ anyway~~ (EDIT: I am using CMake\nand it's painful). I'm going to write the\n[compiler and virtual machine in Rust](https://github.com/cbebe/monkey-rs).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbebe%2Fmonkey-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbebe%2Fmonkey-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbebe%2Fmonkey-cpp/lists"}