2026.05.13¶
~literalizer.HaskellCURRIED~literalizer.CallStylenow emits a thunk binding (process :: IO Val/process = ...) for zero-parameter calls instead of a malformed signature with an empty argument type (process :: -> IO Val).~literalizer.literalizenow raises~literalizer.exceptions.WrapInFileWithoutVariableNotSupportedErrorwhenwrap_in_file=Trueis combined withvariable_form=Nonefor a target language that cannot represent a bare value at file-statement scope. Each~literalizer._language.Languagedeclares its ability to render this shape via a newsupports_no_variable_wrap_in_fileflag. Strict-typed compiled languages (Rust, C, C++, Haskell, OCaml, Swift, Ada, D, Dart, C#, Elm, Mojo, Nim, Objective-C, Odin, SML, V, Zig, Go, Java, Kotlin, F#, Scala, Erlang, Gleam, Roc, PureScript, Tcl, Bash, VB, SystemVerilog, Occam) opt out, along with Cobol, Fortran, Php, Lua, Toml, and Dhall, each of which produced a file whose linter rejected the resulting bare-value rendering even though the issue text initially listed them as opt-in. The renderer no longer silently emits invalid output for any of these.~literalizer.Haskell,~literalizer.FSharp,~literalizer.OCaml, and~literalizer.Smlnow expose aCURRIED~literalizer.CallStylealongside the existingPOSITIONALmember. Selecting it emits curried application calls (process arg1 arg2) with curried stubs in place of the tuple form.~literalizer.Haskelldefaults toCURRIEDsince curried application is the idiomatic call form in Haskell; F#, OCaml, and SML keepPOSITIONALas the default.~literalizer.Elm~literalizer.literalize_callnow emits curried-application calls (process (EInt 1) (EInt 2)) with curried type stubs (process : a -> b -> ()) in place of the prior tuple-form (process (EInt 1, EInt 2)). Elm tuple literals cap at three elements, so the tuple form had no representation for calls with four or more parameters; the curried form composes naturally with|>and matches the convention used byelm-formatand the standard library.The
Language.max_call_parametersattribute has been removed. No remaining language sets a maximum parameter count, so the upstreamUnsupportedCallShapeErrorcheck in~literalizer.literalize_calland the correspondinglanguage_cls.max_call_parametersintrospection no longer have a load-bearing caller.The
supports_commented_dict_call_argsflag has been removed fromLanguage. Every (language, shape) pair previously dropped by the test-discovery filter on this flag is either already short-circuited by an earlier exception path or now renders cleanly, leaving the flag with no load-bearing callers.~literalizer.literalize_callnow raises~literalizer.exceptions.UnsupportedCallShapeErrorwhen the innermost segment oftarget_functioncollides with one of the target language’s reserved identifiers. The renderer previously produced output that would not parse in the target language.~literalizer.literalize_callnow raises~literalizer.exceptions.UnsupportedCallShapeErrorwhen acall_transformwrapper is supplied for a language whose calls are statements rather than expressions (i.e.call_returns_expressionisFalse). The wrapper cannot consume the call as a value in that case, and the renderer previously emitted invalid output.~literalizer.literalize_callno longer rejects identitycall_transformvalues on Ada, Fortran, and SystemVerilog. Bare procedure-call statements (Process(x);,call process(x),process(x);) are valid in all three languages, so the prior rejection encoded a constraint that does not exist. TheLanguage.allows_bare_call_statementflag introduced alongside that check has been removed.The PureScript, Roc, and Elm wrapped-call indent helpers no longer carry defensive branches for blank or whitespace-leading lines. These helpers only ever receive single-line call expressions from
literalize_call(which usesCollectionLayout.COMPACTfor wrapped calls and rejects standalone comments in that path), so the empty-line and continuation arms were unreachable via the golden integration cases. Four unit tests intests/test_languages.pythat drove the Elm helpers directly with constructed multi-line input have been removed in favor of the existing golden-file contract.Mojo~literalizer.literalize_callnow supports refs nested inside dict literals and commented dict-literal call arguments. The typed-stub changes merged in #1972 made both shapes compile cleanly undermojo run --Werror, so the correspondingsupports_call_refs_in_dict_literalsandsupports_commented_dict_call_argsflags flip toTruefor Mojo and two newcall_*golden cases are exercised.MojoandC++~literalizer.literalize_callno longer wrap a consumable$refin the language’s consume form when the underlying value’s type would make the wrapping a hard error or aclang-tidylint failure. In Mojo,^is dropped for register-trivial scalars (Int,Bool,Float64) because Mojo 0.26.1.0+ rejects “transfer from a value of trivial register type” under--Werror. In C++,std::moveis dropped for register-trivial types (bool, integer,double,std::chrono::year_month_day,std::chrono::system_clock::time_point) whichperformance-move-const-arg/hicpp-move-const-argreject. Non-trivial refs (e.g.List[...],Dict[...], strings, bytes) keep their consume form.Languageexposes a new~literalizer._language.Language.consumable_ref_value_inhibits_consuming_formpredicate that languages override to opt into per-value routing; the default (~literalizer._language.never_inhibits_consuming_form) preserves the existing behavior.Renamed
VariableTypeHints.AUTOtoVariableTypeHints.NEVERfor every language. The behavior is unchanged; the new name describes the option (no annotation, defer to the language’s inference) rather than implying intent, and pairs symmetrically withALWAYS.Every language’s
VariableTypeHintsenum now exposes a third value,SAFE, alongsideNEVERandALWAYS.SAFEannotates only when the language’s own inference would widen the variable to a permissive type (e.g.unknown[]for an empty TypeScript array,Object[]for an empty Java array), making downstream consumption safer thanNEVERwithout the noise ofALWAYS. The predicate is per-language:TypeScriptandJavaannotate empty list / set / dict literals; for every other languageSAFEcurrently produces the same output asNEVERwhile leaving room for a future per-language predicate.Nim~literalizer.literalize_callnow emits the object-varianttypedeclaration when theOBJECT_VARIANTheterogeneous strategy is active, so the rendered call references a defined wrapping type.Mojotyped call stubs now coverbool,float,bytes,date, anddatetimeargument values (mapped toBool,Float64, andStringrespectively), and apply to dotted-method stubs as well as free-function stubs. The generic[*Ts: AnyType](*args: *Ts)form is still emitted when scalar types disagree across calls or any argument is non-scalar.Mojo~literalizer.Language.format_call_preamble_stubnow raises~literalizer.exceptions.HeterogeneousScalarCollectionErrorunder the defaultERRORheterogeneous_strategywhen concrete Mojo argument types diverge across calls at one parameter slot (including divergent shapes such as scalar in one call and list in another).VARIANTcallers continue to fall back to the generic[*Ts: AnyType](*args: *Ts)form for cross-call divergence pending follow-up wrap machinery.~literalizer.literalize_callnow raises a typed~literalizer.exceptions.UnsupportedCallShapeErrorwhenwrap_in_file=Trueand the YAML source carries standalone comments but the target language setssupports_standalone_comments_in_wrapped_calls = False(currentlyElm,Erlang,Haskell,Jsonnet,PureScript, andRoc).~literalizer.LiteralizeResultnow exposes~literalizer.LiteralizeResult.contains_standalone_commentsso callers that wrap manually via~literalizer.Language.wrap_calls_with_declarationscan apply the same guard.~literalizer.literalizenow raises a typed~literalizer.exceptions.VariableNameNotSupportedErrorwhenvariable_formis supplied but the target language setssupports_variable_names = False(currentlyJson5,Jsonnet, andYaml). The capability flag is now enforced rather than declarative.supports_variable_namesis nowTrueonClojure,CommonLisp,Julia,Racket,Ruby, andScheme, reflecting that these languages do support named variable wrapping vialiteralize’svariable_formargument (and have golden files exercising that behavior).Separated syntactic
ref_casevalidity from stylistic preference.~literalizer.Languagenow exposes~literalizer.Language.supported_ref_cases– a frozenset of cases that produce a syntactically legal identifier – alongside the existing~literalizer.Language.identifier_cases, which now documents stylistic preference only.literalizeandliteralize_callvalidateref_caseagainstsupported_ref_cases, so cases that are syntactically legal but non-idiomatic (e.g.IdentifierCase.CAMELin Python) are now accepted. Two shared constants,~literalizer.NON_KEBAB_REF_CASESand~literalizer.ALL_REF_CASES, cover the common settings.~literalizer.literalize_callnow raises a typed~literalizer.exceptions.DottedCallTargetNotSupportedErrorwhentarget_functioncontains a dot but the target language setssupports_dotted_calls = False(currently onlyHcl). The capability flag is now enforced rather than declarative.~literalizer.literalize_callnow raises a typed~literalizer.exceptions.DottedCallStubNotSupportedErrorwhencall_transformproduces a dotted wrapper name (e.g.tracer.emit) but the target language setssupports_dotted_call_stub = False. The capability flag is now enforced rather than declarative.~literalizer.literalize_callnow raises a typed~literalizer.exceptions.FreeFunctionCallNotSupportedErrorwhencall_transformproduces a bare wrapper name with no dot (e.g.emit) but the target language setshas_free_function_calls = False(currently onlyWren). The capability flag is now enforced rather than declarative.Removed the redundant
supports_default_set_element_type,supports_default_sequence_element_type,supports_default_dict_value_type,supports_default_dict_key_type, andsupports_default_ordered_map_value_typeclass attributes fromLanguageClsand all language implementations. Direct constructor calls already surface unsupporteddefault_*_typekeyword arguments through type checking, making these probe flags unnecessary.~literalizer.literalize_callaccepts a newref_valuesmapping from{"$ref": "name"}identifiers to the source values declared elsewhere. Supplied ref values now participate in data-driven preamble inference, so generated body declarations such as Haskell’sdata Val = ...include types reachable only through refs while the rendered call still emits the bare identifier.