{"id":13672615,"url":"https://github.com/hsiaosiyuan0/naive","last_synced_at":"2026-01-16T15:45:23.444Z","repository":{"id":38326117,"uuid":"193093770","full_name":"hsiaosiyuan0/naive","owner":"hsiaosiyuan0","description":"Learn JavaScript the hard way 🤯","archived":false,"fork":false,"pushed_at":"2019-07-24T02:34:25.000Z","size":153,"stargazers_count":216,"open_issues_count":0,"forks_count":12,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-11T10:42:34.470Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/hsiaosiyuan0.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}},"created_at":"2019-06-21T12:24:45.000Z","updated_at":"2024-11-11T05:52:06.000Z","dependencies_parsed_at":"2022-08-25T04:50:17.193Z","dependency_job_id":null,"html_url":"https://github.com/hsiaosiyuan0/naive","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/hsiaosiyuan0%2Fnaive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsiaosiyuan0%2Fnaive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsiaosiyuan0%2Fnaive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsiaosiyuan0%2Fnaive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hsiaosiyuan0","download_url":"https://codeload.github.com/hsiaosiyuan0/naive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251219601,"owners_count":21554444,"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-08-02T09:01:41.714Z","updated_at":"2026-01-16T15:45:23.405Z","avatar_url":"https://github.com/hsiaosiyuan0.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Naive\n\nThis is a naive JavaScript engine implemented in pure Rust to improve my JavaScript knowledge.\n\n[![asciicast](https://asciinema.org/a/NSyybvRaFimC4OLIDtarKJkII.svg)](https://asciinema.org/a/NSyybvRaFimC4OLIDtarKJkII)\n\n## Checklist\n\n### Frontend\n\n* [x] Lexer\n* [x] Recursive descent parser with [Operator Precedence Algorithm](https://en.wikipedia.org/wiki/Operator-precedence_parser) to optimize operators parsing\n* [x] Generates abstract syntax tree on basis of [ESTree](https://github.com/estree/estree)\n\n### Intermediate\n\n* [x] Generates bytecode(opcode) from AST\n* [ ] Bytecode analysis\n* [ ] Optimizes bytecode according to the analysis result\n\n### VM\n\n* [x] Reference-counting GC with Mark-and-Sweep to deal with the reference cycle\n* [x] Common Flow Control Statements(if-else, for, while, do-while)\n* [x] Closure\n* [x] Mathematical Operations\n* [x] Function Invocation\n* [x] Logical Operations\n* [ ] Bitwise Operations\n* [x] Object Literal\n* [x] New Expression\n* [x] Member Access Expression\n* [ ] For-in Statement\n* [ ] Switch Case Statement\n* [ ] Try-catch Statement\n* [ ] Debug\n\n## How to run\n\nThanks to the Rust development infrastructure, run this engine from source is very easy, just:\n\n```\n$ cargo build\n$ cargo run your-script.js\n```\n\nIt's still in development, after it’s completed I’d like to write a series of posts to describe how to build a JavaScript engine from scratch, stay tuned.\n\nFeel free to leave any response by submitting a issue. Star/Fork to subscribe its updates is welcome.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsiaosiyuan0%2Fnaive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhsiaosiyuan0%2Fnaive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsiaosiyuan0%2Fnaive/lists"}