{"id":13658271,"url":"https://github.com/ocsigen/js_of_ocaml","last_synced_at":"2026-10-19T16:38:33.841Z","repository":{"id":9776885,"uuid":"11749064","full_name":"ocsigen/js_of_ocaml","owner":"ocsigen","description":"Compiler from OCaml to Javascript.","archived":false,"fork":false,"pushed_at":"2026-10-12T11:20:00.000Z","size":3468186,"stargazers_count":1135,"open_issues_count":75,"forks_count":202,"subscribers_count":27,"default_branch":"master","last_synced_at":"2026-10-12T11:41:50.502Z","etag":null,"topics":["compiler","javascript","jsoo","ocaml","ocsigen"],"latest_commit_sha":null,"homepage":"http://ocsigen.org/js_of_ocaml/","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ocsigen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2013-07-29T20:28:11.000Z","updated_at":"2026-10-12T11:20:02.000Z","dependencies_parsed_at":"2023-01-16T19:45:58.828Z","dependency_job_id":"bea7bb4d-0789-47bf-b346-452aae2d1159","html_url":"https://github.com/ocsigen/js_of_ocaml","commit_stats":null,"previous_names":[],"tags_count":80,"template":false,"template_full_name":null,"purl":"pkg:github/ocsigen/js_of_ocaml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocsigen%2Fjs_of_ocaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocsigen%2Fjs_of_ocaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocsigen%2Fjs_of_ocaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocsigen%2Fjs_of_ocaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ocsigen","download_url":"https://codeload.github.com/ocsigen/js_of_ocaml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocsigen%2Fjs_of_ocaml/sbom","scorecard":{"id":701569,"data":{"date":"2025-08-11","repo":{"name":"github.com/ocsigen/js_of_ocaml","commit":"a66fa7d8c707a4134ad886172dfcec26a7265b87"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.8,"checks":[{"name":"Code-Review","score":5,"reason":"Found 6/12 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 11 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/changelog.yml:1","Warn: no topLevel permission defined: .github/workflows/js_of_ocaml.yml:1","Warn: no topLevel permission defined: .github/workflows/lint.yml:1","Warn: no topLevel permission defined: .github/workflows/wasm_of_ocaml.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 6.2.0 not signed: https://api.github.com/repos/ocsigen/js_of_ocaml/releases/236169086","Warn: release artifact 6.1.1 not signed: https://api.github.com/repos/ocsigen/js_of_ocaml/releases/230470474","Warn: release artifact 6.1.0 not signed: https://api.github.com/repos/ocsigen/js_of_ocaml/releases/230124703","Warn: release artifact 6.0.1 not signed: https://api.github.com/repos/ocsigen/js_of_ocaml/releases/199034518","Warn: release artifact 6.0.0 not signed: https://api.github.com/repos/ocsigen/js_of_ocaml/releases/198217599","Warn: release artifact 6.2.0 does not have provenance: https://api.github.com/repos/ocsigen/js_of_ocaml/releases/236169086","Warn: release artifact 6.1.1 does not have provenance: https://api.github.com/repos/ocsigen/js_of_ocaml/releases/230470474","Warn: release artifact 6.1.0 does not have provenance: https://api.github.com/repos/ocsigen/js_of_ocaml/releases/230124703","Warn: release artifact 6.0.1 does not have provenance: https://api.github.com/repos/ocsigen/js_of_ocaml/releases/199034518","Warn: release artifact 6.0.0 does not have provenance: https://api.github.com/repos/ocsigen/js_of_ocaml/releases/198217599"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/changelog.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/changelog.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/js_of_ocaml.yml:119: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/js_of_ocaml.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/js_of_ocaml.yml:135: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/js_of_ocaml.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/js_of_ocaml.yml:140: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/js_of_ocaml.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/js_of_ocaml.yml:151: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/js_of_ocaml.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/js_of_ocaml.yml:193: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/js_of_ocaml.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/lint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/lint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/lint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/lint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/lint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/lint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/wasm_of_ocaml.yml:77: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/wasm_of_ocaml.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/wasm_of_ocaml.yml:83: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/wasm_of_ocaml.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/wasm_of_ocaml.yml:90: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/wasm_of_ocaml.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/wasm_of_ocaml.yml:95: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/wasm_of_ocaml.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/wasm_of_ocaml.yml:100: update your workflow using https://app.stepsecurity.io/secureworkflow/ocsigen/js_of_ocaml/wasm_of_ocaml.yml/master?enable=pin","Warn: containerImage not pinned by hash: bench.Dockerfile:1: pin your Docker image by updating ocaml/opam:debian-ocaml-5.3 to ocaml/opam:debian-ocaml-5.3@sha256:ba521060d69d6c844f3d8eae8ac57e1653e8f7ec28d3f56a1ffdec6033891441","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  12 third-party GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T05:19:55.741Z","repository_id":9776885,"created_at":"2025-08-22T05:19:55.741Z","updated_at":"2025-08-22T05:19:55.741Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38361578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-19T02:00:06.414Z","response_time":53,"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":["compiler","javascript","jsoo","ocaml","ocsigen"],"created_at":"2024-08-02T05:00:58.189Z","updated_at":"2026-10-19T16:38:33.833Z","avatar_url":"https://github.com/ocsigen.png","language":"OCaml","funding_links":[],"categories":["OCaml (14)","OCaml","compiler"],"sub_categories":[],"readme":"# Js_of_ocaml (jsoo)\n\n[![Build js_of_ocaml](https://github.com/ocsigen/js_of_ocaml/actions/workflows/js_of_ocaml.yml/badge.svg)](https://github.com/ocsigen/js_of_ocaml/actions/workflows/js_of_ocaml.yml)\n[![Build wasm_of_ocaml](https://github.com/ocsigen/js_of_ocaml/actions/workflows/wasm_of_ocaml.yml/badge.svg)](https://github.com/ocsigen/js_of_ocaml/actions/workflows/wasm_of_ocaml.yml)\n[![Update Web site - build](https://github.com/ocsigen/js_of_ocaml/actions/workflows/siteupdate.yml/badge.svg)](https://github.com/ocsigen/js_of_ocaml/actions/workflows/siteupdate.yml)\n[![Update Web site - deploy](https://github.com/ocsigen/js_of_ocaml/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/ocsigen/js_of_ocaml/actions/workflows/pages/pages-build-deployment)\n\nJs_of_ocaml is a compiler from OCaml bytecode to JavaScript. It makes it\npossible to run pure OCaml programs in JavaScript environment like browsers and\nNode.js.\n\n- It is easy to install and use as it works with an existing installation of\n  OCaml, with no need to recompile any library.\n- It comes with bindings for a large part of the browser APIs.\n- According to our benchmarks, the generated programs run typically faster than\n  with the OCaml bytecode interpreter.\n- We believe this compiler will prove much easier to maintain than a retargeted\n  OCaml compiler, as the bytecode provides a very stable API.\n\nJs_of_ocaml is composed of multiple packages:\n- js_of_ocaml-compiler, the compiler.\n- js_of_ocaml-ppx, a ppx syntax extension.\n- js_of_ocaml, the base library.\n- js_of_ocaml-ppx_deriving_json\n- js_of_ocaml-lwt, lwt support.\n- js_of_ocaml-tyxml, tyxml support.\n- js_of_ocaml-toplevel, lib and tools to build an OCaml toplevel to\n  JavaScript.\n- wasm_of_ocaml-compiler, [the Wasm_of_ocaml compiler](README_wasm_of_ocaml.md).\n\n## Requirements\n\nSee the\n[opam](https://github.com/ocsigen/js_of_ocaml/blob/master/js_of_ocaml-compiler.opam)\nfiles for version constraints.\n\nwasm_of_ocaml-compiler additionally depends on a system installation of binaryen (version 119 or later)\n\n## Supported engines\n\nThe generated code and runtime target ECMAScript 2020 (ES2020). Out of the box\nthey run on Node.js 18 or later and any evergreen web browser released since\nearly 2020 (Chrome 80+, Firefox 74+, Safari 13.4+, Edge 80+). QuickJS-NG is also\nsupported.\n\nWe optionally rely on js `WeakRef`, which is part of ECMAScript 2021, to implement `Stdlib.Weak` and `Stdlib.Ephemeron`.\nFor older engines, the output can be transpiled down to ES5 — see the\n[browser compatibility](https://ocsigen.org/js_of_ocaml/latest/manual/browser-compat) section of the manual.\n\n### Toplevel requirements\n\n- tyxml, reactiveData\n- ocp-indent: needed to support indentation in the toplevel\n- higlo: needed to support Syntax highlighting in the toplevel\n- cohttp: needed to build the toplevel webserver\n\n## Installation\n\n### Opam\n\n```\nopam install js_of_ocaml js_of_ocaml-compiler js_of_ocaml-ppx\n```\n\n## Usage\n\nYour program must first be compiled using the OCaml bytecode compiler `ocamlc`.\nJavaScript bindings are provided by the `js_of_ocaml` package. The syntax\nextension is provided by `js_of_ocaml-ppx` package.\n\n```\nocamlfind ocamlc -package js_of_ocaml -package js_of_ocaml-ppx -linkpkg -o cubes.byte cubes.ml\n```\n\nThen, run the `js_of_ocaml` compiler to produce JavaScript code:\n\n```\njs_of_ocaml cubes.byte\n```\n\n## Features\n\nMost of the OCaml standard library is supported. However,\n\n- Most of the Sys module is not supported.\n\nExtra libraries distributed with OCaml (such as Thread) are not supported in\ngeneral. However,\n\n- Bigarray: bigarrays are supported using Typed Arrays\n- Num: supported\n- Str: supported\n- Graphics: partially supported using canvas (see js_of_ocaml-lwt.graphics)\n- Unix: time related functions are supported\n\nTail call is not optimized in general. However, mutually recursive functions are\noptimized:\n\n- self recursive functions (when the tail calls are the function itself) are\n  compiled using a loop.\n- trampolines are used otherwise.\n  [More](https://ocsigen.org/js_of_ocaml/latest/js_of_ocaml/tailcall.html) about tail call\n  optimization.\n\nEffect handlers are supported with the `--effects={cps,double-translation}`\nflag.\n\n## Data representation\n\nData representation differs from the usual one. Most notably, integers are 32\nbits (rather than 31 bits or 63 bits), which is their natural size in\nJavaScript, and floats are not boxed. As a consequence, marshalling, polymorphic\ncomparison, and hashing functions can yield results different from usual:\n\n- marshalling floats might generate different output. Such output should not be\n  unmarshalled using the standard OCaml runtime (native or bytecode).\n- the polymorphic hash function will not give the same results on datastructures\n  containing floats;\n- these functions may be more prone to stack overflow.\n\n| OCaml | JavaScript |\n| ------------- | ------------- |\n| int   | number (32bit int)  |\n| int32 | number (32bit int)  |\n| nativeint | number (32bit int)  |\n| int64 | Object (MlInt64) |\n| float | number |\n| string | string or object (MlBytes) |\n| bytes | object (MlBytes) |\n| \"immediate\" (e.g. true, false, None, ()) | number (32bit int) |\n| \"block\" | array with tag as first element (e.g. `C(1,2) =\u003e [tag,1,2]`) |\n| array | block with tag 0 (e.g. `[\\|1;2\\|] =\u003e [0,1,2]`) |\n| tuple | block with tag 0 (e.g. `(1,2) =\u003e [0,1,2]`) |\n| record | block (e.g. `{x=1;y=2} =\u003e [0,1,2]`) |\n| constructor with arguments | block (e.g. `C (1, 2) =\u003e [tag,1,2]`) |\n| module | block |\n| exception and extensible variant | block or immediate |\n| function | function |\n\n\n\n## Toplevel\n\n- [OCaml 4.04.0+BER](http://ocsigen.github.io/js_of_ocaml/toplevel/#version=4.04.0+BER)\n  see http://okmij.org/ftp/ML/MetaOCaml.html\n- [OCaml 4.06.0](http://ocsigen.github.io/js_of_ocaml/toplevel/#version=4.06.0)\n  includes Base, Core_kernel, Async_kernel, Async_js\n\n## Contents of the distribution\n\n| Filename    | Description                                  |\n| ----------- | -------------------------------------------- |\n| LICENSE     | license and copyright notice                 |\n| README      | this file                                    |\n| compiler/   | compiler                                     |\n| examples/   | small examples                               |\n| lib/        | library for interfacing with JavaScript APIs |\n| ppx/        | ppx syntax extensions                        |\n| runtime/    | runtime system                               |\n| toplevel/   | web-based OCaml toplevel                     |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focsigen%2Fjs_of_ocaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focsigen%2Fjs_of_ocaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focsigen%2Fjs_of_ocaml/lists"}