Paperclip Interim Compiler

raw JSON →
18.3.8 verified Fri May 01 auth: no javascript

Interim compiler step for Paperclip, a visual programming language. Current stable version 18.3.8. Acts as an intermediate representation layer between Paperclip engines and output compilers like React. Bundles AST transformations and provides a uniform interface for compiler backends. Differentiates by being part of the Paperclip ecosystem, designed for multi-target code generation with a focus on UI components. Release cadence is tied to Paperclip monorepo releases, roughly monthly.

error TypeError: InterimCompiler is not a constructor
cause Using CommonJS require() in ESM-only package.
fix
Use import { InterimCompiler } from 'paperclip-interim' or ensure your module system is ESM.
error Cannot find module 'paperclip-interim'
cause Package not installed or missing from dependencies.
fix
Run npm install paperclip-interim@18.3.8
gotcha InterimCompiler constructor expects an engine instance; passing a string will throw silently.
fix Ensure first argument is a compatible Paperclip engine object.
gotcha toString() method may produce undefined if not preprocessed; check engine state.
fix Run engine's compile() before accessing InterimCompiler's output methods.
deprecated InterimCompiler.serialize() is deprecated in v18, use toString() instead.
fix Replace serialize() calls with toString().
npm install paperclip-interim
yarn add paperclip-interim
pnpm add paperclip-interim

Shows basic usage of InterimCompiler with an existing engine and serialization of the intermediate representation.

import { InterimCompiler } from 'paperclip-interim';
import { existingEngine } from './engine'; // hypothetical

const compiler = new InterimCompiler(existingEngine);
console.log(compiler.toString()); // serialized IR