{"id":16549731,"url":"https://github.com/uiur/mjs","last_synced_at":"2026-05-30T18:31:38.961Z","repository":{"id":141424572,"uuid":"338549170","full_name":"uiur/mjs","owner":"uiur","description":"minimal javascript interpreter in c","archived":false,"fork":false,"pushed_at":"2021-04-04T05:28:47.000Z","size":125,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-01T18:55:51.484Z","etag":null,"topics":[],"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/uiur.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":"2021-02-13T10:28:34.000Z","updated_at":"2023-08-29T06:55:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"1b93248e-e930-44cd-aec3-e62c15c77151","html_url":"https://github.com/uiur/mjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/uiur/mjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiur%2Fmjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiur%2Fmjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiur%2Fmjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiur%2Fmjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uiur","download_url":"https://codeload.github.com/uiur/mjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiur%2Fmjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33705207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-11T19:30:59.612Z","updated_at":"2026-05-30T18:31:38.937Z","avatar_url":"https://github.com/uiur.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mjs\n\nA minimal (toy) JavaScript interpreter.\n\nThe goal is that it can be used as a good subset of ES5.\n\nThe implementation is from scratch. It doesn't have any library dependencies except for standard C library.\nThe parser and lexer are written as a recursive descendant parser.\n\n## motivation\n\n\u003e What I cannot create, I do not understand - Richard Feynman\n\nThe motivation is to:\n\n- learn C language \n- learn algorithms and data structures such as hash table\n- learn how to build an interpreter of a dynamic-typed language\n- know more deeply about JavaScript\n\n## status\n\n- It can run sort algorithms \n- It has very basic object system with prototype chains\n\n## development\n\nHere's a note for myself.\n\n### build\n\n```sh\nmake\n./build/main test/input/8-array-sort.js\n```\n\n### test\n\nThis runs unit tests in C and end-to-end tests in shell scripts.\n\n```sh\nmake test_run\n```\n\n## examples\n\nsee `test/input`\n\n```js\nfunction sort(items) {\n  for (var i = 0; i \u003c items.length; i = i + 1) {\n    var j = 0;\n    var stop = items.length - 1;\n    for (; j \u003c stop; j = j + 1){\n      if (items[j] \u003e items[j + 1]){\n        var temp = items[j];\n        items[j] = items[j + 1];\n        items[j + 1] = temp;\n      }\n    }\n  }\n\n  return items;\n}\n\nArray.prototype.sort = function () {\n  return sort(this);\n};\n\nconsole.log([3, 2, 1].sort());\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuiur%2Fmjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuiur%2Fmjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuiur%2Fmjs/lists"}