numbl 0.4.21 → 0.4.22
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/binding.gyp +12 -6
- package/dist-browser/browser/index.d.ts +1 -1
- package/dist-browser/browser/mip.d.ts +7 -0
- package/dist-browser/browser/protocol.d.ts +1 -1
- package/dist-browser/browser.js +1 -1
- package/dist-browser/db/operations.d.ts +0 -1
- package/dist-browser/gpuHelper.d.ts +29 -0
- package/dist-browser/hooks/projectFilesState.d.ts +37 -0
- package/dist-browser/numbl-core/execSession.d.ts +39 -0
- package/dist-browser/numbl-core/executeCode.d.ts +10 -1
- package/dist-browser/numbl-core/executors/classification.d.ts +2 -10
- package/dist-browser/numbl-core/executors/jit/backend.d.ts +65 -0
- package/dist-browser/numbl-core/executors/jit/cBackend.d.ts +22 -0
- package/dist-browser/numbl-core/executors/jit/callExecutor.d.ts +13 -44
- package/dist-browser/numbl-core/executors/jit/hostHelpers.d.ts +24 -0
- package/dist-browser/numbl-core/executors/jit/jsBackend.d.ts +15 -0
- package/dist-browser/numbl-core/executors/jit/loopExecutor.d.ts +13 -40
- package/dist-browser/numbl-core/executors/jit/session.d.ts +1 -1
- package/dist-browser/numbl-core/executors/jit/topLevelExecutor.d.ts +13 -33
- package/dist-browser/numbl-core/executors/jit/valueAdapterC.d.ts +32 -48
- package/dist-browser/numbl-core/executors/lowering.d.ts +38 -96
- package/dist-browser/numbl-core/executors/plugins.d.ts +14 -28
- package/dist-browser/numbl-core/executors/registry.d.ts +32 -133
- package/dist-browser/numbl-core/executors/types.d.ts +30 -92
- package/dist-browser/numbl-core/functionResolve.d.ts +3 -13
- package/dist-browser/numbl-core/helpers/check-helpers.d.ts +0 -5
- package/dist-browser/numbl-core/helpers/glob.d.ts +14 -0
- package/dist-browser/numbl-core/helpers/linsolve.d.ts +3 -13
- package/dist-browser/numbl-core/helpers/reduction-helpers.d.ts +2 -4
- package/dist-browser/numbl-core/helpers/shape-utils.d.ts +10 -0
- package/dist-browser/numbl-core/interpreter/builtins/index.d.ts +3 -1
- package/dist-browser/numbl-core/interpreter/builtins/time-system.d.ts +0 -1
- package/dist-browser/numbl-core/interpreter/builtins/types.d.ts +7 -7
- package/dist-browser/numbl-core/interpreter/interpreter.d.ts +6 -6
- package/dist-browser/numbl-core/interpreter/interpreterFunctions.d.ts +9 -1
- package/dist-browser/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +6 -3
- package/dist-browser/numbl-core/jit/builtins/defs/_shared.d.ts +1 -5
- package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +1 -2
- package/dist-browser/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +3 -3
- package/dist-browser/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +1 -1
- package/dist-browser/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +1 -1
- package/dist-browser/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +5 -2
- package/dist-browser/numbl-core/jit/builtins/defs/math/realsqrt.d.ts +6 -0
- package/dist-browser/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +0 -5
- package/dist-browser/numbl-core/jit/builtins/defs/shape/_construct.d.ts +0 -4
- package/dist-browser/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +2 -8
- package/dist-browser/numbl-core/jit/builtins/defs/system/deal.d.ts +4 -5
- package/dist-browser/numbl-core/jit/builtins/defs/system/feval.d.ts +7 -29
- package/dist-browser/numbl-core/jit/builtins/registry.d.ts +15 -30
- package/dist-browser/numbl-core/jit/builtins/runtime/system/cdiv.d.ts +4 -0
- package/dist-browser/numbl-core/jit/builtins/runtime/system/cscalar.d.ts +4 -0
- package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +45 -15
- package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +5 -5
- package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +6 -0
- package/dist-browser/numbl-core/jit/codegen/emit.d.ts +9 -30
- package/dist-browser/numbl-core/jit/codegen/emitJs.d.ts +9 -27
- package/dist-browser/numbl-core/jit/codegen/emitStmt.d.ts +8 -31
- package/dist-browser/numbl-core/jit/codegen/emitTensorFused.d.ts +10 -9
- package/dist-browser/numbl-core/jit/codegen/inlinePass.d.ts +39 -48
- package/dist-browser/numbl-core/jit/codegen/prettyIR.d.ts +1 -6
- package/dist-browser/numbl-core/jit/codegen/runtime.d.ts +7 -28
- package/dist-browser/numbl-core/jit/compileSpec.d.ts +3 -6
- package/dist-browser/numbl-core/jit/compileSpecC.d.ts +5 -0
- package/dist-browser/numbl-core/jit/lowering/assignedFlags.d.ts +24 -0
- package/dist-browser/numbl-core/jit/lowering/definiteAssign.d.ts +3 -1
- package/dist-browser/numbl-core/jit/lowering/errors.d.ts +3 -15
- package/dist-browser/numbl-core/jit/lowering/ir.d.ts +0 -2
- package/dist-browser/numbl-core/jit/lowering/lower.d.ts +4 -12
- package/dist-browser/numbl-core/jit/lowering/types.d.ts +2 -7
- package/dist-browser/numbl-core/jit/numbl/index.d.ts +5 -14
- package/dist-browser/numbl-core/jit/parser/index.d.ts +4 -9
- package/dist-browser/numbl-core/jit/workspace/workspace.d.ts +32 -136
- package/dist-browser/numbl-core/jitDeclineDiagnostics.d.ts +1 -1
- package/dist-browser/numbl-core/jsUserFunctions.d.ts +10 -12
- package/dist-browser/numbl-core/lowering/classInfo.d.ts +4 -1
- package/dist-browser/numbl-core/lowering/loweringContext.d.ts +15 -23
- package/dist-browser/numbl-core/native/lapack-bridge.d.ts +111 -130
- package/dist-browser/numbl-core/native/ts-lapack-bridge.d.ts +4 -5
- package/dist-browser/numbl-core/native/ts-lapack-complex.d.ts +23 -0
- package/dist-browser/numbl-core/native/ts-lapack-qr-lu.d.ts +37 -0
- package/dist-browser/numbl-core/native/wasm-lapack-bridge.d.ts +4 -5
- package/dist-browser/numbl-core/ops/dispatch.d.ts +4 -5
- package/dist-browser/numbl-core/parser/types.d.ts +1 -21
- package/{dist-lib/numbl-core/runtime → dist-browser/numbl-core/plotting}/axisCommand.d.ts +2 -2
- package/dist-browser/{graphics → numbl-core/plotting}/axisLimits.d.ts +14 -2
- package/dist-browser/numbl-core/plotting/builtins.d.ts +8 -0
- package/dist-browser/numbl-core/plotting/colormaps.d.ts +10 -0
- package/dist-browser/numbl-core/{runtime/plotBuiltinDispatch.d.ts → plotting/dispatch.d.ts} +14 -25
- package/dist-browser/numbl-core/plotting/imagescExtent.d.ts +19 -0
- package/dist-browser/numbl-core/{runtime/runtimePlot.d.ts → plotting/instructions.d.ts} +5 -17
- package/dist-browser/numbl-core/plotting/parseArgsChart.d.ts +94 -0
- package/dist-browser/numbl-core/plotting/parseArgsCommon.d.ts +64 -0
- package/dist-browser/numbl-core/plotting/parseArgsLine.d.ts +103 -0
- package/dist-browser/numbl-core/plotting/parseArgsPatch.d.ts +38 -0
- package/dist-browser/numbl-core/plotting/parseArgsQuiver.d.ts +32 -0
- package/dist-browser/numbl-core/plotting/parseArgsSurface.d.ts +75 -0
- package/dist-browser/numbl-core/plotting/streamline.d.ts +16 -0
- package/{dist-graphics/graphics → dist-browser/numbl-core/plotting}/types.d.ts +9 -7
- package/dist-browser/numbl-core/runtime/cow.d.ts +0 -8
- package/dist-browser/numbl-core/runtime/refcount.d.ts +0 -3
- package/dist-browser/numbl-core/runtime/registerSpecial.d.ts +15 -0
- package/dist-browser/numbl-core/runtime/runtime.d.ts +11 -35
- package/dist-browser/numbl-core/runtime/runtimeDispatch.d.ts +6 -0
- package/dist-browser/numbl-core/runtime/specialBuiltins.d.ts +3 -9
- package/dist-browser/numbl-core/runtime/uihtmlSession.d.ts +5 -13
- package/dist-browser/numbl-core/runtime/utils.d.ts +4 -1
- package/dist-browser/numbl-core/version.d.ts +1 -1
- package/dist-browser/numbl-core/workspace/workspace.d.ts +64 -0
- package/dist-browser/vfs/syncVfsChanges.d.ts +2 -2
- package/dist-cli/cli.js +74244 -80566
- package/dist-graphics/graphics/FigureView.d.ts +1 -1
- package/dist-graphics/graphics/SurfView.d.ts +3 -2
- package/dist-graphics/graphics/drawPlot.d.ts +1 -1
- package/dist-graphics/graphics/exportFigureHdf5.d.ts +1 -1
- package/dist-graphics/graphics/figureHashTransport.d.ts +1 -1
- package/dist-graphics/graphics/figureUpload.d.ts +1 -1
- package/dist-graphics/graphics/importFigureHdf5.d.ts +1 -1
- package/dist-graphics/graphics/openInFigureViewer.d.ts +1 -1
- package/dist-graphics/graphics/plotHelpers.d.ts +1 -1
- package/dist-graphics/graphics/plotLegend.d.ts +1 -1
- package/dist-graphics/graphics/plotMarkers.d.ts +1 -1
- package/dist-graphics/graphics/restoreNaNs.d.ts +1 -1
- package/dist-graphics/graphics/uihtmlRelay.d.ts +16 -0
- package/dist-graphics/graphics-lib.d.ts +3 -3
- package/dist-graphics/index.js +294 -328
- package/{dist-lib/graphics → dist-graphics/numbl-core/plotting}/axisLimits.d.ts +14 -2
- package/dist-graphics/numbl-core/plotting/colormaps.d.ts +10 -0
- package/dist-graphics/numbl-core/plotting/imagescExtent.d.ts +19 -0
- package/{dist-browser/graphics → dist-graphics/numbl-core/plotting}/types.d.ts +9 -7
- package/dist-lib/browser/mip.d.ts +17 -0
- package/dist-lib/cli-scan.d.ts +8 -1
- package/dist-lib/lib.d.ts +1 -1
- package/dist-lib/lib.js +29201 -35301
- package/dist-lib/node.js +22 -14
- package/dist-lib/numbl-core/execSession.d.ts +39 -0
- package/dist-lib/numbl-core/executeCode.d.ts +10 -1
- package/dist-lib/numbl-core/executors/classification.d.ts +2 -10
- package/dist-lib/numbl-core/executors/jit/backend.d.ts +65 -0
- package/dist-lib/numbl-core/executors/jit/cBackend.d.ts +22 -0
- package/dist-lib/numbl-core/executors/jit/callExecutor.d.ts +13 -44
- package/dist-lib/numbl-core/executors/jit/hostHelpers.d.ts +24 -0
- package/dist-lib/numbl-core/executors/jit/jsBackend.d.ts +15 -0
- package/dist-lib/numbl-core/executors/jit/loopExecutor.d.ts +13 -40
- package/dist-lib/numbl-core/executors/jit/session.d.ts +1 -1
- package/dist-lib/numbl-core/executors/jit/topLevelExecutor.d.ts +13 -33
- package/dist-lib/numbl-core/executors/jit/valueAdapterC.d.ts +32 -48
- package/dist-lib/numbl-core/executors/lowering.d.ts +38 -96
- package/dist-lib/numbl-core/executors/plugins.d.ts +14 -28
- package/dist-lib/numbl-core/executors/registry.d.ts +32 -133
- package/dist-lib/numbl-core/executors/types.d.ts +30 -92
- package/dist-lib/numbl-core/functionResolve.d.ts +3 -13
- package/dist-lib/numbl-core/helpers/check-helpers.d.ts +0 -5
- package/dist-lib/numbl-core/helpers/glob.d.ts +14 -0
- package/dist-lib/numbl-core/helpers/linsolve.d.ts +3 -13
- package/dist-lib/numbl-core/helpers/reduction-helpers.d.ts +2 -4
- package/dist-lib/numbl-core/helpers/shape-utils.d.ts +10 -0
- package/dist-lib/numbl-core/interpreter/builtins/index.d.ts +3 -1
- package/dist-lib/numbl-core/interpreter/builtins/time-system.d.ts +0 -1
- package/dist-lib/numbl-core/interpreter/builtins/types.d.ts +7 -7
- package/dist-lib/numbl-core/interpreter/interpreter.d.ts +6 -6
- package/dist-lib/numbl-core/interpreter/interpreterFunctions.d.ts +9 -1
- package/dist-lib/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +6 -3
- package/dist-lib/numbl-core/jit/builtins/defs/_shared.d.ts +1 -5
- package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +1 -2
- package/dist-lib/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +3 -3
- package/dist-lib/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +1 -1
- package/dist-lib/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +1 -1
- package/dist-lib/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +5 -2
- package/dist-lib/numbl-core/jit/builtins/defs/math/realsqrt.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +0 -5
- package/dist-lib/numbl-core/jit/builtins/defs/shape/_construct.d.ts +0 -4
- package/dist-lib/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +2 -8
- package/dist-lib/numbl-core/jit/builtins/defs/system/deal.d.ts +4 -5
- package/dist-lib/numbl-core/jit/builtins/defs/system/feval.d.ts +7 -29
- package/dist-lib/numbl-core/jit/builtins/registry.d.ts +15 -30
- package/dist-lib/numbl-core/jit/builtins/runtime/system/cdiv.d.ts +4 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/system/cscalar.d.ts +4 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +45 -15
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +5 -5
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +6 -0
- package/dist-lib/numbl-core/jit/codegen/emit.d.ts +9 -30
- package/dist-lib/numbl-core/jit/codegen/emitJs.d.ts +9 -27
- package/dist-lib/numbl-core/jit/codegen/emitStmt.d.ts +8 -31
- package/dist-lib/numbl-core/jit/codegen/emitTensorFused.d.ts +10 -9
- package/dist-lib/numbl-core/jit/codegen/inlinePass.d.ts +39 -48
- package/dist-lib/numbl-core/jit/codegen/prettyIR.d.ts +1 -6
- package/dist-lib/numbl-core/jit/codegen/runtime.d.ts +7 -28
- package/dist-lib/numbl-core/jit/compileSpec.d.ts +3 -6
- package/dist-lib/numbl-core/jit/compileSpecC.d.ts +5 -0
- package/dist-lib/numbl-core/jit/lowering/assignedFlags.d.ts +24 -0
- package/dist-lib/numbl-core/jit/lowering/definiteAssign.d.ts +3 -1
- package/dist-lib/numbl-core/jit/lowering/errors.d.ts +3 -15
- package/dist-lib/numbl-core/jit/lowering/ir.d.ts +0 -2
- package/dist-lib/numbl-core/jit/lowering/lower.d.ts +4 -12
- package/dist-lib/numbl-core/jit/lowering/types.d.ts +2 -7
- package/dist-lib/numbl-core/jit/numbl/index.d.ts +5 -14
- package/dist-lib/numbl-core/jit/parser/index.d.ts +4 -9
- package/dist-lib/numbl-core/jit/workspace/workspace.d.ts +32 -136
- package/dist-lib/numbl-core/jitDeclineDiagnostics.d.ts +1 -1
- package/dist-lib/numbl-core/jsUserFunctions.d.ts +10 -12
- package/dist-lib/numbl-core/lowering/classInfo.d.ts +4 -1
- package/dist-lib/numbl-core/lowering/loweringContext.d.ts +15 -23
- package/dist-lib/numbl-core/native/lapack-bridge.d.ts +111 -130
- package/dist-lib/numbl-core/native/ts-lapack-bridge.d.ts +4 -5
- package/dist-lib/numbl-core/native/ts-lapack-complex.d.ts +23 -0
- package/dist-lib/numbl-core/native/ts-lapack-qr-lu.d.ts +37 -0
- package/dist-lib/numbl-core/native/wasm-lapack-bridge.d.ts +4 -5
- package/dist-lib/numbl-core/ops/dispatch.d.ts +4 -5
- package/dist-lib/numbl-core/parser/types.d.ts +1 -21
- package/{dist-browser/numbl-core/runtime → dist-lib/numbl-core/plotting}/axisCommand.d.ts +2 -2
- package/{dist-graphics/graphics → dist-lib/numbl-core/plotting}/axisLimits.d.ts +14 -2
- package/dist-lib/numbl-core/plotting/builtins.d.ts +8 -0
- package/dist-lib/numbl-core/plotting/colormaps.d.ts +10 -0
- package/dist-lib/numbl-core/{runtime/plotBuiltinDispatch.d.ts → plotting/dispatch.d.ts} +14 -25
- package/dist-lib/numbl-core/plotting/imagescExtent.d.ts +19 -0
- package/dist-lib/numbl-core/{runtime/runtimePlot.d.ts → plotting/instructions.d.ts} +5 -17
- package/dist-lib/numbl-core/plotting/parseArgsChart.d.ts +94 -0
- package/dist-lib/numbl-core/plotting/parseArgsCommon.d.ts +64 -0
- package/dist-lib/numbl-core/plotting/parseArgsLine.d.ts +103 -0
- package/dist-lib/numbl-core/plotting/parseArgsPatch.d.ts +38 -0
- package/dist-lib/numbl-core/plotting/parseArgsQuiver.d.ts +32 -0
- package/dist-lib/numbl-core/plotting/parseArgsSurface.d.ts +75 -0
- package/dist-lib/numbl-core/plotting/streamline.d.ts +16 -0
- package/dist-lib/{graphics → numbl-core/plotting}/types.d.ts +9 -7
- package/dist-lib/numbl-core/runtime/cow.d.ts +0 -8
- package/dist-lib/numbl-core/runtime/refcount.d.ts +0 -3
- package/dist-lib/numbl-core/runtime/registerSpecial.d.ts +15 -0
- package/dist-lib/numbl-core/runtime/runtime.d.ts +11 -35
- package/dist-lib/numbl-core/runtime/runtimeDispatch.d.ts +6 -0
- package/dist-lib/numbl-core/runtime/specialBuiltins.d.ts +3 -9
- package/dist-lib/numbl-core/runtime/uihtmlSession.d.ts +5 -13
- package/dist-lib/numbl-core/runtime/utils.d.ts +4 -1
- package/dist-lib/numbl-core/version.d.ts +1 -1
- package/dist-lib/numbl-core/workspace/workspace.d.ts +64 -0
- package/dist-lib/vfs/unzipToFiles.d.ts +7 -0
- package/dist-plot-viewer/assets/index-C0fIevlp.js +4504 -0
- package/dist-plot-viewer/index.html +1 -1
- package/dist-site-viewer/assets/index-BDaviCH6.js +4832 -0
- package/dist-site-viewer/assets/numbl-worker-D6m4K2PP.js +5691 -0
- package/dist-site-viewer/index.html +2 -2
- package/native/numbl_addon.cpp +2 -12
- package/native/numbl_addon_common.h +0 -5
- package/package.json +6 -5
- package/dist-browser/hooks/useProjectFiles.d.ts +0 -45
- package/dist-browser/numbl-core/executors/context.d.ts +0 -76
- package/dist-browser/numbl-core/executors/index.d.ts +0 -14
- package/dist-browser/numbl-core/executors/jit/cJitCallExecutor.d.ts +0 -35
- package/dist-browser/numbl-core/executors/jit/cJitLoopExecutor.d.ts +0 -31
- package/dist-browser/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +0 -29
- package/dist-browser/numbl-core/helpers/dummy.d.ts +0 -5
- package/dist-browser/numbl-core/jit/runtime/context.d.ts +0 -23
- package/dist-browser/numbl-core/jit/runtime/inferType.d.ts +0 -10
- package/dist-browser/numbl-core/jit/runtime/value.d.ts +0 -101
- package/dist-browser/numbl-core/jit/workspace/driverPrologue.d.ts +0 -59
- package/dist-browser/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +0 -62
- package/dist-browser/numbl-core/native/bridge-resolve.d.ts +0 -14
- package/dist-browser/numbl-core/runtime/plotUtils.d.ts +0 -336
- package/dist-browser/numbl-core/runtime/specialBuiltinNames.d.ts +0 -2
- package/dist-graphics/graphics/surfColormap.d.ts +0 -2
- package/dist-lib/numbl-core/executors/context.d.ts +0 -76
- package/dist-lib/numbl-core/executors/index.d.ts +0 -14
- package/dist-lib/numbl-core/executors/jit/cJitCallExecutor.d.ts +0 -35
- package/dist-lib/numbl-core/executors/jit/cJitLoopExecutor.d.ts +0 -31
- package/dist-lib/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +0 -29
- package/dist-lib/numbl-core/helpers/dummy.d.ts +0 -5
- package/dist-lib/numbl-core/jit/runtime/context.d.ts +0 -23
- package/dist-lib/numbl-core/jit/runtime/inferType.d.ts +0 -10
- package/dist-lib/numbl-core/jit/runtime/value.d.ts +0 -101
- package/dist-lib/numbl-core/jit/workspace/driverPrologue.d.ts +0 -59
- package/dist-lib/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +0 -62
- package/dist-lib/numbl-core/native/bridge-resolve.d.ts +0 -14
- package/dist-lib/numbl-core/runtime/plotUtils.d.ts +0 -336
- package/dist-lib/numbl-core/runtime/specialBuiltinNames.d.ts +0 -2
- package/dist-plot-viewer/assets/index-YeXWXIxH.js +0 -4504
- package/dist-site-viewer/assets/index-DrtkDG_M.js +0 -4832
- package/dist-site-viewer/assets/numbl-worker-Dz_Z8B9u.js +0 -5327
- package/native/elemwise.cpp +0 -360
- package/native/unary_elemwise.cpp +0 -67
- /package/dist-browser/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
- /package/dist-graphics/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
- /package/dist-lib/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
|
@@ -36,7 +36,9 @@ import type { IRFunc } from "./ir.js";
|
|
|
36
36
|
* lists the loop variable (and other loop-body locals) as pseudo-outputs
|
|
37
37
|
* that are legitimately unassigned when the loop runs zero times, so the
|
|
38
38
|
* check would over-decline every loop.
|
|
39
|
+
*
|
|
40
|
+
* Returns the names definitely assigned on the fall-through path.
|
|
39
41
|
*/
|
|
40
42
|
export declare function assertDefiniteAssignment(fn: IRFunc, opts?: {
|
|
41
43
|
checkOutputs: boolean;
|
|
42
|
-
}):
|
|
44
|
+
}): ReadonlySet<string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* JIT lowering errors.
|
|
3
3
|
*
|
|
4
4
|
* Most errors carry a `Span` so the CLI can point at the offending
|
|
5
5
|
* source location. Builtin authors (whose `transfer`/`emit` hooks
|
|
@@ -15,21 +15,9 @@ export declare class TypeError extends Error {
|
|
|
15
15
|
span?: Span;
|
|
16
16
|
constructor(message: string, span?: Span);
|
|
17
17
|
}
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* "Output argument 'x' not assigned". Distinct from
|
|
21
|
-
* `UnsupportedConstruct` (which means "this language feature isn't
|
|
22
|
-
* implemented in mtoc2 yet"); using one for the other muddles the
|
|
23
|
-
* user-vs-tool signal. Mirrors numbl's `RuntimeError` so error class
|
|
24
|
-
* matches across the two runners. */
|
|
25
|
-
export declare class RuntimeError extends Error {
|
|
26
|
-
span?: Span;
|
|
27
|
-
constructor(message: string, span?: Span);
|
|
28
|
-
}
|
|
29
|
-
/** Run `fn` and, if it throws an `UnsupportedConstruct`, `TypeError`,
|
|
30
|
-
* or `RuntimeError` with no span attached, backfill `span`. Used at
|
|
18
|
+
/** Run `fn` and, if it throws an `UnsupportedConstruct` or `TypeError`
|
|
19
|
+
* with no span attached, backfill `span`. Used at
|
|
31
20
|
* framework→builtin call boundaries so builtin authors can throw
|
|
32
21
|
* without carrying a span around in every signature. Pre-existing
|
|
33
22
|
* spans (from nested framework calls) are preserved. */
|
|
34
23
|
export declare function withSpan<T>(span: Span, fn: () => T): T;
|
|
35
|
-
export declare function formatError(e: UnsupportedConstruct | TypeError | RuntimeError, source: string): string;
|
|
@@ -577,8 +577,6 @@ export interface IRFunc {
|
|
|
577
577
|
span: Span;
|
|
578
578
|
}
|
|
579
579
|
export interface IRProgram {
|
|
580
|
-
/** Script-level top-level statements. */
|
|
581
|
-
topLevelStmts: IRStmt[];
|
|
582
580
|
/** All specialized function definitions, keyed by their mangled cName. */
|
|
583
581
|
functions: Map<string, IRFunc>;
|
|
584
582
|
}
|
|
@@ -31,19 +31,12 @@
|
|
|
31
31
|
* vendored resolver. Anything outside that throws
|
|
32
32
|
* `UnsupportedConstruct` with a span.
|
|
33
33
|
*/
|
|
34
|
-
import type {
|
|
34
|
+
import type { Expr, Stmt, Span } from "../parser/index.js";
|
|
35
35
|
import { type Type, type NumericType } from "./types.js";
|
|
36
36
|
import type { ClassRegistration } from "./classDefs.js";
|
|
37
37
|
import type { Workspace } from "../workspace/workspace.js";
|
|
38
38
|
import type { CallSite } from "../numbl/index.js";
|
|
39
|
-
|
|
40
|
-
* Defaults to `console.error` (so emitted lines go to stderr and
|
|
41
|
-
* don't mix with the cross-runner's stdout comparison). Tests
|
|
42
|
-
* replace this with a capturing function. */
|
|
43
|
-
export declare let printTypeSink: (line: string) => void;
|
|
44
|
-
export declare function setPrintTypeSink(sink: (line: string) => void): void;
|
|
45
|
-
export declare function resetPrintTypeSink(): void;
|
|
46
|
-
import { type Assign, type IRExpr, type IRStmt, type IRFunc, type IRProgram } from "./ir.js";
|
|
39
|
+
import { type Assign, type IRExpr, type IRStmt, type IRFunc } from "./ir.js";
|
|
47
40
|
export interface EnvEntry {
|
|
48
41
|
cName: string;
|
|
49
42
|
ty: Type;
|
|
@@ -151,7 +144,6 @@ export declare class Lowerer {
|
|
|
151
144
|
* bridge's `fromExistingContext` mode — surfacing the error at
|
|
152
145
|
* the first actual use rather than at workspace finalize. */
|
|
153
146
|
classReg(name: string): ClassRegistration | undefined;
|
|
154
|
-
lowerProgram(ast: AbstractSyntaxTree): IRProgram;
|
|
155
147
|
lowerStmts(stmts: Stmt[]): IRStmt[];
|
|
156
148
|
private lowerStmt;
|
|
157
149
|
private lowerStmtInner;
|
|
@@ -172,8 +164,8 @@ export declare class Lowerer {
|
|
|
172
164
|
* once per function specialization. No IR node, no codegen
|
|
173
165
|
* interaction.
|
|
174
166
|
*
|
|
175
|
-
*
|
|
176
|
-
* unaffected. */
|
|
167
|
+
* The interpreter ignores all three directives, so program output
|
|
168
|
+
* is unaffected. */
|
|
177
169
|
private lowerDirective;
|
|
178
170
|
/** Look up each name in `args` in the current env, snapshotting its
|
|
179
171
|
* `cName` and current `Type`. Throws `UnsupportedConstruct` with
|
|
@@ -290,8 +290,8 @@ export declare function cellUniform(dims: DimInfo[], elem: Type): CellType;
|
|
|
290
290
|
/** The canonical "empty `[]` double tensor" slot type — what numbl
|
|
291
291
|
* initialises every fresh slot in `cell(n, m)` to
|
|
292
292
|
* (see `numbl/.../type-constructors.ts:442-469`). Shape is `[0, 0]`,
|
|
293
|
-
* no exact data, sign unknown.
|
|
294
|
-
* so
|
|
293
|
+
* no exact data, sign unknown. The JIT reuses this exact representation
|
|
294
|
+
* so displays of an unwritten slot match the interpreter byte-for-byte. */
|
|
295
295
|
export declare function emptyDoubleTensorType(): NumericType;
|
|
296
296
|
export declare function isNumeric(t: Type): t is NumericType;
|
|
297
297
|
export declare function isVoid(t: Type): t is VoidType;
|
|
@@ -423,10 +423,6 @@ export declare function typeToString(t: Type): string;
|
|
|
423
423
|
/** Stable string key used for the specialization-key hash. Includes
|
|
424
424
|
* exact when set, so each unique exact-value gets its own spec. */
|
|
425
425
|
export declare function canonicalizeType(t: Type): string;
|
|
426
|
-
/** True iff two types have the same canonical form. Convenience
|
|
427
|
-
* wrapper around `canonicalizeType` for callers that don't need the
|
|
428
|
-
* string key. */
|
|
429
|
-
export declare function canonicalEq(a: Type, b: Type): boolean;
|
|
430
426
|
/** Storage compatibility: do two types occupy the same C-level slot?
|
|
431
427
|
* This is COARSER than canonical equality — every multi-element
|
|
432
428
|
* tensor shares the same `mtoc2_tensor_t` storage regardless of
|
|
@@ -441,7 +437,6 @@ export declare function canonicalEq(a: Type, b: Type): boolean;
|
|
|
441
437
|
export declare function storageEquivalent(a: Type, b: Type): boolean;
|
|
442
438
|
/** FNV-1a 32-bit; matches the mangling scheme used in current mtoc. */
|
|
443
439
|
export declare function hashType(s: string): string;
|
|
444
|
-
export declare function specializationKey(argTypes: Type[]): string;
|
|
445
440
|
/** Mangled C typedef name for a handle's capture shape. All no-capture
|
|
446
441
|
* handles share `mtoc2_handle_empty_t` regardless of target identity
|
|
447
442
|
* (the function dispatch is static — the struct is just a carrier).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Single intra-repo bridge module for everything the vendored JIT
|
|
3
3
|
* (`src/numbl-core/jit/*`) consumes from the rest of numbl-core. Every
|
|
4
|
-
* `numbl-core/*`
|
|
4
|
+
* `numbl-core/*` path the JIT depends on appears here
|
|
5
5
|
* exactly once, so:
|
|
6
6
|
*
|
|
7
7
|
* - a numbl rename / move surfaces as a single tsc error in this file
|
|
@@ -9,22 +9,13 @@
|
|
|
9
9
|
* - the surface area between the JIT and the rest of numbl is visible at
|
|
10
10
|
* a glance.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* `../../../numbl/` checkout); after vendoring it resolves the same
|
|
14
|
-
* symbols through local `numbl-core` relative paths. `parser/index.ts`
|
|
15
|
-
* re-exports through this module so the vendored files' import shapes
|
|
16
|
-
* stay unchanged.
|
|
12
|
+
* `parser/index.ts` re-exports through this module.
|
|
17
13
|
*/
|
|
18
|
-
export {
|
|
14
|
+
export { BinaryOperation, UnaryOperation } from "../../parser/index.js";
|
|
19
15
|
export type { Span, Expr, Stmt, LValue, AbstractSyntaxTree, } from "../../parser/index.js";
|
|
20
|
-
export { LoweringContext } from "../../lowering/loweringContext.js";
|
|
16
|
+
export type { LoweringContext } from "../../lowering/loweringContext.js";
|
|
21
17
|
export { resolveFunction } from "../../functionResolve.js";
|
|
22
18
|
export type { CallSite } from "../../runtime/runtimeHelpers.js";
|
|
23
19
|
export type { ItemType } from "../../lowering/itemTypes.js";
|
|
24
20
|
export type { ClassInfo } from "../../lowering/classInfo.js";
|
|
25
|
-
export { PLOT_ALL_NAMES } from "../../
|
|
26
|
-
export { dispatchPlotBuiltin, type PlotDispatchState, } from "../../runtime/plotBuiltinDispatch.js";
|
|
27
|
-
export type { PlotInstruction } from "../../../graphics/types.js";
|
|
28
|
-
export { allocFloat64Array } from "../../runtime/alloc.js";
|
|
29
|
-
export { RTV } from "../../runtime/constructors.js";
|
|
30
|
-
export type { RuntimeValue } from "../../runtime/types.js";
|
|
21
|
+
export { PLOT_ALL_NAMES } from "../../plotting/dispatch.js";
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Parser re-exports for
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* preserves their import shape unchanged.
|
|
6
|
-
*
|
|
7
|
-
* Structural AST drift is caught at `tsc` time; semantic drift is
|
|
8
|
-
* caught by the cross-runner. The pinned numbl SHA lives in
|
|
9
|
-
* `NUMBL_VERSION`, which CI checks out against.
|
|
2
|
+
* Parser re-exports for JIT consumers. The actual import from numbl
|
|
3
|
+
* lives in `../numbl/index.ts`; this module is the stable path the
|
|
4
|
+
* JIT's call sites import from.
|
|
10
5
|
*/
|
|
11
|
-
export {
|
|
6
|
+
export { BinaryOperation, UnaryOperation } from "../numbl/index.js";
|
|
12
7
|
export type { Span, Expr, Stmt, LValue, AbstractSyntaxTree, } from "../numbl/index.js";
|
|
@@ -1,43 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Workspace + cross-file function dispatch.
|
|
3
3
|
*
|
|
4
|
-
* Thin adapter over numbl's
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* `ResolvedTarget` shape and fences off everything outside v1
|
|
13
|
-
* (private/, +pkg/ namespaces, .numbl.js, imports) with a clean
|
|
4
|
+
* Thin adapter over numbl's `LoweringContext`, shared with the
|
|
5
|
+
* interpreter. Numbl's `resolveFunction` is the source of truth for
|
|
6
|
+
* "which function does `foo(...)` refer to from this call site"; it
|
|
7
|
+
* implements MATLAB's precedence rules (local > workspace > builtin,
|
|
8
|
+
* plus class-method dispatch on `obj.method(args)` and
|
|
9
|
+
* `ClassName.method(args)`). The JIT translates the result back into
|
|
10
|
+
* its own narrow `ResolvedTarget` shape and fences off everything it
|
|
11
|
+
* doesn't support (private/, .numbl.js, ...) with a clean
|
|
14
12
|
* `UnsupportedConstruct`.
|
|
15
13
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
14
|
+
* The `Type → ItemType` adapter is intentionally lossy: the resolver
|
|
15
|
+
* inspects `kind === "ClassInstance"` (and only the `className`
|
|
16
|
+
* there); every other shape collapses to `Unknown`. That's all the
|
|
17
|
+
* resolver needs to apply class-method precedence.
|
|
20
18
|
*/
|
|
21
19
|
import type { AbstractSyntaxTree, Stmt, Span } from "../parser/index.js";
|
|
22
|
-
import { LoweringContext, type CallSite
|
|
20
|
+
import { type LoweringContext, type CallSite } from "../numbl/index.js";
|
|
23
21
|
import { UnsupportedConstruct } from "../lowering/errors.js";
|
|
24
22
|
import type { Type } from "../lowering/types.js";
|
|
25
23
|
import { type ClassRegistration } from "../lowering/classDefs.js";
|
|
26
|
-
import type { Builtin } from "../builtins/registry.js";
|
|
27
24
|
type FuncStmt = Extract<Stmt, {
|
|
28
25
|
type: "Function";
|
|
29
26
|
}>;
|
|
30
|
-
type ClassDefStmt = Extract<Stmt, {
|
|
31
|
-
type: "ClassDef";
|
|
32
|
-
}>;
|
|
33
27
|
export interface WorkspaceFile {
|
|
34
28
|
/** Absolute (or web-IDE-flat) file name used in error attribution
|
|
35
29
|
* and in numbl's resolver. Numbl uses `fileToFuncName` to derive
|
|
36
30
|
* bare workspace-function names from this. */
|
|
37
31
|
name: string;
|
|
38
32
|
source: string;
|
|
39
|
-
/** Pre-parsed AST
|
|
40
|
-
* it via `parseMFile` before registration. */
|
|
33
|
+
/** Pre-parsed AST (shared with numbl's `fileASTCache`). */
|
|
41
34
|
ast?: AbstractSyntaxTree;
|
|
42
35
|
}
|
|
43
36
|
/** Narrow shape mtoc2 cares about. The resolver may return additional
|
|
@@ -59,15 +52,6 @@ export type ResolvedTarget = {
|
|
|
59
52
|
* validates it against its own builtin registry. */
|
|
60
53
|
kind: "builtin";
|
|
61
54
|
name: string;
|
|
62
|
-
} | {
|
|
63
|
-
/** A `.mtoc2.js` user function discovered in the workspace.
|
|
64
|
-
* The evaluated `Builtin` lives in `Workspace.userBuiltins` —
|
|
65
|
-
* fetch via `getUserBuiltin(name)` for both lowering and
|
|
66
|
-
* codegen. The resolved-target carries the source-level name
|
|
67
|
-
* (which the lowerer also uses as the emitted C call name). */
|
|
68
|
-
kind: "mtoc2UserFunction";
|
|
69
|
-
name: string;
|
|
70
|
-
file: string;
|
|
71
55
|
} | {
|
|
72
56
|
/** `Foo(args)` — class constructor call. The class is looked
|
|
73
57
|
* up in `Workspace.classes`. */
|
|
@@ -86,112 +70,43 @@ export type ResolvedTarget = {
|
|
|
86
70
|
stripInstance: boolean;
|
|
87
71
|
};
|
|
88
72
|
export declare class Workspace {
|
|
89
|
-
/** File source + AST, keyed by file name.
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* (`offsetToLineCol`). */
|
|
73
|
+
/** File source + AST, keyed by file name. This side map keeps
|
|
74
|
+
* `source` retrievable for diagnostics (`offsetToLineCol`) and the
|
|
75
|
+
* main file's AST for local-function resolution. */
|
|
93
76
|
readonly files: Map<string, WorkspaceFile>;
|
|
94
77
|
/** The entry file (active file) — bare-name calls from sibling
|
|
95
78
|
* files don't see its local functions. */
|
|
96
79
|
readonly mainFile: string;
|
|
97
|
-
/**
|
|
98
|
-
*
|
|
99
|
-
* `
|
|
100
|
-
*
|
|
101
|
-
readonly
|
|
102
|
-
/** Numbl resolution context. Holds the workspace registry
|
|
103
|
-
* (`filesByFuncName`, `classesByName`, `localClassesByName`) and
|
|
104
|
-
* the `FunctionIndex` used by `resolveFunction`. Settable so the
|
|
105
|
-
* `fromExistingContext` JIT factory can replace the constructor-
|
|
106
|
-
* built default with a caller-owned context. */
|
|
107
|
-
ctx: LoweringContext;
|
|
80
|
+
/** Numbl resolution context, owned by the interpreter. Holds the
|
|
81
|
+
* workspace registry (`filesByFuncName`, `classesByName`,
|
|
82
|
+
* `localClassesByName`) and the `FunctionIndex` used by
|
|
83
|
+
* `resolveFunction`. */
|
|
84
|
+
readonly ctx: LoweringContext;
|
|
108
85
|
/** Resolved class registry — populated by `finalize()` by walking
|
|
109
86
|
* every classdef numbl knows about (workspace + local) and
|
|
110
|
-
* applying
|
|
87
|
+
* applying the JIT's validation/property-type inference. */
|
|
111
88
|
classes: Map<string, ClassRegistration>;
|
|
112
|
-
/** Classes that numbl knows about but
|
|
113
|
-
*
|
|
114
|
-
* populated in `fromExistingContext` (JIT bridge) mode — the
|
|
115
|
-
* standalone path still fails finalize() on the first bad class.
|
|
89
|
+
/** Classes that numbl knows about but `registerClassDef` rejected
|
|
90
|
+
* (e.g. inheritance, unsupported attributes).
|
|
116
91
|
*
|
|
117
92
|
* `isClass(name)` returns `true` for these so call-site dispatch
|
|
118
93
|
* doesn't get steered into a wrong code path (treating a class
|
|
119
94
|
* reference as a function call). `requireClass(name)` re-throws
|
|
120
95
|
* the saved `UnsupportedConstruct` at the actual use site, which
|
|
121
|
-
* the
|
|
96
|
+
* the executor catches as a decline and falls back to the
|
|
122
97
|
* interpreter for that call. */
|
|
123
98
|
failedClassValidations: Map<string, UnsupportedConstruct>;
|
|
124
|
-
/** Workspace-scoped `Builtin` objects loaded from `.mtoc2.js` files.
|
|
125
|
-
* Keyed by source-level function name (matches numbl's
|
|
126
|
-
* `mtoc2UserFunctionsByName` keys). Populated lazily by `finalize`. */
|
|
127
|
-
private userBuiltins;
|
|
128
|
-
/** Sibling C/H files pulled in by `.mtoc2.js` user functions via
|
|
129
|
-
* `exports.cSources`. Each entry carries the originating
|
|
130
|
-
* `.mtoc2.js` function name (for namespacing in the build dir),
|
|
131
|
-
* the file's relative path (as the user wrote it), and the file
|
|
132
|
-
* text. Populated lazily by `finalize`; exposed via
|
|
133
|
-
* `getUserCSources()` for the build pipeline. */
|
|
134
|
-
private userCSources;
|
|
135
99
|
private finalized;
|
|
136
|
-
|
|
137
|
-
* populated by the caller (numbl's interpreter, in the JIT case)
|
|
138
|
-
* and re-registering its local functions / classes / workspace
|
|
139
|
-
* files in `finalize()` would duplicate work and possibly error.
|
|
140
|
-
* The mtoc2-side phases (class registry, `.mtoc2.js` loader) still
|
|
141
|
-
* run regardless — those are mtoc2-only bookkeeping. */
|
|
142
|
-
private skipCtxRegistration;
|
|
143
|
-
constructor(mainFile: string, searchPaths?: ReadonlyArray<string>);
|
|
100
|
+
private constructor();
|
|
144
101
|
/** Build a Workspace that wraps an existing `LoweringContext`. The
|
|
145
102
|
* caller's `ctx` must already have file ASTs cached, local
|
|
146
103
|
* functions and classes for the main file registered, workspace
|
|
147
|
-
* files registered, and the function index built —
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* + `.mtoc2.js` loader bookkeeping on top.
|
|
151
|
-
*
|
|
152
|
-
* Used by the numbl JIT bridge so a single `LoweringContext` is
|
|
153
|
-
* shared between numbl's interpreter and mtoc2's JIT compile path
|
|
154
|
-
* per session. */
|
|
104
|
+
* files registered, and the function index built — because numbl's
|
|
105
|
+
* interpreter has been driving the same context. The JIT runs its
|
|
106
|
+
* own class-registry bookkeeping on top. */
|
|
155
107
|
static fromExistingContext(ctx: LoweringContext, mainFile: string, files: Iterable<WorkspaceFile>): Workspace;
|
|
156
|
-
/**
|
|
157
|
-
*
|
|
158
|
-
* - `.m` files require a pre-parsed `ast` (from `parseMFile`) so
|
|
159
|
-
* numbl's resolver and mtoc2's lowerer share one cached AST per
|
|
160
|
-
* file.
|
|
161
|
-
* - `.mtoc2.js` files carry source text only; the workspace passes
|
|
162
|
-
* the source to numbl's registry under the function's basename
|
|
163
|
-
* and (later) evaluates the JS via `loadMtoc2UserFunctions`. No
|
|
164
|
-
* AST is required. */
|
|
165
|
-
addFile(file: WorkspaceFile): void;
|
|
166
|
-
/** Build the function index + class registry. Call once after
|
|
167
|
-
* every file has been added. Subsequent calls are no-ops. */
|
|
108
|
+
/** Build the class registry. Subsequent calls are no-ops. */
|
|
168
109
|
finalize(): void;
|
|
169
|
-
/** Compute the workspace-relative path for `absPath`. Used to hash
|
|
170
|
-
* per-file C-namespace prefixes for `.mtoc2.js` user functions so
|
|
171
|
-
* the same hash falls out regardless of where the project lives
|
|
172
|
-
* on disk. Falls back to the bare basename when no search path
|
|
173
|
-
* contains the file (web IDE, ad-hoc absolute path outside the
|
|
174
|
-
* entry's directory). */
|
|
175
|
-
private workspaceRelativePath;
|
|
176
|
-
/** Look up an evaluated `.mtoc2.js` user function by source-level
|
|
177
|
-
* name. Returns `undefined` if no such workspace user function
|
|
178
|
-
* exists. Both the lowerer and codegen consult this — the former
|
|
179
|
-
* to call `transfer`, the latter to call `emit`. */
|
|
180
|
-
getUserBuiltin(name: string): Builtin | undefined;
|
|
181
|
-
/** Sibling C/H files supplied by `.mtoc2.js` user functions via
|
|
182
|
-
* `exports.cSources`. The build pipeline writes each file to a
|
|
183
|
-
* per-owner subdirectory under the build root and adds `-I` for
|
|
184
|
-
* that subdir; `.c` entries are compiled along with the main C,
|
|
185
|
-
* `.h` entries just sit in the include path. Each entry's
|
|
186
|
-
* `ownerHash` is the same FNV-1a hash that names the owner's
|
|
187
|
-
* C-symbol prefix, so per-user-function subdirs stay collision-
|
|
188
|
-
* free even if two files share a basename. */
|
|
189
|
-
getUserCSources(): ReadonlyArray<{
|
|
190
|
-
ownerFunc: string;
|
|
191
|
-
ownerHash: string;
|
|
192
|
-
relPath: string;
|
|
193
|
-
source: string;
|
|
194
|
-
}>;
|
|
195
110
|
/** Pull the primary Function AST from each `@ClassName/<methodName>.m`
|
|
196
111
|
* external method file that numbl registered for `info`. Any other
|
|
197
112
|
* top-level functions in the file are per-method-file local helpers
|
|
@@ -221,23 +136,4 @@ export declare class Workspace {
|
|
|
221
136
|
* line/column in the right file. */
|
|
222
137
|
sourceOf(file: string): string | undefined;
|
|
223
138
|
}
|
|
224
|
-
|
|
225
|
-
*
|
|
226
|
-
* The `mainName` file's parse errors are propagated; for every other
|
|
227
|
-
* file, parse errors are reported via `onWarn` and the file is
|
|
228
|
-
* dropped from the result. This matches numbl, which warns and
|
|
229
|
-
* skips workspace siblings that fail to parse so that a single bad
|
|
230
|
-
* file in an `addpath`'d tree doesn't poison the whole run.
|
|
231
|
-
*
|
|
232
|
-
* Files ending in `.mtoc2.js` skip MATLAB parsing — they're plain
|
|
233
|
-
* JavaScript text that the workspace will hand to the mtoc2 user-
|
|
234
|
-
* function loader later. Their `ast` field stays undefined. */
|
|
235
|
-
export declare function parseFiles(files: ReadonlyArray<{
|
|
236
|
-
name: string;
|
|
237
|
-
source: string;
|
|
238
|
-
}>, mainName?: string, onWarn?: (msg: string) => void): WorkspaceFile[];
|
|
239
|
-
/** Adapter from mtoc2's `Type` to numbl's `ItemType`. The resolver
|
|
240
|
-
* only reads `kind === "ClassInstance"` and `className` from there;
|
|
241
|
-
* every other shape collapses to `Unknown`. */
|
|
242
|
-
export declare function mtypeToItemType(t: Type): ItemType;
|
|
243
|
-
export type { ClassDefStmt };
|
|
139
|
+
export {};
|
|
@@ -21,7 +21,7 @@ export interface JitDecline {
|
|
|
21
21
|
message: string;
|
|
22
22
|
/** Error class name: "UnsupportedConstruct" | "JitTypeError". */
|
|
23
23
|
kind: string;
|
|
24
|
-
/** Which executor declined
|
|
24
|
+
/** Which executor declined, e.g. "jit-loop" or "cjit-call". */
|
|
25
25
|
where: string;
|
|
26
26
|
/** Source position of the offending construct, when the thrown error
|
|
27
27
|
* carried one. Only used for diagnostics. */
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Loader for .numbl.js user functions.
|
|
3
3
|
*
|
|
4
|
-
* Evaluates .numbl.js files that define
|
|
5
|
-
* register({
|
|
4
|
+
* Evaluates .numbl.js files that define a function via
|
|
5
|
+
* register(function (args, nargout) { ... })
|
|
6
|
+
* or register({ apply, help }). The older register({ resolve }) form, whose
|
|
7
|
+
* resolve(argTypes, nargout) returns { outputTypes, apply }, is still
|
|
8
|
+
* accepted.
|
|
6
9
|
* Supports optional WASM and native shared library bindings via directives:
|
|
7
10
|
* // wasm: <name>
|
|
8
11
|
* // native: <name>
|
|
@@ -31,24 +34,19 @@ export interface LoadedJsUserFunction {
|
|
|
31
34
|
name: string;
|
|
32
35
|
fileName: string;
|
|
33
36
|
builtin: IBuiltin;
|
|
37
|
+
/** Help text from `register({ help })`, printed by `help name`. */
|
|
38
|
+
help?: string;
|
|
34
39
|
}
|
|
35
40
|
/** Returns true if the file is a numbl JS user function file (`*.numbl.js`). */
|
|
36
41
|
export declare function isNumblJsFile(fileName: string): boolean;
|
|
37
|
-
|
|
38
|
-
* Numbl recognizes the extension for workspace discovery + function-name
|
|
39
|
-
* resolution, but never executes the body — mtoc2's loader does that. */
|
|
40
|
-
export declare function isMtoc2JsFile(fileName: string): boolean;
|
|
41
|
-
/** Derive a function name from a `.mtoc2.js` workspace file path.
|
|
42
|
-
* "myadd.mtoc2.js" → "myadd"
|
|
43
|
-
* "/path/to/myadd.mtoc2.js" → "myadd" */
|
|
44
|
-
export declare function funcNameFromMtoc2JsFile(fileName: string): string;
|
|
42
|
+
export declare function setJsGpuHelper(helper: unknown): void;
|
|
45
43
|
/**
|
|
46
44
|
* Load .numbl.js user function files and return them as LoadedJsUserFunction
|
|
47
45
|
* records. Each loaded record carries the function name, source file name,
|
|
48
46
|
* and the IBuiltin object built from the file's `register()` call.
|
|
49
47
|
*
|
|
50
|
-
* Each .numbl.js file calls register(
|
|
51
|
-
*
|
|
48
|
+
* Each .numbl.js file calls register() once; see builtinFromSpec for the
|
|
49
|
+
* accepted forms.
|
|
52
50
|
*
|
|
53
51
|
* A .numbl.js file can specify bindings via directives at the top of the file:
|
|
54
52
|
* // wasm: <name> — load a WASM module (looked up by name in wasmFiles)
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* Class information types and extraction utilities.
|
|
3
3
|
*/
|
|
4
4
|
import { type Expr, type Stmt } from "../parser/index.js";
|
|
5
|
+
/** Built-in base classes that confer handle (reference) semantics. */
|
|
6
|
+
export declare const HANDLE_BASE_CLASSES: Set<string>;
|
|
5
7
|
/**
|
|
6
8
|
* Metadata about a class definition.
|
|
7
9
|
* The ctx field is typed as 'unknown' to avoid circular dependencies with LoweringContext.
|
|
@@ -12,7 +14,8 @@ export interface ClassInfo {
|
|
|
12
14
|
qualifiedName: string;
|
|
13
15
|
fileName: string;
|
|
14
16
|
source: string;
|
|
15
|
-
|
|
17
|
+
/** Direct superclasses in declaration order (`classdef A < B & C`). */
|
|
18
|
+
superClasses: string[];
|
|
16
19
|
propertyNames: string[];
|
|
17
20
|
propertyDefaults: Map<string, Expr>;
|
|
18
21
|
methodNames: Set<string>;
|
|
@@ -22,13 +22,7 @@ interface WorkspaceRegistry {
|
|
|
22
22
|
jsUserFunctionsByName: Map<string, {
|
|
23
23
|
fileName: string;
|
|
24
24
|
builtin: IBuiltin;
|
|
25
|
-
|
|
26
|
-
/** mtoc2-only user functions (.mtoc2.js): functionName → { fileName, source }.
|
|
27
|
-
* Numbl never executes these — the source text is stored for mtoc2's loader
|
|
28
|
-
* to consume. Numbl's interpreter rejects calls to them with a clear error. */
|
|
29
|
-
mtoc2UserFunctionsByName: Map<string, {
|
|
30
|
-
fileName: string;
|
|
31
|
-
source: string;
|
|
25
|
+
help?: string;
|
|
32
26
|
}>;
|
|
33
27
|
/** Per-workspace-file lowering contexts (created on demand) */
|
|
34
28
|
fileContexts: Map<string, LoweringContext>;
|
|
@@ -75,10 +69,6 @@ export interface FunctionIndex {
|
|
|
75
69
|
workspaceFunctions: Set<string>;
|
|
76
70
|
/** JS user functions (resolved at workspace-function priority, not builtin) */
|
|
77
71
|
jsUserFunctions: Set<string>;
|
|
78
|
-
/** mtoc2-only user functions (.mtoc2.js). Resolved at workspace-function
|
|
79
|
-
* priority, like jsUserFunctions. Numbl's interpreter rejects calls to
|
|
80
|
-
* these; mtoc2 routes them through its own loader. */
|
|
81
|
-
mtoc2UserFunctions: Set<string>;
|
|
82
72
|
/** Workspace classes (classdef files) */
|
|
83
73
|
workspaceClasses: Set<string>;
|
|
84
74
|
/** Local subfunctions per workspace file: primaryFuncName → Set<subfuncName> */
|
|
@@ -152,10 +142,7 @@ export declare class LoweringContext {
|
|
|
152
142
|
* Also handles @ClassName class folders.
|
|
153
143
|
*
|
|
154
144
|
* `.m` files register as workspace functions / classes / private functions
|
|
155
|
-
* (the regular MATLAB-style discovery).
|
|
156
|
-
* mtoc2-only user functions: numbl tracks the name so resolution sees
|
|
157
|
-
* them, but the body stays unparsed — mtoc2's loader evaluates them.
|
|
158
|
-
* `.mtoc2.js` files in `@ClassName/` are not yet supported.
|
|
145
|
+
* (the regular MATLAB-style discovery).
|
|
159
146
|
*/
|
|
160
147
|
registerWorkspaceFiles(files: WorkspaceFile[]): void;
|
|
161
148
|
isWorkspaceFunction(name: string): boolean;
|
|
@@ -165,14 +152,7 @@ export declare class LoweringContext {
|
|
|
165
152
|
* Register a JS user function (.numbl.js) in the workspace registry.
|
|
166
153
|
* Uses first-wins semantics so search-path priority is honored.
|
|
167
154
|
*/
|
|
168
|
-
registerJsUserFunction(funcName: string, fileName: string, builtin: IBuiltin): void;
|
|
169
|
-
/**
|
|
170
|
-
* Register an mtoc2-only user function (.mtoc2.js) in the workspace
|
|
171
|
-
* registry. Numbl stores the source text verbatim; mtoc2's loader
|
|
172
|
-
* evaluates it. Uses first-wins semantics so search-path priority is
|
|
173
|
-
* honored — same as `.numbl.js`.
|
|
174
|
-
*/
|
|
175
|
-
registerMtoc2UserFunction(funcName: string, fileName: string, source: string): void;
|
|
155
|
+
registerJsUserFunction(funcName: string, fileName: string, builtin: IBuiltin, help?: string): void;
|
|
176
156
|
/**
|
|
177
157
|
* Get the effective directory for this context's file, used for
|
|
178
158
|
* private function resolution. If the file is inside a private/ folder,
|
|
@@ -209,6 +189,18 @@ export declare class LoweringContext {
|
|
|
209
189
|
isLocalClass(name: string): boolean;
|
|
210
190
|
isClass(name: string): boolean;
|
|
211
191
|
getClassInfo(name: string): ClassInfo | null;
|
|
192
|
+
/** Ancestors of a class in method-resolution order: depth-first, left to
|
|
193
|
+
* right through each `<` list, each name once. Built-in bases such as
|
|
194
|
+
* `handle` are included even though they have no ClassInfo; a built-in
|
|
195
|
+
* handle mixin (e.g. `matlab.mixin.Copyable`) is followed by `handle`. */
|
|
196
|
+
superclassNames(info: ClassInfo): string[];
|
|
197
|
+
/** `superclassNames` by class name; empty for an unknown class. */
|
|
198
|
+
classAncestors(className: string): string[];
|
|
199
|
+
/** A class followed by its ancestors that have class definitions, in
|
|
200
|
+
* method-resolution order. */
|
|
201
|
+
classLineage(info: ClassInfo): ClassInfo[];
|
|
202
|
+
/** True if the class derives from a handle base class. */
|
|
203
|
+
isHandleClass(info: ClassInfo): boolean;
|
|
212
204
|
/** Check if a class (or any ancestor) has a given method. */
|
|
213
205
|
classHasMethod(className: string, methodName: string): boolean;
|
|
214
206
|
/** Check if a class (or any ancestor) has a given static method. */
|