The September checkpoint made the stated floor true — an ES2020 engine, Node 12 — and deliberately went no further. This is the reverse question: what in Amber is the way it is because the floor used to be lower, now that the reason is gone; and what, among the things that look that way, is not that at all.
Read in full: lang/base (the hand-written kernel), the 330 inlineJS: bodies of the image
(22.8 KB inside 513 KB of .st), the compiler's JS emitter (IRJSTranslator and JSStream
in Compiler-IR.st, Compiler-Inlining.st), the exporters and transports
(Platform-ImportExport.st), the collection, promise, exception, platform and
infrastructure classes, sdk/, cli/, the scaffold, both Gruntfiles, the pages, the
release scripts, CI. Measured on this checkout on 2026-10-16 (Node 24.18.0 and 14.21.3,
Windows 11); dates from git log -S; registry facts from npm view. Companion to
ANALYSIS-2026-08.md (architecture, boot cost, the sail direction) and
ANALYSIS-2026-09-honest-checkpoint.md (the floor). Engine-support versions quoted below
are MDN compatibility data and the Node changelogs as the author knows them; the ones that
decide anything are stated with their numbers so they can be rechecked.
Three kinds of "archaic" turned up, and they want three different treatments.
Dictionary and Set scanning linearly because objects could not be hashed before
Map and WeakMap — measured: 8,000 object keys take 5 s where Map takes 1 ms
(§2.3); newWithValues: built on the ES5 Object.create + apply trick, which
cannot instantiate an ES2015 class or Promise (§2.3); and a handful of Node APIs
from 2011–2013 — new Buffer, fs.exists, url.parse, callback-wrapped promise chains
(§2.4).grunt deploy minifies with UglifyJS 2, so
the first ES2015 token in any emitted code — kernel, compiled package, inlineJS: body,
generated parser — costs those projects their minification until that minifier is
replaced. That is the first domino; everything syntax-shaped waits behind it.inherits over class,
prototype-chained method dictionaries over Map, the $early throw,
hasOwnProperty.call (Object.hasOwn is ES2022, above the floor), #{} being a plain
JS object, kernel-checks.js in ES5. §5 lists them so that nobody "fixes" them.Two facts about the floor itself fell out and belong on the record (§1). Node 12 has no
?. and no ?? (V8 8.0 arrived with Node 14), so the ES2020 syntax the lint level
permits (esversion: 11) is not available on the declared Node floor: "ES2020-capable" is,
in practice, ES2019 syntax plus the ES2020 APIs. And the browser versions the floor names
are the globalThis ones, which predate Promise.allSettled, String.matchAll, BigInt
on Safari (14) and dynamic import() on Firefox (67). Nothing in the tree is wrong because
of this today; it decides what new code may use. Since then the floor is Node 14 (§7,
item 7), which has both operators; the bound moved to r.js, whose parser stops at ES2017
(§4.1).
The module system (AMD → ESM) is the largest item and the least urgent (§3): everything AMD
does for Amber has an ESM equivalent inside the floor, except bare-specifier resolution on
the unbundled development page (import maps: 2023 browsers) and the siblings' shims for
jQuery UI, Bootstrap 3 and CodeMirror 5. The August roadmap puts ESM after packages-as-data,
and the reason still holds: data packages have no module format, which shrinks the ESM
question to the ten hand-written files.
Recommended order (§7): minifier swap → peggy → Node hygiene → hashing → prototype-chain insertion → decide the floor nuance → optional syntax raises → ESM after sail.
"ES2020-capable, Node 12, Chrome/Edge 79+ (Chrome 71+), Firefox 65+, Safari 12.1+" names
the engines that have globalThis. What else those engines have:
| feature | ES | Node 12 | Chrome 71 | Firefox 65 | Safari 12.1 |
|---|---|---|---|---|---|
class, arrows, let/const, template literals, destructuring, rest/spread, generators, Map/Set/WeakMap/Symbol/Proxy/Reflect, Promise, Array.from, Object.assign |
2015 | yes | yes | yes | yes |
**, Array.prototype.includes |
2016 | yes | yes | yes | yes |
async/await, Object.entries/values, padStart/padEnd |
2017 | yes | yes | yes | yes |
object rest/spread, async iteration, Promise.prototype.finally |
2018 | yes | yes | yes | yes |
regex lookbehind, named groups, s flag, property escapes |
2018 | yes | yes | 78 | 11.1 / lookbehind 16.4 |
Array.prototype.flat/flatMap, Object.fromEntries, trimStart/trimEnd, optional catch binding, stable sort |
2019 | yes | yes (fromEntries 73) |
yes | yes |
globalThis |
2020 | yes | yes | yes | yes |
dynamic import() |
2020 | 12.17 | yes (63) | 67 | yes (11.1) |
BigInt |
2020 | yes (10.4) | yes (67) | 68 | 14 |
Promise.allSettled |
2020 | 12.9 | 76 | 71 | 13 |
String.prototype.matchAll |
2020 | yes | 73 | 67 | 13 |
?. and ?? |
2020 | 14.0 | 80 | 74 | 13.1 |
export * as ns from |
2020 | yes | 72 | 80 | 14.1 |
| import maps (HTML, not ES) | — | — | 89 (2021) | 108 (2022) | 16.4 (2023) |
Object.hasOwn, at(), WeakRef, structuredClone, Error.cause, node:test, fetch in Node |
2021+ | 16–18 | 92+ | 90+ | 15+ |
Bold is above the stated floor. Consequences:
?., not ??. .jshintrc's esversion: 11 is one notch too permissive; the honest
lint level for the Node 12 floor is esversion: 10, or the floor moves to Node 14 /
2020 browsers (Chrome 80, Firefox 74, Safari 13.1), which is where every ES2020 feature
actually lives. Node 12 has been end-of-life since 2022-04; nothing on this machine runs
it (14 is the lowest here); CI exercises the built runner on node:12. A one-line
decision; it gates §2.1 and §3..st or kernel regexes while Firefox 65
and Safari 12.1 are the floor; nothing uses them today (Kernel-Collections.st's regexes
are all ES5).Promise.allSettled, matchAll and BigInt are the
ones that need a two-to-four-version nudge; kernel-checks.js probes none of them and
nothing uses them, so the statement stays honest as long as that remains so.Math.log1p (ES2015) is used by Number >> ln1p since 2018-04-19 (832734f7) and
is in neither the checkpoint's requirement table nor the kernel-checks probes. Same
class of fact as Number.isFinite; every engine with globalThis has it; worth a line
in the probe list for the same reason Number.isFinite got one.The development floor is a different number and already is: grunt 1.6 needs Node 16, so
amber init (which runs npm run init → grunt) effectively needs Node 16 while @ambers/cli
declares >=12. Saying "runtime Node 12, development Node 16+" would be more honest than
the single number, and it is what makes 2023-browser import maps acceptable for the
development page later (§3.3).
Each item: where, what, when it was written and why, what the floor now allows, what the change buys, verdict.
lang/base)| where | what | since | the reason, and whether it is gone |
|---|---|---|---|
kernel-runtime.js:163-169 copySuperclass, :115-117 selectorsAdded fan-out, :256-266 the detached-root branch of propagateMethodChange |
copies every selector onto each detached root's prototype, forever | 2012-11-09 (89881034) |
no reliable Object.setPrototypeOf on builtins in 2012; gone, and proven safe across the floor in ANALYSIS-2026-08.md §5.2. ~75% of boot's defineProperty work. Do (August roadmap #2). |
kernel-runtime.js:86, :393 [].slice.call(arguments); kernel-language.js:102, :282 push.apply |
ES5 spellings of rest/spread | 2012–2014 | the syntax exists; the spellings are correct and cost nothing measurable. Cosmetic: only inside a deliberate, single "raise the kernel to ES20xx syntax" commit (AGENTS.md forbids the piecemeal raise), and only after §4.1. Done on 2026-10-17 (Use rest parameters and spread.). |
kernel-language.js:391-396 4-argument addClass back-compat (arguments[3]) |
marked TODO remove, backward compatibility (… only deprecated as of this note) since 0.29.2 (2020-05) |
2020 | not a floor item: a deprecation that has had six years. Kept on 2026-10-17, by the maintainer's decision, because it is still called: contrib-jquery 0.8.0, contrib-web 0.9.0, DOMite 0.10.0, Silk 0.7.0 and ProfStef 0.4.0, released in September 2026, ship .js last compiled in 2019–2020 by a pre-0.29.2 amberc, sixteen four-argument calls between them. Without the branch their classes load into packages named by their slot arrays, with no slots: Helios's package list fails to sort, and a subclass method reading an inherited slot does not compile. It can go once those five are released recompiled. |
boot.js:49-51 runtime loaded through AMD require; helpers.js:63-66 loadPackages likewise |
Promise-wrapped callback loading | 2013-07 (AMD) | the module-system item, §3. |
kernel-fundamentals.js:12, :173-175 Object.create(null) for the selector set and the method dictionaries |
pre-Map dictionaries |
2012-11-07 | not gone, deliberately: methods = Object.create(superclass.methods) is method inheritance — the prototype chain does the lookup. A Map cannot chain. Keep (§5). |
kernel-fundamentals.js:9, kernel-runtime.js:11 hop.call(obj, key) |
own-property check | 2012 | Object.hasOwn is ES2022, above the floor. Keep. |
junk-drawer.js:4-12 inherits, constructor functions everywhere |
pre-class |
2011 | a class needs a static superclass; Amber's is dynamic (inherits(function(){}, superclass.fn)) and detached roots are native constructors. class buys nothing here. Keep (§5). |
junk-drawer.js:14-19 Object.defineProperty installs |
non-enumerable methods on native prototypes | 2012 | still the only way to keep for..in over a JS array clean. Keep. |
a$cls, a$nil, a$atx string-keyed markers |
pre-Symbol |
2017-04-11 (a$ prefix) |
Symbol keys would be collision-free, but compiled code reads .a$nil inline (Compiler-Inlining.st:277) and .a$cls is the public "is this Smalltalk" test; no collision has ever been reported. Keep; note the hazard that an own property named a$cls on a HashedCollection opts the object out (§5). |
kernel-checks.js in ES5 |
the probe that must run on a too-old engine | 2026-09 | stays ES5 by design. Caveat worth writing down: once any other kernel file carries ES2015 syntax, an ES5-only engine dies with a SyntaxError before the probe reports. The engines that benefit from the probe's message are the 2015–2018 ones (they parse ES2015+ and lack globalThis); ES5-only engines are IE 11 and Node ≤ 4. Acceptable. What must not happen is ES2020 syntax in the kernel while Node 12 / Chrome 71–79 / Firefox 65–73 / Safari 12.1–13.0 are inside the floor — those would die with a SyntaxError instead of the message (§1). |
Net for the kernel: one real item (the copying), one deprecation past its time, and a syntax raise that is cosmetic. The kernel's ES5 syntax is not an archaism with a cost; it is a style, and the honest thing to say is that raising it buys readability for the next reader and nothing else.
inlineJS:The emitter (Compiler-IR.st:1172-1383) writes ES5: function for methods
(nextPutFunctionWith:, :1316) and blocks (nextPutClosureWith:, :1273), var for
temps and aliases (nextPutVars:, :1376), the [expr, $ctx1.sendIdx[…]=1][0] trick for
"evaluate the second, answer the first" (:1217-1229), throw $early=[…] for non-local
return (:1347-1361). The compiled image contains 4,220 (function( closures in 3.4 MB.
What the floor would allow, and what it would buy:
self, $self,
locals and $ctx; it never uses this or arguments (both are reserved by the
compiler: Kernel-Infrastructure.st:886 lists arguments; self is a captured
variable, not this). Saving: a few bytes per closure and nothing at runtime.let/const for the $1…$n aliases: equivalent semantics, no gain.$early throw and the […][0] trick have no ES2015+ replacement.ANALYSIS-2026-08.md §7. A syntax raise of the emitter is
roadmap item #8 there, "when IRJSTranslator is next touched", and that is still the
right weight — after §4.1, because every scaffolded grunt deploy would otherwise
break on the first arrow.inlineJS: bodies (330, 22.8 KB) are pasted verbatim; the compiler imposes no level
on them. They are ES5 today by convention and by the same minifier coupling. Once §4.1 is
done they may use ES2015–2019 (not ?./??, §1); the spellings that would change are
listed in §2.3. The August note that each body appears three times in the output
(source:, pragmas:, code) still stands.Compiler eval: (Compiler-Core.st:199) and Package >> eval: wrap sources for eval;
new Function is the same thing under CSP. Not an archaism.Hashing: Dictionary and Set are O(n) per operation. In 2013 a JS object could not
be used as a key and could not be given a hidden identity hash without touching it. So:
Dictionary keeps parallel keys/values arrays and finds a key by scanning them with
= (Kernel-Collections.st:719-830, positionOfKey: at :816-823, 2013-03-07
a00b67c7). removeKey: swaps the last pair into the hole (:776-789), so the only
order the class has is lost on removal.Set (:1771-1991, 2013-12-26 ad5268b3) buckets by type: strings, numbers and
booleans become property names of Object.create(null) stores (O(1)); objects go to
ArrayBucketStores keyed by Smalltalk class name or JS constructor name, i.e. one
bucket per class, scanned with indexOf: and =.HashedCollection (string-keyed, a plain object) is the only O(1) map, and it is what
#{} builds.Object >> identityHash (Kernel-Objects.st:16-24) is deprecated and calls
$core.nextId(), which does not exist in the kernel (nothing defines nextId); it would
throw if anything still sent it.Measured on this checkout (bench-collections.js, Node 24; the image booted through
RequireJS as in the August profiling):
| N | Dictionary at:put:, object keys |
at: each |
Dictionary at:put:, string keys |
HashedCollection at:put: |
Set add:, objects of one class |
Set includes: each |
JS Map.set |
JS Set.add |
|---|---|---|---|---|---|---|---|---|
| 2,000 | 267 ms | 236 ms | 124 ms | 2.4 ms | 283 ms | 271 ms | 0.5 ms | 0.2 ms |
| 8,000 | 5,061 ms | 5,300 ms | 3,076 ms | 23.5 ms | 6,156 ms | 5,482 ms | 1.1 ms | 0.9 ms |
Four times the keys, nineteen times the time: quadratic, as the code says. Dictionary
with string keys is quadratic too — strings go through the same scan, only
HashedCollection has the fast path. Eight thousand entries is not exotic: it is the size
of a selector table, a parsed file's token list, a package's method set.
What ES2015 changed: Map and Set are O(1) with SameValueZero equality and insertion
order; WeakMap gives any object a hidden identity number without defining a property on
it (which Object.defineProperty cannot do on frozen or primitive-wrapped receivers). The
design that falls out, and the Pharo rule that comes with it:
hash protocol, consistent with =: identity by default (a WeakMap-backed counter —
which is also the honest identityHash), by value for String/Number/Boolean, and
structural for the eight classes that override = today — Association
(Kernel-Collections.st:30), AssociativeCollection (:557),
SequenceableCollection (:992), String (:1354), Set (:1844), JSObjectProxy
(Kernel-Infrastructure.st:105), Date (Kernel-Objects.st:706), Point (:1353),
Rectangle (:1554).Dictionary and Set as Pharo has them: a Map from key hash to a bucket, and =
deciding inside the bucket. A JS Map compares by SameValueZero, which is Smalltalk's
==, so it can be the dictionary only for identity-keyed and string-keyed collections
(IdentityDictionary, IdentitySet, which Amber lacks and could gain cheaply, and
HashedCollection); an equality-keyed one uses it as the index. Still O(1): an
identity class hashes to its identity number and its bucket holds one entry, so the one
= send is a pointer comparison; a value class hashes structurally and compares the
one or two candidates. Iteration becomes insertion-ordered, which nothing promised and
the tests do not pin (Kernel-Tests.st:1017-1030 use assertSameContents:),
consistent with AGENTS.md's rule on order.= must override hash. Today no
such obligation exists, so this is breaking in the Smalltalk sense and opens with
Working on 0.32, an API-CHANGES.txt entry, and tests that pin the contract.Verdict: the strongest library-level win on the list — independent of everything else, measurable, medium-sized, and overdue by ten years of engine support.
Construction of JS objects: BlockClosure >> newWithValues: (Kernel-Methods.st:166-172)
simulates new with Object.create(self.prototype) + self.apply(object, args), the only
way before ES2015. Verified today: it works for an ES5 function constructor and for Date,
and throws for an ES2015 class ("Class constructor … cannot be invoked without 'new'"),
for Promise and for Map. newValue:, newValue:value: and newValue:value:value:
all route through it (:154-164). Reflect.construct(self, args) (ES2015) is the correct
spelling and handles all five. Behavior >> applySuperConstructorOn:withArguments:
(Kernel-Classes.st:36-41) has the same shape for the superclass constructor of a detached
root. Verdict: a defect born of the floor; fix, with the test that pins a class
constructor.
Committing packages over XHR. PackageHandler >> ajaxPutAt:data:onSuccess:onError:
(Platform-ImportExport.st:847-857) drives XMLHttpRequest through
Platform newXhr, which on the browser side builds a NativeFunction constructorOf:
(Platform-Browser.st:37-40) and on the Node side (Platform-Node.st:33-36) can never
succeed — Node has no XMLHttpRequest. fetch is inside the floor on all four browsers
(Chrome 42, Firefox 39, Safari 10.1) and already wrapped as Platform fetch: /
fetchUrl:options: with feature detection. A PUT through fetchUrl:options: makes
newXhr and both of its implementations unnecessary. Verdict: small; do with the next
touch of the commit path. (Node 12–16 have no fetch; the commit path is IDE-only, so that
does not bite.)
Promise (Kernel-Promises.st): TThenable has then:/catch:/on:do: and no
finally: — Promise.prototype.finally (ES2018) is inside the floor everywhere.
Promise class >> any: (:12-15) is Promise.race; ES2021 gave the name any the opposite
meaning (first fulfilled), so the selector now reads wrong to anyone who knows modern JS.
allSettled: (ES2020) is just above the stated browser floor (§1). Verdict: add finally:;
consider race: with any: deprecated, an API-CHANGES.txt matter.
Small spellings whose modern form is inside the floor — none worth a commit alone; all
of them belong in the inlineJS: sweep that §4.1 unlocks:
| where | today | modern | note |
|---|---|---|---|
Kernel-Objects.st:1061-1066 truncated |
Math.floor on the absolute value |
Math.trunc |
ES2015 |
:1156 log |
Math.log(self) / Math.LN10 |
Math.log10 |
ES2015; exact for powers of ten, which the division is not |
:1164 raisedTo: |
Math.pow |
** |
ES2016, equivalent |
Kernel-Collections.st:1461-1463 reversed |
split("").reverse().join("") |
Array.from(self).reverse().join("") |
ES2015; the current one breaks surrogate pairs |
:1303-1305 asciiValue, :1322 charCodeAt: |
UTF-16 code unit | codePointAt |
ES2015; see the string note below |
Kernel-Infrastructure.st:121-126, :214-229 for (var i in o) |
enumerates inherited enumerables too | Object.entries |
ES2017 — but the semantics differ (own only); leave unless the inherited-property behaviour is decided to be a bug |
Kernel-Methods.st:85-91 currySelf, kernel-runtime.js:86 |
arguments + push.apply |
rest/spread | ES2015, cosmetic |
Strings are UTF-16 code units, not characters: at: indexes String(self)[i-1]
(Kernel-Collections.st:1307-1316), size is .length. In 2011 JS had no code-point
API; now Array.from, codePointAt, String.fromCodePoint and for..of exist, and Pharo's
String is a sequence of code points. Making size/at: code-point-based is breaking and
costs O(n) indexing; a non-breaking codePoints-style accessor is the honest addition.
Noted, not recommended as a change.
String >> escaped / unescaped (:1457-1467, 2011-03-14) wrap escape/unescape,
Annex B legacy functions deprecated by the language; uriComponentEncoded is the modern
pair and already exists. Not a floor item; a deprecation candidate.
Interop the floor newly permits but nothing offers: Amber's Dictionary, Set and
streams are not JS-iterable (Symbol.iterator), so for..of and spread from JS do not
work on them — one generator method per class once inlineJS: may be ES2015; BigInt
(Safari 14 and up) makes a LargeInteger possible for the first time. Opportunities, not
archaisms (§6).
sdk/, cli/, the scaffold| where | what | since | modern form (Node version) | verdict |
|---|---|---|---|---|
cli/src/AmberCli.st:237-239 base64Decode: |
new Buffer(aString, "base64") |
2013-01-01 (99c1bde9) |
Buffer.from (5.10, 2016); new Buffer is DEP0005 and prints a runtime deprecation warning on Node ≥ 10, so amber serve with basic auth warns on every request |
do |
sdk/lib/amberc.js:170-191, :335-352 |
fs.exists with a callback — written in 2013-03-16 to "make Node.js 0.8 compatible" |
2013 | fs.promises.access / stat; fs.exists is deprecated (DEP0003) |
do, with the next row |
sdk/lib/amberc.js:115-129, :137-352 |
hand-wrapped promise chain over callback fs |
2013–2014 | async/await (7.6) over fs/promises (10, stable 12): the same program in roughly half the lines, no behaviour change |
do as one commit |
sdk/lib/amberc.js:70-74 |
verbosity implemented by replacing console.log globally with a no-op |
2013 | a log function |
hygiene, not floor; fold into the row above |
sdk/lib/amberc.js:82-100 |
reads config.js by evaling it with a fake require |
2015 | vm.runInNewContext, or a JSON/import-map config (§3) |
leave until §3 |
cli/src/AmberCli.st:291 url parse: |
the legacy url API, deprecated in favour of WHATWG URL |
2011-09-11 (the first file server, in Jtalk) | new URL(request.url, base) (global since 10) |
do with the next FileServer touch |
cli/test/*.js |
shelljs ^0.3.0 (2014-05-08), whose exec().output field later versions removed — the tests are pinned to it |
2014-10-17 | child_process.execSync (0.12, 2015-02) |
do; also drops a dependency |
cli/package.json mocha ^5.2.0 |
2018 | — | mocha 12 (needs Node 18+, which the development toolchain already exceeds) or node:test |
bump when touched |
cli/src/AmberCli.st:985-997 gruntInitThenDo: |
forks the grunt-init binary (last release 2014-05-11) with the template path's backslashes doubled and colons escaped, because grunt-init splits template names on : |
2013-03-17 | an npm init @ambers/<name> initializer (create-<name>, npm 6 / Node 10): the root/ files port unchanged, template.js's prompts become ~100 lines over readline, the lodash {%= %} templating becomes a string replacement; grunt-init and the global-install prerequisite in README.md go |
medium; when the scaffold is next reworked |
Gruntfile.js:48 closure_jar: '' |
an option for Google Closure Compiler from the 2012 amberc (adfd3695) that amberc.js no longer reads anywhere |
2012-12-27 | delete | trivial, next Gruntfile touch |
grunt-init-project/root/parts.html:19-21 |
"Polyfilling: some dependencies in package.json and their use in Gruntfile.js and index.html" | 2018 | the polyfill left in the checkpoint; the sentence did not | delete the bullet |
index.html:6-8, grunt-init-project/root/index.html:2-8, parts.html, uninstall.html |
<meta http-equiv="content-type">, type='text/javascript', no lang on the scaffold's <html> |
2011 | <meta charset="utf-8">, bare <script> |
cosmetic; with any page touch |
sdk/lib/helpers.js:1-14, @ambers/amdefine, requirejs-text + sdk/lib/without-imports.js |
the Node wrapper (var module = void 0; // Bad UMDs workaround), AMD in Node, the loader plugin that strips imports so amberc can load libraries without their JS dependencies |
2013-07-28 | §3 | with the module system |
setversion.sh, local-amberc |
need a globally installed amberc; absent, the version recompile is silently skipped (HANDOFF-2026-09.md) |
2013 | node cli/dist/amberc-cli.js |
hygiene, not floor |
The FileServer's 400-entry MIME table (AmberCli.st:468-879, Debian's /etc/mime.types
of 2011) and the Repl's keypress hotkey are of the same era; neither is an engine
matter and neither is wrong, so they stay off this list.
AMD arrived in 2013-07 (97ce4d60 "amber loaded by require.js", 18c7ac9e
AmdExporter). RequireJS's last feature release was 2.3.6 (2018-08); 2.3.7 (2024) and 2.3.8
(2025) are maintenance and still bundle UglifyJS 2.8.29 (§4.1). The ecosystem moved to ESM
with ES2015 and the browsers caught up by 2018; the reason for AMD — no module system in the
language — is gone.
| job | AMD today | ESM, within the floor? |
|---|---|---|
resolve amber/core/Kernel-Objects to a file |
paths in the generated config.js, built by amd-config-builder from every .amd.json it finds under the checkout (sdk/lib/config.js) |
in Node: package.json exports (12.16) — each @ambers/* package declares its own; in browsers, unbundled: import maps, 2023 browsers (§1) — or the development server, which is Amber's own code (FileServer), serves a generated map or rewrites specifiers; a paths object is an import map minus shim; bundled (deploy): the bundler resolves, no runtime need |
| load non-module libraries | shim for jquery-ui 1.14, bootstrap 3.4's dropdown, codemirror 5 + the css! plugin (helios/*.amd.json, contrib-legacy/*.amd.json) |
no shim in ESM. jQuery 4 ships ESM (contrib-legacy already has 4.0.0 with a module field); jQuery UI and Bootstrap 3 need a wrapper module each; css! becomes a <link> or a CSS module import (too new for the floor). The long tail is in the siblings, not in lang. |
lazy loading (loadPackages, imports, the runtime layer) |
require([...], cb) in helpers.js:63-66, boot.js:49-51; $pkg.isReady = new Promise(… requirejs([imports] …)) emitted by AmdExporter (Platform-ImportExport.st:462-484) |
dynamic import() — Node 12.17, Firefox 67 |
| commit path of a package | require.toUrl (Platform-ImportExport.st:922-926) |
import.meta.resolve is Node 20.6 / 2023 browsers — above the floor; the transport knows its namespace → directory from the same map data, so no runtime resolution is needed |
| bundling with pragma stripping (`//>>excludeStart("ide" | "ctx" | "imports")`) |
| running in Node | @ambers/amdefine wrapper around every bundle (sdk/lib/helpers.js) |
native: "type": "module" or .mjs; the wrapper, amdefine, and the module = void 0 workaround go |
amberc loading libraries without their JS imports |
requirejs-text + without-imports.js |
a loader hook (module.register, Node 20.6) — above the floor; simpler: let the compiler not await isReady of the packages it loads, which is what the plugin achieves by surgery |
Node runs ESM unflagged from 12.17.0 (2020-05-26); engines would read >=12.17.0,
honestly >=14 (top-level await 14.8, node: specifiers 14.18; 12 is EOL). In browsers,
<script type="module"> and static imports are inside the floor; import() needs Firefox
67; import maps need 2023 browsers and are needed only by the unbundled development page,
which is already a development-floor matter (§1). A deployed bundle needs ES2020 and nothing
more.
AGENTS.md asks that where a second way is foreseen, the one way is reached through the place
that will choose. That place exists: PackageTransport's registry dispatches on type
(Platform-ImportExport.st:1015-1064, 'amd'). An 'esm' transport with an EsmExporter
beside AmdExporter (~100 lines of .st: import for the prologue, import() for the
isReady promise, export nothing — packages register through $core) lets packages move
one at a time. The kernel's ten files become export-ing modules with a twenty-line AMD
facade (define('amber/boot', …)) kept during the transition so AMD-compiled siblings keep
loading. lang and cli can move first — neither needs a shim; the CLI bundle is then an
esbuild script of ~30 lines instead of r.js + amdefine. The siblings follow one by one; r.js
stays for projects that have not moved.
The August roadmap places ESM (#7) after packages-as-data (#4–6), and the argument has not changed: once packages are data, there is no package module format to migrate, and ESM is a question about ten hand-written files and a loader. Doing ESM first means converting the format of 26 packages and seven siblings that the sail work would retire. If sail stalls, the kernel-first move with the AMD facade is about a day's work and is what unblocks ESM consumers; it is also the path §3.3 describes. Either way, §4.1 comes first and is independent.
Verified today with r.js 2.3.5 (installed) and 2.3.8 (the current release, fetched from the
registry): optimize: "uglify" on a module containing const, an arrow, a class and a
template literal refuses the file with SyntaxError: Unexpected token: operator (>); r.js's own
message says "If the source uses ES2015 or later syntax, please pass optimize: 'none' to
r.js and use an ES2015+ compatible minifier after running r.js. The included UglifyJS only
understands ES5 or earlier syntax." (r.js:26969, UglifyJS 2.8.29 at :30392).
Where that bites: the scaffold's deploy and deploy:lambda tasks use
optimize: "uglify2" (grunt-init-project/root/Gruntfile.js:96, :130); devel sets no
optimize and so gets r.js's default, uglify, though its bundle excludes the image and
carries only the loader stubs. Amber's own Gruntfile uses optimize: "none" everywhere. So:
every project scaffolded since 2013 minifies the whole image with an ES5-only parser, and
the first ES2015 token anywhere in Amber's output costs its deploy build the minification:
r.js logs Cannot uglify file, skips the step, exits green, and the bundle ships unminified
at 1.9× its size (measured on a scaffolded project with one ES2015 line injected into
Kernel-Objects.js: 1,052,554 bytes against 553,293; the devel bundle, 19.5 KB of loader
and stubs without a line of Amber, is untouched by it). This is the coupling that makes
§2.1's syntax raise, §2.2's emitter raise, the inlineJS: sweep and even a
peggy-generated parser (which the deploy bundle happens not to include, §4.2) wait.
Measured on 2026-10-17 with r.js 2.3.8: the parser is a second, harder bound. r.js traces
dependencies with the esprima 4.0.1 it embeds, which reads ES2017 and no later edition, and
a module it cannot parse fails the build outright, optimize: "none" or not: Parse error
using esprima … Unexpected token ? on ??, Unexpected token . on ?., while async,
**, rest and spread, class and template literals pass. So everything r.js bundles — the
kernel, the image and the inlineJS: inside it, a scaffolded project's packages — is
ES2017 syntax at most, whatever the engine floor allows; the Node-only code (sdk, cli, the
Gruntfiles) is bounded by the floor alone.
The fix is small and local to the scaffold: optimize: "none" plus a minify step with a
current minifier (terser, or esbuild's --minify once bundles are ESM) in the two deploy
tasks — exactly what r.js recommends. One scaffold release. Projects already scaffolded keep
their Gruntfile and would need the same two-line change before upgrading @ambers/lang past
the first release that emits ES2015, which is a release-note matter when that day comes.
pegjs 0.10.0 is from 2016-08-19 and unmaintained; peggy is its maintained fork (5.1.0, 2026-03; the tool itself needs Node 20, which only the developer runs). Verified today on the RAM disk, without touching the tree:
peggy --cache -o … --format amd --dependency __boot:./boot lang/base/parser.pegjs
builds the grammar unchanged; --format amd and --dependency work as in pegjs;
--format es exists for the ESM future.class peg$SyntaxError
extends SyntaxError, const/let, eight arrows; no ?., ??, template literals or
anything past ES2015.lang/ with the peggy parser swapped in:
763 tests run, 0 failures, 0 errors on Node 24.18.0 and on Node 14.21.3 (the lowest
Node on this machine; Node 12 would be CI's test-on-floor step, and ES2015 is well
inside it). Baseline with the pegjs parser, same harness: identical result.lang/base/[^p]*.js).Cost: lang/package.json's devDependency and build:parser script in one commit; the
regenerated parser.js in its own commit, the Recompile. convention (regenerated output,
no source change, with the body saying the generator changed). The deploy bundles never
include the parser (deploy.js stops before the compiler chain), so §4.1 does not block
this; the CLI bundle includes it and is built with optimize: "none".
amber compile, amber test, beside the existing
amber config) would drop the global grunt-cli + grunt-init prerequisite for new
projects — a dependency reduction, not a floor item.import in hand-written files) or if the kernel
syntax rises and the stricter parser is wanted. Optional. The one change that is due now
is the lint level, §1: esversion: 10 for a Node 12 floor, or the floor to Node 14.
Done on 2026-10-17 as the first step of the maintainer's "2020 as the baseline" line:
ESLint at ecmaVersion: 2020 through npm run lint, ahead of the syntax raise..amd.json-shaped
metadata, nothing, nothing).release-worker.sh is sound; setversion.sh's global amberc
dependency is §2.4's last row. A .gitattributes with * text=auto eol=lf is still the
cheapest fix on any list (HANDOFF-2026-09.md).Object.create(globalThis) as the
globals — Amber's identity (ANALYSIS-2026-08.md §4, §8).inherits and constructor functions — dynamic superclass; class cannot express it.Object.create(superclass.methods) — the prototype chain is
the inheritance lookup; Map has no chain.hop.call — Object.hasOwn is ES2022.throw $early=[…] — the only non-local return there is; the sail interpreter uses
the same strategy.$recv() wrapping, a$cls / a$nil markers — the interop boundary; Symbol keys
would be collision-free at the price of touching every inlined ifNil:.Object.defineProperty installs — non-enumerability on native prototypes."use strict" prologues — redundant under ESM, not wrong before it.reservedWords (Kernel-Infrastructure.st:875-891) — already the ES2015 list.Array >> addAll:'s 65,000 guard (Kernel-Collections.st:1124-1126) — the
argument-count limit is the same for spread.sort: with a comparator that never answers 0 (:1228-1230) — fine, and since
ES2019 made sort stable (V8 7.0: Chrome 70, Node 11) its result is deterministic across
engines: a reason gone in Amber's favour.HashedCollection as a plain object — #{} is a JS object; that is the point of it.
The known hazards of the design (__proto__ as a key; an own a$cls key opting the
instance out, Kernel-Infrastructure.st:855-860) are old and unchanged by the floor.withContext / $ctx — the debugger's substrate; its modernization is
ANALYSIS-2026-08.md §7.5, not syntax.kernel-checks.js in ES5 — by design (§2.1).Array new: answering a holey array — a performance note in
ANALYSIS-2026-08.md §5.2, to be settled with the prototype-chain insertion.Listed so the next feature reaches for them, and so nobody reaches past the floor:
Map/Set/WeakMap (§2.3), Reflect.construct (§2.3),
Promise.prototype.finally (§2.3), Symbol.iterator on collections, async/await in
the hand-written Node code (§2.4), fetch for commits (§2.3), import() (§3),
Array.from/codePointAt for a code-point string API, Math.trunc/log10.Promise.allSettled, String.matchAll,
BigInt (a LargeInteger class; Safari 14), ?./?? (Node 14, Chrome 80, Firefox 74,
Safari 13.1 — §1).Object.hasOwn, Array.prototype.at, WeakRef,
structuredClone, Error.cause, class fields, import.meta.resolve, CSS modules, Node's
fetch/node:test/util.parseArgs.Cheap and independent first; each line is one or two single-concern commits unless said.
optimize: "none" + terser in deploy and
deploy:lambda, a scaffold release. Unblocks every syntax-shaped item below.
Done on 2026-10-16.Buffer.from; async/await + fs/promises in amberc.js
(drops fs.exists and the console.log surgery); URL in the file server;
execSync for shelljs; the stale parts.html bullet; the dead closure_jar. Five or
six commits, each tiny, each with the existing e2e tests as the gate.Reflect.construct in newWithValues: and applySuperConstructorOn:withArguments:
(§2.3), with the test that constructs an ES2015 class. A defect, so it needs no floor
decision. Done on 2026-10-16 for newWithValues:; the super-constructor method stays,
since initializing an existing object through a class constructor is not expressible.hash protocol, WeakMap identity hashes, Map-backed
Dictionary and Set, tests that pin the contract and not the order. Opens with
Working on 0.32. Postponed on 2026-10-17: a hash protocol is a feature with a new
obligation on user classes, which the floor allows but does not call for; it is not
part of the up-to-par line.ANALYSIS-2026-08.md §5.1, roadmap
#2) — independent of all of the above; the biggest boot-time payoff.esversion: 10, or Node 14 / 2020
browsers with esversion: 11. One line in .jshintrc, engines, kernel-checks.js's
FLOOR string, README, CI's floor image — and Working on 0.32 if the floor moves.
Decided on 2026-10-16: Node 14 and the 2020 browsers, as Working on 0.32.0 and the
commits after it; .jshintrc and kernel-checks.js needed no change.inlineJS: spellings of §2.3; the kernel; the emitter when IRJSTranslator is next
touched (roadmap #8). None of them buys speed; all of them buy readability; the honest
priority is low.
Done on 2026-10-17 for the kernel and all the hand-written JS around it, idiom by idiom
(Declare with const and let. through Raise the page scripts and the scaffold's AMD
stubs too.), at ES2017 in what r.js bundles and ES2020 elsewhere (§4.1); the
inlineJS: spellings and the emitter remain.finally:, race: over any:, Symbol.iterator — small library additions, each
with its API-CHANGES.txt line.npm init initializer, mocha — when the scaffold and the CLI tests are
next reworked.Throwaway scripts in the session scratchpad on the RAM disk, nothing committed:
baseUrl at the repo root and the
amber/amber/core path mapping (as the August boot profiling); loads amber/deploy +
amber/core/Platform-Node, initializes, then times Dictionary, HashedCollection and
Set against Map and Set for 2,000 and 8,000 keys (Object new instances and
strings), process.hrtime.bigint around each loop.npx -p peggy@5 peggy --cache -o parser-peggy.js --format amd --dependency
__boot:./boot lang/base/parser.pegjs; a copy of lang/ (without node_modules) and
sdk/lib on the RAM disk, a three-line config.js, an r.js build file mirroring the
Gruntfile's test_runner target with the wrapper written out of
sdk.helpers.nodeWrapperWithShebang; built once with the committed parser (baseline) and
once with parser-peggy.js copied over lang/base/parser.js; run with Node 24.18.0 and
E:\.nvm\v14.21.3\node.exe.r.js -o name=<file> out=<file>.min.js baseUrl=. optimize=uglify on an ES5
module and an ES2015 one, with the installed r.js 2.3.5 and with 2.3.8 from npm pack.newWithValues: — a Node one-liner applying the Object.create + apply shape and
Reflect.construct to an ES5 constructor, an ES2015 class, Map, Date and Promise.npm view <pkg> version time; first and last appearance of
each vestige: git log -S<text> --reverse.