cwise-compiler is the internal compiler component of the cwise library for ndarray-optimized operations. Version 1.1.3 is the current stable release. It provides a lower-level API to compile cwise procedures directly, bypassing the parser (cwise-parser) and esprima. This package is intended for advanced users who need to skip the standard cwise interface. It compiles a procedure object containing parsed pre, body, and post functions into optimized JavaScript. The main differentiator is its role as a core piece of the cwise ecosystem, offering a minimal, direct compilation path for ndarray operations.
npm install cwise-compilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates compiling a simple procedure that adds one to each element of an ndarray.
Ensure procedure object includes all required fields: args, pre, body, post, funcName, blockSize, debug.
Use cwise package instead of calling cwise-compiler directly.
Use cwise-parser to parse raw function strings into the required format, or ensure you provide correctly structured objects.
Match the args array to the types and order of arrays passed to the compiled function.
Check that the procedure object has correctly formed pre, body, post sub-objects each with a 'body' string property.
Ensure args is an array of strings like 'array', 'scalar', 'index', 'shape', etc., as defined by cwise.
Add 'a' to the localVars array of the corresponding pre/body/post object, or ensure it's an argument.