Registry / sai-language

sai-language

JSON →
library0.2.8jsnpmunverified

SAI is a whitespace-sensitive, object-oriented programming language that transpiles in-place to JavaScript for the Node.js environment. Current version 0.2.8 (released sporadically, last update 2021). It emphasizes code readability, maintainability, and asynchronous constructs (Promises, finite state machines). Unlike CoffeeScript, SAI is an independent language with rigid parsing, collection manipulators, and compile-time sanity checks. It can be used in dynamic mode (runtime compilation via `sai-language` package) or build-time mode (`sai-build` + `sai-library` runtime). Suitable for Node.js only; not yet browser-ready.

npm install sai-language
INSTALL
IMPORT
SIG · SAI-LANGUAGE
S
sai-language
javascriptv0.2.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const sai = require('sai-language');
import sai from 'sai-language';
The package is CommonJS-only; ESM imports are not supported.
SAI namespace
const sai = require('sai-language');
const { SAI, compile, run } = require('sai-language');
There is no named export; the entire API is on the default export object.
sai-build CLI
const { exec } = require('child_process'); exec('npx sai-build', ...);
require('sai-build');
sai-build is a CLI tool, not a programmatic API. Use shell execution.
sai-run CLI
const { exec } = require('child_process'); exec('npx sai-run HelloWorld', ...);
import { run } from 'sai-language';
sai-run is a separate CLI (part of sai-language package) but invoked from shell, not require().

Creates a minimal SAI object with a main task that prints 'Hello world!', then runs it with the CLI.

// HelloWorld.sai object HelloWorld main 1.0.0 Instantiate task debug 'Hello world!' // Terminal: // $ npx sai-run HelloWorld // Hello world!
sai --version
Debug
Known issues
breakingSAI is whitespace-sensitive: indenting must be consistent (spaces only, no tabs). Mixing tabs and spaces causes parse errors.
fix
Use only spaces (2 or 4) and ensure consistent indentation per file.
affects: >=0.1.0
gotchaSAI transpiled JS is not human-readable; do not modify the generated .js files, as they are overwritten on next build.
fix
Edit only .sai source files; run sai-build to regenerate .js files.
affects: >=0.1.0
deprecatedDynamic mode (compiling .sai at runtime via `require('sai-language')`) may have performance penalty. Prefer build-time compilation.
fix
Use sai-build to pre-compile, then require the generated .js files directly.
affects: >=0.2.0
gotchaComments in SAI use `//` only; `/* */` block comments are not supported in all versions.
fix
Use line comments `//` exclusively.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'sai-language'
sai-language not installed globally or locally.
fix
npm install sai-language --save-dev (or global install with -g).
SyntaxError: Expected 'object', got something else
Misformed SAI source header; missing version or invalid syntax after 'object'.
fix
Ensure first line matches: object ObjectName main MAJOR.MINOR.PATCH (e.g., object HelloWorld main 1.0.0).
ReferenceError: sai is not defined
Attempting to use `require('sai-language')` but not assigned to a variable.
fix
const sai = require('sai-language');
Error: Unknown option '--output'
Using sai-build with an unsupported flag.
fix
sai-build does not take --output; it transpiles in-place. Use --help for available options.
Upgrade
Version history
0.2.8latest on npm
Audit
Dependencies
sai-libraryoptionalRequired runtime for compiled SAI modules; provides core language constructs.
Agent activity
2 hits · last 30 days
node
2
Resources
sai-language — npm install sai-language · libregistry