SEALang
raw JSON → 1.0.5 verified Fri May 01 auth: no javascript
SEALang is a superset of Perl5 with static typing, transpiled to Perl5 via Node.js. Version 1.0.5 (latest) is in early active development with a focus on adding static typing and modern features to Perl. It provides a schema API to generate Perl5 code for a compiler, but is not yet stable for production use. Key differentiators: brings static typing to Perl5, uses JavaScript/Node for tooling, and provides object-oriented primitives like Map, Array, Hash, and Scalar.
Common errors
error Cannot find module 'sealang' ↓
cause Package not installed or module path incorrect.
fix
Run
npm install sealang and ensure node_modules is in the correct directory. error TypeError: SEASchema is not a constructor ↓
cause Importing SEASchema without destructuring (e.g., const SEASchema = require('sealang'))
fix
Use const { SEASchema } = require('sealang');
error SyntaxError: Unexpected token 'export' ↓
cause Attempting to import using ES module syntax in a CommonJS context.
fix
Use require() instead of import.
Warnings
gotcha Package is in early development; API may break without major version bump. ↓
fix Pin to exact version and test upgrades thoroughly.
breaking ES module imports are not supported; only CommonJS require works. ↓
fix Use `const { ... } = require('sealang')` instead of `import`.
gotcha Documentation is sparse; source code may be the only reference for advanced usage. ↓
fix Read the GitHub source files for API details.
deprecated The roadmap includes items marked as done but those features may still be unstable. ↓
fix Test each feature in isolation before relying on it.
Install
npm install sealang yarn add sealang pnpm add sealang Imports
- SEASchema wrong
import { SEASchema } from 'sealang'; // Not a standard ES modulecorrectconst { SEASchema } = require('sealang'); - SEACompiler wrong
import SEACompiler from 'sealang';correctconst { SEACompiler } = require('sealang'); - exportSEA wrong
const exportSEA = require('sealang/export'); // Wrong pathcorrectconst { exportSEA } = require('sealang');
Quickstart
const { SEASchema, SEACompiler } = require('sealang');
const schema = new SEASchema();
schema.addRoutine('hello', () => {
console.log('Hello, SEALang!');
});
const compiler = new SEACompiler(schema);
const perlCode = compiler.compile();
console.log(perlCode);