numbl 0.4.8 → 0.4.9

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.
Files changed (543) hide show
  1. package/dist-browser/browser/index.d.ts +21 -0
  2. package/dist-browser/browser/mip.d.ts +10 -0
  3. package/dist-browser/browser/protocol.d.ts +59 -0
  4. package/dist-browser/browser/session.d.ts +55 -0
  5. package/dist-browser/browser/system-store.d.ts +30 -0
  6. package/dist-browser/browser/worker.d.ts +1 -0
  7. package/dist-browser/browser.js +131 -0
  8. package/dist-browser/db/operations.d.ts +25 -0
  9. package/dist-browser/db/schema.d.ts +26 -0
  10. package/dist-browser/graphics/axisLimits.d.ts +23 -0
  11. package/dist-browser/graphics/figuresReducer.d.ts +86 -0
  12. package/dist-browser/graphics/types.d.ts +423 -0
  13. package/dist-browser/hooks/useProjectFiles.d.ts +45 -0
  14. package/dist-browser/numbl-core/diagnostics/errors.d.ts +8 -0
  15. package/dist-browser/numbl-core/diagnostics/index.d.ts +27 -0
  16. package/dist-browser/numbl-core/executeCode.d.ts +108 -0
  17. package/dist-browser/numbl-core/executors/cache.d.ts +26 -0
  18. package/dist-browser/numbl-core/executors/classification.d.ts +134 -0
  19. package/dist-browser/numbl-core/executors/context.d.ts +76 -0
  20. package/dist-browser/numbl-core/executors/handleInline.d.ts +58 -0
  21. package/dist-browser/numbl-core/executors/index.d.ts +14 -0
  22. package/dist-browser/numbl-core/executors/jit/cJitCallExecutor.d.ts +35 -0
  23. package/dist-browser/numbl-core/executors/jit/cJitLoopExecutor.d.ts +31 -0
  24. package/dist-browser/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +29 -0
  25. package/dist-browser/numbl-core/executors/jit/callExecutor.d.ts +45 -0
  26. package/dist-browser/numbl-core/executors/jit/compileC.d.ts +51 -0
  27. package/dist-browser/numbl-core/executors/jit/compileC.node.d.ts +25 -0
  28. package/dist-browser/numbl-core/executors/jit/hostHelpers.d.ts +31 -0
  29. package/dist-browser/numbl-core/executors/jit/loopExecutor.d.ts +41 -0
  30. package/dist-browser/numbl-core/executors/jit/session.d.ts +17 -0
  31. package/dist-browser/numbl-core/executors/jit/topLevelExecutor.d.ts +36 -0
  32. package/dist-browser/numbl-core/executors/jit/typeAdapter.d.ts +28 -0
  33. package/dist-browser/numbl-core/executors/jit/typeAdapterC.d.ts +73 -0
  34. package/dist-browser/numbl-core/executors/jit/valueAdapter.d.ts +55 -0
  35. package/dist-browser/numbl-core/executors/jit/valueAdapterC.d.ts +108 -0
  36. package/dist-browser/numbl-core/executors/lowering.d.ts +120 -0
  37. package/dist-browser/numbl-core/executors/plugins.d.ts +41 -0
  38. package/dist-browser/numbl-core/executors/registry.d.ts +148 -0
  39. package/dist-browser/numbl-core/executors/types.d.ts +103 -0
  40. package/dist-browser/numbl-core/externalAccessDirective.d.ts +6 -0
  41. package/dist-browser/numbl-core/fileIOAdapter.d.ts +88 -0
  42. package/dist-browser/numbl-core/functionResolve.d.ts +70 -0
  43. package/dist-browser/numbl-core/helpers/arithmetic.d.ts +47 -0
  44. package/dist-browser/numbl-core/helpers/bessel.d.ts +49 -0
  45. package/dist-browser/numbl-core/helpers/check-helpers.d.ts +49 -0
  46. package/dist-browser/numbl-core/helpers/constants.d.ts +6 -0
  47. package/dist-browser/numbl-core/helpers/dummy.d.ts +5 -0
  48. package/dist-browser/numbl-core/helpers/effectively-real.d.ts +25 -0
  49. package/dist-browser/numbl-core/helpers/eigs-select.d.ts +25 -0
  50. package/dist-browser/numbl-core/helpers/erf.d.ts +5 -0
  51. package/dist-browser/numbl-core/helpers/gmres.d.ts +51 -0
  52. package/dist-browser/numbl-core/helpers/linsolve.d.ts +25 -0
  53. package/dist-browser/numbl-core/helpers/marching-cubes-tables.d.ts +10 -0
  54. package/dist-browser/numbl-core/helpers/marching-cubes.d.ts +46 -0
  55. package/dist-browser/numbl-core/helpers/ode-rk.d.ts +83 -0
  56. package/dist-browser/numbl-core/helpers/prng.d.ts +19 -0
  57. package/dist-browser/numbl-core/helpers/quadgk.d.ts +32 -0
  58. package/dist-browser/numbl-core/helpers/reduction/cumulative.d.ts +8 -0
  59. package/dist-browser/numbl-core/helpers/reduction/min-max.d.ts +5 -0
  60. package/dist-browser/numbl-core/helpers/reduction-helpers.d.ts +66 -0
  61. package/dist-browser/numbl-core/helpers/registry.d.ts +7 -0
  62. package/dist-browser/numbl-core/helpers/scanFormat.d.ts +11 -0
  63. package/dist-browser/numbl-core/helpers/shape-utils.d.ts +7 -0
  64. package/dist-browser/numbl-core/helpers/sparse-arithmetic.d.ts +16 -0
  65. package/dist-browser/numbl-core/helpers/string.d.ts +11 -0
  66. package/dist-browser/numbl-core/interpreter/builtins/arithmetic.d.ts +4 -0
  67. package/dist-browser/numbl-core/interpreter/builtins/array-construction.d.ts +10 -0
  68. package/dist-browser/numbl-core/interpreter/builtins/array-extras.d.ts +5 -0
  69. package/dist-browser/numbl-core/interpreter/builtins/array-manipulation.d.ts +7 -0
  70. package/dist-browser/numbl-core/interpreter/builtins/cell-struct.d.ts +5 -0
  71. package/dist-browser/numbl-core/interpreter/builtins/complex.d.ts +4 -0
  72. package/dist-browser/numbl-core/interpreter/builtins/datetime.d.ts +40 -0
  73. package/dist-browser/numbl-core/interpreter/builtins/dictionary.d.ts +15 -0
  74. package/dist-browser/numbl-core/interpreter/builtins/fft.d.ts +7 -0
  75. package/dist-browser/numbl-core/interpreter/builtins/gallery.d.ts +7 -0
  76. package/dist-browser/numbl-core/interpreter/builtins/geometry.d.ts +10 -0
  77. package/dist-browser/numbl-core/interpreter/builtins/graph.d.ts +29 -0
  78. package/dist-browser/numbl-core/interpreter/builtins/help-text.d.ts +5 -0
  79. package/dist-browser/numbl-core/interpreter/builtins/index.d.ts +39 -0
  80. package/dist-browser/numbl-core/interpreter/builtins/introspection.d.ts +6 -0
  81. package/dist-browser/numbl-core/interpreter/builtins/linear-algebra.d.ts +9 -0
  82. package/dist-browser/numbl-core/interpreter/builtins/logical.d.ts +9 -0
  83. package/dist-browser/numbl-core/interpreter/builtins/math.d.ts +4 -0
  84. package/dist-browser/numbl-core/interpreter/builtins/misc.d.ts +7 -0
  85. package/dist-browser/numbl-core/interpreter/builtins/numerical.d.ts +10 -0
  86. package/dist-browser/numbl-core/interpreter/builtins/predicates.d.ts +4 -0
  87. package/dist-browser/numbl-core/interpreter/builtins/prng.d.ts +4 -0
  88. package/dist-browser/numbl-core/interpreter/builtins/reductions.d.ts +6 -0
  89. package/dist-browser/numbl-core/interpreter/builtins/set-operations.d.ts +4 -0
  90. package/dist-browser/numbl-core/interpreter/builtins/sparse.d.ts +4 -0
  91. package/dist-browser/numbl-core/interpreter/builtins/special-math.d.ts +4 -0
  92. package/dist-browser/numbl-core/interpreter/builtins/string-extras.d.ts +5 -0
  93. package/dist-browser/numbl-core/interpreter/builtins/strings.d.ts +7 -0
  94. package/dist-browser/numbl-core/interpreter/builtins/time-system.d.ts +6 -0
  95. package/dist-browser/numbl-core/interpreter/builtins/type-constructors.d.ts +5 -0
  96. package/dist-browser/numbl-core/interpreter/builtins/types.d.ts +98 -0
  97. package/dist-browser/numbl-core/interpreter/builtins/utility.d.ts +4 -0
  98. package/dist-browser/numbl-core/interpreter/builtins/validation.d.ts +4 -0
  99. package/dist-browser/numbl-core/interpreter/interpreter.d.ts +199 -0
  100. package/dist-browser/numbl-core/interpreter/interpreterExec.d.ts +81 -0
  101. package/dist-browser/numbl-core/interpreter/interpreterFunctions.d.ts +62 -0
  102. package/dist-browser/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +35 -0
  103. package/dist-browser/numbl-core/interpreter/types.d.ts +114 -0
  104. package/dist-browser/numbl-core/jit/builtins/defs/_shared.d.ts +43 -0
  105. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +123 -0
  106. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/minus.d.ts +2 -0
  107. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/mpower.d.ts +12 -0
  108. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/mrdivide.d.ts +5 -0
  109. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/mtimes.d.ts +2 -0
  110. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/plus.d.ts +2 -0
  111. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/power.d.ts +30 -0
  112. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/rdivide.d.ts +2 -0
  113. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/times.d.ts +2 -0
  114. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/uminus.d.ts +2 -0
  115. package/dist-browser/numbl-core/jit/builtins/defs/compare/_compare.d.ts +12 -0
  116. package/dist-browser/numbl-core/jit/builtins/defs/compare/eq.d.ts +2 -0
  117. package/dist-browser/numbl-core/jit/builtins/defs/compare/ge.d.ts +2 -0
  118. package/dist-browser/numbl-core/jit/builtins/defs/compare/gt.d.ts +2 -0
  119. package/dist-browser/numbl-core/jit/builtins/defs/compare/le.d.ts +2 -0
  120. package/dist-browser/numbl-core/jit/builtins/defs/compare/lt.d.ts +2 -0
  121. package/dist-browser/numbl-core/jit/builtins/defs/compare/ne.d.ts +2 -0
  122. package/dist-browser/numbl-core/jit/builtins/defs/diag/assert.d.ts +6 -0
  123. package/dist-browser/numbl-core/jit/builtins/defs/io/_format_args.d.ts +17 -0
  124. package/dist-browser/numbl-core/jit/builtins/defs/io/disp.d.ts +2 -0
  125. package/dist-browser/numbl-core/jit/builtins/defs/io/error.d.ts +2 -0
  126. package/dist-browser/numbl-core/jit/builtins/defs/io/fprintf.d.ts +2 -0
  127. package/dist-browser/numbl-core/jit/builtins/defs/io/sprintf.d.ts +2 -0
  128. package/dist-browser/numbl-core/jit/builtins/defs/io/warning.d.ts +15 -0
  129. package/dist-browser/numbl-core/jit/builtins/defs/logical/_shortcircuit.d.ts +30 -0
  130. package/dist-browser/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +30 -0
  131. package/dist-browser/numbl-core/jit/builtins/defs/logical/and.d.ts +5 -0
  132. package/dist-browser/numbl-core/jit/builtins/defs/logical/andand.d.ts +1 -0
  133. package/dist-browser/numbl-core/jit/builtins/defs/logical/boolconst.d.ts +3 -0
  134. package/dist-browser/numbl-core/jit/builtins/defs/logical/classBuiltin.d.ts +21 -0
  135. package/dist-browser/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +15 -0
  136. package/dist-browser/numbl-core/jit/builtins/defs/logical/isa.d.ts +13 -0
  137. package/dist-browser/numbl-core/jit/builtins/defs/logical/iscell.d.ts +8 -0
  138. package/dist-browser/numbl-core/jit/builtins/defs/logical/isempty.d.ts +2 -0
  139. package/dist-browser/numbl-core/jit/builtins/defs/logical/isequal.d.ts +2 -0
  140. package/dist-browser/numbl-core/jit/builtins/defs/logical/isfield.d.ts +20 -0
  141. package/dist-browser/numbl-core/jit/builtins/defs/logical/isinf.d.ts +2 -0
  142. package/dist-browser/numbl-core/jit/builtins/defs/logical/isnan.d.ts +1 -0
  143. package/dist-browser/numbl-core/jit/builtins/defs/logical/isnumeric.d.ts +7 -0
  144. package/dist-browser/numbl-core/jit/builtins/defs/logical/isreal.d.ts +2 -0
  145. package/dist-browser/numbl-core/jit/builtins/defs/logical/isscalar.d.ts +20 -0
  146. package/dist-browser/numbl-core/jit/builtins/defs/logical/isstruct.d.ts +7 -0
  147. package/dist-browser/numbl-core/jit/builtins/defs/logical/logical.d.ts +1 -0
  148. package/dist-browser/numbl-core/jit/builtins/defs/logical/not.d.ts +15 -0
  149. package/dist-browser/numbl-core/jit/builtins/defs/logical/or.d.ts +11 -0
  150. package/dist-browser/numbl-core/jit/builtins/defs/logical/oror.d.ts +1 -0
  151. package/dist-browser/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +21 -0
  152. package/dist-browser/numbl-core/jit/builtins/defs/logical/typequery.d.ts +10 -0
  153. package/dist-browser/numbl-core/jit/builtins/defs/logical/xor.d.ts +12 -0
  154. package/dist-browser/numbl-core/jit/builtins/defs/math/_complex_fold.d.ts +34 -0
  155. package/dist-browser/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +51 -0
  156. package/dist-browser/numbl-core/jit/builtins/defs/math/abs.d.ts +7 -0
  157. package/dist-browser/numbl-core/jit/builtins/defs/math/angle.d.ts +7 -0
  158. package/dist-browser/numbl-core/jit/builtins/defs/math/asinh.d.ts +1 -0
  159. package/dist-browser/numbl-core/jit/builtins/defs/math/atan.d.ts +1 -0
  160. package/dist-browser/numbl-core/jit/builtins/defs/math/atan2.d.ts +3 -0
  161. package/dist-browser/numbl-core/jit/builtins/defs/math/besselh.d.ts +2 -0
  162. package/dist-browser/numbl-core/jit/builtins/defs/math/ceil.d.ts +4 -0
  163. package/dist-browser/numbl-core/jit/builtins/defs/math/conj.d.ts +7 -0
  164. package/dist-browser/numbl-core/jit/builtins/defs/math/constants.d.ts +7 -0
  165. package/dist-browser/numbl-core/jit/builtins/defs/math/cos.d.ts +1 -0
  166. package/dist-browser/numbl-core/jit/builtins/defs/math/cosh.d.ts +1 -0
  167. package/dist-browser/numbl-core/jit/builtins/defs/math/dot.d.ts +20 -0
  168. package/dist-browser/numbl-core/jit/builtins/defs/math/double.d.ts +28 -0
  169. package/dist-browser/numbl-core/jit/builtins/defs/math/exp.d.ts +1 -0
  170. package/dist-browser/numbl-core/jit/builtins/defs/math/fix.d.ts +4 -0
  171. package/dist-browser/numbl-core/jit/builtins/defs/math/floor.d.ts +4 -0
  172. package/dist-browser/numbl-core/jit/builtins/defs/math/hypot.d.ts +3 -0
  173. package/dist-browser/numbl-core/jit/builtins/defs/math/imag.d.ts +7 -0
  174. package/dist-browser/numbl-core/jit/builtins/defs/math/linspace.d.ts +6 -0
  175. package/dist-browser/numbl-core/jit/builtins/defs/math/log.d.ts +4 -0
  176. package/dist-browser/numbl-core/jit/builtins/defs/math/log10.d.ts +3 -0
  177. package/dist-browser/numbl-core/jit/builtins/defs/math/log2.d.ts +5 -0
  178. package/dist-browser/numbl-core/jit/builtins/defs/math/logspace.d.ts +8 -0
  179. package/dist-browser/numbl-core/jit/builtins/defs/math/mod.d.ts +1 -0
  180. package/dist-browser/numbl-core/jit/builtins/defs/math/norm.d.ts +2 -0
  181. package/dist-browser/numbl-core/jit/builtins/defs/math/rand.d.ts +2 -0
  182. package/dist-browser/numbl-core/jit/builtins/defs/math/real.d.ts +7 -0
  183. package/dist-browser/numbl-core/jit/builtins/defs/math/rem.d.ts +3 -0
  184. package/dist-browser/numbl-core/jit/builtins/defs/math/round.d.ts +1 -0
  185. package/dist-browser/numbl-core/jit/builtins/defs/math/sign.d.ts +5 -0
  186. package/dist-browser/numbl-core/jit/builtins/defs/math/sin.d.ts +1 -0
  187. package/dist-browser/numbl-core/jit/builtins/defs/math/sinh.d.ts +1 -0
  188. package/dist-browser/numbl-core/jit/builtins/defs/math/sqrt.d.ts +11 -0
  189. package/dist-browser/numbl-core/jit/builtins/defs/math/tan.d.ts +1 -0
  190. package/dist-browser/numbl-core/jit/builtins/defs/math/tanh.d.ts +1 -0
  191. package/dist-browser/numbl-core/jit/builtins/defs/math/uniquetol.d.ts +22 -0
  192. package/dist-browser/numbl-core/jit/builtins/defs/plot/dispatch.d.ts +6 -0
  193. package/dist-browser/numbl-core/jit/builtins/defs/reduction/_cumulative.d.ts +49 -0
  194. package/dist-browser/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +126 -0
  195. package/dist-browser/numbl-core/jit/builtins/defs/reduction/_variance.d.ts +17 -0
  196. package/dist-browser/numbl-core/jit/builtins/defs/reduction/all.d.ts +1 -0
  197. package/dist-browser/numbl-core/jit/builtins/defs/reduction/any.d.ts +1 -0
  198. package/dist-browser/numbl-core/jit/builtins/defs/reduction/cummax.d.ts +1 -0
  199. package/dist-browser/numbl-core/jit/builtins/defs/reduction/cummin.d.ts +1 -0
  200. package/dist-browser/numbl-core/jit/builtins/defs/reduction/cumprod.d.ts +1 -0
  201. package/dist-browser/numbl-core/jit/builtins/defs/reduction/cumsum.d.ts +1 -0
  202. package/dist-browser/numbl-core/jit/builtins/defs/reduction/diff.d.ts +16 -0
  203. package/dist-browser/numbl-core/jit/builtins/defs/reduction/length.d.ts +2 -0
  204. package/dist-browser/numbl-core/jit/builtins/defs/reduction/max.d.ts +1 -0
  205. package/dist-browser/numbl-core/jit/builtins/defs/reduction/mean.d.ts +1 -0
  206. package/dist-browser/numbl-core/jit/builtins/defs/reduction/min.d.ts +1 -0
  207. package/dist-browser/numbl-core/jit/builtins/defs/reduction/numel.d.ts +2 -0
  208. package/dist-browser/numbl-core/jit/builtins/defs/reduction/prod.d.ts +1 -0
  209. package/dist-browser/numbl-core/jit/builtins/defs/reduction/std.d.ts +1 -0
  210. package/dist-browser/numbl-core/jit/builtins/defs/reduction/sum.d.ts +1 -0
  211. package/dist-browser/numbl-core/jit/builtins/defs/reduction/var.d.ts +1 -0
  212. package/dist-browser/numbl-core/jit/builtins/defs/shape/_construct.d.ts +67 -0
  213. package/dist-browser/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +34 -0
  214. package/dist-browser/numbl-core/jit/builtins/defs/shape/cat.d.ts +33 -0
  215. package/dist-browser/numbl-core/jit/builtins/defs/shape/diag.d.ts +29 -0
  216. package/dist-browser/numbl-core/jit/builtins/defs/shape/eye.d.ts +5 -0
  217. package/dist-browser/numbl-core/jit/builtins/defs/shape/flip.d.ts +7 -0
  218. package/dist-browser/numbl-core/jit/builtins/defs/shape/meshgrid.d.ts +12 -0
  219. package/dist-browser/numbl-core/jit/builtins/defs/shape/ones.d.ts +1 -0
  220. package/dist-browser/numbl-core/jit/builtins/defs/shape/repmat.d.ts +37 -0
  221. package/dist-browser/numbl-core/jit/builtins/defs/shape/reshape.d.ts +39 -0
  222. package/dist-browser/numbl-core/jit/builtins/defs/shape/size.d.ts +20 -0
  223. package/dist-browser/numbl-core/jit/builtins/defs/shape/sort.d.ts +19 -0
  224. package/dist-browser/numbl-core/jit/builtins/defs/shape/transpose.d.ts +6 -0
  225. package/dist-browser/numbl-core/jit/builtins/defs/shape/tril.d.ts +16 -0
  226. package/dist-browser/numbl-core/jit/builtins/defs/shape/triu.d.ts +16 -0
  227. package/dist-browser/numbl-core/jit/builtins/defs/shape/zeros.d.ts +1 -0
  228. package/dist-browser/numbl-core/jit/builtins/defs/system/deal.d.ts +20 -0
  229. package/dist-browser/numbl-core/jit/builtins/defs/system/feval.d.ts +36 -0
  230. package/dist-browser/numbl-core/jit/builtins/defs/system/pathBuiltins.d.ts +4 -0
  231. package/dist-browser/numbl-core/jit/builtins/defs/system/tic.d.ts +8 -0
  232. package/dist-browser/numbl-core/jit/builtins/defs/system/toc.d.ts +5 -0
  233. package/dist-browser/numbl-core/jit/builtins/index.d.ts +16 -0
  234. package/dist-browser/numbl-core/jit/builtins/registry.d.ts +138 -0
  235. package/dist-browser/numbl-core/jit/builtins/runtime/cell/cell.d.ts +24 -0
  236. package/dist-browser/numbl-core/jit/builtins/runtime/indexing/loop_count.d.ts +1 -0
  237. package/dist-browser/numbl-core/jit/builtins/runtime/indexing/range_value.d.ts +1 -0
  238. package/dist-browser/numbl-core/jit/builtins/runtime/indexing/scalar_index.d.ts +11 -0
  239. package/dist-browser/numbl-core/jit/builtins/runtime/indexing/tensor_make_range.d.ts +5 -0
  240. package/dist-browser/numbl-core/jit/builtins/runtime/io/assert_fmt.d.ts +1 -0
  241. package/dist-browser/numbl-core/jit/builtins/runtime/io/disp_complex.d.ts +1 -0
  242. package/dist-browser/numbl-core/jit/builtins/runtime/io/disp_double.d.ts +1 -0
  243. package/dist-browser/numbl-core/jit/builtins/runtime/io/disp_struct.d.ts +1 -0
  244. package/dist-browser/numbl-core/jit/builtins/runtime/io/disp_tensor.d.ts +1 -0
  245. package/dist-browser/numbl-core/jit/builtins/runtime/io/disp_tensor_complex.d.ts +1 -0
  246. package/dist-browser/numbl-core/jit/builtins/runtime/io/error_fmt.d.ts +2 -0
  247. package/dist-browser/numbl-core/jit/builtins/runtime/io/format_complex.d.ts +1 -0
  248. package/dist-browser/numbl-core/jit/builtins/runtime/io/format_double.d.ts +1 -0
  249. package/dist-browser/numbl-core/jit/builtins/runtime/io/format_engine.d.ts +1 -0
  250. package/dist-browser/numbl-core/jit/builtins/runtime/io/fprintf.d.ts +1 -0
  251. package/dist-browser/numbl-core/jit/builtins/runtime/io/sprintf.d.ts +5 -0
  252. package/dist-browser/numbl-core/jit/builtins/runtime/io/warning_fmt.d.ts +2 -0
  253. package/dist-browser/numbl-core/jit/builtins/runtime/plot/plot_dispatch.d.ts +1 -0
  254. package/dist-browser/numbl-core/jit/builtins/runtime/snippets.c.gen.d.ts +4 -0
  255. package/dist-browser/numbl-core/jit/builtins/runtime/snippets.gen.d.ts +85 -0
  256. package/dist-browser/numbl-core/jit/builtins/runtime/system/cdiv.d.ts +4 -0
  257. package/dist-browser/numbl-core/jit/builtins/runtime/system/cscalar.d.ts +103 -0
  258. package/dist-browser/numbl-core/jit/builtins/runtime/system/deep_clone.d.ts +1 -0
  259. package/dist-browser/numbl-core/jit/builtins/runtime/system/isequal.d.ts +2 -0
  260. package/dist-browser/numbl-core/jit/builtins/runtime/system/tictoc.d.ts +5 -0
  261. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor.d.ts +6 -0
  262. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_alloc.d.ts +5 -0
  263. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_alloc_complex.d.ts +6 -0
  264. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_alloc_nd.d.ts +5 -0
  265. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_alloc_nd_complex.d.ts +6 -0
  266. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_copy_complex.d.ts +6 -0
  267. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_from_matrix.d.ts +5 -0
  268. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_from_matrix_complex.d.ts +6 -0
  269. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_from_row.d.ts +5 -0
  270. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_from_row_complex.d.ts +6 -0
  271. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_cat.d.ts +11 -0
  272. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_cumulative.d.ts +32 -0
  273. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_diag.d.ts +33 -0
  274. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_diff.d.ts +5 -0
  275. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_dot.d.ts +16 -0
  276. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_complex.d.ts +90 -0
  277. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real.d.ts +75 -0
  278. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +95 -0
  279. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_eye.d.ts +10 -0
  280. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_fill_nd.d.ts +11 -0
  281. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_fill_square.d.ts +5 -0
  282. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_flip.d.ts +11 -0
  283. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_imag_all_zero.d.ts +1 -0
  284. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_linspace.d.ts +5 -0
  285. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_logical_real.d.ts +10 -0
  286. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_logspace.d.ts +5 -0
  287. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_meshgrid.d.ts +29 -0
  288. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_mtimes_complex.d.ts +10 -0
  289. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_mtimes_real.d.ts +6 -0
  290. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_norm.d.ts +4 -0
  291. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_ones_nd.d.ts +5 -0
  292. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_ones_square.d.ts +5 -0
  293. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_predicate.d.ts +42 -0
  294. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_complex.d.ts +53 -0
  295. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +42 -0
  296. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_repmat.d.ts +11 -0
  297. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reshape_nd.d.ts +5 -0
  298. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reshape_nd_complex.d.ts +6 -0
  299. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_size.d.ts +5 -0
  300. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_sort_real.d.ts +36 -0
  301. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_transpose.d.ts +5 -0
  302. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_transpose_complex.d.ts +6 -0
  303. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_triangular.d.ts +22 -0
  304. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_complex_math.d.ts +128 -0
  305. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +95 -0
  306. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_uniquetol.d.ts +5 -0
  307. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_var.d.ts +12 -0
  308. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_zeros_nd.d.ts +5 -0
  309. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_zeros_square.d.ts +5 -0
  310. package/dist-browser/numbl-core/jit/builtins/runtime/text/strcmp.d.ts +2 -0
  311. package/dist-browser/numbl-core/jit/codegen/cFormat.d.ts +36 -0
  312. package/dist-browser/numbl-core/jit/codegen/cHelpers.d.ts +48 -0
  313. package/dist-browser/numbl-core/jit/codegen/emit.d.ts +55 -0
  314. package/dist-browser/numbl-core/jit/codegen/emitCellTypedef.d.ts +23 -0
  315. package/dist-browser/numbl-core/jit/codegen/emitExpr.d.ts +33 -0
  316. package/dist-browser/numbl-core/jit/codegen/emitIndex.d.ts +56 -0
  317. package/dist-browser/numbl-core/jit/codegen/emitJs.d.ts +64 -0
  318. package/dist-browser/numbl-core/jit/codegen/emitNamedTypedef.d.ts +58 -0
  319. package/dist-browser/numbl-core/jit/codegen/emitStmt.d.ts +76 -0
  320. package/dist-browser/numbl-core/jit/codegen/emitTensorConcat.d.ts +23 -0
  321. package/dist-browser/numbl-core/jit/codegen/emitTensorConcatJs.d.ts +16 -0
  322. package/dist-browser/numbl-core/jit/codegen/emitTensorFused.d.ts +77 -0
  323. package/dist-browser/numbl-core/jit/codegen/inlinePass.d.ts +66 -0
  324. package/dist-browser/numbl-core/jit/codegen/liveness.d.ts +58 -0
  325. package/dist-browser/numbl-core/jit/codegen/prettyIR.d.ts +24 -0
  326. package/dist-browser/numbl-core/jit/codegen/runtime.d.ts +152 -0
  327. package/dist-browser/numbl-core/jit/compileSpec.d.ts +84 -0
  328. package/dist-browser/numbl-core/jit/compileSpecC.d.ts +100 -0
  329. package/dist-browser/numbl-core/jit/index.d.ts +15 -0
  330. package/dist-browser/numbl-core/jit/lowering/classDefs.d.ts +109 -0
  331. package/dist-browser/numbl-core/jit/lowering/definiteAssign.d.ts +42 -0
  332. package/dist-browser/numbl-core/jit/lowering/errors.d.ts +35 -0
  333. package/dist-browser/numbl-core/jit/lowering/indexFold.d.ts +31 -0
  334. package/dist-browser/numbl-core/jit/lowering/indexResolve.d.ts +100 -0
  335. package/dist-browser/numbl-core/jit/lowering/ir.d.ts +584 -0
  336. package/dist-browser/numbl-core/jit/lowering/lower.d.ts +271 -0
  337. package/dist-browser/numbl-core/jit/lowering/lowerCellIndex.d.ts +41 -0
  338. package/dist-browser/numbl-core/jit/lowering/lowerCellLit.d.ts +19 -0
  339. package/dist-browser/numbl-core/jit/lowering/lowerClassConstructor.d.ts +55 -0
  340. package/dist-browser/numbl-core/jit/lowering/lowerFuncCall.d.ts +34 -0
  341. package/dist-browser/numbl-core/jit/lowering/lowerHandle.d.ts +57 -0
  342. package/dist-browser/numbl-core/jit/lowering/lowerIndexLoad.d.ts +16 -0
  343. package/dist-browser/numbl-core/jit/lowering/lowerIndexSlice.d.ts +29 -0
  344. package/dist-browser/numbl-core/jit/lowering/lowerIndexSliceStore.d.ts +19 -0
  345. package/dist-browser/numbl-core/jit/lowering/lowerIndexStore.d.ts +14 -0
  346. package/dist-browser/numbl-core/jit/lowering/lowerMethodCall.d.ts +45 -0
  347. package/dist-browser/numbl-core/jit/lowering/lowerMultiAssign.d.ts +36 -0
  348. package/dist-browser/numbl-core/jit/lowering/lowerTensorLit.d.ts +25 -0
  349. package/dist-browser/numbl-core/jit/lowering/rangeCount.d.ts +19 -0
  350. package/dist-browser/numbl-core/jit/lowering/specialize.d.ts +93 -0
  351. package/dist-browser/numbl-core/jit/lowering/types.d.ts +503 -0
  352. package/dist-browser/numbl-core/jit/lowering/walk.d.ts +17 -0
  353. package/dist-browser/numbl-core/jit/numbl/index.d.ts +30 -0
  354. package/dist-browser/numbl-core/jit/parser/astUtils.d.ts +43 -0
  355. package/dist-browser/numbl-core/jit/parser/index.d.ts +12 -0
  356. package/dist-browser/numbl-core/jit/parser/sourceLoc.d.ts +12 -0
  357. package/dist-browser/numbl-core/jit/runtime/context.d.ts +23 -0
  358. package/dist-browser/numbl-core/jit/runtime/inferType.d.ts +10 -0
  359. package/dist-browser/numbl-core/jit/runtime/value.d.ts +101 -0
  360. package/dist-browser/numbl-core/jit/workspace/driverPrologue.d.ts +59 -0
  361. package/dist-browser/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +62 -0
  362. package/dist-browser/numbl-core/jit/workspace/workspace.d.ts +243 -0
  363. package/dist-browser/numbl-core/jitDeclineDiagnostics.d.ts +32 -0
  364. package/dist-browser/numbl-core/jitTypes.d.ts +94 -0
  365. package/dist-browser/numbl-core/jsUserFunctions.d.ts +61 -0
  366. package/dist-browser/numbl-core/lexer/helpers.d.ts +15 -0
  367. package/dist-browser/numbl-core/lexer/index.d.ts +4 -0
  368. package/dist-browser/numbl-core/lexer/keywords.d.ts +3 -0
  369. package/dist-browser/numbl-core/lexer/token-config.d.ts +94 -0
  370. package/dist-browser/numbl-core/lexer/tokenizer.d.ts +9 -0
  371. package/dist-browser/numbl-core/lexer/types.d.ts +80 -0
  372. package/dist-browser/numbl-core/lowering/classInfo.d.ts +53 -0
  373. package/dist-browser/numbl-core/lowering/constants.d.ts +4 -0
  374. package/dist-browser/numbl-core/lowering/errors.d.ts +17 -0
  375. package/dist-browser/numbl-core/lowering/index.d.ts +3 -0
  376. package/dist-browser/numbl-core/lowering/itemTypes.d.ts +87 -0
  377. package/dist-browser/numbl-core/lowering/loweringContext.d.ts +241 -0
  378. package/dist-browser/numbl-core/native/bridge-resolve.d.ts +14 -0
  379. package/dist-browser/numbl-core/native/geometry-bridge.d.ts +39 -0
  380. package/dist-browser/numbl-core/native/lapack-bridge.d.ts +482 -0
  381. package/dist-browser/numbl-core/native/qhull-browser.d.ts +15 -0
  382. package/dist-browser/numbl-core/native/qhull-node.d.ts +13 -0
  383. package/dist-browser/numbl-core/native/ts-lapack-bridge.d.ts +9 -0
  384. package/dist-browser/numbl-core/native/ts-lapack-eig-complex.d.ts +32 -0
  385. package/dist-browser/numbl-core/ops/bessel.d.ts +18 -0
  386. package/dist-browser/numbl-core/ops/comparison.d.ts +11 -0
  387. package/dist-browser/numbl-core/ops/complexBinaryElemwise.d.ts +10 -0
  388. package/dist-browser/numbl-core/ops/complexUnaryElemwise.d.ts +8 -0
  389. package/dist-browser/numbl-core/ops/dispatch.d.ts +26 -0
  390. package/dist-browser/numbl-core/ops/index.d.ts +8 -0
  391. package/dist-browser/numbl-core/ops/opCodes.d.ts +70 -0
  392. package/dist-browser/numbl-core/ops/realBinaryElemwise.d.ts +8 -0
  393. package/dist-browser/numbl-core/ops/realUnaryElemwise.d.ts +5 -0
  394. package/dist-browser/numbl-core/ops/reduce.d.ts +6 -0
  395. package/dist-browser/numbl-core/parser/ArgumentsParser.d.ts +33 -0
  396. package/dist-browser/numbl-core/parser/ClassParser.d.ts +21 -0
  397. package/dist-browser/numbl-core/parser/CommandParser.d.ts +31 -0
  398. package/dist-browser/numbl-core/parser/ControlFlowParser.d.ts +16 -0
  399. package/dist-browser/numbl-core/parser/ExpressionParser.d.ts +32 -0
  400. package/dist-browser/numbl-core/parser/FunctionParser.d.ts +10 -0
  401. package/dist-browser/numbl-core/parser/Parser.d.ts +17 -0
  402. package/dist-browser/numbl-core/parser/ParserBase.d.ts +35 -0
  403. package/dist-browser/numbl-core/parser/StatementParser.d.ts +13 -0
  404. package/dist-browser/numbl-core/parser/errors.d.ts +15 -0
  405. package/dist-browser/numbl-core/parser/index.d.ts +7 -0
  406. package/dist-browser/numbl-core/parser/types.d.ts +342 -0
  407. package/dist-browser/numbl-core/runtime/alloc.d.ts +12 -0
  408. package/dist-browser/numbl-core/runtime/axisCommand.d.ts +34 -0
  409. package/dist-browser/numbl-core/runtime/compare.d.ts +5 -0
  410. package/dist-browser/numbl-core/runtime/constructors.d.ts +39 -0
  411. package/dist-browser/numbl-core/runtime/convert.d.ts +10 -0
  412. package/dist-browser/numbl-core/runtime/cow.d.ts +33 -0
  413. package/dist-browser/numbl-core/runtime/display.d.ts +6 -0
  414. package/dist-browser/numbl-core/runtime/error.d.ts +78 -0
  415. package/dist-browser/numbl-core/runtime/index.d.ts +13 -0
  416. package/dist-browser/numbl-core/runtime/indexing.d.ts +28 -0
  417. package/dist-browser/numbl-core/runtime/plotBuiltinDispatch.d.ts +92 -0
  418. package/dist-browser/numbl-core/runtime/plotUtils.d.ts +336 -0
  419. package/dist-browser/numbl-core/runtime/refcount.d.ts +85 -0
  420. package/dist-browser/numbl-core/runtime/runtime.d.ts +354 -0
  421. package/dist-browser/numbl-core/runtime/runtimeDispatch.d.ts +27 -0
  422. package/dist-browser/numbl-core/runtime/runtimeHelpers.d.ts +31 -0
  423. package/dist-browser/numbl-core/runtime/runtimeIndexing.d.ts +28 -0
  424. package/dist-browser/numbl-core/runtime/runtimeMemberAccess.d.ts +26 -0
  425. package/dist-browser/numbl-core/runtime/runtimeOperators.d.ts +24 -0
  426. package/dist-browser/numbl-core/runtime/runtimePlot.d.ts +129 -0
  427. package/dist-browser/numbl-core/runtime/sentinels.d.ts +4 -0
  428. package/dist-browser/numbl-core/runtime/specialBuiltinNames.d.ts +2 -0
  429. package/dist-browser/numbl-core/runtime/specialBuiltins.d.ts +13 -0
  430. package/dist-browser/numbl-core/runtime/struct-access.d.ts +11 -0
  431. package/dist-browser/numbl-core/runtime/syncChannel.d.ts +1 -0
  432. package/dist-browser/numbl-core/runtime/tensor-construction.d.ts +10 -0
  433. package/dist-browser/numbl-core/runtime/types.d.ts +197 -0
  434. package/dist-browser/numbl-core/runtime/uihtmlSession.d.ts +40 -0
  435. package/dist-browser/numbl-core/runtime/utils.d.ts +19 -0
  436. package/dist-browser/numbl-core/stdlib-bundle.d.ts +3 -0
  437. package/dist-browser/numbl-core/systemAdapter.d.ts +23 -0
  438. package/dist-browser/numbl-core/version.d.ts +2 -0
  439. package/dist-browser/numbl-core/workspace/index.d.ts +4 -0
  440. package/dist-browser/numbl-core/workspace/types.d.ts +24 -0
  441. package/dist-browser/ts-lapack/src/BLAS/daxpy.d.ts +1 -0
  442. package/dist-browser/ts-lapack/src/BLAS/dcopy.d.ts +1 -0
  443. package/dist-browser/ts-lapack/src/BLAS/ddot.d.ts +1 -0
  444. package/dist-browser/ts-lapack/src/BLAS/dgemm.d.ts +1 -0
  445. package/dist-browser/ts-lapack/src/BLAS/dgemm_optimized.d.ts +1 -0
  446. package/dist-browser/ts-lapack/src/BLAS/dgemv.d.ts +1 -0
  447. package/dist-browser/ts-lapack/src/BLAS/dger.d.ts +1 -0
  448. package/dist-browser/ts-lapack/src/BLAS/dnrm2.d.ts +1 -0
  449. package/dist-browser/ts-lapack/src/BLAS/drot.d.ts +1 -0
  450. package/dist-browser/ts-lapack/src/BLAS/dscal.d.ts +1 -0
  451. package/dist-browser/ts-lapack/src/BLAS/dswap.d.ts +1 -0
  452. package/dist-browser/ts-lapack/src/BLAS/dtrmm.d.ts +1 -0
  453. package/dist-browser/ts-lapack/src/BLAS/dtrmv.d.ts +1 -0
  454. package/dist-browser/ts-lapack/src/BLAS/dtrsm.d.ts +1 -0
  455. package/dist-browser/ts-lapack/src/BLAS/idamax.d.ts +1 -0
  456. package/dist-browser/ts-lapack/src/SRC/dbdsqr.d.ts +10 -0
  457. package/dist-browser/ts-lapack/src/SRC/dgebak.d.ts +1 -0
  458. package/dist-browser/ts-lapack/src/SRC/dgebal.d.ts +5 -0
  459. package/dist-browser/ts-lapack/src/SRC/dgebd2.d.ts +1 -0
  460. package/dist-browser/ts-lapack/src/SRC/dgebrd.d.ts +1 -0
  461. package/dist-browser/ts-lapack/src/SRC/dgeev.d.ts +3 -0
  462. package/dist-browser/ts-lapack/src/SRC/dgehd2.d.ts +1 -0
  463. package/dist-browser/ts-lapack/src/SRC/dgehrd.d.ts +1 -0
  464. package/dist-browser/ts-lapack/src/SRC/dgelq2.d.ts +1 -0
  465. package/dist-browser/ts-lapack/src/SRC/dgelqf.d.ts +1 -0
  466. package/dist-browser/ts-lapack/src/SRC/dgeqr2.d.ts +1 -0
  467. package/dist-browser/ts-lapack/src/SRC/dgeqrf.d.ts +1 -0
  468. package/dist-browser/ts-lapack/src/SRC/dgeqrf_optimized.d.ts +1 -0
  469. package/dist-browser/ts-lapack/src/SRC/dgesvd.d.ts +28 -0
  470. package/dist-browser/ts-lapack/src/SRC/dgetrf.d.ts +1 -0
  471. package/dist-browser/ts-lapack/src/SRC/dgetrf2.d.ts +1 -0
  472. package/dist-browser/ts-lapack/src/SRC/dgetri.d.ts +1 -0
  473. package/dist-browser/ts-lapack/src/SRC/dhseqr.d.ts +32 -0
  474. package/dist-browser/ts-lapack/src/SRC/dlabrd.d.ts +1 -0
  475. package/dist-browser/ts-lapack/src/SRC/dlacpy.d.ts +18 -0
  476. package/dist-browser/ts-lapack/src/SRC/dladiv.d.ts +9 -0
  477. package/dist-browser/ts-lapack/src/SRC/dlaexc.d.ts +21 -0
  478. package/dist-browser/ts-lapack/src/SRC/dlahqr.d.ts +24 -0
  479. package/dist-browser/ts-lapack/src/SRC/dlahr2.d.ts +1 -0
  480. package/dist-browser/ts-lapack/src/SRC/dlaln2.d.ts +5 -0
  481. package/dist-browser/ts-lapack/src/SRC/dlamch.d.ts +1 -0
  482. package/dist-browser/ts-lapack/src/SRC/dlange.d.ts +1 -0
  483. package/dist-browser/ts-lapack/src/SRC/dlanv2.d.ts +12 -0
  484. package/dist-browser/ts-lapack/src/SRC/dlapy2.d.ts +1 -0
  485. package/dist-browser/ts-lapack/src/SRC/dlaqr1.d.ts +1 -0
  486. package/dist-browser/ts-lapack/src/SRC/dlaqr30.d.ts +81 -0
  487. package/dist-browser/ts-lapack/src/SRC/dlaqr5.d.ts +38 -0
  488. package/dist-browser/ts-lapack/src/SRC/dlarf.d.ts +18 -0
  489. package/dist-browser/ts-lapack/src/SRC/dlarf1f.d.ts +1 -0
  490. package/dist-browser/ts-lapack/src/SRC/dlarfb.d.ts +25 -0
  491. package/dist-browser/ts-lapack/src/SRC/dlarfg.d.ts +4 -0
  492. package/dist-browser/ts-lapack/src/SRC/dlarft.d.ts +20 -0
  493. package/dist-browser/ts-lapack/src/SRC/dlarfx.d.ts +17 -0
  494. package/dist-browser/ts-lapack/src/SRC/dlartg.d.ts +5 -0
  495. package/dist-browser/ts-lapack/src/SRC/dlas2.d.ts +4 -0
  496. package/dist-browser/ts-lapack/src/SRC/dlascl.d.ts +1 -0
  497. package/dist-browser/ts-lapack/src/SRC/dlaset.d.ts +19 -0
  498. package/dist-browser/ts-lapack/src/SRC/dlasr.d.ts +1 -0
  499. package/dist-browser/ts-lapack/src/SRC/dlassq.d.ts +18 -0
  500. package/dist-browser/ts-lapack/src/SRC/dlasv2.d.ts +8 -0
  501. package/dist-browser/ts-lapack/src/SRC/dlaswp.d.ts +1 -0
  502. package/dist-browser/ts-lapack/src/SRC/dlasy2.d.ts +5 -0
  503. package/dist-browser/ts-lapack/src/SRC/dorg2r.d.ts +1 -0
  504. package/dist-browser/ts-lapack/src/SRC/dorgbr.d.ts +1 -0
  505. package/dist-browser/ts-lapack/src/SRC/dorghr.d.ts +1 -0
  506. package/dist-browser/ts-lapack/src/SRC/dorgl2.d.ts +1 -0
  507. package/dist-browser/ts-lapack/src/SRC/dorglq.d.ts +1 -0
  508. package/dist-browser/ts-lapack/src/SRC/dorgqr.d.ts +1 -0
  509. package/dist-browser/ts-lapack/src/SRC/dorgqr_optimized.d.ts +1 -0
  510. package/dist-browser/ts-lapack/src/SRC/dorm2r.d.ts +1 -0
  511. package/dist-browser/ts-lapack/src/SRC/dormhr.d.ts +1 -0
  512. package/dist-browser/ts-lapack/src/SRC/dormqr.d.ts +1 -0
  513. package/dist-browser/ts-lapack/src/SRC/dpotf2.d.ts +1 -0
  514. package/dist-browser/ts-lapack/src/SRC/dtrevc3.d.ts +27 -0
  515. package/dist-browser/ts-lapack/src/SRC/dtrexc.d.ts +24 -0
  516. package/dist-browser/ts-lapack/src/SRC/dtrti2.d.ts +1 -0
  517. package/dist-browser/ts-lapack/src/SRC/dtrtri.d.ts +1 -0
  518. package/dist-browser/ts-lapack/src/utils/constants.d.ts +28 -0
  519. package/dist-browser/ts-lapack/src/utils/iladlc.d.ts +1 -0
  520. package/dist-browser/ts-lapack/src/utils/iladlr.d.ts +1 -0
  521. package/dist-browser/ts-lapack/src/utils/ilaenv.d.ts +1 -0
  522. package/dist-browser/ts-lapack/src/utils/xerbla.d.ts +1 -0
  523. package/dist-browser/vfs/BrowserFileIOAdapter.d.ts +60 -0
  524. package/dist-browser/vfs/BrowserSystemAdapter.d.ts +27 -0
  525. package/dist-browser/vfs/VirtualFileSystem.d.ts +66 -0
  526. package/dist-browser/vfs/syncVfsChanges.d.ts +23 -0
  527. package/dist-browser/vfs/unzipToFiles.d.ts +7 -0
  528. package/dist-cli/cli.js +1290 -197
  529. package/dist-lib/lib.js +1284 -197
  530. package/dist-lib/numbl-core/helpers/scanFormat.d.ts +11 -0
  531. package/dist-lib/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +2 -2
  532. package/dist-lib/numbl-core/runtime/constructors.d.ts +3 -1
  533. package/dist-lib/numbl-core/runtime/indexing.d.ts +3 -0
  534. package/dist-lib/numbl-core/runtime/runtime.d.ts +1 -0
  535. package/dist-lib/numbl-core/runtime/types.d.ts +15 -1
  536. package/dist-lib/numbl-core/runtime/utils.d.ts +3 -0
  537. package/dist-lib/numbl-core/version.d.ts +1 -1
  538. package/dist-lib/vfs/BrowserFileIOAdapter.d.ts +6 -0
  539. package/dist-site-viewer/assets/{index-C-wfkZK0.js → index-CT9HA1Pn.js} +318 -316
  540. package/dist-site-viewer/assets/numbl-worker-CYPflGmm.js +5246 -0
  541. package/dist-site-viewer/index.html +1 -1
  542. package/package.json +9 -3
  543. package/dist-site-viewer/assets/numbl-worker-Bnbz2rMQ.js +0 -5228
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Entry point for code execution.
3
+ *
4
+ * Parses source, sets up the LoweringContext and Runtime,
5
+ * creates an Interpreter, and runs the AST.
6
+ */
7
+ import type { RuntimeValue } from "./runtime/index.js";
8
+ import type { PlotInstruction } from "../graphics/types.js";
9
+ import type { FileIOAdapter } from "./fileIOAdapter.js";
10
+ import type { SystemAdapter } from "./systemAdapter.js";
11
+ import type { WorkspaceFile } from "../numbl-core/workspace/index.js";
12
+ import type { NativeBridge } from "./workspace/index.js";
13
+ import { type UihtmlSession } from "./runtime/uihtmlSession.js";
14
+ export type { UihtmlSession } from "./runtime/uihtmlSession.js";
15
+ export interface ExecOptions {
16
+ onOutput?: (text: string) => void;
17
+ onDrawnow?: (plotInstructions: PlotInstruction[]) => void;
18
+ displayResults?: boolean;
19
+ maxIterations?: number;
20
+ initialVariableValues?: Record<string, RuntimeValue>;
21
+ /** Optional callback for verbose compilation logging. */
22
+ log?: (message: string) => void;
23
+ /** Enable profiling of builtin function calls. */
24
+ profile?: boolean;
25
+ /** Called each time a JIT function is compiled, with a description, the
26
+ * generated source, and the backend language (`"js"` or `"c"`). */
27
+ onJitCompile?: (description: string, code: string, lang: "js" | "c") => void;
28
+ /** Called when a JIT-compiled unit bails to the interpreter at runtime
29
+ * (e.g. an indexed-store array growth the JIT can't model). Surfaced
30
+ * as a warning; the CLI routes it to stderr. */
31
+ onJitBail?: (message: string) => void;
32
+ /** Initial hold state for plotting (persisted across REPL executions). */
33
+ initialHoldState?: boolean;
34
+ /** Override or add builtins for this execution only. */
35
+ customBuiltins?: Record<string, (nargout: number, args: any[]) => any>;
36
+ /** Platform-specific file I/O adapter (e.g. Node.js fs). */
37
+ fileIO?: FileIOAdapter;
38
+ /** Platform-specific system adapter (env vars, cwd, platform info). */
39
+ system?: SystemAdapter;
40
+ /** Synchronous callback for the `input()` builtin. Displays prompt, returns user's line. */
41
+ onInput?: (prompt: string) => string;
42
+ /** Optimization mode: `"0"` interpreter, `"1"` JS-JIT, `"2"` C-JIT. */
43
+ optimization?: import("./executors/plugins.js").OptLevel;
44
+ /**
45
+ * Initial implicit cwd path for the MATLAB-style "cwd is the first search path" feature.
46
+ * - undefined → auto-detect from `system.cwd()` and scan its files.
47
+ * - a string → use this absolute path as the implicit cwd (REPL persistence).
48
+ * - null → opt out of the implicit-cwd behavior entirely.
49
+ */
50
+ implicitCwdPath?: string | null;
51
+ /** SharedArrayBuffer for cooperative cancellation. Int32[0] != 0 means cancelled. */
52
+ cancelSAB?: SharedArrayBuffer;
53
+ /** Hook for `sendEventToHTMLSource(src,name,data)` — pushes an event from a
54
+ * uihtml callback back to the component's page (MATLAB → JS). `dataJson` is
55
+ * the data already `jsonencode`d. The host forwards it to the iframe. */
56
+ onHtmlSourceEvent?: (compId: string, name: string, dataJson: string) => void;
57
+ }
58
+ export interface BuiltinProfileEntry {
59
+ totalTimeMs: number;
60
+ callCount: number;
61
+ }
62
+ export interface BuiltinProfileBreakdown {
63
+ /** Calls from the registry fallback (rt.builtins). */
64
+ fallback: BuiltinProfileEntry;
65
+ /** Calls from the interpreter (IBuiltin.resolve → apply). */
66
+ interp: BuiltinProfileEntry;
67
+ /** Calls from JIT-compiled code (ib_* helpers). */
68
+ jit: BuiltinProfileEntry;
69
+ }
70
+ export interface HotLoopEntry {
71
+ file: string;
72
+ line: number;
73
+ kind: "for" | "while";
74
+ iterations: number;
75
+ callCount: number;
76
+ totalTimeMs: number;
77
+ }
78
+ export interface ProfileData {
79
+ executionTimeMs: number;
80
+ jitCompileTimeMs: number;
81
+ builtins: Record<string, BuiltinProfileBreakdown>;
82
+ dispatches: Record<string, BuiltinProfileEntry>;
83
+ hotLoops: HotLoopEntry[];
84
+ }
85
+ export interface ExecResult {
86
+ output: string[];
87
+ generatedJS: string;
88
+ /** C source emitted by the C-JIT backend (`--opt 2`). Empty placeholder
89
+ * when no C was generated (e.g. `--opt 0`/`1`). */
90
+ generatedC: string;
91
+ plotInstructions: PlotInstruction[];
92
+ returnValue: RuntimeValue;
93
+ variableValues: Record<string, RuntimeValue>;
94
+ holdState: boolean;
95
+ profileData?: ProfileData;
96
+ dispatchUnknownCounts?: Record<string, number>;
97
+ /** Updated search paths (set when addpath/rmpath was called). */
98
+ searchPaths?: string[];
99
+ /** Updated workspace files (set when addpath/rmpath was called). */
100
+ workspaceFiles?: WorkspaceFile[];
101
+ /** Final implicit cwd path (for REPL persistence across commands). */
102
+ implicitCwdPath?: string | null;
103
+ /** Present when the run left `uihtml` reverse-channel callbacks registered.
104
+ * The host retains this to dispatch later iframe events into the still-live
105
+ * interpreter (see UihtmlSession). Absent for normal runs (no overhead). */
106
+ uihtmlSession?: UihtmlSession;
107
+ }
108
+ export declare function executeCode(source: string, options?: ExecOptions, workspaceFiles?: WorkspaceFile[], mainFileName?: string, searchPaths?: string[], nativeBridge?: NativeBridge): ExecResult;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Per-executor compilation cache.
3
+ *
4
+ * Keyed by (executor, owner, cacheKey). The `owner` is the object the
5
+ * cache entry's lifetime is tied to:
6
+ * - For stmt dispatch: the head Stmt at `siblings[i]`.
7
+ * - For function-call dispatch: the FunctionDef.
8
+ *
9
+ * WeakMap scoping ensures entries are reclaimed when the owner is
10
+ * garbage-collected (e.g., when an AST is dropped after addpath).
11
+ *
12
+ * Each registered executor gets its own slot in the cache; a single
13
+ * owner can host entries from multiple executors with different
14
+ * specializations.
15
+ */
16
+ declare const BAILED: unique symbol;
17
+ type Bailed = typeof BAILED;
18
+ export declare class ExecutorCache {
19
+ /** owner → executorName → cacheKey → compiled artifact (or BAILED) */
20
+ private readonly slots;
21
+ get(executorName: string, owner: object, key: string): unknown | undefined;
22
+ set(executorName: string, owner: object, key: string, compiled: unknown): void;
23
+ markBailed(executorName: string, owner: object, key: string): void;
24
+ isBailed(value: unknown): value is Bailed;
25
+ }
26
+ export {};
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Classification (JS-JIT-independent).
3
+ *
4
+ * Two classification phases — top-level (whole-script) and call
5
+ * (user-function-call) — produce the analysis records that codegen
6
+ * executors consume to decide whether they can lower a stmt list /
7
+ * call and to key their caches.
8
+ *
9
+ * The analysis is purely AST + type inference and is consumed by the
10
+ * JIT executors (`executors/jit/`) — no backend-specific IR involved.
11
+ */
12
+ import type { Interpreter } from "../interpreter/interpreter.js";
13
+ import type { FunctionDef } from "../interpreter/types.js";
14
+ import type { Stmt, Expr } from "../parser/types.js";
15
+ import { type JitType } from "../jitTypes.js";
16
+ /** A capture-free function handle the JIT inlines into the spec body as
17
+ * an in-scope `@...` constant instead of taking it as a runtime input.
18
+ * `identity` keys the spec cache (distinct handles → distinct specs). */
19
+ export interface ConstHandle {
20
+ readonly name: string;
21
+ readonly expr: Expr;
22
+ readonly identity: string;
23
+ }
24
+ /** Names that look like variables but never resolve to env values
25
+ * (constants, the special `end` slot, the imaginary unit). Skipped
26
+ * when collecting env inputs. */
27
+ export declare const KNOWN_CONSTANTS: ReadonlySet<string>;
28
+ /**
29
+ * Drop `exact` from a numeric scalar `JitType`. Numeric `exact` only
30
+ * survives unification when two consecutive specializations see the
31
+ * *same* literal — almost never the case for variables — so stripping
32
+ * up front means the first specialization's cacheKey already matches
33
+ * later calls.
34
+ */
35
+ export declare function pruneArgType(t: JitType): JitType;
36
+ /**
37
+ * Progressive type widening: in-place unify each entry of `types`
38
+ * with the corresponding entry of `prev`. No-op when shapes don't
39
+ * match (different arity → different specialization, no widening).
40
+ *
41
+ * Widening that would collapse a known type to `unknown` is rejected
42
+ * — keep this call's concrete type so a fresh, specific spec gets
43
+ * built. Without this, a 1st call with (number, …) followed by a 2nd
44
+ * call with (tensor, …) would unify the first arg to `unknown` and
45
+ * poison every subsequent specialization with the same arg shape.
46
+ */
47
+ export declare function widenAgainst(types: JitType[], prev: readonly JitType[] | undefined): void;
48
+ /**
49
+ * Gather env inputs for the synthetic FunctionDef of a top-level
50
+ * block. For each candidate name: skip known constants, skip names
51
+ * not in env (likely fn names), infer the JIT type, prune `exact`.
52
+ * Returns null if any candidate has an unknown type — that's a
53
+ * structural blocker for lowering.
54
+ */
55
+ export declare function gatherTypedEnvInputs(interp: Interpreter, candidates: readonly string[]): {
56
+ inputs: string[];
57
+ inputTypes: JitType[];
58
+ } | null;
59
+ export interface TopLevelClassification {
60
+ readonly stmts: readonly Stmt[];
61
+ readonly inputs: readonly string[];
62
+ readonly inputTypes: readonly JitType[];
63
+ readonly outputs: readonly string[];
64
+ readonly currentFile: string;
65
+ readonly hasReturn: boolean;
66
+ /** Body contains a `%!numbl:assert_jit c` directive (the C-JIT
67
+ * variant) — see `containsAssertJitC`. Makes the JS-JIT executors
68
+ * decline at `--opt 2` so the unit must C-JIT (or fall to the
69
+ * interpreter, which raises). */
70
+ readonly assertsCJit: boolean;
71
+ readonly cacheKey: string;
72
+ }
73
+ export declare function classifyTopLevel(interp: Interpreter, stmts: readonly Stmt[], prevInputTypes: readonly JitType[] | undefined): TopLevelClassification | null;
74
+ export interface LoopClassification {
75
+ /** The single For/While stmt this classification describes. */
76
+ readonly stmt: Stmt & {
77
+ type: "For" | "While";
78
+ };
79
+ readonly inputs: readonly string[];
80
+ readonly inputTypes: readonly JitType[];
81
+ /** Loop-local writes that are read by code AFTER the loop in the
82
+ * same sibling list. Loop-internal-only temporaries are filtered
83
+ * out so a JIT artifact doesn't need to write them back to env. */
84
+ readonly outputs: readonly string[];
85
+ readonly currentFile: string;
86
+ readonly hasReturn: boolean;
87
+ /** Loop body contains a `%!numbl:assert_jit c` directive (C-JIT variant). */
88
+ readonly assertsCJit: boolean;
89
+ /** Capture-free handle inputs to inline as in-scope `@...` constants
90
+ * in the synthesized spec body (instead of runtime inputs). */
91
+ readonly constHandles: readonly ConstHandle[];
92
+ readonly cacheKey: string;
93
+ }
94
+ /**
95
+ * Classify a single For/While loop at `siblings[siblingIndex]`. The
96
+ * post-loop tail of the sibling list is scanned to filter the
97
+ * loop's assigned-set down to names that are actually live-out
98
+ * (read after the loop) — purely loop-internal scratch never makes
99
+ * it into the synthetic function's outputs.
100
+ */
101
+ export declare function classifyLoop(interp: Interpreter, stmt: Stmt & {
102
+ type: "For" | "While";
103
+ }, siblings: readonly Stmt[], siblingIndex: number, prevInputTypes: readonly JitType[] | undefined): LoopClassification | null;
104
+ export interface CallClassification {
105
+ readonly fn: FunctionDef;
106
+ readonly nargout: number;
107
+ readonly argTypes: readonly JitType[];
108
+ readonly cacheKey: string;
109
+ /**
110
+ * Effective parameter names for this specialization. Mirrors
111
+ * `fn.params` for non-varargin functions. For varargin functions,
112
+ * the trailing `varargin` is replaced with one synthetic name per
113
+ * variadic arg (`$va_0`, `$va_1`, …). argTypes is one-to-one with
114
+ * effectiveParams.
115
+ */
116
+ readonly effectiveParams: readonly string[];
117
+ /** Number of variadic args (0 when fn has no varargin). */
118
+ readonly nVarargin: number;
119
+ /** Function body contains a `%!numbl:assert_jit c` directive (C-JIT variant). */
120
+ readonly assertsCJit: boolean;
121
+ }
122
+ export declare function classifyCall(fn: FunctionDef, args: unknown[], nargout: number, prevArgTypes: readonly JitType[] | undefined): CallClassification | null;
123
+ /** True if any statement in `stmts` is a `%!numbl:assert_jit c` directive
124
+ * (the C-JIT variant), recursing into control-flow bodies (if / for /
125
+ * while / switch / try) but NOT into nested function definitions — a
126
+ * directive inside a nested function belongs to that function's own unit.
127
+ *
128
+ * Only the `c` variant matters here: it requires C-JIT at `--opt 2`, so
129
+ * the JS-JIT executors decline such a unit at `--opt 2` to force either
130
+ * C-JIT or an interpreter fallthrough (which then raises). The plain
131
+ * `%!numbl:assert_jit` (require JS-JIT at `--opt 1` only) needs no
132
+ * executor change — the interpreter's `Directive` handler raises if it
133
+ * reaches the directive at `--opt 1`. */
134
+ export declare function containsAssertJitC(stmts: readonly Stmt[]): boolean;
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Dispatch context — passed to every executor call.
3
+ *
4
+ * Provides env access, type-info queries, sub-dispatch into the
5
+ * registry, and runtime callbacks. Memoizes type-info lookups for the
6
+ * lifetime of a single dispatch so repeated `typeOf(name)` calls from
7
+ * different executors don't re-infer.
8
+ */
9
+ import type { Interpreter } from "../interpreter/interpreter.js";
10
+ import type { Stmt } from "../parser/types.js";
11
+ import type { ControlSignal } from "../interpreter/types.js";
12
+ import type { Registry } from "./registry.js";
13
+ import { type JitType } from "../jitTypes.js";
14
+ export declare class DispatchContext {
15
+ readonly interp: Interpreter;
16
+ readonly registry: Registry;
17
+ /** When true, only no-bail executors are eligible. Set when the
18
+ * caller's compiled artifact has emitted observable side effects
19
+ * that mustn't repeat. */
20
+ readonly requireNoBail: boolean;
21
+ /** Per-dispatch memoization of typeOf(name) lookups. */
22
+ private readonly typeCache;
23
+ /** Re-entrancy guard: which executors are currently running on
24
+ * which head stmts. Prevents an executor sub-dispatching back into
25
+ * itself on the same stmt. */
26
+ private readonly active;
27
+ /** Sibling list and head index for the current dispatch. Set by
28
+ * Registry.dispatch before calling executors; read by peekSibling.
29
+ * Most executors don't read these directly. */
30
+ private _siblings;
31
+ private _i;
32
+ constructor(interp: Interpreter, registry: Registry, requireNoBail: boolean, active?: Set<string>);
33
+ /** Look up a name's JitType from the interpreter env, memoized. */
34
+ typeOf(name: string): JitType;
35
+ /** Read a value from env (no inference). Returns undefined if unbound. */
36
+ envValue(name: string): unknown;
37
+ /** Peek at a sibling stmt at `offset` from the current head.
38
+ * offset=0 is the current stmt; positive values look ahead.
39
+ * Returns null if the offset is past the end of the scope. Used by
40
+ * chain-style executors that may consume multiple consecutive
41
+ * stmts. */
42
+ peekSibling(offset: number): Stmt | null;
43
+ /** Sibling list of the current scope. The head stmt is at
44
+ * `siblings[headIndex]`. Most executors don't need this directly —
45
+ * use `peekSibling(offset)` for lookahead. The rare cases that
46
+ * forward the raw list to a legacy adapter (the chain executor) or
47
+ * claim the whole scope (the top-level executor) read these. */
48
+ get siblings(): readonly Stmt[];
49
+ get headIndex(): number;
50
+ /** @internal Set the position state for an upcoming dispatch. Only
51
+ * the registry calls this. */
52
+ _setPosition(siblings: readonly Stmt[], i: number): void;
53
+ /** Reset per-dispatch state so this context can be reused for the
54
+ * next stmt in a sibling loop. The reentrancy guard is expected to
55
+ * already be empty (every pushActive is paired with a popActive in
56
+ * Registry.runCandidate's finally). */
57
+ resetForNextDispatch(): void;
58
+ /** Construct a child context for sub-dispatch. `requireNoBail` is
59
+ * the OR of the parent flag and the parent executor's
60
+ * `requireNoBailInChildren` declaration. */
61
+ childContext(requireNoBail: boolean): DispatchContext;
62
+ /** @internal Whether the reentrancy guard has any entries. The
63
+ * registry uses this to skip the guard check on the hot path —
64
+ * when nothing is active there's nothing to detect. */
65
+ get hasActive(): boolean;
66
+ /** @internal Used by the registry's reentrancy guard. Pre-checked
67
+ * with hasActive on the hot path, so the actual `has` only fires
68
+ * during sub-dispatch. */
69
+ isActive(executorName: string, stmt: Stmt): boolean;
70
+ /** @internal */
71
+ pushActive(executorName: string, stmt: Stmt): void;
72
+ /** @internal */
73
+ popActive(executorName: string, stmt: Stmt): void;
74
+ }
75
+ /** Re-export for the runner's signal type. */
76
+ export type { ControlSignal };
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Function-handle inlining for the JIT.
3
+ *
4
+ * A function handle that crosses a compile boundary — a loop input
5
+ * (`f = @...; for ...; f(x); end`) or a call argument
6
+ * (`applyfn(@sq, x)`) — arrives at the executor as an opaque
7
+ * `function_handle` value the JIT can't type. But a *capture-free*
8
+ * handle is fully described by its source AST, so instead of marshaling
9
+ * it across the boundary we inline its `@...` definition as an in-scope
10
+ * handle constant inside the synthesized spec. That reduces the boundary
11
+ * case to the already-supported in-scope case (`lowerAnonFunc` /
12
+ * `lowerFuncHandle` + `dispatchHandleCall`), which lowers identically on
13
+ * the JS and C backends — no value-adapter or ABI work.
14
+ *
15
+ * "Capture-free" is the key constraint: a handle that closes over an
16
+ * outer variable can't be inlined, because the inlined copy would
17
+ * re-resolve that name in the spec's scope (a different value, or
18
+ * unresolved) rather than the by-value snapshot the handle took. We
19
+ * detect captures against the handle's own recorded definition
20
+ * environment, so the test reflects what the handle actually closed
21
+ * over, not a syntactic guess.
22
+ *
23
+ * A second constraint applies at the relocation site. A body name that
24
+ * is NOT a variable in the def env resolves at definition time to a
25
+ * function (or is undefined). After relocation into the loop's synthetic
26
+ * scope, that same name may be bound as a variable (a loop input or
27
+ * assigned local). Re-lowering would then capture the loop variable
28
+ * instead of resolving the function/undefined the handle saw — silently
29
+ * turning `@(t) sq(t)` from a function call into an array index, or
30
+ * masking an undefined-variable error. So the caller passes the set of
31
+ * names that will be in scope at the relocation site, and we decline
32
+ * when a free body name collides with it. A name that is purely a
33
+ * function (never an env variable) is not in that set, so the common
34
+ * `@(t) sq(t)` case still inlines; only the genuine shadowing case
35
+ * declines (and falls back to the interpreter).
36
+ */
37
+ import type { Expr } from "../parser/index.js";
38
+ /**
39
+ * If `val` is a function handle the JIT can inline as a compile-time
40
+ * constant in a spec compiled for `compileFile`, return its `@...`
41
+ * defining Expr; otherwise return null.
42
+ *
43
+ * Inlinable iff:
44
+ * - it's a `RuntimeFunction` carrying a recorded `handleAst`, AND
45
+ * - it was defined in `compileFile` (so a `@name` target resolves to
46
+ * the same function it did at definition — file-local functions can
47
+ * shadow across files), AND
48
+ * - for an anonymous handle, it is capture-free: no name its body
49
+ * references (other than its own params) exists as a variable in the
50
+ * handle's recorded definition environment, AND no free body name
51
+ * collides with `relocScopeNames` (the names that will be in scope
52
+ * where the handle is inlined).
53
+ *
54
+ * Named (`@name`) handles are always capture-free. Anything the lowerer
55
+ * ultimately can't compile (e.g. a builtin target) simply makes the
56
+ * enclosing unit decline to the interpreter — still correct.
57
+ */
58
+ export declare function inlinableHandleExpr(val: unknown, compileFile: string, relocScopeNames?: ReadonlySet<string>): Expr | null;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Executor registry — public surface.
3
+ *
4
+ * See docs/developer_reference/executors.md for the design.
5
+ */
6
+ export type { Executor, CostEstimate, BailReason, RunResult, Proposal, } from "./types.js";
7
+ export { Registry, makeRootContext } from "./registry.js";
8
+ export type { DispatchResult, CallDispatchResult, WholeScopeResult, } from "./registry.js";
9
+ export { DispatchContext } from "./context.js";
10
+ export { ExecutorCache } from "./cache.js";
11
+ export type { JitType, SignCategory } from "../jitTypes.js";
12
+ export { jitTypeKey, unifyJitTypes, isScalarType, isTensorType, isComplexType, isKnownInteger, } from "../jitTypes.js";
13
+ export { inferJitType } from "../interpreter/builtins/types.js";
14
+ export { registerExecutorsForOpt } from "./plugins.js";
@@ -0,0 +1,35 @@
1
+ /**
2
+ * cjit-call — C-backed JIT executor for user-function calls.
3
+ *
4
+ * Mirrors `callExecutor.ts` (the JS-emit sibling) but routes the
5
+ * specialization's emitted code through `compileSpecC` →
6
+ * `cc -shared -fPIC -O3` → `dlopen` via koffi instead of
7
+ * `new Function(source)`. The dispatch, gating, and caching
8
+ * conventions are otherwise identical, so a sibling executor can
9
+ * register alongside the JS path at the same opt level without any
10
+ * arbitration in the dispatcher beyond cost-based selection.
11
+ *
12
+ * Declines when:
13
+ * - `nativeBridge` / `koffi` are not available (browser).
14
+ * - Any param or output type fails the C-FFI feasibility check
15
+ * (`compilerTypeToCDecl` returns null).
16
+ * - mtoc2 throws `UnsupportedConstruct` / `JitTypeError` at lowering.
17
+ */
18
+ import type { Executor } from "../types.js";
19
+ import { type JitType } from "../../jitTypes.js";
20
+ import type { FunctionDef } from "../../interpreter/types.js";
21
+ import { type Type as CompilerType, type SpecCSignature } from "../../jit/index.js";
22
+ import { type CompiledC } from "./compileC.js";
23
+ interface CJitCallData {
24
+ readonly fn: FunctionDef;
25
+ readonly nargout: number;
26
+ readonly argTypes: readonly JitType[];
27
+ readonly compilerArgTypes: readonly CompilerType[];
28
+ readonly args: readonly unknown[];
29
+ }
30
+ interface CompiledArtifact {
31
+ readonly compiled: CompiledC;
32
+ readonly signature: SpecCSignature;
33
+ }
34
+ export declare const cJitCallExecutor: Executor<CJitCallData, CompiledArtifact | null>;
35
+ export {};
@@ -0,0 +1,31 @@
1
+ /**
2
+ * cjit-loop — C-backed JIT executor for outermost For/While
3
+ * loops. Mirrors `loopExecutor.ts` (JS-emit sibling) but routes
4
+ * through `compileSpecC` → `cc -shared` → `koffi`. See
5
+ * `cJitCallExecutor.ts` for the marshaling protocol; this file just
6
+ * adapts the loop-shape `data` to the same C-side pipeline.
7
+ */
8
+ import type { Executor } from "../types.js";
9
+ import { type JitType } from "../../jitTypes.js";
10
+ import type { Stmt } from "../../parser/index.js";
11
+ import type { ConstHandle } from "../classification.js";
12
+ import { type Type as CompilerType, type SpecCSignature } from "../../jit/index.js";
13
+ import { type CompiledC } from "./compileC.js";
14
+ interface CJitLoopData {
15
+ readonly loopStmt: Stmt & {
16
+ type: "For" | "While";
17
+ };
18
+ readonly inputs: readonly string[];
19
+ readonly outputs: readonly string[];
20
+ readonly inputTypes: readonly JitType[];
21
+ readonly compilerInputTypes: readonly CompilerType[];
22
+ readonly constHandles: readonly ConstHandle[];
23
+ readonly currentFile: string;
24
+ readonly cacheKey: string;
25
+ }
26
+ interface CompiledArtifact {
27
+ readonly compiled: CompiledC;
28
+ readonly signature: SpecCSignature;
29
+ }
30
+ export declare const cJitLoopExecutor: Executor<CJitLoopData, CompiledArtifact | null>;
31
+ export {};
@@ -0,0 +1,29 @@
1
+ /**
2
+ * cjit-top-level — C-backed JIT executor for whole-script bodies.
3
+ *
4
+ * Mirrors `topLevelExecutor.ts` (JS-emit sibling) but routes through
5
+ * `compileSpecC` → `cc -shared` → `koffi`. See `cJitCallExecutor.ts`
6
+ * for the marshaling protocol. Same `isAllSuppressed` gate as the JS
7
+ * sibling so `displayAssign`/`displayResult` semantics stay on the
8
+ * interpreter path.
9
+ */
10
+ import type { Executor } from "../types.js";
11
+ import { type JitType } from "../../jitTypes.js";
12
+ import type { Stmt } from "../../parser/index.js";
13
+ import { type Type as CompilerType, type SpecCSignature } from "../../jit/index.js";
14
+ import { type CompiledC } from "./compileC.js";
15
+ interface CJitTopLevelData {
16
+ readonly stmts: readonly Stmt[];
17
+ readonly inputs: readonly string[];
18
+ readonly outputs: readonly string[];
19
+ readonly inputTypes: readonly JitType[];
20
+ readonly compilerInputTypes: readonly CompilerType[];
21
+ readonly currentFile: string;
22
+ readonly cacheKey: string;
23
+ }
24
+ interface CompiledArtifact {
25
+ readonly compiled: CompiledC;
26
+ readonly signature: SpecCSignature;
27
+ }
28
+ export declare const cJitTopLevelExecutor: Executor<CJitTopLevelData, CompiledArtifact | null>;
29
+ export {};
@@ -0,0 +1,45 @@
1
+ /**
2
+ * jit-call — executor that compiles user-function calls via mtoc2's
3
+ * `compileSpec` JIT entry point and runs the emitted JS in-process.
4
+ *
5
+ * Replaces the JS-JIT call executor at `--opt 1`. The shape of the
6
+ * fallback path is the same: on rejection (mtoc2's
7
+ * `UnsupportedConstruct` / `TypeError` during lowering, or a JitType
8
+ * the type adapter can't translate), `propose()` declines and the
9
+ * dispatcher falls through to the next executor / interpreter.
10
+ *
11
+ * Key differences from JS-JIT:
12
+ *
13
+ * - **No mid-run bailouts.** mtoc2 either lowers cleanly or rejects
14
+ * statically. When `compile()` returns, the artifact will run to
15
+ * completion. `bailRisk` is `false`.
16
+ * - **Shared `Lowerer.specializations` is the cache.** One Workspace
17
+ * + Lowerer pair per LoweringContext (i.e. per execution session);
18
+ * accumulating specs persist across calls so a function called
19
+ * repeatedly with the same arg signature reuses the prior compile.
20
+ * - **Output-count support.** `nargout >= 1` (single-output and
21
+ * multi-output `[a, b, ...] = f(x)`). `nargout === 0` (bare-stmt
22
+ * `f();`) is declined because mtoc2's nargout=0 spec emits a no-
23
+ * return body, but numbl's interpreter still uses the first
24
+ * declared output for `ans` binding — let the interpreter handle.
25
+ * - **Loop-depth gate.** Declines when `interp.loopDepth > 0` so a
26
+ * hot loop iterating function calls doesn't pay per-call JIT
27
+ * propose / spec-cache overhead. Once an outer call is JIT'd, its
28
+ * loops run inside mtoc2's compiled code anyway.
29
+ */
30
+ import type { Executor } from "../types.js";
31
+ import { type JitType } from "../../jitTypes.js";
32
+ import type { FunctionDef } from "../../interpreter/types.js";
33
+ import { type Type as CompilerType } from "../../jit/index.js";
34
+ interface JitCallData {
35
+ readonly fn: FunctionDef;
36
+ readonly nargout: number;
37
+ readonly argTypes: readonly JitType[];
38
+ readonly compilerArgTypes: readonly CompilerType[];
39
+ readonly args: readonly unknown[];
40
+ }
41
+ interface CompiledArtifact {
42
+ readonly specFn: (...args: unknown[]) => unknown;
43
+ }
44
+ export declare const jitCallExecutor: Executor<JitCallData, CompiledArtifact | null>;
45
+ export {};
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Browser-safe surface for the koffi C-JIT pipeline.
3
+ *
4
+ * The real implementation (`compileAndLoadCImpl`) lives in
5
+ * `compileC.node.ts` because it imports Node-only modules (`node:fs`,
6
+ * `node:child_process`, `node:os`, `node:crypto`) that vite/rollup
7
+ * cannot bundle for the browser. The CLI's bootstrap registers the
8
+ * Node implementation here at startup via `setCompileAndLoadCImpl()`;
9
+ * any browser bundle leaves it unregistered, so the koffi-backed
10
+ * executors decline (their proposals already gate on
11
+ * `bridge.koffi !== undefined`).
12
+ *
13
+ * Types stay in this file so the koffi executors can import them
14
+ * without dragging Node-only deps into the static dep graph.
15
+ */
16
+ import type { NativeBridge } from "../../workspace/types.js";
17
+ /** The koffi function reference returned by `lib.func(decl)`. The
18
+ * actual call signature is controlled by the caller's declaration —
19
+ * type as variadic and let the caller cast. */
20
+ export type CFn = (...args: unknown[]) => unknown;
21
+ export interface CompiledC {
22
+ readonly fn: CFn;
23
+ /** koffi `Lib` instance — useful for binding auxiliary symbols
24
+ * (`free` from libc, allocator helpers, etc.) without re-opening
25
+ * the .so. */
26
+ readonly lib: KoffiLib;
27
+ /** Path to the .so on disk — diagnostics only. */
28
+ readonly libPath: string;
29
+ /** Cache hit (true) vs. fresh cc invocation (false). */
30
+ readonly cacheHit: boolean;
31
+ }
32
+ /** koffi's runtime-shaped lib object. Loosely typed because koffi
33
+ * doesn't ship TS types for its declaration-string API. */
34
+ export interface KoffiLib {
35
+ func(declaration: string): CFn;
36
+ }
37
+ /** Signature of the real compile-and-load. The CLI registers an
38
+ * implementation that shells out to `cc` and `dlopen`s the result
39
+ * via koffi. */
40
+ export type CompileAndLoadCImpl = (source: string, declaration: string, bridge: NativeBridge) => CompiledC;
41
+ /** Install the Node-side C-JIT implementation. Called by `cli.ts`
42
+ * during CLI bootstrap; browser bundles never call this, so `impl`
43
+ * stays null and the koffi executors decline. */
44
+ export declare function setCompileAndLoadCImpl(fn: CompileAndLoadCImpl): void;
45
+ /** Compile (or look up cached) and load. Delegates to whatever was
46
+ * registered via `setCompileAndLoadCImpl()`; throws if no
47
+ * implementation is available (= running in a browser host that
48
+ * somehow got past the koffi executor's `bridge.koffi` gate). */
49
+ export declare function compileAndLoadC(source: string, declaration: string, bridge: NativeBridge): CompiledC;
50
+ export declare function setReadCachedCSourceImpl(fn: (hash: string) => string | null): void;
51
+ export declare function readCachedCSource(hash: string): string | null;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Node-only implementation of the koffi C-JIT pipeline.
3
+ *
4
+ * Cache layout: `~/.cache/numbl/mtoc2-c-jit/<sha>.so` (one per unique
5
+ * `(declaration, source, flags)` triple). On hit, `dlopen` and reuse —
6
+ * no `cc` invocation. On miss, write `<sha>.c`, exec `cc`, then
7
+ * `dlopen`.
8
+ *
9
+ * This file is split out of `compileC.ts` so the browser bundle stays
10
+ * free of `node:fs` / `node:child_process` imports — vite/rollup
11
+ * cannot resolve them for the browser target. Browser bundles import
12
+ * only `compileC.ts` (types + a runtime-injected stub); the CLI
13
+ * imports this file at bootstrap and calls `setCompileAndLoadCImpl()`.
14
+ */
15
+ import type { NativeBridge } from "../../workspace/types.js";
16
+ import { type CompiledC } from "./compileC.js";
17
+ /** Compile (or look up cached) and load. The cache key is the SHA of
18
+ * `(flags, declaration, source)` so two different signatures or
19
+ * compile-flag sets against the same source get distinct artifacts. */
20
+ export declare function compileAndLoadC(source: string, declaration: string, bridge: NativeBridge): CompiledC;
21
+ /** Read a previously-compiled C source from disk. Diagnostic helper. */
22
+ export declare function readCachedCSource(hash: string): string | null;
23
+ /** Register both implementations with the browser-safe surface. The
24
+ * CLI imports this module at bootstrap to wire them in. */
25
+ export declare function registerNodeCompileC(): void;