{"id":17925299,"url":"https://github.com/y21/dash","last_synced_at":"2025-03-24T03:31:06.264Z","repository":{"id":39618648,"uuid":"359955792","full_name":"y21/dash","owner":"y21","description":"Experimental JavaScript implementation in Rust","archived":false,"fork":false,"pushed_at":"2025-03-01T03:42:25.000Z","size":3229,"stargazers_count":44,"open_issues_count":8,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-19T01:11:44.913Z","etag":null,"topics":["compiler","ecma262","es6","interpreter","javascript","parser","rust","wasm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/y21.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","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-04-20T21:29:24.000Z","updated_at":"2025-03-01T03:37:57.000Z","dependencies_parsed_at":"2023-10-12T04:35:41.967Z","dependency_job_id":"ab237f5e-f01b-41d4-a2fd-1578d9765aeb","html_url":"https://github.com/y21/dash","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/y21%2Fdash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y21%2Fdash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y21%2Fdash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y21%2Fdash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/y21","download_url":"https://codeload.github.com/y21/dash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245204494,"owners_count":20577361,"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":["compiler","ecma262","es6","interpreter","javascript","parser","rust","wasm"],"created_at":"2024-10-28T20:53:23.272Z","updated_at":"2025-03-24T03:31:06.243Z","avatar_url":"https://github.com/y21.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dash\n\n![Tests](https://github.com/y21/dash/actions/workflows/test.yml/badge.svg)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/y21/dash)\n\nExperimental JavaScript implementation in Rust.\n\n## ⚠️ WIP\n\nThis is a _WIP_ and **not** yet production ready. It is actively being worked on and the API is constantly changing.\n\nCurrent status: Not recommended for use in real projects. Feel free to experiment. The majority of language constructs are implemented and \"work fine\". It currently passes around 25% of test262.\n\n## Usage\n\n### Using the CLI\n\n```js\nconst numbers = [1, 2, 3, 4, 5];\nconst sum = numbers.reduce((acc, num) =\u003e acc + num, 0);\n\nconsole.log(`Sum of array: ${sum}`);\n```\n\n## Install\n\n```sh\n# Install Rust\n$ curl -sSf https://sh.rustup.rs | sh\n\n# Build project\n$ cargo install --git https://github.com/y21/dash dash-cli\n\n# Optional: rename binary to `dashjs`\n$ mv ~/.cargo/bin/dash-cli ~/.cargo/bin/dashjs\n\n# Run the program (run with --help for help)\n$ dashjs run example.js\n```\n\n### Embedding into a Rust application\n\nNote that the API is very unstable. Things are constantly changing, so your code may break at any time when bumping the version, which is why it is highly recommended to lock in to a specific revision for now.\nThe MSRV for this project is the version that is currently stable. No nightly should be required to build the project or to use it as a library (except for the custom linter in `lints/` which is only useful for development).\n\n- Cargo.toml\n\n```toml\n[dependencies]\ndash_vm = { git = \"https://github.com/y21/dash\", features = [\"eval\"], rev = \"9401b84\" }\n```\n\n\u003e The `eval` feature exposes a convenience `eval()` method on the `Vm` struct\n\u003e that lets you specify a JavaScript source string directly instead of having to pass the different IRs around.\n\n- main.rs\n\n```rs\nuse dash_vm::Vm;\nuse dash_vm::value::Root;\nuse dash_vm::value::ops::conversions::ValueConversion;\n\nfn main() {\n    let source = \"const x = 42; x * x\";\n    let mut vm = Vm::new(Default::default());\n    let mut scope = vm.scope();\n    let result = scope\n        .eval(source, Default::default())\n        .unwrap()\n        .root(\u0026mut scope);\n\n    println!(\"Result: {}\", result.to_number(\u0026mut scope).unwrap());\n}\n```\n\n### Node compatibility\n\nThere's experimental support for running scripts that use NodeJS APIs. If you want to try it out, pass `--features nodejs` to the cargo install/build command.\nWhen running dash, you can then pass `--node` and various node-specific things will be available to the JS environment, such as the `require` function.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy21%2Fdash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fy21%2Fdash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy21%2Fdash/lists"}