2026.04.29¶
~literalizer.literalizenow accepts aref_caseparameter (~literalizer.IdentifierCase). When set, any{"$ref": "name"}mapping in the input data – at the top level or nested inside dicts and lists – is rendered as a bare identifier instead of a literal dict. The identifier is case-converted to match the language’s conventions (e.g.my_varbecomesmyVarfor JavaScript). Languages apply their own sigil prefix viaformat_call_ref_identifier(e.g.$my_varfor PHP). Withoutref_case,$refmappings are treated as ordinary literal dicts, preserving backwards compatibility. Passing a case not inlanguage.identifier_casesraises~literalizer.exceptions.UnsupportedIdentifierCaseError.Added support for Roc as a new output language.
Rocemits aValtag-union type alias (RNull,RBool,RInt,RFloat,RStr,RList,RDict,RSet) inside the module body, exposing the generated value viamodule [my_data]. Calls use the space-separated command syntax with each argument wrapped in parentheses (process (RInt 1) (RInt 2)), with module-level stubs of the formname : a, b -> {}. A newlint-rocjob in.github/workflows/lint.ymlrunsroc checkagainst every.rocfixture using the upstream nightly tarball.C, C++, Objective-C, and D fixtures now emit a
mainentry point directly (int main(void)/int main()/void main()) instead of acheck_()/_check()function that required a separate per-language driver script. Haskell non-call fixtures now appendmain = seq my_data (return ())to the module, and SML fixtures are emitted as top-level declarations ending withval _ = my_datainstead of inside astructure Check = struct … endwrapper. All six driver scripts (c_main.c,cpp_main.cpp,objc_main.m,d_main.d,sml_force.sml,sml_main.mlb,sml_call_main.mlb) have been removed. CI now compiles and runs each fixture directly without a linking step against a driver object.run_haskell.pyhas been removed; the CI now copies each Haskell fixture to a temporary workspace (renaming to match its unique module name), generates aMain.hsdriver that imports every fixture qualified and calls itsmain, and compiles and runs them all in a singleghcinvocation.Ada output now uses Ada 2022 container aggregates (
AList'[...],AMap'[...],ASet'[...]) and emits awith A_Stub; use A_Stub;context clause so each fixture compiles and runs against a checked-in stub package. The lint workflow gained a “Run Ada files” step that builds and executes every fixture, replacing the previous syntax-only check. The combined declaration + assignment wrapper now keeps both forms in a single procedure scope so the assignment can reachmy_data.Jsonnetnow emits$refdeclarations as top-levellocalbindings before the call expressions, so call-mode output withref_declarationsis supported. Previously the integration harness skippedJsonnetfor ref-declaration cases because the array-wrapped output had no place for variable bindings. TheDeclarationStyles.ASSIGNtemplate changed from{value}tolocal {name} = {value};, andJsonnetnow overrideswrap_calls_with_declarationsto emit those bindings beforewrap_in_filewraps the calls in[ … ].C single-name call stubs (e.g.
emit,process) are now emitted asstaticdefinitions with a stub body instead of bare forward declarations, so generated fixtures can be linked and run. The lint workflow now compiles each C fixture against a smallc_main.cdriver and executes the resulting binary, surfacing runtime errors that the previous-fsyntax-onlycheck missed.Crystal.wrap_in_filenow wraps content in amodule Check ... endblock withextend self, matching what Erlang, Scala, and Haskell already do.Crystalgains amodule_nameconstructor argument (default"Check") to control the wrapper name. Callers that relied onliteralize(language=Crystal(), wrap_in_file=True)returning bare content will now receive amoduleblock.Java sets and dicts no longer emit a trailing comma when
trailing_comma=TrailingCommas.YESis requested.Set.of(...)andMap.ofEntries(...)are method calls and the previous output was rejected byjavac.SetFormatConfigandDictFormatConfiggain asupports_trailing_commafield (defaults toTrue) mirroringSequenceFormatConfig; formats built around method-call syntax can opt out.Added
CallStyleEnumas the base class for per-languageCallStylesenums. Itsconfigaccessor returns the enum member’s value typed as theCallStyleunion, removing thecast("CallStyle", self.call_style.value)boilerplate previously duplicated in every multi-style language module.module_namehas moved from a parameter onliteralizeandliteralize_callto a constructor argument on the ten languages whosewrap_in_fileintroduces a named scope:C,Cpp,D,Erlang,Fortran,FSharp,Java,ObjectiveC,OccamandSystemVerilog. Pass it when constructing the language (e.g.Java(module_name="Foo")); it defaults to"Module". Languages whose wrappers do not introduce a named scope no longer acceptmodule_nameat all, so passing it where it has no effect is now aTypeErrorinstead of being silently ignored.Language.wrap_in_fileandLanguage.wrap_combined_in_filelose themodule_nameparameter; the named-scope languages readself.module_nameinstead. Languages must now be instantiated before being passed toliteralize(language=Python()rather thanlanguage=Python).OCaml integer values outside the signed 64-bit range now raise
UnrepresentableIntegerErrorinstead of emitting anint_of_stringfallback that overflowed OCaml’s 63-bit nativeintat runtime and silently misrepresented the data.literalize_callnow supports Visual Basic. The default style is positional (foo(1, 2));VisualBasic.CallStyles.NAMEDenables VB’s named-argument syntax (foo(x:=1, y:=2)). Generated stubs are emitted as module-levelClassandFunctionblocks and the call body is placed insideSub _calls()because VB does not allow bare expression statements at module scope.Added
literalize_callsupport forZig.Zig.CallStylesnow exposes aPOSITIONALmember backed byPositionalCallStyle, andformat_call_preamble_stubemits file-scope Zig stub declarations because Zig disallows nested function definitions insidemain. Dotted targets likeapp.client.fetchare realized as a nestedstructchain rooted at a module-level constant, and call arguments are wrapped in theZValunion so anonymous union literals coerce to a concrete type at the call site.literalize_callnow emits R stub declarations (name <- function(...) NULL) for the called function and any call-transform wrappers, so generated R call output runs cleanly underRscriptwithoutcould not find functionerrors.Removed
R.TrailingCommas.YES: R’slist()rejects empty arguments, solist(1, 2,)parses but raises at runtime. OnlyR.TrailingCommas.NOremains.Fixed Dhall typed-empty literals for doubly-nested lists. Input like
[[[1, 2]], [], [[3, 4]]]previously rendered the empty sibling as[] : List List Integer, which is invalid Dhall (parses as(List List) Integer). The innerListtype is now parenthesized, producing[] : List (List Integer).infer_element_typeno longer gives up when a nested list is empty alongside non-empty homogeneous siblings: empty inner lists are now skipped during inference, so input like[[1, 2], [], [3, 4]]resolves toListType(inner=int)instead of falling back toNone(mixed types). When the rendered list literal contains an empty inner list beside non-empty list siblings, the empty inner now inherits the typed sequence opener of its siblings, so generated literals type-check cleanly under strongly typed languages (new int[]{}instead ofnew Object[]{}for Java,std::vector<int>{}for C++,[]int{}for Go,vec![]for Rust,New Integer() {}for Visual Basic, etc.).Documented the preamble-duplication sharp edge that arises when a caller composes
literalize(declaring a{"$ref": "name"}variable) withliteralize_call(referencing it) into a single source file: each call independently computes its ownpreambleandbody_preamble, so the combined output contains duplicates that strict compilers reject and a linter flags. Theliteralize_callreference now points at the new “Composing declarations and calls” section indocs/source/function-call-use-case.rst, which shows a worked Haskell example with the combinedbody_preambleblocks already deduplicated.CommonLispnow wraps{"$ref": "name"}identifiers in earmuffs (*name*) at the call site so they resolve to the matchingdefparameterdeclaration.CommonLispis no longer skipped by theliteralize_callreference-argument integration tests, which now lint cleanly under SBCL.Erlangnow capitalizes{"$ref": "name"}call arguments so they reference the declared variable instead of parsing as a lowercase atom, matching the existingMy_var = ...capitalization on the declaration site.Erlang.format_variable_declarationnow emits the trailing,separator itself so multiple declarations can precede a call;Erlang.wrap_in_fileis adjusted accordingly and the rendered output is unchanged for the single-declaration case.Perlliteralize_calloutput now emits Perl’s scalar$sigil before each{"$ref": "name"}identifier via aformat_call_ref_identifieroverride, so a ref tomy_varrenders as$my_varat the call site and lines up with themy $my_var = ...declaration site. Generated files now passperl -cunderuse strictandPerlis no longer excluded from the integration suite’s ref-declaration golden cases.Added
literalize_callsupport forMatlab.Matlab.CallStylesnow has aPOSITIONALmember backed by aPositionalCallStyle, andformat_call_stubemitsname = @(varargin) [];assignments so every target (including dotted paths likeapp.client.fetch) is a bound function handle before it is invoked. MATLAB’s auto-vivifying struct-field assignment means a single line defines the entire chain regardless of depth, so the stub is one statement per call target.lint-purescriptin.github/workflows/lint.ymlnow runs each PureScript fixture end-to-end. A newRun PureScript filesstep compiles each fixture withpurs compileand loads the resultingCheckmodule in Node so its top-levelmy_databinding is evaluated, catching foreign-implementation failures and other load-time crashes that the existingcheck_purescript_syntax.pycompile-only check would miss. The shared Prelude stub used by both steps lives in a newpurescript_common.pymodule.Added a
benchmarksjob to.github/workflows/ci.ymlthat runs thetests/benchmarks/suite under CodSpeed viapytest-codspeed. The job posts a per-benchmark performance delta on every pull request, making it easier to spot regressions in the YAML fast path, JSON formatting, and heterogeneous-widening logic.C,Cpp, andObjectiveCwrap_in_file/wrap_combined_in_fileoutput now emits(void)<variable_name>;after the declaration (and between the declaration and the re-assignment in the combined form) so the initial value is read before it is overwritten. clang-tidy’sclang-analyzer-deadcode.DeadStorescheck, previously suppressed in.clang-tidybecause the combined form and unused C++ scalars triggered dead-store warnings, is now enforced.