Releases: vlang/v
Releases Β· vlang/v
weekly.2025.43
releases: weekly.2025.43
weekly.2025.42
releases: weekly.2025.42
weekly.2025.41
releases: weekly.2025.41
weekly.2025.40
releases: weekly.2025.40
weekly.2025.39
releases: weekly.2025.39
0.4.12
V 0.4.12
19 Sep 2025
Improvements in the language
- json2: replace encoder with a new implementation. It's 70% faster than the old json2, and 110% faster than json that is based on cJSON (#25224)
- Virtual C consts with custom types (const C.MY_CONST u8)
- Support
-div-by-zero-is-zero
, which allows forx / 0 == 0
andx % 0 == x
, avoiding division by zero traps/panics (#24981) - Limit -div-by-zero-is-zero influence to just the integer types (for f32 and f64, / produces a +inf or -inf value, and the program continues to run)
- VLS mode for the language server in pure V
- Add support for
@OS
,@CCOMPILER
@BACKEND
and@PLATFORM
(#25174)
Breaking changes
- Deprecate
gx
and replace all occurences withgg
(which now contains all the functionality ofgx
) (#24966)
Checker improvements/fixes
- Fix
sizeof(T)
usage in generic struct (fix #24806) (#24808) - Add
$if sizeof(T) == int_literal {
support (#24831) - Improve virtual C consts
- Markused,checker: fix hello world size after the introduction of
builtin.closure
in 2d87ac4 (#24989) - Remove dump() dependency from ComptimeFor (#25000)
- Cleanup - remove unused c.using_new_err_struct (#25036)
- Cleanup
err
removal (#25043) - Add comptime support for s390x, ppc64le and loongarch64 platforms (#25048)
- Allow for
v -is_o -o x mm.v
, wheremm.v
starts withmodule abc
(i.e. not justmodule main
) - Fix calls with result propagation, using other consts, in const declaration expressions (fix #21609) (#25060)
- Fix array init with interface (fix #24255) (#25073)
- Fix missing map float key duplicated checking (fix #25098) (#25117)
- Fix missing check for struct generic init from call (fix #25084) (#25119)
- Fix missing check for empty array to generic param (fix #25056) (#25118)
- Rewrite comptime_if_cond() to support comptime if cond evaluate (fix #24938) (fix #25099) (#25122)
- Add error for struct not init (fix #24893) (#25134)
- Fix sql insert expr propagate result (fix #24833) (#25136)
- Fix checking return type call disregarding unwrapping (fix #25140) (#25143)
- Ensure the defer behavior matches that of cgen (fix #25148) (#25146)
- Nil check for c.table.cur_fn in gen_branch_context_string() (fix #25170) (#25171)
- Relax the "unreachable code after a @[noreturn] call" error to a warning to reduce prototyping friction (#25173)
- Fix multi return arg passing checking (fix #25167) (fix #25180) (#25177)
- Use keywords matcher trie for imported symbol presence checks, instead of
x in p.imported_symbol
(#25201) - Fix iteration over mutable option (fix #24860) (#25199)
- Add
T.typ
andT.unaliased_typ
checking to$match
(fix #25200) (#25202) - Add more checks for map.delete (fix #25204) (#25205)
- Fix static init var (fix #25203) (#25209)
- Add top level comptime support for
$match @OS {
too (#25222) - Comptime match only eval true branch (fix #25223) (#25225)
- Fix multi return var passing to fn arg (potential fix for #24870) (#25250)
- Prevent usage of imported module name prefix as identifier names, to avoid cgen collisions (#25280)
- Disallow duplicate export names (fix #25301) (#25302)
- Reduce the verboseness of
unsupported size ... for global
messages, forv -b native examples/hello_world.v
Parser improvements
- Split parser methods to files based on topic (#24786)
- Fix arch loongarch64 comptime support (fix #24906) (#24907)
- Fix const error
- pref,parser: implement support for
-force-bounds-checking
to enable easier testing of functions tagged with@[direct_array_access]
(essentially turning off that flag) - Allow keyword as struct param key on fn call (fix #24957) (#24958)
- Fix syntax error for
for c in [othermod.Struct{field: 255}] {
(fix #24943) (#24978) - Reduce calls to util.contains_capital
- Fix overriding of fn names in
-translated
mode (fix #25024) (#25061) - Fix asm modifier parsing (allow for
=r, =&r, +r, +&r,=m,=rm,=@ccl, =*r
) (fix #25070) (#25072) - Allow using aliased types in interface method implementations (provide backwards compatibility to
ui
, during the migration of code fromgx
togg
) (#25106) - Fix interface method declaration with fixed array return type (fix #25137) (#25145)
- Prepare for eliminating a warning for
v -cross -o vc/v.c cmd/v
(part 1) (reduce CI annotation noise) - Add duplicate import symbol detect (fix #25185) (#25187)
- vfmt,parser: move mark used from vfmt to parser (#25190)
- v.ast: add a
mod
field to ast.FnTypeDecl too
Compiler internals
- scanner: fix multi-level string interpolation in if/match branch (#24805)
- markused: fix mark for array init from sumtype (fix #24887) (#24889)
- markused: whitelist
_option_none
too (fix #24862) (#24885) - markused: remove
@[markused]
from option and result fns (#24900) - markused: skip unused symbols, dump fns and generic specialization (fix #24921) (fix #24927) (#24924)
- parser,markused: support
@[markused]
for interface declarations too (#24963) - markused: fix interface fields and chan usage (fix #24961) (#24962)
- v.builder: add a clearer error message for
v -shared run empty.v
(issue found by Felipe Pena) - markused: use eprintln for
PANIC DEPS
too (for consistency and easier redirection for the whole trace) - v.util: add support for setting VUTIL_RETRY_MAX_COUNT=1 to ease the workflow for developing backends
- markused: improve the tracking of used closures (#25009)
- markused: improve array resources tracking + remove all_fns loop for orm (#25007)
- markused: fix generic map index (fix #25012) (#25022)
- markused: improve array tracking (range, gated) (#25023)
- markused: fix option tracking on sumtype (fix #25025) (#25028)
- markused: fix thread type mark by go/spawn expr (fix #25049) (#25054)
- scanner: refactor string interpolation (fix #24198) (#25053)
- markused: fix array append c code dependency (fix #25057) (#25058)
- markused: fix option array element (fix #23089) (#25179)
- markused: fix option map value (fix #25186) (#25188)
- parser,fmt,markused: add top level comptime
$if
support (enable$if platform { import module struct Abc {} }
) (#25216) - v.builder: add -DNO_DEBUGGING in addition to -DNDEBUG, when compiling with -prod
- v.builder: support
-d trace_type_symbols_after_checker
- scanner: uncomment working rune test (#25305)
- v.util: fix handling of "start \u005c${...} end" in cgen (fix #25304) (#25306)
- markused: fix marking of mutable generic method calls (fix #25312) (#25314)
Standard library
- x.crypto: initial addition of curve25519 module (#24748)
- thirdparty: add NDEBUG check before glGetErrorCode if-statement in sokol_gfx.h (#24754)
- math.big: remove unnecessary code from / and % (the same is done in div_mod, which they call) (#24766)
- builtin: add a rune iterator method to strings, allowing
for for i, r in s.runes_iterator() {
without first allocating an array for all the runes (#24769) - builtin: support
-d builtin_free_nop
to help diagnose problems with too early manual free() calls - builtin: use s.runes_iterator() in trim_runes/2 to avoid needless allocation
- builtin: add string.expand_tabs() (#24781)
- os: do not resolve symlinks in os.find_abs_path_of_executable/1 (fix #24759) (#24761)
- os: improve documentation (#24790)
- gg: allow for
-d gg_memory_trace_frame
to be used in combination with-prealloc -d prealloc_dump
- sync: add SpinLock (#24788)
- os: fix documentation for environ function (#24796)
- sync: fix documentation for new_spin_lock function (#24795)
- sync: add implementation for WaitGroup.go/1, add test (#24797)
- sync: improve documentation (#24799)
- sync: fix spin lock, add destroy() and try_lock(), add valgrind annotate support (#24798)
- os: add os.write_bytes/2 as a complement to os.read_bytes/1, add test
- sync: use SpinLock for channel (fix #24680) (#24802)
- crypto: fix ambiguous expressions in DES implementation (#24814)
- sync: use an atomic counter in test_waitgroup_go in waitgroup_test.v
- datatypes: add lockfree version of counter and ringbuffer (#24839)
- sync: add thread local storage (TLS) support (#24849)
- math.unsigned: fix rotate_left() for uint256, add test (#24872)
- math.unsigned: replace untested comments for uint256 public APIs (#24873)
- log: use
@[noinline]
for level_from_tag/1 and target_from_label/1 to avoid triggering panics for programs usinglog
, compiled with -prod and -cc gcc>10 (fix 8000 #24874) - math.big: fix toom-cook 3-way multiplication (#24888)
- runtime: add used_memory() (#24897)
- runtime: add note for the availability of the used_memory implementation (#24913)
- os: remove commented code in home_dir() function (#24929)
- math.big: fix the order of calculations in mod_pow() to improve performance (#24935)
- math.big: add shrink zeros to karatsuba and toom-cook (#24937)
- math.big: fix big_mod_pow() (#24939)
- os,runtime: move some C struct and fn def to
builtin
(#24942) - math.big: fix validate_string and integer_from_regular_string (check for characters.len > 0, before accessing characters[0])
- builtin: prepare for adding a
-force-bounds-checking
option - strconv: fix bounds check bug, discovered by the equivalent of
./v -g -force-bounds-checking test vlib/toml/
(thanks to tankf33der) - builtin: fix OOB bugs in s.is_bin, s.is_oct, s.is_hex, discovered through
./v -force-bounds-checking test vlib/builtin/
- regex: fix OOB bug discovered through
./v -g -force-bounds-checking vlib/regex/
(fix by @penguindark) (#24960) - time: fix custom_format panic (fix #24977) (#24987)
- time: fix more panics in the supported specifiers in Time.custom_format/1 (#24988)
- vlib: add
archive.tar
module to enable reading of .tar ang .tar.gz files (#24995) - builtin: fix warnings for
./v doc -m -f html vlib/builtin/
- sokol.gfx: set the missed array_count field too in the
set_vert_uniform
andset_frag_uniform
APIs (#25019)
...
weekly.2025.38
releases: weekly.2025.38
weekly.2025.37
releases: weekly.2025.37
weekly.2025.36
releases: weekly.2025.36
weekly.2025.35
releases: weekly.2025.35