Short: JavaScript runtime (Node.js-like) Author: Juen/Project R3D+Appendix+Nah-Kolor Uploader: biuro cdlabel info (Pawel Nowak) Type: dev/lang Version: 0.8.0 Requires: 68000+, 1 MB RAM, bsdsocket.library (for networking) Architecture: m68k-amigaos >= 2.0.4 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 - Template literals, destructuring, spread/rest - for-of loops, default parameters - 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, time/timeEnd, assert) - Math (18 functions), JSON (with reviver/replacer) - Date, RegExp, Buffer, Error (with stack traces) - Promise (then/catch/finally/all/race/allSettled/any) - Map, Set, WeakMap, WeakSet, Symbol - setTimeout/setInterval/clearTimeout - crypto (MD5, SHA-256 hashing) - process.nextTick, queueMicrotask * String methods: 25+ (charAt, indexOf, slice, split, replace, trim, includes, startsWith, padStart, etc.) * Array methods: 28+ (push, pop, map, filter, reduce, sort, find, forEach, every, some, splice, flat, etc.) * Object: keys, values, entries, assign, create, freeze, seal, is, fromEntries, defineProperty/ies, getPrototypeOf, getters/setters * 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) - Native modules: fs, http, net, buffer, os, child_process, crypto, intuition - JS modules: path, events, url, querystring, util, stream, assert, repl * File I/O (fs module) - readFileSync, writeFileSync, appendFileSync - existsSync, unlinkSync, renameSync, statSync - Full AmigaOS path support (Volume:dir/file) * HTTP server and client - http.createServer() ? non-blocking, 8 concurrent - http.get(), http.post(), http.request() - Automatic redirect following (301/302/307) - 10-second socket timeout - 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 messages with filename and line number Usage ----- NodeAmiga script.js Execute a JavaScript file NodeAmiga -e "code" Evaluate inline JavaScript 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 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 ES modules (import/export), use require() * No Proxy, generators/yield * No tagged template literals * HTTPS: detects AmiSSL, full integration planned * WeakMap/WeakSet: no true weak refs (refcounting) * await is synchronous (spin-waits on event loop) Credits ------- Juen/Project R3D+Appendix+Nah-Kolor