2026.05.16

  • ~literalizer.Elm now accepts variable_form on ~literalizer.literalize_call, emitting the inference-style binding my_data = make_widget (EInt 42) without a name : Val annotation (the call’s return type is not known to the renderer). A wrap_in_file=True Elm scaffold places the binding inside the main let block so the call is still exercised when the module is run. See #2245.

  • ~literalizer.Cpp now supports the TUPLE heterogeneous_strategy: a fixed-length heterogeneous scalar array that is a dict value or the document root is rendered as std::make_tuple(...) typed std::tuple<T0, ...> (with #include <tuple> emitted by the data-dependent preamble) instead of std::vector<std::variant<...>>. C++’s TUPLE strategy does not compose RECORD, so the preamble fires off the tuple ids alone, even when the data has no record-shaped dicts. The default (ERROR) std::variant output is unchanged. See #2329.

  • ~literalizer.Scala now supports the TUPLE heterogeneous_strategy, which composes RECORD: a fixed-length heterogeneous scalar array that is a record field, another dict value, or the document root is rendered as a native tuple (e0, e1, ...) typed (T0, T1, ...) (a tuple-valued case class field is declared with the tuple type) instead of raising or widening to List[Any]. Scala 3 (the only version this language targets) imposes no tuple-length limit – lengths past 22 are transparently backed by TupleXXL – so every fixed-length heterogeneous scalar array is representable. The default (ERROR) output is unchanged. See #2330.

  • ~literalizer.TypeScript now supports the TUPLE heterogeneous_strategy: a fixed-length heterogeneous scalar array that is a dict value or the document root is rendered as an [e0, e1, ...] as const tuple literal, which TypeScript infers as a readonly [T0, T1, ...] tuple type, instead of a widened (T0 | T1)[] array. TypeScript has no RECORD strategy and as const needs no imports, so there is no data-dependent preamble. The default (ERROR) union-array output is unchanged. See #2328.

  • ~literalizer.Kotlin now supports the TUPLE heterogeneous_strategy, composing RECORD: a fixed-length heterogeneous scalar array that is a dict value or the document root is rendered as a two-element Pair(...) or three-element Triple(...) typed Pair<...> / Triple<...>, and a record field whose value is such an array becomes a tuple-typed field. Kotlin has no general N-tuple, so an array of any other length raises ~literalizer.exceptions.TupleArityNotRepresentableError rather than degrading to a homogeneous list. The default (ERROR) output is unchanged. See #2331.

  • ~literalizer.literalize_call gains a comment_source argument: a sequence of trailing source-code comments, one per generated call, paired positionally. Each non-empty entry is emitted as a line comment after the statement terminator using the target language’s comment syntax (#, //, --, …), falling back to that language’s block-comment form (/* ... */) where there is no line comment. This places the comment where only the core can put it – a call_transform only sees the pre-terminator call expression, so a transform that appended a line comment would have the terminator commented out. An empty entry emits no comment. A length mismatch raises ~literalizer.exceptions.CommentSourceLengthMismatchError and a multi-line entry raises ~literalizer.exceptions.CommentSourceMultilineError. Languages that assemble the call sequence into a single clause/list/expression (so a separator, terminator or closer would follow the comment on the same line and be swallowed) reject a non-empty comment_source with ~literalizer.exceptions.UnsupportedCallShapeError; the supported set is the languages whose ~literalizer.Language.supports_standalone_comments_in_wrapped_calls is True. See #2369.

  • ~literalizer.FSharp now accepts variable_form on ~literalizer.literalize_call for both ~literalizer.NewVariable and ~literalizer.ExistingVariable, emitting the inference-style binding let my_data = make_widget(42) without the name: Val type annotation or tagged-enum constructor wrapper that literal bindings use (the call’s return type is not known to the renderer). Existing literal-binding output for F# is unchanged. See #2249.

  • ~literalizer.PureScript now accepts variable_form on ~literalizer.literalize_call, emitting the inference-style binding my_data = make_widget (PInt 42) without a name :: Type annotation (the call’s return type is not known to the renderer). wrap_in_file=True PureScript scaffolds add import Prelude so the call stub’s Unit result type resolves; literal-binding output is unchanged. See #2247.

  • ~literalizer.Rust under the RECORD heterogeneous_strategy now raises ~literalizer.exceptions.UnrepresentableInputError for a set-valued record field, and for a record field whose value is a dict that is not record-eligible (empty, non-string-keyed, or an ordered map), instead of emitting a struct whose declared field type disagrees with the rendered HashSet/BTreeSet/HashMap literal and fails to compile.

  • ~literalizer.Roc now accepts variable_form on ~literalizer.literalize_call, emitting the inference-style binding my_data = make_widget (RInt 42i128) without a my_data : Val annotation (the call’s return type is not known to the renderer, and Roc infers it). The Val tag-union alias is omitted from such scaffolds because nothing annotates with : Val; existing literal-binding output is unchanged. See #2250.

  • ~literalizer.Sml now accepts variable_form on ~literalizer.literalize_call, emitting the inference-style binding val my_data = make_widget(42) without the : val_t annotation or datatype constructor wrapping used for literal bindings (the call’s return type is not known to the renderer, so SML infers it). See #2248.

  • ~literalizer.OCaml now accepts variable_form on ~literalizer.literalize_call, for both ~literalizer.NewVariable and ~literalizer.ExistingVariable, emitting the inference-style binding let my_data = make_widget(42) without the : val_t annotation or tag constructor used for literal bindings (the call’s return type is not known to the renderer, so OCaml infers it). The call-binding bypass now also covers the assignment template via the new format_call_variable_assignment hook, so OCaml’s non-bare let x : val_t = ... assignment no longer leaks a tag constructor onto a call result. Existing literal-binding output for every language is unchanged. See #2246.

  • ~literalizer.Java and ~literalizer.Scala no longer emit output that fails to compile for a post-2038 ~datetime.datetime under the RECORD heterogeneous_strategy with datetime_format=EPOCH. The epoch seconds now carry the language’s wide-integer suffix and the record component widens accordingly (long / Long) once the value leaves signed 32-bit range, so the declared component type always matches the rendered literal. In-range epochs are unaffected. See #2338.

  • ~literalizer.Go no longer emits output that fails to compile for a record field holding a positive integer beyond the signed 64-bit range under the RECORD heterogeneous_strategy. Such a value renders through the uint64(...) overflow fallback, and the generated struct field is now typed uint64 to match it instead of int / int64. Record integer fields formatted with a non-default integer_format, numeric_separator or numeric_literal_suffix keep their value-derived field type. In-range integers are unaffected. See #2306.

  • ~literalizer.Kotlin, ~literalizer.Java and ~literalizer.Scala no longer emit output that fails to compile for a record field holding an integer beyond the signed 64-bit range under the RECORD heterogeneous_strategy. The generated data class / record / case class field is now typed BigInteger / BigInteger / BigInt to match the arbitrary-precision overflow-fallback literal instead of Long / long. In-range integers are unaffected. See #2376.

  • Internal: the RECORD heterogeneous_strategy no longer threads the already-formatted field literal into the field-type hook. ~literalizer.Kotlin now derives each generated data class field’s declared type structurally from the raw value through its own collection openers and scalar mapping (matching the Go/Java/Scala ports), and the formatted string is dropped from the renderer contract. No generated output changes. See #2305.