ClojureScript JavaScript Interop: Using js/ and clj->js Safely
Practical guidance for calling JavaScript from ClojureScript using the js/ prefix and converting data with clj->js.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Practical guidance for calling JavaScript from ClojureScript using the js/ prefix and converting data with clj->js.
Learn how to expose ClojureScript functions to plain JavaScript using ^:export, see a concrete example, and understand the trade‑offs with dead‑code elimination.
PureScript's foreign import lets you call JavaScript with typed signatures, but the compiler never inspects the JS body. Learn how to treat FFI as an untrusted boundary and validate at the edges.
PureScript’s Foreign Function Interface lets you call JavaScript from pure code. This post walks through declaring imports, writing the JS side, bundling, and testing the boundary—plus the trade‑offs you should know.
Learn how to manage WebAssembly linear memory to exchange strings and complex data between JavaScript and Wasm modules using allocation pointers and byte buffers.
Learn how externs files keep external JavaScript names intact during ClojureScript's advanced compilation, letting you shrink bundles without breaking third‑party APIs.
Learn how ClojureScript's :advanced compilation shrinks production bundles through dead‑code elimination and symbol renaming, while keeping JavaScript interop reliable via :foreign-libs and careful export handling.
Step‑by‑step guide to diagnose and fix PureScript FFI runtime errors such as 'Foreign import failed' by checking annotations, exports, arity, and bundle inclusion.
A practical look at using PyScript for browser-based Python including a worked example of pyscope interop and key limitations to consider before committing