{"id":19255239,"url":"https://github.com/devlzl/runjs","last_synced_at":"2025-02-23T17:24:10.041Z","repository":{"id":156892139,"uuid":"566562574","full_name":"devlzl/RunJS","owner":"devlzl","description":"JavaScript engine written in JavaScript.","archived":false,"fork":false,"pushed_at":"2024-02-11T10:50:54.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-05T07:47:27.114Z","etag":null,"topics":["javascript-engine"],"latest_commit_sha":null,"homepage":"https://devlzl.github.io/RunJS/","language":"JavaScript","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/devlzl.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-11-15T23:48:53.000Z","updated_at":"2024-02-15T05:35:15.000Z","dependencies_parsed_at":"2024-01-22T11:16:48.399Z","dependency_job_id":"6ec59c2c-6342-4b6a-aac3-bc1e4e40ff89","html_url":"https://github.com/devlzl/RunJS","commit_stats":null,"previous_names":["devlzl/runjs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlzl%2FRunJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlzl%2FRunJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlzl%2FRunJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlzl%2FRunJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devlzl","download_url":"https://codeload.github.com/devlzl/RunJS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240349304,"owners_count":19787481,"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":["javascript-engine"],"created_at":"2024-11-09T18:39:56.519Z","updated_at":"2025-02-23T17:24:10.016Z","avatar_url":"https://github.com/devlzl.png","language":"JavaScript","readme":"# RunJS JavaScript Engine\n\n## 1. Introduction\nRunJS is a small JavaScript engine written in JavaScript,  no external dependency.\n\nIt includes a set of classic JavaScript features in reference to the ECMA-262 Language Specification.\n\n[Online Demo](https://devlzl.github.io/RunJS/)  \n\n\n##  2. Usage\n`main.js` provides a `run` function that accepts JavaScript source code as an argument.\n\nYou can import `run` anywhere and execute it.\n\n\n## 3. Specifications\n### 3.1 Language support\n- Primitive data types and object\n- Arithmetic and logical operations\n- Conditional and iteration statements\n- Function and scope\n\n### 3.2 Standard library\n```JavaScript\n// Similar to console.log()\nlog(...args);\n```\n\n\n## 4. Internals\n### 4.1 Lexer\nImplemented lexical analysis using regular expressions.\n\n### 4.2 Parser\nImplemented syntax analysis from scratch according to LL algorithm, and construct AST.\n\n### 4.3 Runtime\nImplemented a set of runtime infrastructure:\n- LanguageTypes\n    - NumberType (represented as Float64Array)\n    - StringType (represented as Uint16Array)\n    - BooleanType\n    - ObjectType\n    - UndefinedType\n    - NullType\n- Realm\n    - The `log` function is registered here\n- SpecificationTypes\n    - CompletionRecord\n    - LexicalEnvironment\n    - Reference\n- ExecutionContext\n\n### 4.4 Evaluator\nWhen a new instance of the JavaScript engine is created, Realm will be created, ExecutionContextStack will be initialized, AST will be traversed and interpreted.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlzl%2Frunjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevlzl%2Frunjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlzl%2Frunjs/lists"}