Language reference

Data types

Current Sun runtime classes and the roadmap for typed arrays.

01

EN / PT: Bounded real sparse matrices

EN: Stage 5 Value::Sparse stores rows, cols and sorted unique finite nonzero triplets; class is double, issparse is true. Logical rows*cols<=16777216 and input/stored triplets<=1000000, not unbounded sparse storage. See /language/sparse-advanced-solvers for sparse/full/issparse/nnz and solver boundaries. Studio read-only sparse metadata is upcoming, not an editable grid.

PT: Value::Sparse da etapa 5 guarda rows, cols e tripletas ordenadas unicas finitas nao zero; classe double, issparse true. Produto logico rows*cols<=16777216 e tripletas de entrada/armazenadas<=1000000, nao armazenamento ilimitado. Veja /language/sparse-advanced-solvers para sparse/full/issparse/nnz e limites dos solvers. Metadados esparsos somente leitura no Studio estao previstos, nao grade editavel.

02

Current runtime classes

Sun stores real and complex scalars/arrays as double-precision values. Logical values have dense 2D array storage. Strings remain scalar, and runtime exceptions use the SunException class. Stage 4 adds scalar structs, 2D cells, string-key maps, tables, explicit null and UTC datetime scalars; see /language/data-and-files for the bounded subset.

  • double: real scalars/arrays and complex scalars/arrays
  • logical: boolean scalars and dense logical arrays
  • string: UTF-8 text scalars (char converts to the same type)
  • struct, cell, containers.Map, table: value-copy containers
  • null: explicit null, not []
  • datetime: canonical UTC scalar
  • SunException: caught runtime exceptions
03

Identify a value

class returns the exact runtime class. isa accepts exact names and the numeric categories numeric, float, and integer.

Sun
disp(class(3.5));              % double
disp(class(true));             % logical
disp(isa([1, 2], "numeric")); % true
disp(isa(1, "integer"));     % false
04

Convert and inspect components

double preserves double arrays and converts logical scalars/arrays to 0 or 1. real, imag, and conj preserve complex-array shapes. char and string convert scalar text, finite numbers, logicals, datetime and null to scalar Unicode text; they do not introduce MATLAB character arrays or string arrays.

Sun
mask = [true, false];
disp(double(mask));       % [1, 0]
z = [1+i, 2-i];
disp(real(z));
disp(imag(z));
05

Type roadmap

  • Advanced signal processing and mature complex linear algebra beyond FFT/eig/roots; see /language/spectral-statistics
  • Typed dense arrays for single, half, and signed or unsigned integers
  • Separate character arrays and string arrays
  • Datetime arrays, arithmetic, durations and categorical arrays
  • Struct arrays, timetables, joins and OOP beyond the Stage 4 scalar/container subset
  • Time series and broader map APIs
Support boundary

Logical and complex arrays support interpreter operations and Studio cell editing. Container previews are read-only. Headerless numeric CSV, graphics, parfor output matrices and native LLVM retain their existing real-double restrictions; Stage 4 table I/O has its own limited logical/text/null support. Numerical reductions currently accept real and logical inputs, not complex arrays.

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