Registry / serialization / samalang-compiler

samalang-compiler

JSON →
library1.3.0jsnpmunverified

The Samala Compiler compiles the Samawa programming language into Lua. Version 1.3.0 is the latest stable release. It transpiles Samawa code to Lua, enabling execution in Lua environments. Active development is uncertain due to limited community engagement and documentation. Key differentiators include targeting the niche Samawa language, which is designed for simplicity and embedding in Lua projects.

npm install samalang-compiler
INSTALL
IMPORT
SIG · SAMALANG-COMPILER
S
samalang-compiler
serializationjavascriptv1.3.0
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.

compile
import { compile } from 'samalang-compiler'
const { compile } = require('samalang-compiler')
ESM-only; use import syntax.
compileFile
import { compileFile } from 'samalang-compiler'
import compileFile from 'samalang-compiler/compileFile'
Use named import, not default import from subpath.
default
import Samalang from 'samalang-compiler'
const Samalang = require('samalang-compiler').default
Default export wraps all compiler utilities.

Compiles a simple Samawa print statement to Lua and logs the result.

import { compile } from 'samalang-compiler'; const luaCode = compile('print "Hello, Samala!"'); console.log(luaCode);
samalang-compiler --version
Debug
Known issues
deprecatedcompileFile() is deprecated; use compile with file contents instead.
fix
Read file manually and pass contents to compile().
affects: >=1.2.0
breakingVersion 1.0.0 changed output syntax from Lua 5.1 to 5.3.
fix
Ensure your Lua runtime supports Lua 5.3 features.
affects: >=1.0.0
gotchaStrings in Samawa must be double-quoted; single quotes cause parse errors.
fix
Always use double quotes for string literals.
affects: all
Errors
Common errors & fixes
SyntaxError: Unexpected token ';' at line 1
Using semicolons in Samawa code, which are not supported.
fix
Remove semicolons; they are optional and cause parse errors.
TypeError: compile is not a function
Importing incorrectly as default instead of named export.
fix
Use import { compile } from 'samalang-compiler'.
Upgrade
Version history
1.3.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
samalang-compiler — npm install samalang-compiler · libregistry