xbintsc 0.5.6 → 0.5.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +20 -10
- package/README.md +8 -7
- package/README.zh-CN.md +6 -6
- package/dist/src/binder/declarations.js +14 -3
- package/dist/src/binder/declarations.js.map +1 -1
- package/dist/src/cli/hints.js +7 -1
- package/dist/src/cli/hints.js.map +1 -1
- package/dist/src/cli/main.js +115 -15
- package/dist/src/cli/main.js.map +1 -1
- package/dist/src/cli/watch.d.ts +25 -0
- package/dist/src/cli/watch.js +93 -0
- package/dist/src/cli/watch.js.map +1 -0
- package/dist/src/codegen/generator/calls/access.js +11 -2
- package/dist/src/codegen/generator/calls/access.js.map +1 -1
- package/dist/src/codegen/generator/calls/closures.js +12 -4
- package/dist/src/codegen/generator/calls/closures.js.map +1 -1
- package/dist/src/codegen/generator/context.d.ts +8 -0
- package/dist/src/codegen/generator/context.js +22 -3
- package/dist/src/codegen/generator/context.js.map +1 -1
- package/dist/src/codegen/generator/expressions/operators.js +17 -15
- package/dist/src/codegen/generator/expressions/operators.js.map +1 -1
- package/dist/src/codegen/generator/expressions/primary.js +5 -0
- package/dist/src/codegen/generator/expressions/primary.js.map +1 -1
- package/dist/src/codegen/generator/module.js +0 -7
- package/dist/src/codegen/generator/module.js.map +1 -1
- package/dist/src/codegen/generator/numeric.d.ts +6 -3
- package/dist/src/codegen/generator/numeric.js +54 -11
- package/dist/src/codegen/generator/numeric.js.map +1 -1
- package/dist/src/codegen/generator/state.js +23 -0
- package/dist/src/codegen/generator/state.js.map +1 -1
- package/dist/src/codegen/generator/statements/control-flow.js +1 -4
- package/dist/src/codegen/generator/statements/control-flow.js.map +1 -1
- package/dist/src/codegen/generator/statements/loops.js +48 -16
- package/dist/src/codegen/generator/statements/loops.js.map +1 -1
- package/dist/src/codegen/generator/tables.js +26 -1
- package/dist/src/codegen/generator/tables.js.map +1 -1
- package/dist/src/diagnostics/diagnostic.d.ts +3 -1
- package/dist/src/diagnostics/diagnostic.js +23 -3
- package/dist/src/diagnostics/diagnostic.js.map +1 -1
- package/dist/src/driver/app-artifacts.d.ts +42 -0
- package/dist/src/driver/app-artifacts.js +53 -0
- package/dist/src/driver/app-artifacts.js.map +1 -0
- package/dist/src/driver/build-key.d.ts +29 -0
- package/dist/src/driver/build-key.js +35 -0
- package/dist/src/driver/build-key.js.map +1 -0
- package/dist/src/driver/bundler/graph.js +61 -12
- package/dist/src/driver/bundler/graph.js.map +1 -1
- package/dist/src/driver/bundler/merge.js +7 -1
- package/dist/src/driver/bundler/merge.js.map +1 -1
- package/dist/src/driver/compiler.d.ts +10 -67
- package/dist/src/driver/compiler.js +95 -234
- package/dist/src/driver/compiler.js.map +1 -1
- package/dist/src/driver/config.d.ts +3 -0
- package/dist/src/driver/config.js +8 -0
- package/dist/src/driver/config.js.map +1 -1
- package/dist/src/driver/frontend.d.ts +37 -0
- package/dist/src/driver/frontend.js +92 -0
- package/dist/src/driver/frontend.js.map +1 -0
- package/dist/src/driver/index.d.ts +1 -1
- package/dist/src/driver/index.js.map +1 -1
- package/dist/src/driver/options.d.ts +64 -0
- package/dist/src/driver/options.js +9 -0
- package/dist/src/driver/options.js.map +1 -0
- package/dist/src/driver/runtime-objects.d.ts +38 -0
- package/dist/src/driver/runtime-objects.js +112 -0
- package/dist/src/driver/runtime-objects.js.map +1 -0
- package/dist/src/driver/toolchain-provider.d.ts +4 -0
- package/dist/src/driver/toolchain-provider.js +4 -0
- package/dist/src/driver/toolchain-provider.js.map +1 -1
- package/dist/src/driver/toolchain.d.ts +32 -1
- package/dist/src/driver/toolchain.js +115 -11
- package/dist/src/driver/toolchain.js.map +1 -1
- package/dist/src/driver/version.d.ts +12 -0
- package/dist/src/driver/version.js +13 -0
- package/dist/src/driver/version.js.map +1 -0
- package/dist/src/driver/win-icon.d.ts +7 -9
- package/dist/src/driver/win-icon.js +37 -35
- package/dist/src/driver/win-icon.js.map +1 -1
- package/dist/src/extensions/node/fs/index.d.ts +4 -3
- package/dist/src/extensions/node/fs/index.js +12 -3
- package/dist/src/extensions/node/fs/index.js.map +1 -1
- package/dist/src/extensions/node/fs-promises/index.d.ts +5 -5
- package/dist/src/extensions/node/fs-promises/index.js +15 -6
- package/dist/src/extensions/node/fs-promises/index.js.map +1 -1
- package/dist/src/parser/declarations/classes.js +5 -0
- package/dist/src/parser/declarations/classes.js.map +1 -1
- package/dist/src/parser/declarations/functions.js +13 -1
- package/dist/src/parser/declarations/functions.js.map +1 -1
- package/dist/src/parser/modules.js +8 -3
- package/dist/src/parser/modules.js.map +1 -1
- package/dist/src/parser/parser.d.ts +1 -0
- package/dist/src/parser/parser.js +23 -0
- package/dist/src/parser/parser.js.map +1 -1
- package/dist/tests/cli/check.test.d.ts +6 -0
- package/dist/tests/cli/check.test.js +68 -0
- package/dist/tests/cli/check.test.js.map +1 -0
- package/dist/tests/cli/main.test.js +19 -0
- package/dist/tests/cli/main.test.js.map +1 -1
- package/dist/tests/cli/watch.test.d.ts +6 -0
- package/dist/tests/cli/watch.test.js +72 -0
- package/dist/tests/cli/watch.test.js.map +1 -0
- package/dist/tests/codegen/expressions.test.js +15 -3
- package/dist/tests/codegen/expressions.test.js.map +1 -1
- package/dist/tests/codegen/llvm.test.js +16 -0
- package/dist/tests/codegen/llvm.test.js.map +1 -1
- package/dist/tests/diagnostics/diagnostic.test.js +8 -0
- package/dist/tests/diagnostics/diagnostic.test.js.map +1 -1
- package/dist/tests/docs/structure.test.d.ts +1 -0
- package/dist/tests/docs/structure.test.js +92 -0
- package/dist/tests/docs/structure.test.js.map +1 -0
- package/dist/tests/driver/compiler.test.js +6 -0
- package/dist/tests/driver/compiler.test.js.map +1 -1
- package/dist/tests/driver/config.test.js +9 -0
- package/dist/tests/driver/config.test.js.map +1 -1
- package/dist/tests/driver/icon.test.js +19 -32
- package/dist/tests/driver/icon.test.js.map +1 -1
- package/dist/tests/driver/invalid-input.test.d.ts +10 -0
- package/dist/tests/driver/invalid-input.test.js +29 -0
- package/dist/tests/driver/invalid-input.test.js.map +1 -0
- package/dist/tests/driver/modules.test.js +42 -3
- package/dist/tests/driver/modules.test.js.map +1 -1
- package/dist/tests/driver/toolchain-provider.test.js +27 -1
- package/dist/tests/driver/toolchain-provider.test.js.map +1 -1
- package/dist/tests/driver/toolchain.test.js +60 -2
- package/dist/tests/driver/toolchain.test.js.map +1 -1
- package/dist/tests/e2e/array-buffer.test.d.ts +5 -0
- package/dist/tests/e2e/array-buffer.test.js +38 -0
- package/dist/tests/e2e/array-buffer.test.js.map +1 -0
- package/dist/tests/e2e/array-from-iterables.test.d.ts +7 -0
- package/dist/tests/e2e/array-from-iterables.test.js +34 -0
- package/dist/tests/e2e/array-from-iterables.test.js.map +1 -0
- package/dist/tests/e2e/array-symbol-iterator.test.d.ts +8 -0
- package/dist/tests/e2e/array-symbol-iterator.test.js +42 -0
- package/dist/tests/e2e/array-symbol-iterator.test.js.map +1 -0
- package/dist/tests/e2e/async-await.test.js +1 -1
- package/dist/tests/e2e/async-fs.test.d.ts +9 -0
- package/dist/tests/e2e/async-fs.test.js +119 -0
- package/dist/tests/e2e/async-fs.test.js.map +1 -0
- package/dist/tests/e2e/async-generators.test.d.ts +1 -0
- package/dist/tests/e2e/async-generators.test.js +154 -0
- package/dist/tests/e2e/async-generators.test.js.map +1 -0
- package/dist/tests/e2e/await-ordering.test.d.ts +5 -0
- package/dist/tests/e2e/await-ordering.test.js +37 -0
- package/dist/tests/e2e/await-ordering.test.js.map +1 -0
- package/dist/tests/e2e/compile-builtins.test.js +1 -1
- package/dist/tests/e2e/compile-modules.test.js +7 -0
- package/dist/tests/e2e/compile-modules.test.js.map +1 -1
- package/dist/tests/e2e/date-parse.test.d.ts +8 -0
- package/dist/tests/e2e/date-parse.test.js +38 -0
- package/dist/tests/e2e/date-parse.test.js.map +1 -0
- package/dist/tests/e2e/default-anonymous-exports.test.d.ts +7 -0
- package/dist/tests/e2e/default-anonymous-exports.test.js +23 -0
- package/dist/tests/e2e/default-anonymous-exports.test.js.map +1 -0
- package/dist/tests/e2e/fetch.test.js +24 -0
- package/dist/tests/e2e/fetch.test.js.map +1 -1
- package/dist/tests/e2e/globals-microtask.test.d.ts +9 -0
- package/dist/tests/e2e/globals-microtask.test.js +37 -0
- package/dist/tests/e2e/globals-microtask.test.js.map +1 -0
- package/dist/tests/e2e/gui-inline-svg.test.d.ts +11 -0
- package/dist/tests/e2e/gui-inline-svg.test.js +160 -0
- package/dist/tests/e2e/gui-inline-svg.test.js.map +1 -0
- package/dist/tests/e2e/gui-media.test.js +8 -1
- package/dist/tests/e2e/gui-media.test.js.map +1 -1
- package/dist/tests/e2e/inspect-builtins.test.d.ts +10 -0
- package/dist/tests/e2e/inspect-builtins.test.js +43 -0
- package/dist/tests/e2e/inspect-builtins.test.js.map +1 -0
- package/dist/tests/e2e/json-builtin-objects.test.d.ts +9 -0
- package/dist/tests/e2e/json-builtin-objects.test.js +23 -0
- package/dist/tests/e2e/json-builtin-objects.test.js.map +1 -0
- package/dist/tests/e2e/json-circular.test.d.ts +6 -0
- package/dist/tests/e2e/json-circular.test.js +43 -0
- package/dist/tests/e2e/json-circular.test.js.map +1 -0
- package/dist/tests/e2e/json-parse-reviver.test.d.ts +6 -0
- package/dist/tests/e2e/json-parse-reviver.test.js +29 -0
- package/dist/tests/e2e/json-parse-reviver.test.js.map +1 -0
- package/dist/tests/e2e/json-stringify-replacer.test.d.ts +6 -0
- package/dist/tests/e2e/json-stringify-replacer.test.js +27 -0
- package/dist/tests/e2e/json-stringify-replacer.test.js.map +1 -0
- package/dist/tests/e2e/json-stringify-space.test.d.ts +6 -0
- package/dist/tests/e2e/json-stringify-space.test.js +23 -0
- package/dist/tests/e2e/json-stringify-space.test.js.map +1 -0
- package/dist/tests/e2e/method-dispatch-errors.test.d.ts +9 -0
- package/dist/tests/e2e/method-dispatch-errors.test.js +38 -0
- package/dist/tests/e2e/method-dispatch-errors.test.js.map +1 -0
- package/dist/tests/e2e/native-extensions.test.js +1 -1
- package/dist/tests/e2e/native-extensions.test.js.map +1 -1
- package/dist/tests/e2e/promise-with-resolvers.test.d.ts +5 -0
- package/dist/tests/e2e/promise-with-resolvers.test.js +20 -0
- package/dist/tests/e2e/promise-with-resolvers.test.js.map +1 -0
- package/dist/tests/e2e/property-descriptors.test.d.ts +5 -0
- package/dist/tests/e2e/property-descriptors.test.js +25 -0
- package/dist/tests/e2e/property-descriptors.test.js.map +1 -0
- package/dist/tests/e2e/property-ic.test.d.ts +1 -0
- package/dist/tests/e2e/property-ic.test.js +55 -0
- package/dist/tests/e2e/property-ic.test.js.map +1 -0
- package/dist/tests/e2e/runtime-errors.test.d.ts +10 -0
- package/dist/tests/e2e/runtime-errors.test.js +52 -0
- package/dist/tests/e2e/runtime-errors.test.js.map +1 -0
- package/dist/tests/e2e/structured-clone.test.d.ts +6 -0
- package/dist/tests/e2e/structured-clone.test.js +49 -0
- package/dist/tests/e2e/structured-clone.test.js.map +1 -0
- package/dist/tests/e2e/text-codec.test.d.ts +6 -0
- package/dist/tests/e2e/text-codec.test.js +24 -0
- package/dist/tests/e2e/text-codec.test.js.map +1 -0
- package/dist/tests/e2e/typed-array-views.test.d.ts +6 -0
- package/dist/tests/e2e/typed-array-views.test.js +39 -0
- package/dist/tests/e2e/typed-array-views.test.js.map +1 -0
- package/dist/tests/e2e/url-search-params.test.d.ts +5 -0
- package/dist/tests/e2e/url-search-params.test.js +30 -0
- package/dist/tests/e2e/url-search-params.test.js.map +1 -0
- package/dist/tests/e2e/weak-collections.test.d.ts +1 -0
- package/dist/tests/e2e/weak-collections.test.js +88 -0
- package/dist/tests/e2e/weak-collections.test.js.map +1 -0
- package/dist/tests/parser/declarations.test.js +12 -0
- package/dist/tests/parser/declarations.test.js.map +1 -1
- package/dist/tests/parser/module-syntax.test.js +9 -0
- package/dist/tests/parser/module-syntax.test.js.map +1 -1
- package/dist/tests/parser/parser.test.js +7 -0
- package/dist/tests/parser/parser.test.js.map +1 -1
- package/dist/tests/version.test.js +5 -1
- package/dist/tests/version.test.js.map +1 -1
- package/doc/ai/README.md +4 -3
- package/doc/ai/cli.md +41 -0
- package/doc/ai/contributing.md +20 -16
- package/doc/ai/extensions.md +13 -10
- package/doc/ai/language-support.md +19 -14
- package/doc/ai/troubleshooting.md +11 -9
- package/doc/ai/zh-CN/README.md +3 -2
- package/doc/ai/zh-CN/cli.md +35 -0
- package/doc/ai/zh-CN/contributing.md +16 -15
- package/doc/ai/zh-CN/extensions.md +12 -9
- package/doc/ai/zh-CN/language-support.md +19 -15
- package/doc/ai/zh-CN/troubleshooting.md +9 -8
- package/doc/gui/api.md +8 -0
- package/doc/gui/build.md +13 -4
- package/doc/gui/known-issues.md +19 -14
- package/doc/gui/media.md +32 -3
- package/doc/gui/rendering.md +3 -1
- package/doc/gui.md +28 -5
- package/doc/icon.md +5 -4
- package/doc/implemented/async.md +51 -0
- package/doc/implemented/binder.md +13 -0
- package/doc/implemented/cli.md +47 -0
- package/doc/implemented/codegen.md +33 -0
- package/doc/implemented/collections.md +26 -0
- package/doc/implemented/driver.md +19 -0
- package/doc/implemented/extensions.md +19 -0
- package/doc/implemented/fetch.md +44 -0
- package/doc/implemented/lexer.md +23 -0
- package/doc/implemented/modules.md +28 -0
- package/doc/implemented/node/assert.md +17 -0
- package/doc/implemented/node/buffer.md +29 -0
- package/doc/implemented/node/child-process.md +29 -0
- package/doc/implemented/node/crypto.md +9 -0
- package/doc/implemented/node/dgram.md +15 -0
- package/doc/implemented/node/events.md +37 -0
- package/doc/implemented/node/fs-promises.md +49 -0
- package/doc/implemented/node/fs.md +112 -0
- package/doc/implemented/node/http.md +21 -0
- package/doc/implemented/node/net.md +17 -0
- package/doc/implemented/node/os.md +22 -0
- package/doc/implemented/node/path.md +33 -0
- package/doc/implemented/node/process.md +23 -0
- package/doc/implemented/node/querystring.md +20 -0
- package/doc/implemented/node/stream-promises.md +8 -0
- package/doc/implemented/node/stream.md +19 -0
- package/doc/implemented/node/test.md +10 -0
- package/doc/implemented/node/url.md +8 -0
- package/doc/implemented/node/util.md +25 -0
- package/doc/implemented/node/worker-threads.md +10 -0
- package/doc/implemented/node/zlib.md +8 -0
- package/doc/implemented/node.md +48 -0
- package/doc/implemented/operators.md +38 -0
- package/doc/implemented/parser.md +58 -0
- package/doc/implemented/pipeline.md +28 -0
- package/doc/implemented/runtime-core.md +32 -0
- package/doc/implemented/stdlib.md +78 -0
- package/doc/implemented/strings.md +27 -0
- package/doc/implemented/tests.md +10 -0
- package/doc/implemented/typed-arrays.md +26 -0
- package/doc/implemented/value-model.md +18 -0
- package/doc/implemented.md +54 -355
- package/doc/node-implemented.md +3 -585
- package/doc/node-unimplemented.md +3 -164
- package/doc/requirements.md +23 -8
- package/doc/unimplemented/classes.md +22 -0
- package/doc/unimplemented/deviations.md +27 -0
- package/doc/unimplemented/expressions.md +26 -0
- package/doc/unimplemented/functions.md +21 -0
- package/doc/unimplemented/modules.md +22 -0
- package/doc/unimplemented/node/async.md +20 -0
- package/doc/unimplemented/node/bun.md +9 -0
- package/doc/unimplemented/node/fs-promises.md +20 -0
- package/doc/unimplemented/node/fs.md +30 -0
- package/doc/unimplemented/node/globals.md +23 -0
- package/doc/unimplemented/node/modules.md +21 -0
- package/doc/unimplemented/node.md +21 -0
- package/doc/unimplemented/statements.md +18 -0
- package/doc/unimplemented/stdlib.md +54 -0
- package/doc/unimplemented/toolchain.md +14 -0
- package/doc/unimplemented/types.md +12 -0
- package/doc/unimplemented.md +18 -275
- package/doc/xbintsc.config.schema.json +12 -0
- package/doc/zh-CN/gui/api.md +7 -0
- package/doc/zh-CN/gui/build.md +11 -3
- package/doc/zh-CN/gui/known-issues.md +17 -11
- package/doc/zh-CN/gui/media.md +26 -2
- package/doc/zh-CN/gui/rendering.md +2 -1
- package/doc/zh-CN/gui.md +21 -3
- package/doc/zh-CN/icon.md +5 -4
- package/doc/zh-CN/implemented/async.md +49 -0
- package/doc/zh-CN/implemented/binder.md +13 -0
- package/doc/zh-CN/implemented/cli.md +46 -0
- package/doc/zh-CN/implemented/codegen.md +33 -0
- package/doc/zh-CN/implemented/collections.md +26 -0
- package/doc/zh-CN/implemented/driver.md +19 -0
- package/doc/zh-CN/implemented/extensions.md +19 -0
- package/doc/zh-CN/implemented/fetch.md +31 -0
- package/doc/zh-CN/implemented/lexer.md +23 -0
- package/doc/zh-CN/implemented/modules.md +28 -0
- package/doc/zh-CN/implemented/node/assert.md +17 -0
- package/doc/zh-CN/implemented/node/buffer.md +25 -0
- package/doc/zh-CN/implemented/node/child-process.md +27 -0
- package/doc/zh-CN/implemented/node/crypto.md +9 -0
- package/doc/zh-CN/implemented/node/dgram.md +15 -0
- package/doc/zh-CN/implemented/node/events.md +36 -0
- package/doc/zh-CN/implemented/node/fs-promises.md +30 -0
- package/doc/zh-CN/implemented/node/fs.md +105 -0
- package/doc/zh-CN/implemented/node/http.md +17 -0
- package/doc/zh-CN/implemented/node/net.md +17 -0
- package/doc/zh-CN/implemented/node/os.md +21 -0
- package/doc/zh-CN/implemented/node/path.md +26 -0
- package/doc/zh-CN/implemented/node/process.md +23 -0
- package/doc/zh-CN/implemented/node/querystring.md +20 -0
- package/doc/zh-CN/implemented/node/stream-promises.md +8 -0
- package/doc/zh-CN/implemented/node/stream.md +15 -0
- package/doc/zh-CN/implemented/node/test.md +10 -0
- package/doc/zh-CN/implemented/node/url.md +8 -0
- package/doc/zh-CN/implemented/node/util.md +25 -0
- package/doc/zh-CN/implemented/node/worker-threads.md +9 -0
- package/doc/zh-CN/implemented/node/zlib.md +8 -0
- package/doc/zh-CN/implemented/node.md +45 -0
- package/doc/zh-CN/implemented/operators.md +38 -0
- package/doc/zh-CN/implemented/parser.md +58 -0
- package/doc/zh-CN/implemented/pipeline.md +25 -0
- package/doc/zh-CN/implemented/runtime-core.md +31 -0
- package/doc/zh-CN/implemented/stdlib.md +76 -0
- package/doc/zh-CN/implemented/strings.md +27 -0
- package/doc/zh-CN/implemented/tests.md +10 -0
- package/doc/zh-CN/implemented/typed-arrays.md +26 -0
- package/doc/zh-CN/implemented/value-model.md +18 -0
- package/doc/zh-CN/implemented.md +50 -350
- package/doc/zh-CN/node-implemented.md +4 -531
- package/doc/zh-CN/node-unimplemented.md +4 -139
- package/doc/zh-CN/plan-require-node-modules.md +4 -4
- package/doc/zh-CN/requirements.md +20 -6
- package/doc/zh-CN/unimplemented/classes.md +22 -0
- package/doc/zh-CN/unimplemented/deviations.md +24 -0
- package/doc/zh-CN/unimplemented/expressions.md +24 -0
- package/doc/zh-CN/unimplemented/functions.md +21 -0
- package/doc/zh-CN/unimplemented/modules.md +19 -0
- package/doc/zh-CN/unimplemented/node/async.md +20 -0
- package/doc/zh-CN/unimplemented/node/bun.md +8 -0
- package/doc/zh-CN/unimplemented/node/fs-promises.md +12 -0
- package/doc/zh-CN/unimplemented/node/fs.md +24 -0
- package/doc/zh-CN/unimplemented/node/globals.md +14 -0
- package/doc/zh-CN/unimplemented/node/modules.md +15 -0
- package/doc/zh-CN/unimplemented/node.md +18 -0
- package/doc/zh-CN/unimplemented/statements.md +15 -0
- package/doc/zh-CN/unimplemented/stdlib.md +54 -0
- package/doc/zh-CN/unimplemented/toolchain.md +14 -0
- package/doc/zh-CN/unimplemented/types.md +11 -0
- package/doc/zh-CN/unimplemented.md +14 -237
- package/llms.txt +32 -4
- package/package.json +1 -1
- package/runtime/ext_gui/inline_svg.cpp +219 -0
- package/runtime/ext_gui/inline_svg.h +41 -0
- package/runtime/ext_gui/layout.cpp +18 -0
- package/runtime/ext_gui/layout.h +7 -0
- package/runtime/ext_gui/layout_flow.cpp +4 -3
- package/runtime/ext_gui/paint.cpp +14 -0
- package/runtime/ext_gui/paint.h +5 -1
- package/runtime/ext_gui/renderer_image.cpp +53 -25
- package/runtime/ext_gui/renderer_shaders.h +2 -2
- package/runtime/ext_gui/stb_image.h +1 -17
- package/runtime/ext_gui/style_ua.cpp +3 -0
- package/runtime/ext_gui/svg.cpp +122 -39
- package/runtime/ext_gui/svg.h +14 -3
- package/runtime/ext_gui/window.cpp +28 -0
- package/runtime/ext_node/child_process/child_process.c +173 -73
- package/runtime/ext_node/fs/async_api.c +314 -0
- package/runtime/ext_node/fs/async_complete.c +99 -0
- package/runtime/ext_node/fs/async_fh.c +206 -0
- package/runtime/ext_node/fs/async_job.c +81 -0
- package/runtime/ext_node/fs/async_job.h +132 -0
- package/runtime/ext_node/fs/async_worker.c +534 -0
- package/runtime/ext_node/fs/async_worker_dir.c +439 -0
- package/runtime/ext_node/fs/async_worker_dir.h +33 -0
- package/runtime/ext_node/fs/async_worker_fd.c +74 -0
- package/runtime/ext_node/fs/dir.c +60 -15
- package/runtime/ext_node/fs/fs_common.h +9 -0
- package/runtime/ext_node/fs/fs_ops.c +18 -29
- package/runtime/ext_node/fs/parts/builtins.inc +34 -0
- package/runtime/ext_node/fs/parts/platform.inc +66 -0
- package/runtime/ext_node/fs/promises.c +44 -234
- package/runtime/rt.h +15 -0
- package/runtime/rt_internal.h +108 -0
- package/runtime/xt_alloc.c +43 -7
- package/runtime/xt_array_buffer.c +284 -0
- package/runtime/xt_async.c +46 -21
- package/runtime/xt_async_io.c +333 -0
- package/runtime/xt_async_io.h +47 -0
- package/runtime/xt_bigint/helpers.inc +3 -3
- package/runtime/xt_builtins.c +21 -17
- package/runtime/xt_constructors.c +12 -2
- package/runtime/xt_containers/access.inc +148 -3
- package/runtime/xt_containers/objects.inc +26 -2
- package/runtime/xt_containers/shapes.inc +71 -0
- package/runtime/xt_containers.c +1 -0
- package/runtime/xt_coroutine.c +17 -0
- package/runtime/xt_fetch/async.inc +295 -0
- package/runtime/xt_fetch/request.inc +6 -183
- package/runtime/xt_fetch/socket.inc +5 -4
- package/runtime/xt_fetch.c +6 -4
- package/runtime/xt_generator.c +299 -10
- package/runtime/xt_io/inspect.inc +112 -0
- package/runtime/xt_loop.c +79 -7
- package/runtime/xt_performance.c +37 -0
- package/runtime/xt_promise.c +63 -1
- package/runtime/xt_stdlib/arrays.inc +1 -1
- package/runtime/xt_stdlib/dispatch.inc +46 -11
- package/runtime/xt_stdlib/strings.inc +1 -1
- package/runtime/xt_stdlib2/array-statics.inc +25 -0
- package/runtime/xt_stdlib2/arrays.inc +5 -3
- package/runtime/xt_stdlib2/container.inc +5 -0
- package/runtime/xt_stdlib2/date.inc +111 -3
- package/runtime/xt_stdlib2/error.inc +24 -0
- package/runtime/xt_stdlib2/json.inc +310 -19
- package/runtime/xt_stdlib2/number-string-statics.inc +1 -1
- package/runtime/xt_stdlib2/objects.inc +122 -0
- package/runtime/xt_stdlib2/set.inc +1 -1
- package/runtime/xt_structured_clone.c +159 -0
- package/runtime/xt_symbol.c +2 -2
- package/runtime/xt_text_codec.c +69 -0
- package/runtime/xt_typed_array/construction.inc +35 -5
- package/runtime/xt_typed_array/elements.inc +159 -0
- package/runtime/xt_typed_array/methods.inc +21 -5
- package/runtime/xt_typed_array.c +7 -10
- package/runtime/xt_url.c +375 -0
- package/runtime/xt_values/arithmetic.inc +2 -2
- package/runtime/xt_values/conversions.inc +1 -1
- package/runtime/xt_weak.c +281 -0
- package/scripts/build-gui.ts +133 -60
- package/scripts/check-version.ts +3 -3
- package/src/binder/declarations.ts +14 -3
- package/src/cli/hints.ts +8 -1
- package/src/cli/main.ts +119 -18
- package/src/cli/watch.ts +101 -0
- package/src/codegen/generator/calls/access.ts +10 -2
- package/src/codegen/generator/calls/closures.ts +12 -4
- package/src/codegen/generator/context.ts +23 -3
- package/src/codegen/generator/expressions/operators.ts +27 -13
- package/src/codegen/generator/expressions/primary.ts +4 -0
- package/src/codegen/generator/module.ts +0 -7
- package/src/codegen/generator/numeric.ts +85 -11
- package/src/codegen/generator/state.ts +23 -0
- package/src/codegen/generator/statements/control-flow.ts +1 -4
- package/src/codegen/generator/statements/loops.ts +50 -16
- package/src/codegen/generator/tables.ts +26 -1
- package/src/diagnostics/diagnostic.ts +23 -3
- package/src/driver/app-artifacts.ts +77 -0
- package/src/driver/build-key.ts +55 -0
- package/src/driver/bundler/graph.ts +63 -13
- package/src/driver/bundler/merge.ts +4 -1
- package/src/driver/compiler.ts +94 -328
- package/src/driver/config.ts +11 -0
- package/src/driver/frontend.ts +120 -0
- package/src/driver/index.ts +0 -1
- package/src/driver/options.ts +70 -0
- package/src/driver/runtime-objects.ts +134 -0
- package/src/driver/toolchain-provider.ts +4 -0
- package/src/driver/toolchain.ts +154 -10
- package/src/driver/version.ts +12 -0
- package/src/driver/win-icon.ts +36 -36
- package/src/extensions/node/fs/index.ts +12 -3
- package/src/extensions/node/fs-promises/index.ts +15 -6
- package/src/parser/declarations/classes.ts +4 -0
- package/src/parser/declarations/functions.ts +12 -1
- package/src/parser/modules.ts +8 -4
- package/src/parser/parser.ts +28 -0
|
@@ -1,167 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Node extension: unimplemented (moved)
|
|
2
2
|
|
|
3
|
-
This
|
|
4
|
-
|
|
5
|
-
and lists the features that the **Node extension currently does not implement /
|
|
6
|
-
is missing**.
|
|
7
|
-
|
|
8
|
-
> Related documents:
|
|
9
|
-
> - Core language capabilities: [implemented.md](./implemented.md) / [unimplemented.md](./unimplemented.md)
|
|
10
|
-
> - Implemented parts of the Node extension: [node-implemented.md](./node-implemented.md)
|
|
3
|
+
This page moved to [Node extension: unimplemented](./unimplemented/node.md).
|
|
4
|
+
The Node documentation is now split by module under `doc/unimplemented/node/`.
|
|
11
5
|
|
|
12
6
|
> Language: **English** | [简体中文](./zh-CN/node-unimplemented.md)
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## 1. Unimplemented in the `fs` module
|
|
17
|
-
|
|
18
|
-
`fs` now implements the **synchronous** API surface (files, directories,
|
|
19
|
-
descriptors, metadata, links, `cp`, `glob`, `Dir`, `constants`) and
|
|
20
|
-
`fs/promises` wraps each synchronous function in an already-settled Promise
|
|
21
|
-
(see [node-implemented.md](./node-implemented.md)). The rest is still
|
|
22
|
-
unimplemented because xbintsc has **no asynchronous I/O scheduler** for file
|
|
23
|
-
operations (the `fs` module has no reactor backend; the core event loop does
|
|
24
|
-
provide timers and sockets):
|
|
25
|
-
|
|
26
|
-
| Unimplemented API | Category |
|
|
27
|
-
| --- | --- |
|
|
28
|
-
| `readFile` / `writeFile` / `appendFile` / `open` / `close` / `read` / `write` / `stat` / … | callback-style async file operations (`fs/promises` provides the Promise forms) |
|
|
29
|
-
| `createReadStream` / `createWriteStream` | streaming read/write |
|
|
30
|
-
| `watch` / `watchFile` | **real** file watching: the functions exist but the returned objects never emit (there is no inotify/kqueue backend) |
|
|
31
|
-
| `openAsBlob`, `statfs` callback form, `rmdir` `maxRetries` / `retryDelay` | misc. options requiring async retry |
|
|
32
|
-
| `glob` `exclude` / `follow`, `cp` `filter` | option callbacks |
|
|
33
|
-
|
|
34
|
-
### 1.1 Read semantics gaps
|
|
35
|
-
|
|
36
|
-
- `readFileSync` supports encoding options (default/`utf8`/`ascii`/`latin1`/`binary`/ `hex`/`base64`/`base64url`), but **does not return a `Buffer`** by default: even though `Buffer` exists (simulated as a plain object), `readFileSync` still returns a string. Pass a `Buffer`-producing path or read raw bytes explicitly.
|
|
37
|
-
- `utf16le` / `ucs2` decoding is not implemented (the bytes are returned as text).
|
|
38
|
-
- `watch` / `watchFile` / `unwatchFile` return API-shaped emitter objects whose `.close()` / `.on()` methods exist but which **never fire** events.
|
|
39
|
-
- `Dir.read(cb)` / `Dir.close(cb)` and the async form of `FileHandle` methods complete **synchronously** (the callback/Promise is invoked immediately).
|
|
40
|
-
- `mkdtempSync` always appends 6 random characters to the prefix (it does not require a trailing `XXXXXX`).
|
|
41
|
-
- `globSync` supports `*`, `?`, `[...]` and `**` but not the `exclude` callback or `follow`; `**` does not descend through symlinks (matching Node's default).
|
|
42
|
-
- `cpSync` symlink handling follows Node for the common cases but `verbatimSymlinks` is not supported.
|
|
43
|
-
- Platform deviations: on Windows `readlinkSync` raises `ENOSYS` and `chmodSync` / `lchmodSync` / `chownSync` / `lchownSync` / `fchmodSync` / `fchownSync` are no-ops; `statfsSync` returns zeroed fields on Windows/AIX/Sun; `lutimesSync` falls back to `utimesSync` on macOS/Windows.
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## 2. Other Node modules fully unimplemented
|
|
48
|
-
|
|
49
|
-
The following Node built-in modules have no corresponding extension / builtin
|
|
50
|
-
(`fs` / `fs/promises` / `path` / `os` / `process` / `buffer` / `stream` /
|
|
51
|
-
`dgram` / `http` / `events` / `util` / `querystring` / `assert` / `test` are
|
|
52
|
-
implemented, and `crypto` / `url` / `child_process` / `zlib` /
|
|
53
|
-
`stream/promises` / `worker_threads` are partially implemented; see
|
|
54
|
-
[node-implemented.md](./node-implemented.md)):
|
|
55
|
-
|
|
56
|
-
| Module | Notes |
|
|
57
|
-
| --- | --- |
|
|
58
|
-
| `https` | TLS version of HTTP |
|
|
59
|
-
| `readline` | command-line reading |
|
|
60
|
-
| `tls` / `cluster` / `vm` / `os` (partially) etc. | other modules not listed |
|
|
61
|
-
|
|
62
|
-
> `crypto` (only `createHash`, now with the streaming API), `url` (only
|
|
63
|
-
> `pathToFileURL` / `fileURLToPath`), `child_process` (only `spawnSync`),
|
|
64
|
-
> `zlib` (only `createGzip`) and `worker_threads` (only `Worker` /
|
|
65
|
-
> `isMainThread` / `workerData` / `parentPort`) are partially implemented.
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
## 3. Node global objects / namespaces
|
|
70
|
-
|
|
71
|
-
| Unimplemented | Notes |
|
|
72
|
-
| --- | --- |
|
|
73
|
-
| `global` / `globalThis` | none |
|
|
74
|
-
| `__dirname` / `__filename` | none |
|
|
75
|
-
| `require` / `module` / `exports` | only inside `node_modules` packages (the bundler lowers them); user code must use ESM `import` |
|
|
76
|
-
| `fs.readFileSync(...)` without an `import` | ✗ unsupported. `fs` is not a global; import it first (`import fs from "fs"` or `import * as fs from "node:fs"`) and `fs.readFileSync(...)` lowers to the module's runtime symbol. |
|
|
77
|
-
|
|
78
|
-
Node modules are reached through `import` with a bare or `node:`-prefixed
|
|
79
|
-
specifier (`import { readFileSync } from "fs"`, `import path from "path"`,
|
|
80
|
-
`import { platform } from "node:os"`). Named and namespace imports both resolve
|
|
81
|
-
to the extension module's runtime entries.
|
|
82
|
-
|
|
83
|
-
Supported namespace calls: `path.*`, `os.*`, `process.*`, `fs.*`,
|
|
84
|
-
`fs/promises.*` (methods), `child_process.*`, `crypto.*`, `url.*` once imported
|
|
85
|
-
(a namespace/default import or, for `path`/`os`/`process`, the global name),
|
|
86
|
-
plus the dispatcher-backed namespaces `Buffer.*`, `stream.*`, `net.*`,
|
|
87
|
-
`dgram.*`, `http.*` and properties such as `process.platform` /
|
|
88
|
-
`process.argv`. `Readable` / `Writable` / `Duplex` / `Transform` / `PassThrough`
|
|
89
|
-
/ `Buffer` can also be used as global constructors.
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## 4. Async / event loop model
|
|
94
|
-
|
|
95
|
-
Implemented:
|
|
96
|
-
|
|
97
|
-
- Core event loop `runtime/xt_loop.c` (a `select(2)` reactor); `net` / `dgram` / `http` are all built on it.
|
|
98
|
-
- `Promise`, `async` / `await` are available (see the core documents); `fs/promises` returns Promises.
|
|
99
|
-
- Timers are available as globals: `setTimeout` / `clearTimeout` / `setInterval` / `clearInterval` run on the core reactor and keep the process alive until no timer remains.
|
|
100
|
-
- A standalone `EventEmitter` is provided by the `events` module (also a global constructor); streams and sockets additionally carry internal emitter methods (`on` / `addListener` / `once` / `off` / `removeListener` / `emit`).
|
|
101
|
-
|
|
102
|
-
Still unimplemented:
|
|
103
|
-
|
|
104
|
-
- `setImmediate` / `queueMicrotask` and Node's `Timeout` object (`setTimeout` returns a numeric id).
|
|
105
|
-
- A real asynchronous I/O scheduler: `fs/promises` is essentially an immediate-settle wrapper around synchronous operations and does not yield while waiting for I/O.
|
|
106
|
-
- On streams and sockets the built-in `once` is equivalent to `on` (no "remove after firing once" semantics); the `events` module's `EventEmitter` does implement real `once`.
|
|
107
|
-
- `net`'s `connect` is blocking; HTTP responses require `Connection: close`, with no keep-alive / chunked transfer / pipelining.
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## 5. Bun extension unimplemented
|
|
112
|
-
|
|
113
|
-
The `Bun.file` and other Bun APIs mentioned in the design document are only
|
|
114
|
-
design examples of the extension mechanism and are **not yet implemented**:
|
|
115
|
-
|
|
116
|
-
- No `bun` extension directory, no Bun builtins, no Bun C runtime.
|
|
117
|
-
- Under `src/extensions/` there is currently only the single platform extension `node` (plus the core extension).
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## 6. Quick reference: Node extension unimplemented list
|
|
122
|
-
|
|
123
|
-
```
|
|
124
|
-
Implemented (fs): the full synchronous surface — readFileSync (with encoding), readTextFile,
|
|
125
|
-
writeFileSync, appendFileSync, existsSync, readdirSync (withFileTypes/recursive),
|
|
126
|
-
mkdirSync, rmSync, unlinkSync, rmdirSync, renameSync, copyFileSync, cpSync,
|
|
127
|
-
realpathSync, statSync, lstatSync, statfsSync, accessSync, chmodSync, lchmodSync,
|
|
128
|
-
chownSync, lchownSync, truncateSync, utimesSync, lutimesSync, mkdtempSync,
|
|
129
|
-
linkSync, symlinkSync, readlinkSync, opendirSync (Dir), globSync, watch,
|
|
130
|
-
watchFile, unwatchFile, constants,
|
|
131
|
-
openSync, closeSync, readSync, writeSync, readvSync, writevSync, fstatSync,
|
|
132
|
-
fsyncSync, fdatasyncSync, ftruncateSync, fchmodSync, fchownSync, futimesSync
|
|
133
|
-
Implemented (fs/promises): readFile, writeFile, appendFile, mkdir, readdir, rm, unlink,
|
|
134
|
-
rmdir, rename, copyFile, cp, realpath, stat, lstat, statfs, access,
|
|
135
|
-
open (FileHandle), chmod, lchmod, chown, lchown, truncate, utimes,
|
|
136
|
-
lutimes, link, symlink, readlink, mkdtemp, opendir, glob, watch, constants
|
|
137
|
-
Implemented (other modules): path (join/resolve/normalize/dirname/basename/extname/isAbsolute/relative),
|
|
138
|
-
os (platform/arch/type/release/endianness/homedir/tmpdir/hostname/totalmem/freemem/cpus),
|
|
139
|
-
process (cwd/exit/uptime/hrtime/getuid/platform/arch/pid/ppid/argv/env/version/title),
|
|
140
|
-
buffer (from/alloc/isBuffer/byteLength/concat/compare + instance methods),
|
|
141
|
-
stream (Readable/Writable/Duplex/Transform/PassThrough, pipe),
|
|
142
|
-
net (createServer/connect/isIP + Server/Socket),
|
|
143
|
-
dgram (createSocket + bind/send/close/address),
|
|
144
|
-
http (createServer/request/get + req/res),
|
|
145
|
-
events (EventEmitter: on/once/off/emit/listeners/listenerCount/eventNames),
|
|
146
|
-
util (format/inspect/isDeepStrictEqual/inherits/promisify + isX),
|
|
147
|
-
querystring (parse/stringify/escape/unescape),
|
|
148
|
-
crypto (createHash + streaming, SHA-1/SHA-256),
|
|
149
|
-
url (pathToFileURL/fileURLToPath only),
|
|
150
|
-
child_process (spawnSync only),
|
|
151
|
-
zlib (createGzip only), stream/promises (pipeline only),
|
|
152
|
-
worker_threads (Worker/isMainThread/workerData/parentPort only)
|
|
153
|
-
|
|
154
|
-
Unimplemented (fs): callback-style async file operations (readFile/writeFile/appendFile/open/
|
|
155
|
-
read/write/close), createReadStream/createWriteStream, real file watching
|
|
156
|
-
(watch/watchFile objects never emit),
|
|
157
|
-
glob exclude/follow, cp filter, utf16le decoding, Buffer return from readFileSync
|
|
158
|
-
|
|
159
|
-
Unimplemented (other modules): https, readline, tls, cluster, vm
|
|
160
|
-
|
|
161
|
-
Unimplemented (global/namespace): global/globalThis, __dirname, __filename,
|
|
162
|
-
require/module/exports, fs.readFileSync(...) namespace calls
|
|
163
|
-
|
|
164
|
-
Unimplemented (async): setImmediate / queueMicrotask, real async I/O scheduling, keep-alive
|
|
165
|
-
|
|
166
|
-
Unimplemented (platform): Bun extension (design example only)
|
|
167
|
-
```
|
package/doc/requirements.md
CHANGED
|
@@ -46,6 +46,13 @@ Working around the limitation by compiling the IR elsewhere is not supported.
|
|
|
46
46
|
The Windows release targets the **MSVC ABI**: clang uses the
|
|
47
47
|
Windows SDK and the MSVC C/C++ runtime/headers.
|
|
48
48
|
|
|
49
|
+
Optional optimization features add two tools:
|
|
50
|
+
|
|
51
|
+
- `--lto` needs **lld** (`-fuse-ld=lld`); the LLVM installs above include it.
|
|
52
|
+
- `--pgo-use` needs **llvm-profdata** to merge `.profraw` files. The driver
|
|
53
|
+
prefers the copy next to the resolved clang; override it with
|
|
54
|
+
`xbintsc_LLVM_PROFDATA`.
|
|
55
|
+
|
|
49
56
|
## Prebuilt releases (recommended)
|
|
50
57
|
|
|
51
58
|
Download the archive for your platform from
|
|
@@ -114,9 +121,10 @@ Verify with `clang --version`. If xbintsc uses the wrong linker, set
|
|
|
114
121
|
`xbintsc_CLANG` to the clang you want and/or pass extra flags through
|
|
115
122
|
`xbintsc_LINKER_ARGS` (for example `-fuse-ld=lld`).
|
|
116
123
|
|
|
117
|
-
## Windows — install
|
|
124
|
+
## Windows — install the MSVC C++ build tools (and LLVM)
|
|
118
125
|
|
|
119
|
-
|
|
126
|
+
xbintsc targets the **MSVC ABI** on Windows. Install the Visual Studio C++
|
|
127
|
+
build tools plus LLVM with `winget`:
|
|
120
128
|
|
|
121
129
|
```powershell
|
|
122
130
|
winget install -e --id LLVM.LLVM
|
|
@@ -124,17 +132,24 @@ winget install -e --id Microsoft.VisualStudio.2022.BuildTools `
|
|
|
124
132
|
--override "--quiet --wait --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended"
|
|
125
133
|
```
|
|
126
134
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
135
|
+
The LLVM bundled with Visual Studio 2022
|
|
136
|
+
(`VC\Tools\Llvm\x64\bin\clang.exe`, version 19.1.5 in current installs) is
|
|
137
|
+
enough, and so is a standalone LLVM. Either way the compiler must target the
|
|
138
|
+
MSVC ABI (`Target: *-windows-msvc`): clang built for another Windows ABI cannot
|
|
139
|
+
link with the MSVC runtime, so `xbintsc` rejects it with an explicit error.
|
|
140
|
+
|
|
141
|
+
A developer prompt is normally **not** required: `xbintsc` resolves the Visual
|
|
142
|
+
Studio LLVM by absolute path, and that clang locates the MSVC/SDK headers,
|
|
143
|
+
libraries and linker itself. If your installation still needs the environment
|
|
144
|
+
imported, run the build from an **x64 Native Tools Command Prompt for VS 2022**
|
|
145
|
+
(or **ARM64 Native Tools** on Windows on ARM), or import it manually:
|
|
132
146
|
|
|
133
147
|
```powershell
|
|
134
148
|
& "$env:ProgramFiles\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
|
|
135
149
|
```
|
|
136
150
|
|
|
137
|
-
Verify with `clang --version`
|
|
151
|
+
Verify with `xbintsc doctor` (or `clang --version`); the report names the
|
|
152
|
+
resolved compiler, its version and its target.
|
|
138
153
|
|
|
139
154
|
## Building from source (contributors only)
|
|
140
155
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Classes and object orientation
|
|
2
|
+
|
|
3
|
+
> Part of [Unimplemented syntax and features](../unimplemented.md) · [简体中文](../zh-CN/unimplemented/classes.md)
|
|
4
|
+
|
|
5
|
+
| Feature | Status |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `class` declarations / class expressions | ✓ implemented |
|
|
8
|
+
| `constructor` | ✓ |
|
|
9
|
+
| Instance fields / property declarations | ✓ |
|
|
10
|
+
| Methods | ✓ |
|
|
11
|
+
| `static` fields / methods | ✓ |
|
|
12
|
+
| Inheritance `extends` / `super` | ✓ (single level correct; `super` takes the prototype of `this`'s prototype — see [Runtime deviations](./deviations.md)) |
|
|
13
|
+
| Prototype chain / method lookup | ✓ |
|
|
14
|
+
| `instanceof` | ✓ |
|
|
15
|
+
| `new` / instantiation | ✓ |
|
|
16
|
+
| `get` / `set` accessors | ✓ implemented |
|
|
17
|
+
| Parameter properties `constructor(public x: T)` | ✓ implemented |
|
|
18
|
+
| Private fields `#x` | ✓ implemented (stored under a literal `#x` key; no accessibility enforcement) |
|
|
19
|
+
| `enum` / `const enum` | ✓ implemented (forward + reverse mapping) |
|
|
20
|
+
| `private` / `protected` / `public` / `readonly` modifiers | ✗ no access control (erased) |
|
|
21
|
+
| `abstract` / `implements` | ✗ (erased) |
|
|
22
|
+
| Parent/child `#x` name collisions | ✗ may alias (same literal key) |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Runtime deviations
|
|
2
|
+
|
|
3
|
+
> Part of [Unimplemented syntax and features](../unimplemented.md) · [简体中文](../zh-CN/unimplemented/deviations.md)
|
|
4
|
+
|
|
5
|
+
These features **compile and run**, but the result does not fully match ECMAScript:
|
|
6
|
+
|
|
7
|
+
| Item | Deviation |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| RegExp byte-oriented matching | The engine matches UTF-8 bytes: literal multi-byte text works, but `.` and character classes consume one byte per repetition (`\d` / `\w` stay ASCII). Offsets returned by `exec` / `search` / replacement callbacks are converted to UTF-16 code units |
|
|
10
|
+
| Global RegExp `lastIndex` | `test` / `exec` do not advance or honour a caller-set `lastIndex` for `/g` / `/y` regexes |
|
|
11
|
+
| String `normalize` | Not implemented |
|
|
12
|
+
| First-class built-in methods | Implemented as unbound method values (see [Functions](./functions.md)); `fn.toString()` returns a placeholder rather than source text |
|
|
13
|
+
| `for...in` | Enumerates own keys of objects / arrays / strings; does not include prototype-chain properties |
|
|
14
|
+
| Array out-of-bounds / sparse | Out-of-bounds access returns `undefined`; assigning `arr.length` truncates / extends, but sparse holes are not tracked distinctly |
|
|
15
|
+
| Memory management | Non-moving mark-sweep collector behind `xt_alloc`: explicit roots, subsystem root providers and a conservative C-stack scan. Single-threaded and stop-the-world; no moving/compaction or generational mode |
|
|
16
|
+
| Function `arity` / argument count | No argument count validation; `fn.length` reports the declared arity but calls are never checked against it |
|
|
17
|
+
| `async` / `await` | Real suspension on a stackful coroutine; `await` always queues a microtask (non-promises and already-settled promises included), so interleaving with pending `.then` callbacks matches the specification. Top-level `await` blocks on the event loop rather than yielding the module body. `fs/promises` and `fetch` offload their blocking work to a four-worker pool and settle on the reactor. Async generators suspend at both `await` and `yield`; `for await...of` awaits one step per iteration |
|
|
18
|
+
| Async generator cleanup | `for await...of` does not call the iterator's `return()` when the loop exits early. `yield*` inside an async generator delegates to synchronous iterables only. `.return()` at a suspended `yield` completes without running `finally` (the same limitation as synchronous generators) |
|
|
19
|
+
| `super` | `super.x` / `super(...)` takes the prototype of `this`'s prototype; single-level inheritance is correct, but depth > 1 may be inaccurate |
|
|
20
|
+
| `Error.stack` | Function-level frames only: each frame is `at name (file:line)` with the function's declaration line (updated to the construction line for the innermost frame); no column numbers and no frames for generator / `async` bodies (they switch stacks) |
|
|
21
|
+
| Module live bindings | Namespace imports and imported bindings are snapshots (see [Module system](./modules.md)) |
|
|
22
|
+
| `import.meta` | ✓ `import.meta.url` / `.dirname` / `.filename`, resolved from the executable path |
|
|
23
|
+
|
|
24
|
+
> Number formatting, loose equality, `+` / relational `ToPrimitive`, whole-chain
|
|
25
|
+
> optional chaining, `finally` on early exit and object-key ordering have all
|
|
26
|
+
> been brought in line with Node and are covered by the differential tests, so
|
|
27
|
+
> they are no longer listed as deviations.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Expressions and operators
|
|
2
|
+
|
|
3
|
+
> Part of [Unimplemented syntax and features](../unimplemented.md) · [简体中文](../zh-CN/unimplemented/expressions.md)
|
|
4
|
+
|
|
5
|
+
## Parsed but codegen reports `UnsupportedFeature`
|
|
6
|
+
|
|
7
|
+
None — generators are implemented.
|
|
8
|
+
|
|
9
|
+
> Tagged templates are implemented, including raw strings and `String.raw`.
|
|
10
|
+
> Generators (`function*`, `yield`, `yield*`) are implemented with stackful
|
|
11
|
+
> coroutines, including `next`/`throw`/`return`, `for...of`, spread and
|
|
12
|
+
> delegation. `async function*` and `for await...of` are implemented: the body
|
|
13
|
+
> may suspend at both `await` and `yield`, and every `.next()` returns a
|
|
14
|
+
> promise. `import.meta` exposes `url`, `dirname` and `filename`, resolved from
|
|
15
|
+
> the running executable's path (see [Module system](./modules.md)).
|
|
16
|
+
|
|
17
|
+
## Not supported by the parser
|
|
18
|
+
|
|
19
|
+
None known at the expression level.
|
|
20
|
+
|
|
21
|
+
## Unimplemented operators
|
|
22
|
+
|
|
23
|
+
| Operator | Status | Notes |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| `new.target` | ✗ | parsed, then rejected with `UnsupportedFeature` (no `new.target` semantics) |
|
|
26
|
+
| `typeof` / `void` / `in` / `delete` / `instanceof` | ✓ | mapped to runtime helpers (`xt_typeof`, `xt_in`, `xt_delete`, `xt_instance_of`) |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Functions
|
|
2
|
+
|
|
3
|
+
> Part of [Unimplemented syntax and features](../unimplemented.md) · [简体中文](../zh-CN/unimplemented/functions.md)
|
|
4
|
+
|
|
5
|
+
| Feature | Parse | Semantics |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| Default parameters `function f(a = 5)` | ✓ | ✓ implemented |
|
|
8
|
+
| Rest parameters `function f(...args)` | ✓ | ✓ implemented |
|
|
9
|
+
| Spread in call arguments `f(...args)` | ✓ | ✓ implemented |
|
|
10
|
+
| Destructuring parameters / bindings | ✓ | ✓ implemented |
|
|
11
|
+
| `arguments` object | ✓ (implicit) | ✓ implemented (arrow functions get their own parameters, not the outer function's `arguments`, unlike JS) |
|
|
12
|
+
| `this` binding / method call semantics | ✓ | ✓ implemented (`this` is threaded as the first ABI parameter; arrow functions inherit lexically) |
|
|
13
|
+
| `async` / `await` / Promise | ✓ | ✓ implemented with stackful-coroutine suspension: awaiting a pending promise pauses the body and the event loop resumes it (see the deviations table for the remaining differences) |
|
|
14
|
+
| `new.target` | ✗ | parsed, then rejected with `UnsupportedFeature` (no `new.target` semantics) |
|
|
15
|
+
| Generators / iterators / `yield` | ✓ implemented | `function*`, `yield`, `yield*`, `.next/.throw/.return`; `async function*`, `for await...of` and `Symbol.asyncIterator` are supported |
|
|
16
|
+
| Closure `arity` | — | `xt_closure_arity` is always -1, never filled in |
|
|
17
|
+
| `fn.call` / `fn.apply` / `fn.bind` | ✓ | ✓ implemented (the bound closure does not track partial-argument `length`) |
|
|
18
|
+
| `fn.name` / `fn.length` | ✓ | ✓ implemented (inferred from the declaration / assignment / property key; bound functions use `"bound ..."` and adjusted arity) |
|
|
19
|
+
| First-class built-in constructors (`const A = Array`, `new A(...)`, `typeof Map`) | ✓ | ✓ constructors are ordinary function values with `name`/`length`, a `prototype`, their statics (`A.isArray`) and the full `instanceof` protocol |
|
|
20
|
+
| First-class built-in methods (`typeof arr.map`, `const f = arr.push`, `obj.method?.()`) | ✓ | ✓ implemented as *unbound* method values: reading `arr.map` yields a function, `arr.map?.(cb)` and `obj.method?.()` bind the receiver as `this`, and a detached call (`const f = arr.map; f(cb)`) throws exactly like JavaScript. Method `name`/`length` are exposed |
|
|
21
|
+
| `fn.toString()` | ~ | returns a native-style placeholder (`function name() { [native code] }`) instead of the original source text |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Module system
|
|
2
|
+
|
|
3
|
+
> Part of [Unimplemented syntax and features](../unimplemented.md) · [简体中文](../zh-CN/unimplemented/modules.md)
|
|
4
|
+
|
|
5
|
+
| Feature | Status |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| Multi-file / module resolution and linking | ✓ driver-layer AST bundling (`src/driver/modules.ts`): parse each module, rename top-level symbols by module prefix, rewrite references, merge into one file and rebind |
|
|
8
|
+
| Named import/export | ✓ `import { a, b as c }` / `export { a as b }` / `export const/let/var/function/class` |
|
|
9
|
+
| Default import/export | ✓ `export default` / `import d from` |
|
|
10
|
+
| Re-export `export { x } from` / `export * from` | ✓ (`export *` copies the dependency's exports) |
|
|
11
|
+
| Namespace import `import * as ns` | ✓ lowered to a synthetic object literal holding every export |
|
|
12
|
+
| Circular dependencies | ✗ errors out (no circular initialization semantics) |
|
|
13
|
+
| Live bindings | ✗ namespace objects and imported bindings are snapshots at module-evaluation time |
|
|
14
|
+
| ESM `node_modules` packages | ✓ bare specifiers resolve up the tree through `exports` / `module` / `main`, including scoped packages and subpaths; the package sources are bundled like relative modules |
|
|
15
|
+
| CommonJS `require` / `module.exports` | ✓ inside `node_modules` only: the bundler gives each CommonJS package a synthetic `module` / `exports` pair, lowers `require("x")` to the bundled dependency's exports, and hoists external/built-in `require`s into ESM imports. `require()` in user code (outside `node_modules`) is still rejected with a diagnostic pointing at the ESM `import` form. |
|
|
16
|
+
|
|
17
|
+
> Extension modules (such as `fs`) are importable by bare or `node:`-prefixed
|
|
18
|
+
> specifier — `import { readFileSync } from "fs"` / `import path from "path"` —
|
|
19
|
+
> and resolve to their runtime entries (named, default and namespace forms).
|
|
20
|
+
> Relative modules and ESM packages under `node_modules` are bundled at the driver layer.
|
|
21
|
+
|
|
22
|
+
The implemented side of this contract is in [Module system](../implemented/modules.md).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Async and the event-loop model
|
|
2
|
+
|
|
3
|
+
> Part of [Node extension: unimplemented](../node.md) · [简体中文](../../zh-CN/unimplemented/node/async.md)
|
|
4
|
+
|
|
5
|
+
Implemented:
|
|
6
|
+
|
|
7
|
+
- Core event loop `runtime/xt_loop.c` (a `select(2)` reactor); `net` / `dgram` / `http` are all built on it.
|
|
8
|
+
- Async I/O offload `runtime/xt_async_io.c`: blocking file and HTTP-client work runs on four worker threads and completes on the reactor, so `fs/promises` and `fetch` do not stall timers or sockets.
|
|
9
|
+
- `Promise`, `async` / `await` are available (see the core documents); `fs/promises` returns Promises that settle from the reactor.
|
|
10
|
+
- Timers are available as globals: `setTimeout` / `clearTimeout` / `setInterval` / `clearInterval` run on the core reactor and keep the process alive until no timer remains.
|
|
11
|
+
- A standalone `EventEmitter` is provided by the `events` module (also a global constructor); streams and sockets additionally carry internal emitter methods (`on` / `addListener` / `once` / `off` / `removeListener` / `emit`).
|
|
12
|
+
|
|
13
|
+
Still unimplemented:
|
|
14
|
+
|
|
15
|
+
- Node's `Timeout` object (`setTimeout` returns a numeric id; `setImmediate` and `queueMicrotask` exist as globals).
|
|
16
|
+
- File watching: `fs.watch` / `fs/promises.watch` return inert objects; there is no inotify/kqueue/ReadDirectoryChangesW backend.
|
|
17
|
+
- `Dir.read` / `Dir.close` invoke their callbacks immediately, and callback-style `fs.readFile` / `fs.writeFile` / … are still unsupported (use `fs/promises` or the `*Sync` forms).
|
|
18
|
+
- On streams and sockets the built-in `once` is equivalent to `on` (no "remove after firing once" semantics); the `events` module's `EventEmitter` does implement real `once`.
|
|
19
|
+
- `net`'s `connect` is still a blocking `connect(2)` performed before the socket joins the reactor; HTTP responses require `Connection: close`, with no keep-alive / chunked transfer / pipelining. `fetch` has no TLS and buffers the whole body before resolving.
|
|
20
|
+
- The offload pool is fixed at four workers; there is no thread-pool sizing option and no `AbortSignal` cancellation for queued jobs.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# The Bun extension
|
|
2
|
+
|
|
3
|
+
> Part of [Node extension: unimplemented](../node.md) · [简体中文](../../zh-CN/unimplemented/node/bun.md)
|
|
4
|
+
|
|
5
|
+
The `Bun.file` and other Bun APIs mentioned in the design document are only
|
|
6
|
+
design examples of the extension mechanism and are **not yet implemented**:
|
|
7
|
+
|
|
8
|
+
- No `bun` extension directory, no Bun builtins, no Bun C runtime.
|
|
9
|
+
- Under `src/extensions/` there is currently only the single platform extension `node` (plus the core extension).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# `fs/promises` gaps
|
|
2
|
+
|
|
3
|
+
> Part of [Node extension: unimplemented](../node.md) · [简体中文](../../zh-CN/unimplemented/node/fs-promises.md)
|
|
4
|
+
|
|
5
|
+
`fs/promises` now offloads its blocking I/O to the async I/O pool (the
|
|
6
|
+
implemented surface is in
|
|
7
|
+
[implemented: `fs/promises`](../../implemented/node/fs-promises.md)); the
|
|
8
|
+
remaining differences are behavioural:
|
|
9
|
+
|
|
10
|
+
- `FileHandle.appendFile` behaves like `writeFile` (it writes at the current
|
|
11
|
+
file position instead of appending).
|
|
12
|
+
- `FileHandle.readFile()` reads from the current file-descriptor offset.
|
|
13
|
+
- `Dir.read` / `Dir.close` (sync and promise forms) complete their callbacks
|
|
14
|
+
immediately; `Dir.readSync` / `closeSync` remain synchronous.
|
|
15
|
+
- `watch` resolves to the same never-emitting watcher as `fs.watch`; there is no
|
|
16
|
+
real file-watching backend.
|
|
17
|
+
- Reads and writes are whole-file/one-shot operations; there are no streaming
|
|
18
|
+
`FileHandle` variants and no `AbortSignal` cancellation.
|
|
19
|
+
- The pool has four workers; very many simultaneous operations queue behind
|
|
20
|
+
them (they still do not block the event loop).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# `fs`
|
|
2
|
+
|
|
3
|
+
> Part of [Node extension: unimplemented](../node.md) · [简体中文](../../zh-CN/unimplemented/node/fs.md)
|
|
4
|
+
|
|
5
|
+
`fs` implements the **synchronous** API surface (files, directories,
|
|
6
|
+
descriptors, metadata, links, `cp`, `glob`, `Dir`, `constants`), and
|
|
7
|
+
`fs/promises` runs every file/descriptor operation on the asynchronous I/O pool
|
|
8
|
+
(see [implemented: `fs`](../../implemented/node/fs.md) and
|
|
9
|
+
[implemented: `fs/promises`](../../implemented/node/fs-promises.md)). What is
|
|
10
|
+
still missing is mostly about APIs that need a different backend or callback
|
|
11
|
+
plumbing:
|
|
12
|
+
|
|
13
|
+
| Unimplemented API | Category |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| `readFile` / `writeFile` / `appendFile` / `open` / `close` / `read` / `write` / `stat` / … | callback-style async file operations (`fs/promises` provides the Promise forms) |
|
|
16
|
+
| `createReadStream` / `createWriteStream` | streaming read/write |
|
|
17
|
+
| `watch` / `watchFile` | **real** file watching: the functions exist but the returned objects never emit (there is no inotify/kqueue backend) |
|
|
18
|
+
| `openAsBlob`, `statfs` callback form, `rmdir` `maxRetries` / `retryDelay` | misc. options requiring async retry |
|
|
19
|
+
| `glob` `exclude` / `follow`, `cp` `filter` | option callbacks |
|
|
20
|
+
|
|
21
|
+
## Read semantics gaps
|
|
22
|
+
|
|
23
|
+
- `readFileSync` supports encoding options (default/`utf8`/`ascii`/`latin1`/`binary`/ `hex`/`base64`/`base64url`), but **does not return a `Buffer`** by default: even though `Buffer` exists (simulated as a plain object), `readFileSync` still returns a string. Pass a `Buffer`-producing path or read raw bytes explicitly.
|
|
24
|
+
- `utf16le` / `ucs2` decoding is not implemented (the bytes are returned as text).
|
|
25
|
+
- `watch` / `watchFile` / `unwatchFile` return API-shaped emitter objects whose `.close()` / `.on()` methods exist but which **never fire** events.
|
|
26
|
+
- `Dir.read(cb)` / `Dir.close(cb)` complete **synchronously** (the callback is invoked immediately); `FileHandle` methods do return real promises now.
|
|
27
|
+
- `mkdtempSync` always appends 6 random characters to the prefix (it does not require a trailing `XXXXXX`).
|
|
28
|
+
- `globSync` supports `*`, `?`, `[...]` and `**` but not the `exclude` callback or `follow`; `**` does not descend through symlinks (matching Node's default).
|
|
29
|
+
- `cpSync` symlink handling follows Node for the common cases but `verbatimSymlinks` is not supported.
|
|
30
|
+
- Platform deviations: on Windows `readlinkSync` raises `ENOSYS` and `chmodSync` / `lchmodSync` / `chownSync` / `lchownSync` / `fchmodSync` / `fchownSync` are no-ops; `statfsSync` returns zeroed fields on Windows/AIX/Sun; `lutimesSync` falls back to `utimesSync` on macOS/Windows.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Global objects and namespaces
|
|
2
|
+
|
|
3
|
+
> Part of [Node extension: unimplemented](../node.md) · [简体中文](../../zh-CN/unimplemented/node/globals.md)
|
|
4
|
+
|
|
5
|
+
| Unimplemented | Notes |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `global` / `globalThis` | none |
|
|
8
|
+
| `__dirname` / `__filename` | none |
|
|
9
|
+
| `require` / `module` / `exports` | only inside `node_modules` packages (the bundler lowers them); user code must use ESM `import` |
|
|
10
|
+
| `fs.readFileSync(...)` without an `import` | ✗ unsupported. `fs` is not a global; import it first (`import fs from "fs"` or `import * as fs from "node:fs"`) and `fs.readFileSync(...)` lowers to the module's runtime symbol. |
|
|
11
|
+
|
|
12
|
+
Node modules are reached through `import` with a bare or `node:`-prefixed
|
|
13
|
+
specifier (`import { readFileSync } from "fs"`, `import path from "path"`,
|
|
14
|
+
`import { platform } from "node:os"`). Named and namespace imports both resolve
|
|
15
|
+
to the extension module's runtime entries.
|
|
16
|
+
|
|
17
|
+
Supported namespace calls: `path.*`, `os.*`, `process.*`, `fs.*`,
|
|
18
|
+
`fs/promises.*` (methods), `child_process.*`, `crypto.*`, `url.*` once imported
|
|
19
|
+
(a namespace/default import or, for `path`/`os`/`process`, the global name),
|
|
20
|
+
plus the dispatcher-backed namespaces `Buffer.*`, `stream.*`, `net.*`,
|
|
21
|
+
`dgram.*`, `http.*` and properties such as `process.platform` /
|
|
22
|
+
`process.argv`. `Readable` / `Writable` / `Duplex` / `Transform` / `PassThrough`
|
|
23
|
+
/ `Buffer` can also be used as global constructors.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Fully unimplemented modules
|
|
2
|
+
|
|
3
|
+
> Part of [Node extension: unimplemented](../node.md) · [简体中文](../../zh-CN/unimplemented/node/modules.md)
|
|
4
|
+
|
|
5
|
+
The following Node built-in modules have no corresponding extension / builtin
|
|
6
|
+
(`fs` / `fs/promises` / `path` / `os` / `process` / `buffer` / `stream` /
|
|
7
|
+
`dgram` / `http` / `events` / `util` / `querystring` / `assert` / `test` are
|
|
8
|
+
implemented, and `crypto` / `url` / `child_process` / `zlib` /
|
|
9
|
+
`stream/promises` / `worker_threads` are partially implemented; see
|
|
10
|
+
[implemented: Node extension](../../implemented/node.md)):
|
|
11
|
+
|
|
12
|
+
| Module | Notes |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| `https` | TLS version of HTTP |
|
|
15
|
+
| `readline` | command-line reading |
|
|
16
|
+
| `tls` / `cluster` / `vm` | other core modules not listed |
|
|
17
|
+
|
|
18
|
+
> `crypto` (only `createHash`, now with the streaming API), `url` (only
|
|
19
|
+
> `pathToFileURL` / `fileURLToPath`), `child_process` (only `spawnSync`),
|
|
20
|
+
> `zlib` (only `createGzip`) and `worker_threads` (only `Worker` /
|
|
21
|
+
> `isMainThread` / `workerData` / `parentPort`) are partially implemented.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Node extension: unimplemented
|
|
2
|
+
|
|
3
|
+
> Part of [Unimplemented syntax and features](../unimplemented.md) · [简体中文](../zh-CN/unimplemented/node.md)
|
|
4
|
+
|
|
5
|
+
The Node extension implements 21 modules plus the event-loop integration; the
|
|
6
|
+
implemented surface is documented page by page under
|
|
7
|
+
[Node extension: implemented](../implemented/node.md). This section records what
|
|
8
|
+
is missing or differs from Node.
|
|
9
|
+
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [`fs`](./node/fs.md) — callback-style async operations, real file watching, option callbacks
|
|
13
|
+
- [`fs/promises`](./node/fs-promises.md) — `FileHandle` append/read offsets, immediate `Dir` callbacks, inert `watch`, no cancellation
|
|
14
|
+
- [Fully unimplemented modules](./node/modules.md) — `https`, `readline`, `tls`, `cluster`, `vm`, ...
|
|
15
|
+
- [Global objects and namespaces](./node/globals.md) — `global`, `__dirname`, `require` outside `node_modules`
|
|
16
|
+
- [Async and the event-loop model](./node/async.md) — blocked file watching, blocking `net.connect`, no keep-alive, fixed-size offload pool
|
|
17
|
+
- [The Bun extension](./node/bun.md) — design example only
|
|
18
|
+
|
|
19
|
+
A module's implemented page links to its limitation page; when a limitation is
|
|
20
|
+
lifted, move the entry to the matching page under
|
|
21
|
+
`../implemented/node/`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Statements
|
|
2
|
+
|
|
3
|
+
> Part of [Unimplemented syntax and features](../unimplemented.md) · [简体中文](../zh-CN/unimplemented/statements.md)
|
|
4
|
+
|
|
5
|
+
## Parsed but codegen reports `UnsupportedFeature`
|
|
6
|
+
|
|
7
|
+
| Syntax | Status | Notes |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `namespace` / `module` declarations | parse ✓, codegen ✗ | → "does not yet support this statement (module declaration)" |
|
|
10
|
+
|
|
11
|
+
> Labeled statements (`label: statement`, `break label`, `continue label`) are
|
|
12
|
+
> implemented, including labels on non-loop statements.
|
|
13
|
+
|
|
14
|
+
## Not supported by the parser (immediate syntax error)
|
|
15
|
+
|
|
16
|
+
None known at the statement level. The parser is intentionally permissive and
|
|
17
|
+
accepts most TypeScript statement syntax; unsupported forms are rejected later
|
|
18
|
+
by code generation (see above).
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Standard library
|
|
2
|
+
|
|
3
|
+
> Part of [Unimplemented syntax and features](../unimplemented.md) · [简体中文](../zh-CN/unimplemented/stdlib.md)
|
|
4
|
+
|
|
5
|
+
## Implemented (summary)
|
|
6
|
+
|
|
7
|
+
- Arrays: `push` `pop` `shift` `unshift` `join` `slice` `splice` `indexOf` `lastIndexOf` `includes` `concat` `reverse` `forEach` `map` `filter` `reduce` `reduceRight` `find` `findIndex` `findLast` `findLastIndex` `some` `every` `sort` `flat` `flatMap` `fill` `copyWithin` `at` `keys` `values` `entries` and the immutable `toReversed` / `toSorted` / `toSpliced` / `with`
|
|
8
|
+
- Strings: `charAt` `charCodeAt` `codePointAt` `indexOf` `lastIndexOf` `includes` `startsWith` `endsWith` `slice` `substring` `substr` `split` `match` `replace` `replaceAll` `search` `toUpperCase` `toLowerCase` `trim` `trimStart` `trimEnd` `padStart` `padEnd` `repeat` `concat` `at` `localeCompare` `valueOf`
|
|
9
|
+
- `Math`: full set of functions and constants
|
|
10
|
+
- `Object.keys` / `values` / `entries` / `assign` / `getOwnPropertyNames` / `groupBy`, object spread `{...obj}`
|
|
11
|
+
- Global functions: `parseInt` `parseFloat` `isNaN` `isFinite` `Number` `String` `Boolean` `encodeURI` `decodeURI` `encodeURIComponent` `decodeURIComponent`
|
|
12
|
+
- `console.log` / `info` / `warn` / `error` / `dir` / `trace` / `assert` / `count` / `group` / `table` / `time`
|
|
13
|
+
|
|
14
|
+
## Completed
|
|
15
|
+
|
|
16
|
+
- `JSON.parse` / `JSON.stringify`
|
|
17
|
+
- `Date`, `RegExp` (POSIX ERE subset with capture groups), `Map`, `Set`, `Promise`, `BigInt`
|
|
18
|
+
- `Array` statics (`isArray/of/from`), `Object` statics, `Number` statics, `String` statics (`fromCharCode` / `fromCodePoint` / `raw`)
|
|
19
|
+
- Built-in constructors as first-class values (`const A = Array`, `new A(...)`, `A.isArray`, `x instanceof A`) and `Object.prototype` (`hasOwnProperty`, `toString`, `valueOf`, `isPrototypeOf`, `propertyIsEnumerable`, `__proto__`), with `Object.getPrototypeOf({}) === Object.prototype`
|
|
20
|
+
- `Error` family (`Error`, `TypeError`, `RangeError`, `SyntaxError`, `ReferenceError`, `EvalError`, `URIError`, `AggregateError`): `new`, `instanceof`, `extends`, `String(err)` / `err.toString()` and `.stack`
|
|
21
|
+
|
|
22
|
+
## Still unimplemented
|
|
23
|
+
|
|
24
|
+
| Category | Status |
|
|
25
|
+
| --- | --- |
|
|
26
|
+
| `Symbol` constructor and symbol primitives | ✓ `Symbol(description)`, well-known symbols, `Symbol.for` / `Symbol.keyFor`, symbol property keys and `Object.getOwnPropertySymbols` |
|
|
27
|
+
| `String.prototype.normalize` | ✗ not implemented |
|
|
28
|
+
| `structuredClone` | ✓ arrays, objects, Map, Set, Date, RegExp and typed arrays (cycles and shared references preserved); functions, symbols, promises and generators are rejected |
|
|
29
|
+
| `JSON.stringify` options | ✓ `space` (number/string, clamped to 10), a function/array `replacer`, and `toJSON` are honored |
|
|
30
|
+
| Built-in error subclasses (`TypeError`, `RangeError`, ...) | ✓ first-class constructors and prototypes; `instanceof Error` holds for the whole family |
|
|
31
|
+
| `AggregateError` constructor | ✓ `new AggregateError(errors, message)`; `Promise.any` now rejects with one |
|
|
32
|
+
| Iterator protocol / `Symbol.iterator` / custom `for...of` iterables | ✓ arrays, strings, `Map`, `Set`, generators and any object exposing `[Symbol.iterator]()` are iterable in `for...of` / spread |
|
|
33
|
+
| Generators (`function*`, `yield`, `yield*`, `next`/`throw`/`return`) | ✓ implemented with stackful coroutines; `for...of`, spread and delegation supported. `return()` completes without running `finally` |
|
|
34
|
+
| Timers and microtasks | ✓ `setTimeout` / `clearTimeout` / `setInterval` / `clearInterval` / `setImmediate` / `clearImmediate` / `queueMicrotask` and `performance.now` (numeric ids, no `Timeout` / `Immediate` object). A promise settled from a timer can be awaited: the async body suspends on the pending promise and resumes when the timer fires |
|
|
35
|
+
| I/O / process and other host APIs | only via extensions (e.g. Node `fs`) |
|
|
36
|
+
|
|
37
|
+
## Typed arrays
|
|
38
|
+
|
|
39
|
+
Implemented: `Uint8Array`, `Int8Array`, `Uint8ClampedArray`, `Uint16Array`,
|
|
40
|
+
`Int16Array`, `Uint32Array`, `Int32Array`, `Float32Array`, `Float64Array` with
|
|
41
|
+
`new X(n)` / `new X(arrayLike)`, `X.from` / `X.of`, `BYTES_PER_ELEMENT`, coerced
|
|
42
|
+
element writes, and `fill` / `set` / `slice` / `subarray` / `join` / `toString` /
|
|
43
|
+
`indexOf` / `lastIndexOf` / `includes` / `forEach` / `map` / `filter` / `every` /
|
|
44
|
+
`some` / `find` / `findIndex` / `reduce` / `reverse` / `sort` / `copyWithin` /
|
|
45
|
+
`at` / `keys` / `values` / `entries`. Known divergences:
|
|
46
|
+
|
|
47
|
+
| Feature | Status |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| `subarray` | ✓ returns a view over the same buffer; `slice` copies |
|
|
50
|
+
| `keys` / `values` / `entries` | ~ return arrays, not iterator objects |
|
|
51
|
+
| `ArrayBuffer` / `DataView` / `.buffer` / `.byteOffset` semantics | ✓ `ArrayBuffer` (`slice`, `isView`), `DataView` (big-endian by default, `littleEndian` option), typed arrays backed by a buffer and exposing `.buffer` / `.byteOffset`; `new X(buffer, offset, length)` creates views |
|
|
52
|
+
| `BigInt64Array` / `BigUint64Array` | ✗ not implemented |
|
|
53
|
+
| `instanceof` built-in constructors | ✓ `instanceof Array` / `Object` / `Map` / `Set` / `Date` / `RegExp` / `Promise` / `Error` family / typed arrays are recognised by name **and through a first-class constructor value** (`const A = Array; x instanceof A`); constructors can be stored, passed, aliased, called and used with `new` |
|
|
54
|
+
| Typed-array views over a `Buffer` / `ArrayBuffer` | ✓ typed arrays and `DataView` share the `ArrayBuffer` bytes; `Buffer`-backed typed-array views are still not implemented |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Toolchain, platform and engineering
|
|
2
|
+
|
|
3
|
+
> Part of [Unimplemented syntax and features](../unimplemented.md) · [简体中文](../zh-CN/unimplemented/toolchain.md)
|
|
4
|
+
|
|
5
|
+
| Item | Status |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| GC (garbage collection) | ✓ non-moving mark-sweep in `xt_alloc.c`, armed by a live-heap threshold (`XT_GC_THRESHOLD` pins it) or `xt_gc_collect()`; after each collection the threshold becomes twice the surviving heap (floor 1 MiB), so the resident set follows the live set instead of only growing. `XT_GC_TRACE=1` prints one line per collection to stderr. Explicit roots + root providers + conservative active-stack scan. `WeakMap`/`WeakSet` keys are ephemerons (a value is retained only while its key is reachable) and `WeakRef` targets are cleared when unreachable; because the stack scan is conservative, a stale stack word can delay that clearing. No compaction or background collection |
|
|
8
|
+
| Self-hosting | ✓ the compiler compiles itself: `xbintsc build src/cli/main.ts` produces a working binary, and the emitted IR is stable from generation 1 onward. The runtime is still C |
|
|
9
|
+
| Type checker | ✗ only diagnostic codes are defined; no checker |
|
|
10
|
+
| Full standard library | partial: Math / JSON / Date / Map / Set / RegExp / `Error` / `BigInt` / `Symbol` / `structuredClone` implemented; String.normalize missing |
|
|
11
|
+
| Multi-file module bundling | partial: relative-path `.ts` bundling, ESM `node_modules` packages, namespace imports and bare-specifier extension module imports implemented; CommonJS is handled only inside `node_modules`; circular dependencies / live bindings are not implemented |
|
|
12
|
+
| Real async runtime | ✓ `async`/`await` suspends on pending promises on the `select(2)` reactor: timers, TCP sockets, offloaded file/HTTP work and promise callbacks resume the coroutine. Still missing: real OS-level file watching, non-blocking `net.connect`, TLS for `fetch`, and user-visible worker threads (`worker_threads` uses child processes) |
|
|
13
|
+
| Windows binary artifact verification | adapted at the build layer (`.exe` suffix, link flag branch), verified in CI |
|
|
14
|
+
| Precise ECMAScript number / string / comparison semantics | partial, see [Runtime deviations](./deviations.md) |
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Type system
|
|
2
|
+
|
|
3
|
+
> Part of [Unimplemented syntax and features](../unimplemented.md) · [简体中文](../zh-CN/unimplemented/types.md)
|
|
4
|
+
|
|
5
|
+
Type syntax is parsed into the AST and then **erased entirely** during binding /
|
|
6
|
+
code generation; no type checking is performed:
|
|
7
|
+
|
|
8
|
+
- Type annotations, return types, type parameters, type aliases, interfaces, generic constraints, etc.: parse ✓, check ✗.
|
|
9
|
+
- Checker diagnostic codes (`TypeMismatch` `NotCallable` `PropertyNotFound` `ArgumentCountMismatch`) are defined but **unused**.
|
|
10
|
+
- `as` / `satisfies` / non-null assertion `!`: erased directly, no assertion semantics.
|
|
11
|
+
- Generics: no runtime instantiation; type parameters are ignored.
|
|
12
|
+
- Optional chaining `?.` type narrowing: none (runtime short-circuit is implemented, but there is no type-level narrowing).
|