{"id":23189106,"url":"https://github.com/tomcat-42/done","last_synced_at":"2025-04-05T06:11:36.322Z","repository":{"id":124292923,"uuid":"549802308","full_name":"Tomcat-42/done","owner":"Tomcat-42","description":"Done ✅: A proof of concept libuv and v8 based Javascript Runtime","archived":false,"fork":false,"pushed_at":"2022-10-12T02:55:10.000Z","size":109,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T03:34:43.386Z","etag":null,"topics":["cplusplus","javascript","libuv","nodejs","threads","v8","xmake"],"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/Tomcat-42.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":"2022-10-11T19:03:10.000Z","updated_at":"2022-10-12T02:56:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"637ae38b-752e-4bb6-87e1-075b4377b100","html_url":"https://github.com/Tomcat-42/done","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/Tomcat-42%2Fdone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tomcat-42%2Fdone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tomcat-42%2Fdone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tomcat-42%2Fdone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tomcat-42","download_url":"https://codeload.github.com/Tomcat-42/done/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294548,"owners_count":20915340,"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":["cplusplus","javascript","libuv","nodejs","threads","v8","xmake"],"created_at":"2024-12-18T11:17:16.082Z","updated_at":"2025-04-05T06:11:36.304Z","avatar_url":"https://github.com/Tomcat-42.png","language":"C++","readme":"# Done ✅\n\n## Javascript runtimes and engines\n\nA Javascript runtime is a engine that reads, eval and execute Javascript code. We can take as example chrome's v8, Firefox SpiderMonkey and so on.\n\nNodeJS and other popular runtimes like bun and deno in most parts acts like real runtimes, but in fact are proxies to browser runtimes. For example, NodeJS acts like a proxy to chrome's v8, reading JS code, sending it to v8 and performing OS tasks, among other things.\n\n## NodeJS\n\nNodeJS is a runtime build on top of three main components:\n\n  - v8 engine for Javascript execution.\n  - libuv for asynchronous tasks handling.\n  - Core C++ layer for data flow.\n\nIn the main NodeJS event-loop, everytime it encounters an async operation, it will be delegated to libuv, who will execute the operation a call a provided callback. The event-loop is single threaded, while the async tasks can have multiple threads.\n\n![event-loop](./assets/event_loop.png)\n\nThe C++ layer is responsible for reading the JS sources, and sending this string to a JS engine, and there, the JS code will be transformed in C++ Objects. This layer is responsible for executing the event-loop.\n\n## Project\n\nSo said that, `done` is a toy NodeJS clone made for understanting those core NodeJS concepts.\n\n## Running\n\nThis project uses [xmake](https://xmake.io/#/) as the main tool.\n\n### Hot-reload\n\nYou can use the `./scripts/hot-reload` script to hot-reload the project using *nodemon*.\n\n### Main target\n\nFor running `done` just use the command:\n\n```bash\nxmake run -w . -- done index.js\n```\n\n### Separate Examples\n\nAlso, for runnign the standalone examples, just use the command:\n\n```bash\nxmake run \u003cEXAMPLE\u003e\n```\n\nWhere \u003cEXAMPLE\u003e is a file name inside the `standalone` dir without the extention.\n\n## Acknowledgements\n\nMany thanks to @ErickWendel for showing me those concepts and for being a wonderful teacher.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomcat-42%2Fdone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomcat-42%2Fdone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomcat-42%2Fdone/lists"}