{"id":26354,"library":"sai-language","title":"SAI","description":"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.","status":"active","version":"0.2.8","language":"javascript","source_language":"en","source_url":"https://github.com/seanmpuckett/sai","tags":["javascript","transpiler","sai","language"],"install":[{"cmd":"npm install sai-language","lang":"bash","label":"npm"},{"cmd":"yarn add sai-language","lang":"bash","label":"yarn"},{"cmd":"pnpm add sai-language","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required runtime for compiled SAI modules; provides core language constructs.","package":"sai-library","optional":true}],"imports":[{"note":"The package is CommonJS-only; ESM imports are not supported.","wrong":"import sai from 'sai-language';","symbol":"default","correct":"const sai = require('sai-language');"},{"note":"There is no named export; the entire API is on the default export object.","wrong":"const { SAI, compile, run } = require('sai-language');","symbol":"SAI namespace","correct":"const sai = require('sai-language');"},{"note":"sai-build is a CLI tool, not a programmatic API. Use shell execution.","wrong":"require('sai-build');","symbol":"sai-build CLI","correct":"const { exec } = require('child_process'); exec('npx sai-build', ...);"},{"note":"sai-run is a separate CLI (part of sai-language package) but invoked from shell, not require().","wrong":"import { run } from 'sai-language';","symbol":"sai-run CLI","correct":"const { exec } = require('child_process'); exec('npx sai-run HelloWorld', ...);"}],"quickstart":{"code":"// HelloWorld.sai\nobject HelloWorld main 1.0.0\n\nInstantiate task\n  debug 'Hello world!'\n\n// Terminal:\n// $ npx sai-run HelloWorld\n// Hello world!","lang":"javascript","description":"Creates a minimal SAI object with a main task that prints 'Hello world!', then runs it with the CLI."},"warnings":[{"fix":"Use only spaces (2 or 4) and ensure consistent indentation per file.","message":"SAI is whitespace-sensitive: indenting must be consistent (spaces only, no tabs). Mixing tabs and spaces causes parse errors.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Edit only .sai source files; run sai-build to regenerate .js files.","message":"SAI transpiled JS is not human-readable; do not modify the generated .js files, as they are overwritten on next build.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use sai-build to pre-compile, then require the generated .js files directly.","message":"Dynamic mode (compiling .sai at runtime via `require('sai-language')`) may have performance penalty. Prefer build-time compilation.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Use line comments `//` exclusively.","message":"Comments in SAI use `//` only; `/* */` block comments are not supported in all versions.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install sai-language --save-dev (or global install with -g).","cause":"sai-language not installed globally or locally.","error":"Cannot find module 'sai-language'"},{"fix":"Ensure first line matches: object ObjectName main MAJOR.MINOR.PATCH (e.g., object HelloWorld main 1.0.0).","cause":"Misformed SAI source header; missing version or invalid syntax after 'object'.","error":"SyntaxError: Expected 'object', got something else"},{"fix":"const sai = require('sai-language');","cause":"Attempting to use `require('sai-language')` but not assigned to a variable.","error":"ReferenceError: sai is not defined"},{"fix":"sai-build does not take --output; it transpiles in-place. Use --help for available options.","cause":"Using sai-build with an unsupported flag.","error":"Error: Unknown option '--output'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}