AminetAminet
Search:
85205 packages online
About
Recent
Browse
Search
Upload
Setup
Services

dev/lang/NodeAmiga.lha

Mirror:Random
Showing: m68k-amigaos icongeneric icon
No screenshot available
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
Architecture:m68k-amigaos >= 2.0.4
Date:2026-03-25
Requires:68000+, 1 MB RAM, bsdsocket.library (for networking)
Download:dev/lang/NodeAmiga.lha - View contents
Readme:dev/lang/NodeAmiga.readme
Downloads:41

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


Contents of dev/lang/NodeAmiga.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[Amiga]                   1096    3034  36.1% -lh5- 3766 Mar 24 21:49 NodeAmiga/examples/array_fun.js
[Amiga]                   1182    3150  37.5% -lh5- 1a8b Mar 24 21:49 NodeAmiga/examples/buffer.js
[Amiga]                   1431    5426  26.4% -lh5- c117 Mar 24 21:49 NodeAmiga/examples/calculator.js
[Amiga]                    982    2821  34.8% -lh5- f646 Mar 24 21:49 NodeAmiga/examples/classes.js
[Amiga]                   1139    3231  35.3% -lh5- 4786 Mar 24 21:49 NodeAmiga/examples/closures.js
[Amiga]                    516    1194  43.2% -lh5- 4ea6 Mar 24 21:49 NodeAmiga/examples/download.js
[Amiga]                   1070    3068  34.9% -lh5- c202 Mar 24 21:49 NodeAmiga/examples/events.js
[Amiga]                    734    1951  37.6% -lh5- 1b80 Mar 24 21:49 NodeAmiga/examples/fibonacci.js
[Amiga]                   1014    2567  39.5% -lh5- 8170 Mar 24 21:49 NodeAmiga/examples/file_io.js
[Amiga]                    833    2193  38.0% -lh5- b184 Mar 24 21:49 NodeAmiga/examples/gui_demo.js
[Amiga]                    398     702  56.7% -lh5- 1454 Mar 24 21:49 NodeAmiga/examples/gui_hello.js
[Amiga]                    598    1415  42.3% -lh5- ff7f Mar 24 21:49 NodeAmiga/examples/hello.js
[Amiga]                    763    2145  35.6% -lh5- 6c82 Mar 24 21:49 NodeAmiga/examples/http_client.js
[Amiga]                   1077    2894  37.2% -lh5- f64d Mar 24 21:49 NodeAmiga/examples/http_server.js
[Amiga]                   1516    4783  31.7% -lh5- c8a7 Mar 24 21:49 NodeAmiga/examples/json_db.js
[Amiga]                   1269    3404  37.3% -lh5- dc7b Mar 24 21:49 NodeAmiga/examples/mini_grep.js
[Amiga]                    609    1346  45.2% -lh5- 0db5 Mar 24 21:49 NodeAmiga/examples/myip.js
[Amiga]                    829    1960  42.3% -lh5- ec37 Mar 24 21:49 NodeAmiga/examples/nettime.js
[Amiga]                   1105    3330  33.2% -lh5- 5242 Mar 24 21:49 NodeAmiga/examples/promises.js
[Amiga]                   1341    3300  40.6% -lh5- de0d Mar 24 21:49 NodeAmiga/examples/regex.js
[Amiga]                    949    3002  31.6% -lh5- 0cd7 Mar 24 21:49 NodeAmiga/examples/streams.js
[Amiga]                   1034    2982  34.7% -lh5- fe72 Mar 24 21:49 NodeAmiga/examples/sysinfo.js
[Amiga]                    832    2523  33.0% -lh5- 802b Mar 24 21:49 NodeAmiga/examples/timers.js
[Amiga]                   1078    2952  36.5% -lh5- 1bc1 Mar 24 21:49 NodeAmiga/examples/todo_app.js
[Amiga]                   1239    3162  39.2% -lh5- 3470 Mar 24 21:49 NodeAmiga/examples/url_parser.js
[Amiga]                    686    1596  43.0% -lh5- da4d Mar 24 21:49 NodeAmiga/examples/weather.js
[Amiga]                    349    1675  20.8% -lh5- 3360 Mar 24 21:49 NodeAmiga/libs/assert.js
[Amiga]                    862    3445  25.0% -lh5- a260 Mar 24 21:49 NodeAmiga/libs/events.js
[Amiga]                    719    2263  31.8% -lh5- ab6b Mar 24 21:49 NodeAmiga/libs/path.js
[Amiga]                   1137    3669  31.0% -lh5- a120 Mar 24 21:49 NodeAmiga/libs/querystring.js
[Amiga]                    726    1734  41.9% -lh5- 1232 Mar 24 21:49 NodeAmiga/libs/repl.js
[Amiga]                   1319    6375  20.7% -lh5- b0b0 Mar 24 21:49 NodeAmiga/libs/stream.js
[Amiga]                   1779    6756  26.3% -lh5- e2cc Mar 24 21:49 NodeAmiga/libs/url.js
[Amiga]                   1790    7346  24.4% -lh5- e9ea Mar 24 21:49 NodeAmiga/libs/util.js
[Amiga]                  97648  191044  51.1% -lh5- ff6e Mar 24 21:49 NodeAmiga/NodeAmiga
[Amiga]                  97298  189216  51.4% -lh5- 899c Mar 24 21:49 NodeAmiga/NodeAmiga_020
[Amiga]                  95885  188856  50.8% -lh5- a836 Mar 24 21:49 NodeAmiga/NodeAmiga_040
[Amiga]                  95240  187452  50.8% -lh5- 09ff Mar 24 21:49 NodeAmiga/NodeAmiga_060
[Amiga]                   1678    5180  32.4% -lh5- 6317 Mar 24 21:49 NodeAmiga/test/benchmark.js
[Amiga]                  13127   47888  27.4% -lh5- f735 Mar 24 21:49 NodeAmiga/test/test.js
[Amiga]                    612    2036  30.1% -lh5- 0a32 Mar 24 21:49 NodeAmiga/test/test_async.js
[Amiga]                    147     225  65.3% -lh5- de8e Mar 24 21:49 NodeAmiga/test/test_module.js
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total        42 files  435636  915291  47.6%            Mar 25 08:14
Page generated in 0.02 seconds
Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>