Project

Architecture

How source moves from text to interpreter or native execution.

01

EN / PT: Shape-only left division

EN: Binary A\B evaluates left then right once, bypassing overloaded session functions; the named mldivide alias can be shadowed. Shape alone selects exactly square protected LU solve or rectangular default SVD lsqminnorm; no general MATLAB dispatch, singular-square SVD fallback or automatic Cholesky. Interpreter only, no C ABI change. PT: A\B binario avalia esquerda e direita uma vez e ignora sobrecargas de sessao; o alias mldivide pode ser sombreado. Somente a forma seleciona solve LU quadrado ou lsqminnorm SVD retangular padrao, sem despacho geral MATLAB, fallback SVD de quadrada singular ou Cholesky automatico. Somente interpretador; ABI C igual.

02

Language pipeline

  • sun-lexer produces spanned tokens.
  • sun-parser builds the AST.
  • sun-runtime evaluates the AST against a RuntimeHost.
  • sun-codegen-llvm lowers a supported subset.
  • The native executable links a small C runtime ABI.
03

Runtime hosts

Hosts own output, pauses, file effects, optional figures and function-file resolution. The runtime remains parser-independent; the CLI loads and validates source using canonical project contexts. Definitions are cached only for the current execution.

Studio uses a persistent protocol-v2 engine with negotiated capabilities. Incremental figure and panel events update one figure without retransmitting its entire data. Multiple outputs bind ordinary values together after result validation; they do not add a tuple type.

04

EN / PT: Numerical backend

EN: LU uses nalgebra partial row pivoting with positive per-column scaling and U rescaling. Cholesky mirrors the selected triangle, equilibrates diagonally and locates a failed leading minor by bounded binary search calling nalgebra Cholesky, not a custom factor engine. Masks avoid discarded L/U/P or Cholesky factor materialization; requested LU P is size checked before decomposition. Cancellation is not inside the backend. Square solve/inv/det now use the same protected column-scaled LU, a per-column pivot cutoff, LU try_inverse and balanced libm frexp/scalbn determinant accumulation. Native LLVM and C ABI are unchanged; use sun run.

PT: LU usa nalgebra e escala positiva por coluna; Cholesky espelha o triangulo selecionado, equilibra diagonal e busca a falha por busca binaria limitada usando nalgebra. Mascaras evitam fatores descartados; P de LU e validada antes da decomposicao. Sem cancelamento interno ao backend. solve/inv/det agora usam a mesma LU com escalas protegidas por coluna, corte de pivo por coluna, LU try_inverse e acumulacao balanceada libm frexp/scalbn. LLVM nativo e ABI C permanecem iguais; use sun run.

05

Developing areas

Semantic analysis, a stable intermediate representation, richer native coverage, and broader graphics remain active milestones.

Sun is proprietary software under experimental development. Documentation scope: Sun 0.6 development snapshot.