numbl 0.3.3 → 0.4.0
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 +6 -5
- package/dist-cli/cli.js +62367 -41985
- package/dist-lib/lib.d.ts +0 -1
- package/dist-lib/lib.js +79083 -58956
- package/dist-lib/numbl-core/executeCode.d.ts +10 -12
- package/dist-lib/numbl-core/executors/classification.d.ts +134 -0
- package/dist-lib/numbl-core/executors/handleInline.d.ts +42 -0
- package/dist-lib/numbl-core/executors/index.d.ts +0 -3
- package/dist-lib/numbl-core/executors/jit/cJitCallExecutor.d.ts +35 -0
- package/dist-lib/numbl-core/executors/jit/cJitLoopExecutor.d.ts +31 -0
- package/dist-lib/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +29 -0
- package/dist-lib/numbl-core/executors/jit/callExecutor.d.ts +45 -0
- package/dist-lib/numbl-core/executors/jit/compileC.d.ts +51 -0
- package/dist-lib/numbl-core/executors/jit/compileC.node.d.ts +25 -0
- package/dist-lib/numbl-core/executors/jit/hostHelpers.d.ts +27 -0
- package/dist-lib/numbl-core/executors/jit/loopExecutor.d.ts +41 -0
- package/dist-lib/numbl-core/executors/jit/session.d.ts +17 -0
- package/dist-lib/numbl-core/executors/jit/topLevelExecutor.d.ts +36 -0
- package/dist-lib/numbl-core/executors/jit/typeAdapter.d.ts +28 -0
- package/dist-lib/numbl-core/executors/jit/typeAdapterC.d.ts +73 -0
- package/dist-lib/numbl-core/executors/jit/valueAdapter.d.ts +48 -0
- package/dist-lib/numbl-core/executors/jit/valueAdapterC.d.ts +108 -0
- package/dist-lib/numbl-core/executors/lowering.d.ts +31 -77
- package/dist-lib/numbl-core/executors/plugins.d.ts +14 -21
- package/dist-lib/numbl-core/helpers/reduction-helpers.d.ts +4 -1
- package/dist-lib/numbl-core/interpreter/builtins/index.d.ts +1 -1
- package/dist-lib/numbl-core/interpreter/builtins/types.d.ts +0 -18
- package/dist-lib/numbl-core/interpreter/interpreter.d.ts +36 -20
- package/dist-lib/numbl-core/interpreter/interpreterExec.d.ts +6 -0
- package/dist-lib/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +1 -1
- package/dist-lib/numbl-core/jit/builtins/defs/_shared.d.ts +43 -0
- package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +123 -0
- package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/minus.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/mpower.d.ts +12 -0
- package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/mrdivide.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/mtimes.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/plus.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/power.d.ts +30 -0
- package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/rdivide.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/times.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/uminus.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/compare/_compare.d.ts +12 -0
- package/dist-lib/numbl-core/jit/builtins/defs/compare/eq.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/compare/ge.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/compare/gt.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/compare/le.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/compare/lt.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/compare/ne.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/diag/assert.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/defs/io/_format_args.d.ts +17 -0
- package/dist-lib/numbl-core/jit/builtins/defs/io/disp.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/io/error.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/io/fprintf.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/io/sprintf.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/io/warning.d.ts +15 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/_shortcircuit.d.ts +30 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +30 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/and.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/andand.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/boolconst.d.ts +3 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/classBuiltin.d.ts +21 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +15 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/isa.d.ts +13 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/iscell.d.ts +8 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/isempty.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/isequal.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/isfield.d.ts +20 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/isinf.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/isnan.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/isnumeric.d.ts +7 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/isreal.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/isscalar.d.ts +20 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/isstruct.d.ts +7 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/logical.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/not.d.ts +15 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/or.d.ts +11 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/oror.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +21 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/typequery.d.ts +10 -0
- package/dist-lib/numbl-core/jit/builtins/defs/logical/xor.d.ts +12 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/_complex_fold.d.ts +34 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +51 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/abs.d.ts +7 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/angle.d.ts +7 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/asinh.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/atan.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/atan2.d.ts +3 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/besselh.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/ceil.d.ts +4 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/conj.d.ts +7 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/constants.d.ts +7 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/cos.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/cosh.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/dot.d.ts +20 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/double.d.ts +28 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/exp.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/fix.d.ts +4 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/floor.d.ts +4 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/hypot.d.ts +3 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/imag.d.ts +7 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/linspace.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/log.d.ts +4 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/log10.d.ts +3 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/log2.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/logspace.d.ts +8 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/mod.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/norm.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/real.d.ts +7 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/rem.d.ts +3 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/round.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/sign.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/sin.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/sinh.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/sqrt.d.ts +11 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/tan.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/tanh.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/math/uniquetol.d.ts +22 -0
- package/dist-lib/numbl-core/jit/builtins/defs/plot/dispatch.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/_cumulative.d.ts +49 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +126 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/_variance.d.ts +17 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/all.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/any.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/cummax.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/cummin.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/cumprod.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/cumsum.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/diff.d.ts +16 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/length.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/max.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/mean.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/min.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/numel.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/prod.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/std.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/sum.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/var.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/_construct.d.ts +67 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +34 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/cat.d.ts +33 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/diag.d.ts +29 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/eye.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/flip.d.ts +7 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/meshgrid.d.ts +12 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/ones.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/repmat.d.ts +37 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/reshape.d.ts +39 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/size.d.ts +20 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/sort.d.ts +19 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/transpose.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/tril.d.ts +16 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/triu.d.ts +16 -0
- package/dist-lib/numbl-core/jit/builtins/defs/shape/zeros.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/defs/system/deal.d.ts +20 -0
- package/dist-lib/numbl-core/jit/builtins/defs/system/feval.d.ts +36 -0
- package/dist-lib/numbl-core/jit/builtins/defs/system/pathBuiltins.d.ts +4 -0
- package/dist-lib/numbl-core/jit/builtins/defs/system/tic.d.ts +8 -0
- package/dist-lib/numbl-core/jit/builtins/defs/system/toc.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/index.d.ts +16 -0
- package/dist-lib/numbl-core/jit/builtins/registry.d.ts +138 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/cell/cell.d.ts +24 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/indexing/loop_count.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/indexing/range_value.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/indexing/scalar_index.d.ts +11 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/indexing/tensor_make_range.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/io/assert_fmt.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/io/disp_complex.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/io/disp_double.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/io/disp_struct.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/io/disp_tensor.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/io/disp_tensor_complex.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/io/error_fmt.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/io/format_complex.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/io/format_double.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/io/format_engine.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/io/fprintf.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/io/sprintf.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/io/warning_fmt.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/plot/plot_dispatch.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/snippets.gen.d.ts +86 -0
- 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 +103 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/system/deep_clone.d.ts +1 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/system/isequal.d.ts +2 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/system/tictoc.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_alloc.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_alloc_complex.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_alloc_nd.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_alloc_nd_complex.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_copy_complex.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_from_matrix.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_from_matrix_complex.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_from_row.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_from_row_complex.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_cat.d.ts +11 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_cumulative.d.ts +32 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_diag.d.ts +33 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_diff.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_dot.d.ts +16 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_complex.d.ts +90 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real.d.ts +75 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +95 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_eye.d.ts +10 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_fill_nd.d.ts +11 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_fill_square.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_flip.d.ts +11 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_linspace.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_logical_real.d.ts +10 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_logspace.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_meshgrid.d.ts +29 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_mtimes_complex.d.ts +10 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_mtimes_real.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_norm.d.ts +4 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_ones_nd.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_ones_square.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_predicate.d.ts +42 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_complex.d.ts +53 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +42 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_repmat.d.ts +11 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reshape_nd.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reshape_nd_complex.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_size.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_sort_real.d.ts +36 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_transpose.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_transpose_complex.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_triangular.d.ts +22 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_complex_math.d.ts +128 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +95 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_uniquetol.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_var.d.ts +12 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_zeros_nd.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_zeros_square.d.ts +5 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/text/strcmp.d.ts +2 -0
- package/dist-lib/numbl-core/jit/codegen/cFormat.d.ts +36 -0
- package/dist-lib/numbl-core/jit/codegen/cHelpers.d.ts +48 -0
- package/dist-lib/numbl-core/jit/codegen/emit.d.ts +55 -0
- package/dist-lib/numbl-core/jit/codegen/emitCellTypedef.d.ts +23 -0
- package/dist-lib/numbl-core/jit/codegen/emitExpr.d.ts +33 -0
- package/dist-lib/numbl-core/jit/codegen/emitIndex.d.ts +56 -0
- package/dist-lib/numbl-core/jit/codegen/emitJs.d.ts +64 -0
- package/dist-lib/numbl-core/jit/codegen/emitNamedTypedef.d.ts +58 -0
- package/dist-lib/numbl-core/jit/codegen/emitStmt.d.ts +76 -0
- package/dist-lib/numbl-core/jit/codegen/emitTensorConcat.d.ts +23 -0
- package/dist-lib/numbl-core/jit/codegen/emitTensorConcatJs.d.ts +16 -0
- package/dist-lib/numbl-core/jit/codegen/emitTensorFused.d.ts +77 -0
- package/dist-lib/numbl-core/jit/codegen/inlinePass.d.ts +66 -0
- package/dist-lib/numbl-core/jit/codegen/liveness.d.ts +58 -0
- package/dist-lib/numbl-core/jit/codegen/prettyIR.d.ts +24 -0
- package/dist-lib/numbl-core/jit/codegen/runtime.d.ts +150 -0
- package/dist-lib/numbl-core/jit/compileSpec.d.ts +84 -0
- package/dist-lib/numbl-core/jit/compileSpecC.d.ts +93 -0
- package/dist-lib/numbl-core/jit/index.d.ts +15 -0
- package/dist-lib/numbl-core/jit/lowering/classDefs.d.ts +109 -0
- package/dist-lib/numbl-core/jit/lowering/errors.d.ts +35 -0
- package/dist-lib/numbl-core/jit/lowering/indexFold.d.ts +31 -0
- package/dist-lib/numbl-core/jit/lowering/indexResolve.d.ts +100 -0
- package/dist-lib/numbl-core/jit/lowering/ir.d.ts +584 -0
- package/dist-lib/numbl-core/jit/lowering/lower.d.ts +271 -0
- package/dist-lib/numbl-core/jit/lowering/lowerCellIndex.d.ts +41 -0
- package/dist-lib/numbl-core/jit/lowering/lowerCellLit.d.ts +19 -0
- package/dist-lib/numbl-core/jit/lowering/lowerClassConstructor.d.ts +55 -0
- package/dist-lib/numbl-core/jit/lowering/lowerFuncCall.d.ts +34 -0
- package/dist-lib/numbl-core/jit/lowering/lowerHandle.d.ts +57 -0
- package/dist-lib/numbl-core/jit/lowering/lowerIndexLoad.d.ts +16 -0
- package/dist-lib/numbl-core/jit/lowering/lowerIndexSlice.d.ts +29 -0
- package/dist-lib/numbl-core/jit/lowering/lowerIndexSliceStore.d.ts +19 -0
- package/dist-lib/numbl-core/jit/lowering/lowerIndexStore.d.ts +14 -0
- package/dist-lib/numbl-core/jit/lowering/lowerMethodCall.d.ts +45 -0
- package/dist-lib/numbl-core/jit/lowering/lowerMultiAssign.d.ts +36 -0
- package/dist-lib/numbl-core/jit/lowering/lowerTensorLit.d.ts +25 -0
- package/dist-lib/numbl-core/jit/lowering/rangeCount.d.ts +19 -0
- package/dist-lib/numbl-core/jit/lowering/specialize.d.ts +93 -0
- package/dist-lib/numbl-core/jit/lowering/types.d.ts +503 -0
- package/dist-lib/numbl-core/jit/lowering/walk.d.ts +17 -0
- package/dist-lib/numbl-core/jit/numbl/index.d.ts +30 -0
- package/dist-lib/numbl-core/jit/parser/astUtils.d.ts +43 -0
- package/dist-lib/numbl-core/jit/parser/index.d.ts +12 -0
- package/dist-lib/numbl-core/jit/parser/sourceLoc.d.ts +12 -0
- package/dist-lib/numbl-core/jit/runtime/context.d.ts +23 -0
- package/dist-lib/numbl-core/jit/runtime/inferType.d.ts +10 -0
- package/dist-lib/numbl-core/jit/runtime/value.d.ts +101 -0
- package/dist-lib/numbl-core/jit/workspace/driverPrologue.d.ts +59 -0
- package/dist-lib/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +62 -0
- package/dist-lib/numbl-core/jit/workspace/workspace.d.ts +243 -0
- package/dist-lib/numbl-core/jitTypes.d.ts +7 -321
- package/dist-lib/numbl-core/jsUserFunctions.d.ts +2 -2
- package/dist-lib/numbl-core/parser/ClassParser.d.ts +3 -0
- package/dist-lib/numbl-core/runtime/index.d.ts +1 -1
- package/dist-lib/numbl-core/runtime/indexing.d.ts +11 -1
- package/dist-lib/numbl-core/runtime/runtime.d.ts +16 -1
- package/dist-lib/numbl-core/runtime/types.d.ts +13 -0
- package/dist-lib/numbl-core/version.d.ts +1 -1
- package/dist-lib/numbl-core/workspace/types.d.ts +8 -0
- package/dist-site-viewer/404.html +33 -0
- package/dist-site-viewer/assets/index-CgBUy7v7.js +4748 -0
- package/dist-site-viewer/assets/index-D5YY8PKx.css +1 -0
- package/dist-site-viewer/assets/numbl-worker-VkVtodCX.js +11836 -0
- package/dist-site-viewer/coi-serviceworker.js +70 -0
- package/dist-site-viewer/favicon.svg +23 -0
- package/dist-site-viewer/index.html +16 -0
- package/dist-site-viewer/logo.svg +26 -0
- package/dist-site-viewer/numbl-embed.js +111 -0
- package/dist-site-viewer/vite.svg +1 -0
- package/native/ops/real_unary_elemwise.c +3 -1
- package/package.json +15 -9
- package/dist-lib/numbl-core/executors/cJit/builtins.d.ts +0 -30
- package/dist-lib/numbl-core/executors/cJit/chainCodegen.d.ts +0 -59
- package/dist-lib/numbl-core/executors/cJit/chainExecutor.d.ts +0 -27
- package/dist-lib/numbl-core/executors/cJit/chainPass.d.ts +0 -42
- package/dist-lib/numbl-core/executors/cJit/codegen.d.ts +0 -44
- package/dist-lib/numbl-core/executors/cJit/compile.d.ts +0 -45
- package/dist-lib/numbl-core/executors/cJit/elemwiseCodegen.d.ts +0 -23
- package/dist-lib/numbl-core/executors/cJit/elemwiseStructural.d.ts +0 -33
- package/dist-lib/numbl-core/executors/cJit/fuseAnalyze.d.ts +0 -39
- package/dist-lib/numbl-core/executors/cJit/fuseCodegen.d.ts +0 -16
- package/dist-lib/numbl-core/executors/cJit/fuseExecutor.d.ts +0 -28
- package/dist-lib/numbl-core/executors/cJit/loopExecutor.d.ts +0 -32
- package/dist-lib/numbl-core/executors/cJit/register.d.ts +0 -10
- package/dist-lib/numbl-core/executors/cJit/whitelist.d.ts +0 -15
- package/dist-lib/numbl-core/executors/jsJit/callExecutor.d.ts +0 -25
- package/dist-lib/numbl-core/executors/jsJit/codegen/jitCodegen.d.ts +0 -7
- package/dist-lib/numbl-core/executors/jsJit/codegen/jitCodegenHoist.d.ts +0 -70
- package/dist-lib/numbl-core/executors/jsJit/codegen/jsMultiReduction.d.ts +0 -67
- package/dist-lib/numbl-core/executors/jsJit/helpers/jitHelpers.d.ts +0 -34
- package/dist-lib/numbl-core/executors/jsJit/helpers/jitHelpersComplex.d.ts +0 -21
- package/dist-lib/numbl-core/executors/jsJit/helpers/jitHelpersIndex.d.ts +0 -33
- package/dist-lib/numbl-core/executors/jsJit/helpers/jitHelpersTensor.d.ts +0 -34
- package/dist-lib/numbl-core/executors/jsJit/jitCall.d.ts +0 -59
- package/dist-lib/numbl-core/executors/jsJit/jitLoop.d.ts +0 -53
- package/dist-lib/numbl-core/executors/jsJit/jitTopLevel.d.ts +0 -44
- package/dist-lib/numbl-core/executors/jsJit/loopExecutor.d.ts +0 -15
- package/dist-lib/numbl-core/executors/jsJit/lower/blockAnalysis.d.ts +0 -37
- package/dist-lib/numbl-core/executors/jsJit/lower/jitBailSafety.d.ts +0 -41
- package/dist-lib/numbl-core/executors/jsJit/lower/jitLower.d.ts +0 -136
- package/dist-lib/numbl-core/executors/jsJit/lower/jitLowerExpr.d.ts +0 -36
- package/dist-lib/numbl-core/executors/jsJit/lower/jitLowerStmt.d.ts +0 -9
- package/dist-lib/numbl-core/executors/jsJit/lower/jitLowerTypes.d.ts +0 -29
- package/dist-lib/numbl-core/executors/jsJit/lower/scalarEmit.d.ts +0 -58
- package/dist-lib/numbl-core/executors/jsJit/shared.d.ts +0 -120
- package/dist-lib/numbl-core/executors/jsJit/topLevelExecutor.d.ts +0 -17
- /package/dist-lib/numbl-core/{executors/jsJit/helpers → runtime}/alloc.d.ts +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Class-definition registry. The `Workspace` walks each known
|
|
3
|
+
* `Stmt.ClassDef` (main file + every workspace file containing a
|
|
4
|
+
* classdef) and calls `registerClassDef` to validate and infer
|
|
5
|
+
* property types from the declared default expressions. Results are
|
|
6
|
+
* keyed by class name.
|
|
7
|
+
*
|
|
8
|
+
* Scope for v1:
|
|
9
|
+
* - Single `classdef Foo properties ... methods ... end end`
|
|
10
|
+
* blocks; no class attributes accepted.
|
|
11
|
+
* - No inheritance (`< Parent`), no handle classes, no
|
|
12
|
+
* `Events`/`Enumeration`/`Arguments` blocks, no operator
|
|
13
|
+
* overloads, no `get.`/`set.` accessors. Every rejected form
|
|
14
|
+
* surfaces with a clean `UnsupportedConstruct` carrying the
|
|
15
|
+
* class's source span.
|
|
16
|
+
* - Properties may declare a default-value expression. When set,
|
|
17
|
+
* the default's type drives the property's storage type
|
|
18
|
+
* eagerly. When unset, the property's type is inferred at first
|
|
19
|
+
* constructor specialization from the first
|
|
20
|
+
* `obj.<prop> = <rhs>` write at the top level of the
|
|
21
|
+
* constructor body — see `Lowerer.resolveClassType` in
|
|
22
|
+
* [lower.ts](./lower.ts). The C typedef hash uses
|
|
23
|
+
* `cFieldTypeStr` (one C-type string per property), so the
|
|
24
|
+
* typedef stays stable even if writes evolve the internal type.
|
|
25
|
+
* - Methods can be the constructor (named same as class, returns
|
|
26
|
+
* the receiver), an instance method, or a static method
|
|
27
|
+
* (declared inside `methods (Static)` block). v1 only supports
|
|
28
|
+
* methods with 0 or 1 outputs (same as user functions).
|
|
29
|
+
*/
|
|
30
|
+
import type { Stmt, Expr } from "../parser/index.js";
|
|
31
|
+
import { type Type, type ClassType } from "./types.js";
|
|
32
|
+
type ClassDefStmt = Extract<Stmt, {
|
|
33
|
+
type: "ClassDef";
|
|
34
|
+
}>;
|
|
35
|
+
type FuncStmt = Extract<Stmt, {
|
|
36
|
+
type: "Function";
|
|
37
|
+
}>;
|
|
38
|
+
export interface ClassRegistration {
|
|
39
|
+
/** Source-level name. */
|
|
40
|
+
className: string;
|
|
41
|
+
/** File the classdef lives in (used to salt specialization keys
|
|
42
|
+
* and for diagnostics). */
|
|
43
|
+
file: string;
|
|
44
|
+
/** Declared property names in source order (sorted version lives on
|
|
45
|
+
* `ty.properties` once resolved). */
|
|
46
|
+
propertyNames: string[];
|
|
47
|
+
/** Properties with an explicit default-value expression. Each
|
|
48
|
+
* carries the lowered default's precise type (sign, exact, shape
|
|
49
|
+
* preserved). The C typedef hash uses `cFieldTypeStr` so precision
|
|
50
|
+
* differences across writes don't shard typedefs, but downstream
|
|
51
|
+
* reads / spec keying benefit from precision. */
|
|
52
|
+
defaults: Map<string, {
|
|
53
|
+
expr: Expr;
|
|
54
|
+
ty: Type;
|
|
55
|
+
}>;
|
|
56
|
+
/** Properties WITHOUT a default. Their C-level type is inferred at
|
|
57
|
+
* first constructor specialization from direct
|
|
58
|
+
* `obj.<prop> = <rhs>` writes in the constructor body. Disjoint
|
|
59
|
+
* from `defaults`. */
|
|
60
|
+
pendingProperties: Set<string>;
|
|
61
|
+
/** Class instance type. Eagerly resolved when every property has a
|
|
62
|
+
* default (`pendingProperties` empty). Otherwise null at
|
|
63
|
+
* registration and filled in by the lowerer's
|
|
64
|
+
* `resolveClassType()` at first constructor specialization. */
|
|
65
|
+
ty: ClassType | null;
|
|
66
|
+
/** Constructor (a method whose name matches the class). May be
|
|
67
|
+
* null when the class has no constructor — in that case the
|
|
68
|
+
* default-valued receiver is the constructor's "body" and
|
|
69
|
+
* `Foo()` (no args) is the only legal call. Required when
|
|
70
|
+
* `pendingProperties` is non-empty. */
|
|
71
|
+
constructor: FuncStmt | null;
|
|
72
|
+
/** Instance methods, keyed by source name. The constructor is NOT
|
|
73
|
+
* included here. Accessors (`get.X` / `set.X`) live in `getters`
|
|
74
|
+
* / `setters` and are NOT in this map. */
|
|
75
|
+
methods: Map<string, FuncStmt>;
|
|
76
|
+
/** Static methods, keyed by source name. Called as
|
|
77
|
+
* `ClassName.method(args)` — the receiver is not passed. */
|
|
78
|
+
staticMethods: Map<string, FuncStmt>;
|
|
79
|
+
/** `Dependent` properties — no per-instance storage. Reads route
|
|
80
|
+
* through `getters.get(name)`; writes route through
|
|
81
|
+
* `setters.get(name)` if a setter exists. Disjoint from
|
|
82
|
+
* `pendingProperties` and `defaults`; included in `propertyNames`
|
|
83
|
+
* for name-collision checks. */
|
|
84
|
+
dependentProperties: Set<string>;
|
|
85
|
+
/** Property getters declared as `function val = get.X(obj)`.
|
|
86
|
+
* Keyed by the property name (without the `get.` prefix). v1
|
|
87
|
+
* requires the property to be `Dependent`. */
|
|
88
|
+
getters: Map<string, FuncStmt>;
|
|
89
|
+
/** Property setters declared as `function obj = set.X(obj, val)`.
|
|
90
|
+
* Keyed by the property name (without the `set.` prefix). v1
|
|
91
|
+
* requires the property to be `Dependent`. */
|
|
92
|
+
setters: Map<string, FuncStmt>;
|
|
93
|
+
}
|
|
94
|
+
/** Validate one `classdef` AST and infer its property types. Throws
|
|
95
|
+
* `UnsupportedConstruct` for any v1-unsupported form (inheritance,
|
|
96
|
+
* class attributes, get/set accessors, events/enumeration/arguments
|
|
97
|
+
* blocks, operator overloads, etc.). The `file` argument is stored
|
|
98
|
+
* on the registration so cross-file specialization keys can salt by
|
|
99
|
+
* it.
|
|
100
|
+
*
|
|
101
|
+
* `externalMethods` carries instance methods discovered by numbl
|
|
102
|
+
* in an `@ClassName/` folder — one `<methodName>.m` per file. Numbl's
|
|
103
|
+
* `registerWorkspaceFiles` already collected them in
|
|
104
|
+
* `ClassInfo.externalMethodFiles`; the `Workspace` finalizer extracts
|
|
105
|
+
* each file's primary Function AST and passes them here so they
|
|
106
|
+
* participate in the same validation and method-map as in-body
|
|
107
|
+
* methods. */
|
|
108
|
+
export declare function registerClassDef(s: ClassDefStmt, file: string, externalMethods?: ReadonlyMap<string, FuncStmt>): ClassRegistration;
|
|
109
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mtoc2 lowering errors.
|
|
3
|
+
*
|
|
4
|
+
* Most errors carry a `Span` so the CLI can point at the offending
|
|
5
|
+
* source location. Builtin authors (whose `transfer`/`emit` hooks
|
|
6
|
+
* don't see a span) throw with `span` undefined; the framework
|
|
7
|
+
* backfills via `withSpan` at the call-site boundary.
|
|
8
|
+
*/
|
|
9
|
+
import type { Span } from "../parser/index.js";
|
|
10
|
+
export declare class UnsupportedConstruct extends Error {
|
|
11
|
+
span?: Span;
|
|
12
|
+
constructor(message: string, span?: Span);
|
|
13
|
+
}
|
|
14
|
+
export declare class TypeError extends Error {
|
|
15
|
+
span?: Span;
|
|
16
|
+
constructor(message: string, span?: Span);
|
|
17
|
+
}
|
|
18
|
+
/** Raised for ordinary user-facing runtime errors — things like
|
|
19
|
+
* "Undefined function or variable", "Too many output arguments", or
|
|
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
|
|
31
|
+
* framework→builtin call boundaries so builtin authors can throw
|
|
32
|
+
* without carrying a span around in every signature. Pre-existing
|
|
33
|
+
* spans (from nested framework calls) are preserved. */
|
|
34
|
+
export declare function withSpan<T>(span: Span, fn: () => T): T;
|
|
35
|
+
export declare function formatError(e: UnsupportedConstruct | TypeError | RuntimeError, source: string): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compile-time index-fold helpers. Used by two sites that need to
|
|
3
|
+
* resolve a (statically-known shape, statically-known 1-based index
|
|
4
|
+
* tuple) pair to a column-major flat-buffer offset:
|
|
5
|
+
*
|
|
6
|
+
* 1. `foldedElemType` in `lowerIndexLoad.ts` — folds `v(i, j)` to a
|
|
7
|
+
* scalar with exact data when the base is fully exact.
|
|
8
|
+
* 2. `tryRefreshExactAfterIndexedWrite` in `lower.ts` — refreshes the
|
|
9
|
+
* base's exact carrier in place after a single-scalar `IndexStore`.
|
|
10
|
+
*
|
|
11
|
+
* Both need to map (shape, idxVals) → offset using mtoc's column-major
|
|
12
|
+
* stride convention, accept either linear single-index or full N-index
|
|
13
|
+
* forms, and bounds-check each axis. The shared helper keeps the two
|
|
14
|
+
* call sites consistent.
|
|
15
|
+
*/
|
|
16
|
+
/** Map an N-D shape and a 1-based index tuple to a column-major flat
|
|
17
|
+
* offset, or `undefined` if the index is out-of-range or the tuple
|
|
18
|
+
* shape doesn't match a supported form.
|
|
19
|
+
*
|
|
20
|
+
* Supported forms:
|
|
21
|
+
* - `idxVals.length === 1` (linear single-index): the lone index
|
|
22
|
+
* addresses the flat buffer 1..numel. Out-of-range returns
|
|
23
|
+
* `undefined`.
|
|
24
|
+
* - `idxVals.length === shape.length` (full N-index): each slot
|
|
25
|
+
* addresses its axis 1..shape[k]. Out-of-range on any axis
|
|
26
|
+
* returns `undefined`.
|
|
27
|
+
*
|
|
28
|
+
* Mixed forms (numSlots between 1 and shape.length, or numSlots >
|
|
29
|
+
* shape.length) are not supported by the fold; the caller falls back
|
|
30
|
+
* to a runtime read. */
|
|
31
|
+
export declare function columnMajorOffsetFromIndices(shape: ReadonlyArray<number>, idxVals: ReadonlyArray<number>): number | undefined;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared validation helper + slice-arg predicate for the four index
|
|
3
|
+
* lowering helpers (lowerIndexLoad / lowerIndexStore / lowerIndexSlice
|
|
4
|
+
* / lowerIndexSliceStore).
|
|
5
|
+
*
|
|
6
|
+
* `isSliceArg` lets the dispatchers in `lower.ts` choose between the
|
|
7
|
+
* scalar and slice paths without each call site re-discriminating on
|
|
8
|
+
* `Expr` kinds.
|
|
9
|
+
*
|
|
10
|
+
* `resolveIndexBase` performs the common preamble shared by all four
|
|
11
|
+
* helpers: env lookup, numeric/multi-element check, arity check,
|
|
12
|
+
* builds the base `Var` IR node.
|
|
13
|
+
*
|
|
14
|
+
* Adapted from mtoc's `src/lowering/indexResolve.ts`, with the
|
|
15
|
+
* char-tensor / complex / scalar-base branches dropped — mtoc2 v1
|
|
16
|
+
* only indexes real-double multi-element tensors.
|
|
17
|
+
*/
|
|
18
|
+
import type { Expr, LValue, Span } from "../parser/index.js";
|
|
19
|
+
import type { IRExpr } from "./ir.js";
|
|
20
|
+
import { type NumericType } from "./types.js";
|
|
21
|
+
import type { Lowerer } from "./lower.js";
|
|
22
|
+
/** Operation label that selects operation-specific message text. */
|
|
23
|
+
export type IndexOperation = "read" | "write" | "sliceRead" | "sliceWrite";
|
|
24
|
+
/** True when an AST expression node is a range or bare colon — the
|
|
25
|
+
* dispatcher uses this predicate to decide between scalar (IndexLoad /
|
|
26
|
+
* IndexStore) and slice (IndexSlice / IndexSliceStore) paths. */
|
|
27
|
+
export declare function isSliceArg(a: Expr): boolean;
|
|
28
|
+
interface ResolveOptions {
|
|
29
|
+
/** Span of the base identifier node — used for the Var IR node and
|
|
30
|
+
* the "not in scope" diagnostic. Defaults to the outer index span. */
|
|
31
|
+
baseSpan?: Span;
|
|
32
|
+
/** "internal" when the dispatcher already verified the binding exists
|
|
33
|
+
* (a missing one would be a lowerer bug); "user-facing" when the
|
|
34
|
+
* caller is a statement-level dispatcher and the variable may
|
|
35
|
+
* genuinely be undefined. */
|
|
36
|
+
notInScope: "internal" | "user-facing";
|
|
37
|
+
operation: IndexOperation;
|
|
38
|
+
}
|
|
39
|
+
/** Validate and resolve a member-rooted index lvalue like
|
|
40
|
+
* `obj.field(i, j) = rhs`. Walks the Member chain to extract the
|
|
41
|
+
* root Ident, the field path (outermost → innermost), and the leaf
|
|
42
|
+
* field's NumericType; validates that the leaf is a multi-element
|
|
43
|
+
* double tensor and that the index arity matches the leaf's ndim.
|
|
44
|
+
*
|
|
45
|
+
* Returns the same shape as `resolveIndexBase` plus the field path
|
|
46
|
+
* and leaf type, so the caller can build an `IndexStore` /
|
|
47
|
+
* `IndexSliceStore` whose `base` Var still names the OWNING root
|
|
48
|
+
* (struct / class instance) — the codegen path joins `base.cName`
|
|
49
|
+
* with `fieldPath` to address the field slot. */
|
|
50
|
+
export declare function resolveMemberRootedIndexBase(this: Lowerer, lvalue: Extract<LValue, {
|
|
51
|
+
type: "Index";
|
|
52
|
+
}>, span: Span, operation: IndexOperation): {
|
|
53
|
+
rootVar: Extract<IRExpr, {
|
|
54
|
+
kind: "Var";
|
|
55
|
+
}>;
|
|
56
|
+
fieldPath: string[];
|
|
57
|
+
leafTy: NumericType;
|
|
58
|
+
slotCName: string;
|
|
59
|
+
};
|
|
60
|
+
/** Unified resolution result for an indexed-write lvalue base —
|
|
61
|
+
* whether the lvalue's base is a bare `Ident` or a `Member` chain.
|
|
62
|
+
*
|
|
63
|
+
* `base` always names the OWNING root variable (for liveness +
|
|
64
|
+
* ANF book-keeping). `baseCName` is the slot path codegen targets
|
|
65
|
+
* — equal to `base.cName` for bare-Ident, or `<root>.<field>...`
|
|
66
|
+
* for member-rooted. `baseTy` is the leaf NumericType (the field's
|
|
67
|
+
* type for member-rooted; identical to `base.ty` otherwise) so
|
|
68
|
+
* the offset / complex-lane / arity checks downstream don't care
|
|
69
|
+
* which form the LHS took. `fieldPath` / `leafTy` are populated
|
|
70
|
+
* only in the member-rooted case so the caller can stamp them
|
|
71
|
+
* onto the `IndexStore` / `IndexSliceStore` IR node. */
|
|
72
|
+
export interface IndexLvalueBase {
|
|
73
|
+
base: Extract<IRExpr, {
|
|
74
|
+
kind: "Var";
|
|
75
|
+
}>;
|
|
76
|
+
baseTy: NumericType;
|
|
77
|
+
baseCName: string;
|
|
78
|
+
fieldPath?: string[];
|
|
79
|
+
leafTy?: NumericType;
|
|
80
|
+
/** Source-level display name for error messages — `name` for
|
|
81
|
+
* bare-Ident bases, `root.f1.f2...` for member-rooted bases. */
|
|
82
|
+
displayName: string;
|
|
83
|
+
}
|
|
84
|
+
/** Resolve an indexed-write lvalue's base — either a bare `Ident`
|
|
85
|
+
* or a `Member` chain — to the unified `IndexLvalueBase` shape.
|
|
86
|
+
* Single chokepoint shared by `lowerIndexStore` and
|
|
87
|
+
* `lowerIndexSliceStore` so the Ident-vs-Member dispatch lives in
|
|
88
|
+
* one place. Rejects any other base kind with a clear error. */
|
|
89
|
+
export declare function resolveIndexLvalueBase(this: Lowerer, lvalue: Extract<LValue, {
|
|
90
|
+
type: "Index";
|
|
91
|
+
}>, span: Span, operation: IndexOperation): IndexLvalueBase;
|
|
92
|
+
/** Validate and resolve the base variable for an index operation. */
|
|
93
|
+
export declare function resolveIndexBase(this: Lowerer, name: string, argCount: number, span: Span, opts: ResolveOptions): {
|
|
94
|
+
baseTy: NumericType;
|
|
95
|
+
baseCName: string;
|
|
96
|
+
base: Extract<IRExpr, {
|
|
97
|
+
kind: "Var";
|
|
98
|
+
}>;
|
|
99
|
+
};
|
|
100
|
+
export {};
|