A complete JavaScript engine and runtime environment for classic
Amiga computers. Built from scratch in C, targeting MC68000 and
AmigaOS 2.0+. Inspired by Node.js, adapted for the Amiga platform.
Features
--------
* JavaScript engine (ES5.1 + ES6+ features)
- Arrow functions, classes with inheritance, super(), static methods
- Template literals, tagged templates
- Destructuring, spread/rest, default parameters
- for-of loops, regex literal syntax /pattern/flags
- Optional chaining (?.), nullish coalescing (??)
- let/const block scoping, numeric separators
- async/await, Promises
- Automatic Semicolon Insertion (ASI)
- Closures, prototype chain
* Built-in objects and functions
- console (log, error, warn, dir, time/timeEnd, table)
- Math (27 functions incl. cbrt/fround/clz32/imul)
- JSON (with reviver/replacer)
- Date (full API incl. UTC, getUTC*/setUTC*)
- RegExp (lookahead, non-capturing groups, quantifiers,
lazy quantifiers, named groups, flags g/i/m/s/u/y)
- Buffer (hex/base64)
- Promise (then/catch/finally/all/race/allSettled)
- Map, Set, WeakMap, WeakSet, Symbol
- setTimeout/setInterval/clearTimeout
- crypto (MD5, SHA-256), structuredClone
- TextEncoder, TextDecoder
- process.stdout.write, process.stdin.read
- process.hrtime, process.nextTick, queueMicrotask
* String methods: 29+ (charAt, indexOf, slice, split,
replace, replaceAll, trim, includes, startsWith,
padStart, normalize, localeCompare, codePointAt, etc.)
* Array methods: 33+ (push, pop, map, filter, reduce,
reduceRight, sort, find, findLast, findLastIndex,
forEach, every, some, splice, flat, flatMap, entries,
keys, values, copyWithin, at, Array.from/of/isArray)
* Object: keys, values, entries, assign, create, freeze,
seal, is, fromEntries, defineProperty/ies, hasOwn,
getPrototypeOf, setPrototypeOf, getOwnPropertyNames,
getOwnPropertyDescriptor(s), preventExtensions,
isExtensible, getters/setters
* Number: isInteger, isFinite, isNaN, isSafeInteger,
parseInt, parseFloat, toString(radix), toFixed,
toExponential, toPrecision, constants (EPSILON,
MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, NaN, Infinity)
* Global functions: encodeURIComponent, decodeURIComponent,
encodeURI, decodeURI, parseInt, parseFloat, isNaN,
isFinite, eval()
* Symbol: Symbol(), Symbol.for/keyFor, well-known symbols,
Symbol as property key, Iterator protocol (Symbol.iterator)
* Amiga Intuition GUI bindings
- Open windows with title, size, position
- Graphics: lines, rectangles, circles, text, pixels
- Mouse and keyboard event handling
- System requesters (alert, confirm)
- Screen information query
* Node.js-compatible module system
- require() with module caching
- CommonJS exports (module.exports)
- ES modules: import/export (default, named, namespace)
- Native modules: fs, http, net, buffer, os,
child_process, crypto, intuition, readline, dns
- JS modules: path, events, url, querystring, util,
stream, assert, repl, timers
* File I/O (fs module)
- readFileSync, writeFileSync, appendFileSync
- existsSync, unlinkSync, renameSync, statSync
- readdirSync, mkdirSync, rmdirSync, copyFileSync
- Full AmigaOS path support (Volume:dir/file)
* HTTP/HTTPS server and client
- http.createServer() — non-blocking, 8 concurrent
- http.get(), http.post(), http.request()
- HTTPS via AmiSSL (build with -DENABLE_AMISSL)
- Automatic redirect following (301/302/307)
- 10-second socket timeout, dns.lookup()
- Requires bsdsocket.library (e.g. Roadshow, Miami)
* OS integration
- process.platform ("amigaos"), process.arch ("m68k")
- process.argv, process.env, process.cwd(), process.exit
- os.cpus() (detects 68000/020/030/040/060)
- os.freemem(), os.version() (Kickstart version)
- child_process.execSync() via SystemTagList()
* Interactive REPL with command history (arrow up/down)
* Error types: Error, TypeError, RangeError, ReferenceError,
SyntaxError, EvalError, URIError
* Error messages with filename and line number
* Compiler: bundle JS + interpreter into standalone executable
- NodeAmiga -compile MyApp script.js
- Automatic require() and import dependency resolution
- All JS modules bundled into single executable
- No NodeAmiga, no libs/ needed to run the output
Usage
-----
NodeAmiga script.js Execute a JavaScript file
NodeAmiga -e "code" Evaluate inline JavaScript
NodeAmiga -compile out script Compile JS to standalone executable
NodeAmiga Start interactive REPL
NodeAmiga -help Show help
NodeAmiga -v Show version
NodeAmiga --ast script.js Print AST (debug)
Installation
------------
1. Copy NodeAmiga to C: or any directory in your path
2. Copy the libs/ directory to PROGDIR: (same directory
as NodeAmiga), or to LIBS:node/
3. Optional: copy examples/ for demo scripts
Quick test:
NodeAmiga -e "console.log('Hello Amiga!')"
NodeAmiga examples/hello.js
NodeAmiga examples/gui_hello.js
NodeAmiga examples/fibonacci.js
Compile to standalone exe:
NodeAmiga -compile Hello examples/hello.js
Hello
; Runs without NodeAmiga or libs/ !
System Requirements
-------------------
* MC68000 or higher CPU
* AmigaOS 2.04 (Kickstart 37) or higher
* Minimum 1 MB RAM (2+ MB recommended for scripts)
* bsdsocket.library for networking features
(Roadshow, Miami, AmiTCP, or similar)
* No FPU required (software floating-point)
Technical Details
-----------------
* Engine: custom-built lexer, recursive descent parser
with Pratt precedence climbing, tree-walking interpreter
* Memory: reference counting (no GC pauses), arena
allocator for AST, integer cache 0-255
* Stack: auto-allocates 64 KB via StackSwap
Included Examples
-----------------
hello.js Platform info and greeting
fibonacci.js Recursive/iterative/memoized benchmark
file_io.js File read/write/append operations
http_server.js HTTP server with routing
http_client.js HTTP GET and POST requests
classes.js ES6 classes with inheritance
closures.js Closures, IIFE, module pattern
array_fun.js map/filter/reduce/sort with real data
regex.js RegExp /literal/ syntax and methods
events.js EventEmitter custom events
promises.js Promise chains, all, race
timers.js setTimeout and setInterval
buffer.js Binary data manipulation
streams.js Readable/Writable/Transform streams
sysinfo.js Full system information display
todo_app.js TODO app with file persistence
mini_grep.js Pattern search in files
url_parser.js URL and query string parsing
calculator.js Recursive descent expression parser
json_db.js JSON file-based database
myip.js Fetch public IP from internet
nettime.js Internet time via HTTP API
weather.js Weather info for a city
download.js Download file and save to disk
gui_hello.js Simplest Intuition window from JS
gui_demo.js Interactive drawing with mouse events
Known Limitations
-----------------
* No Proxy, generators/yield
* await is synchronous (spin-waits on event loop)
Version History
---------------
0.11.0 (2026-03-26)
- NEW: fs.readdirSync, mkdirSync, rmdirSync, copyFileSync
- NEW: Array: reduceRight, entries, keys, values,
findLast, findLastIndex, copyWithin
- NEW: Object: getOwnPropertyNames, hasOwn, getPrototypeOf,
getOwnPropertyDescriptor(s), setPrototypeOf,
preventExtensions, isExtensible, isPrototypeOf,
propertyIsEnumerable
- NEW: Number.prototype.toExponential, toPrecision
- NEW: Math: cbrt, fround, clz32, imul + constants
- NEW: String: codePointAt, fromCodePoint, localeCompare,
normalize, raw, replace with callback
- NEW: encodeURI/decodeURI, encodeURIComponent/decodeURIComponent
- NEW: console.dir (JSON-formatted output)
- NEW: ES modules (import/export) with default, named, namespace
- NEW: RegExp: {n}/{n,}/{n,m} quantifiers, lazy (*?/+?/??),
non-capturing groups (?:), lookahead (?=)/(?!),
named groups (?<name>), flags s/u/y
- NEW: Symbol as property key, Iterator protocol
- NEW: eval() global function
- NEW: EvalError, URIError error types
- NEW: Date.UTC(), getUTC*/setUTC* (15 methods)
- NEW: Class static methods
- NEW: Destructuring assignment without var/let/const
- NEW: Compiler (-compile) — bundle JS into standalone executable
- FIX: Function.prototype.bind() partial application
- FIX: ES module export function declarations
- FIX: instanceof Error for all Error subtypes
- Tests: 960+ assertions covering all features
- FIX: String.fromCharCode, Number.isInteger/isFinite/
isNaN/isSafeInteger now work correctly
- FIX: Number.prototype.toString(radix) for hex/bin/oct
- FIX: querystring.unescape percent decoding
- Removed 68040/68060 builds (focus on 68000/68020)
- HTTPS support via AmiSSL
- Interactive REPL with readline and history
- Buffer hex/base64 encoding
- Tagged template literals
- Promise chain fixes
Credits
-------
Juen/Project R3D+Appendix+Nah-Kolor
|