Skip to content

Releases: vlang/v

0.5.1

09 Mar 10:10

Choose a tag to compare

V 0.5.1

9 Mar 2026

Improvements in the language

  • New clean and fast v2 backends: cleanc (similar to the old C backend), ssa/arm64, ssa/amd64. cleanc backend can already self host!
  • Add a new generic solver stage (gated behind -new-generic-solver) (#26280)
  • Refactor $var to ${var} across entire repository, make vfmt always output the newer form ${expr} (#26494)
  • Fix support for match exprs with nested if exprs (#26599)
  • Add OS-specific headers support for #include directives (#26654) (fixes #26562)

Checker improvements/fixes

  • Fix compiler panic on wrong arg count with or block (#26665)
  • Support gotodef for fn param and []Type (#26193)
  • Error for unwrapped option/result types used with in operator (fix #26208) (#26223)
  • Expand @VEXEROOT, @VMODROOT, DIR, $d(), $env() inside $embed_file(path) too (#26319)
  • Fix global empty const type check (fix #26324) (#26332)
  • Add error message call stack support (requested by #16127, #24575, etc) (#26356)
  • Fix option in struct member infix expr and swapped none comparion (fix #26351) (#26373)
  • Disallow foo()? == foo where foo returns !string (fix #26383) (#26403)
  • Unset @VCURRENTHASH for V build/bootstrapped outside of a Git repository (fix #26407) (#26426)
  • Check generic struct fields and initialisation (fix #26433) (fix #26436) (#26450)
  • Preserve mut in other non-none if branch (fix #26491) (#26495)
  • Fix sql statement using an unwrapped option value from an if guard (fix #26496) (#26505)
  • Add type checking for param of fn passed as generic arg (fix #26195) (#26257)
  • Add warning for fn f(x u8) {} f(999) (fix #26584) (fix #26585) (#26586)
  • Add passes for top level decls (fix #26306) (#26589)
  • Avoid panic on unresolved infix operand types in -check (fixes #26458) (#26607)
  • Fix shared array slice type with implicit clone (fixes #26663) (#26666)
  • Fix autofree crash with option/result method chains (#26694)

Parser improvements

  • Disallow [3]!int{} (fix #26244) (#26249)
  • Get correct generics for generics struct fn with generic param (fix #26191) (#26251)
  • Fix dump() free bug for v.ast.TypeSymbol (fix #26282) (#26283)
  • Disallow [T] as fn return type (#26530)
  • Show where another declaration is located (fixes #26483)
  • Fix pub: not being detected in structs in -vls-mode (#26581)
  • Fix anonymous function name collisions across files (#26642)
  • Remove @[minify] from structs with enum fields (#26661)

Compiler internals

  • v.comptime,v.generics: unwrap receiver type, support more generic comptime exprs (#26350)
  • v.generic: improve new generic stage, unwrap generic ident info, set ct_expr to false if solved, update receiver_type generic flag (#26366)
  • v.generics: improve the new generics stage, by fixing unwrapping in nested generic struct, also fix suggestions from previous PR (#26430)
  • table: fix generics crash (fix #26438)
  • markused: add array method map and filter support (fix #26233) (#26238)
  • v.pref: exit early with an error message, if coroutines are not supported yet on the current platform, instead of producing a cgen error (#26342)
  • builder: fix compile error message for -m32 (fix #16639) (#26353)
  • v.builder: add -stats for top level statements and non-vlib top level statements (#26451)
  • v.pref: improve musl detection; fixes __atomic_thread_fence for all musl nixes (fix #26449) (#26460)
  • v.builder: always apply -fno-strict-aliasing too, on -cc gcc -prod to avoid the need for the -cflags -fno-inline-small-functions workaround with gcc > 12.0 (fix #26512) (#26552)
  • v.scanner: optimise ident_dec_number, ident_oct_number, ident_hex_number, by using precomputed digit_table and letter_table consts, instead of u8 method calls
  • v.scanner: eliminate str_helper_tokens changes outside string interpolation (fix speed loss after 106da40)
  • markused: add typ==0 guard for MapInit to fix panic in comptime $else branch (#26652)

Standard library

  • builtin.closure: improve ppc64le closure if PIE (#26172)
  • rand.xoroshiro128pp: prevent generation of extra zeros in u16() (#26229)
  • thirdparty: fix tcc __atomic_thread_fence (fix #25856) (fix #26158) (#26185)
  • builtin.closure: use volatile register for s390x (fix #24383) (#26256)
  • thirdparty: update zstd patch with commit 8aa0369 (#26312)
  • regex.pcre: add non-greedy quantifiers like *?, +?, ?? (fix #26579) (#26582)
  • regex.pcre: optimise for speed the PCRE implementation (#26609)
  • atomic: and/or bitwise ops (#26646)
  • x.json2: add a strict: true mode for x.json2.decode(), that rejects string-to-number type casting during decoding (fix #26082) (#26220)
  • builtin: add array.last_index() (#26252)
  • bitfield: fix pop_count(), add test (#26262)
  • io: deprecate the io.string_reader module (not used in vlib, with confusing and under tested/documented API - see #25713 ) (#26274)
  • time: add Duration.times/1
  • os: add Pipe.write_string/1 (#26286)
  • gg: add .draw_ellipse_filled_rotate and .draw_ellipse_empty_rotate APIs (#26309)
  • gg: add draw_ellipse_thick and draw_ellipse_thick_rotate (#26327)
  • os: fix args quoting in win_spawn_process (fix #26261) (#26339)
  • gg: optimize ellipses draw functions (#26340)
  • gg: text_width_f
  • math: fix acosh() for 0.0 (#26360)
  • math: rewrite round() to match closely the Go version (and mpfr's one), update test (#26381)
  • gg: optimise the draw_rounded_rect_filled function (#26390)
  • os: add missing is_opened checks to File.read* functions (fix #26096) (#26413)
  • x.json2: add @[json: name] attr support for enum values (fix #26437) (#26441)
  • x.json2: rename Any.arr() to Any.as_array() for consistency with as_map(), as_map_of_string(); deprecate Any.arr() (#26455)
  • breaking,x.ttf: extract vlib/x/ttf/render_sokol_cpu.v in a separate module x.ttf.render_sokol, to enable headless programs, that do not use gg, to not depend on OpenGL, DX12, Metal etc, through sokol (#26477)
  • crypto.blake3: add @[direct_array_access] and improve f() performance (#26480)
  • crypto.rc4: add @[direct_array_access] (#26507)
  • x.crypto.slhdsa: fix slh signature testing on latest version (fix #24086) (#26519)
  • crypto.pbkdf2: replace a panic with an error return (#26526)
  • regex: fixed missing OR operation on anchor flag (#26540)
  • regex: new PCRE compliant regex submodule written in pure V, available through import regex.pcre (#26545)
  • x.json2: fix decoding wrong value depending on field order (fix #26503) (#26571)
  • crypto: add shake128 and shake256 entries into crypto.Hash enum (#26576)
  • vlib: add x.atomics - implement native_x86-64_atomics in V and assembly, without depending on an external C library (impl #26474) (#26529)
  • os: use _dyld_get_image_name() to increase compatibility with older versions of Mac OS X like 10.4 (#26617)
  • crypto: move up AEAD interface from experimental namespace to cipher.AEAD (#26632)
  • builtin: fix camel_to_snake underscore placement in uppercase runs (#26634)
  • time: parse_http_header_string (#26636)
  • flag: add DocOptions/Show to FlagParser (#26630)
  • runtime: fix issues with nr_cpus() (#26679)
  • thirdparty,sokol: add wayland support (#26682)
  • thirdparty,sokol: fix frame pacing issues on xwayland sessions, prevent sending some keycode events on wayland (#26706)

Web

  • net: add raw sockets support (implement feature request from #19565) (#26237)
  • veb: remove 2 clones of response bodies; reduce the GC load for the most common case (fix #25423) (#26236)
  • wasm: support basic match keyword handling (#26246)
  • wasm: fix infinite loop using continue in C-like for loops (#26250)
  • wasm: add basic for x in start .. end { support (#26248)
  • wasm: implement basic string operations (#26260)
  • veb: fix double-send error when after-middleware sends response (#26270)
  • builder,wasm: fix pointer size to 4 for -b wasm before the checker stage (#26281)
  • wasm: support basic string interpolation (#26288)
  • wasm: fix string plus assign with call expr (#26287)
  • wasm: handle for in strings and FixedArrays (#26290)
  • wasm: support WASI program arguments and IO functions (#26294)
  • net.mbedtls: increase default timeout to 10s (like in Go): 550ms was too low
  • net: add jsonrpc module (#26330)
  • fasthttp,veb: static files via sendfile
  • wasm: fix size of pointers in structs (#26357)
  • thirdparty.mbedtls: upgrade to v3.6.5 (#26365)
  • wasm: only compile .wasm.v, and platform independent .v files (#26386)
  • fasthttp: fix sendfile (#26402)
  • wasm: add run support with wasm-micro-runtime/iwasm (#26417)
  • veb: fix unset Content-Length header, in responses with an empty body (#26431)
  • veb: fix error lines for html templates via source to source mapping
  • net.http: enable test for relative redirects (#26513)
  • fasthttp: fix IPv6 support (fix #26548) (#26549)
  • mbedtls: better ux around client timeout by mentioning the mbedtls_client_read_timeout_ms flag (#26574)
  • Document $veb.html() too in the compiler error messages, as a known comptime function (#26605)
  • fasthttp: remove zero-byte initialization in read buffer #26640
  • net.http: stop reading after Content-Length bytes on keep-alive responses (#26669)

ORM

  • Add explicit JOIN support (INNER, LEFT, RIGHT, FULL OUTER) (fix #21635) (#26400)
  • Support embedded structs
  • Make work with generic structs
  • Fix generic struct creation inside a generic function
  • Resolve generic inserting object type
  • Cgen bug fix (fixes #25847)
  • Handle inserting enum fields (#26680)
  • Add aggregate function support (#26697)
  • Add transaction API with savepoint-backed nesting (#26707)

Database drivers

  • mysql: use correct link flag for both tcc and msvc (#26539)
  • pg: exec_no_null(); gx: remove deprecated test; parser/tmpl: %raw translations; veb: time_to_render()
  • fix(db.sqlite): replace vstring() with tos_clone() to prevent use-after-free (#26700)
  • feat(db.sqlite): add Row.names, get_string/get_int, and improve ex...
Read more

weekly.2026.08

17 Feb 08:04
weekly.2026.08

Choose a tag to compare

releases: weekly.2026.08

weekly.2026.07

09 Feb 13:16
weekly.2026.07
aac7792

Choose a tag to compare

releases: weekly.2026.07

weekly.2026.06

03 Feb 09:05
48000f4

Choose a tag to compare

releases: weekly.2026.06

weekly.2026.05

26 Jan 10:29
6be2fbb

Choose a tag to compare

releases: weekly.2026.05

weekly.2026.04

21 Jan 20:24
37577eb

Choose a tag to compare

releases: weekly.2026.04

weekly.2026.03

13 Jan 06:50
weekly.2026.03
b0ea31e

Choose a tag to compare

releases: weekly.2026.03

weekly.2026.02

05 Jan 10:21
weekly.2026.02
e3616f2

Choose a tag to compare

releases: weekly.2026.02

0.5

31 Dec 20:08

Choose a tag to compare

0.5

V 0.5.0

31 Dec 2025

Improvements in the language

  • Add comptime if is shared support (fix #25600) (#25602)
  • Make defer{} scoped by default, use defer(fn){} to get the old behavior #25639) (#25665)
  • Add gotodef support for nested struct members, fn return types, etc (#26131)
  • Add a new v.comptime stage COMPTIME, that runs after the checker (CHECK), and before the transformer (TRANSFORM), to simplify the work that later stages do #26068 (#26161)

Checker improvements/fixes

  • Correctly detect variadic arg passed to struct fn (fix #25504) (#25509)
  • Fix $(field.name) access on closure fn (fix #25513) (#25514)
  • vls: skip unrelated files (#25531)
  • Fix mutability in for in loops with pointer values (fix #25520) (#25536)
  • Fix type inference, when pushing an empty array to a 2D array (fix #23854) (#25508)
  • Prevent array.insert for array of references when non-reference is passed (fix #25511) (#25557)
  • Add more support for mod autocomplete, allow for .vv files too (#25562)
  • Fix cast from an empty struct to option (fix #25566) (#25581)
  • Ensure ?Struct is not parsed as ??Struct when param is ?T (fix #25559) (#25564)
  • Fix if branch type nr_muls mismatch (fix #25556) (fix #25555) (#25571)
  • Fix comptime else branch handling (fix #25586) (#25589)
  • Smart detect or {} inside loop when using c <-val (fix #24550) (#25435)
  • Vls fix goto definition (#25595)
  • Fix generic resolve for external module generic static method call (fix #21476) (#25634)
  • Correctly detect type, when prepending to generic array (fix #25585) (#25645)
  • Allow cast from voidptr to sumtype in unsafe block (fix #25652) (#25657)
  • Disallow calls to a shared receiver method, on a non-shared var (fix #25577) (#25656)
  • Fix or block endwiths expr (fix #25329) (#25667)
  • Set ast file fallbacks for vls (fix #25678) (#25679)
  • Error/warn when using defer(fn) inside function-scope and lock stmts (#25681)
  • Maintain correct ref level in generic fn (fix #25676) (#25687)
  • In vls mode, make ensure_type_exists return true (#25695)
  • Only collect/hoist inner vars, when defer is function-scoped (#25693)
  • Improve type checking for sumtypes with generics (fix #25690) (#25699)
  • Unwrap for base type if ft.typ and inferred_typ are both opt (fix #25517) (#25728)
  • Disallow deference of nil (fix #25740) (#25746)
  • Fix comptime main fn (#25747)
  • Parser,fmt,checker: use a trie for matching the generic array methods all, any, count, filter, map, sort and sorted (#25759)
  • Fix array fixed unresolved return check and resolver (fix #25774) (#25790)
  • Allow explicit sumtype to option casts (fix #25796) (#25812)
  • Fix possible race on expected arg types unwrapping on cgen (#25815)
  • Skip init check for options (fix #25798) (#25830)
  • Fix module var set at change_current_file() (fix #25845) (#25846)
  • Improve handling of array decompose for dynamic arrays and array init (fix #25838) (#25843)
  • Force all fn declarations to follow after all other top level statements (fix #25889) (#25890)
  • Fix used features tracking when printing pointer values (fix #25899) (#25901)
  • Match type when auto deref occurs (fix #25913) (#25916)
  • Relax the redundant () check to a notice, to enable a future v -W test vlib/builtin job on the CI
  • remove () from match branch exprs (fix #25950) (#25952)
  • Fix array map anon fn return fixed array (fix #25928) (#25977)
  • Cleanup the output of v new --web abcd after feedback from https://youtu.be/IuE6Bo1klK0?t=555
  • Allow assign to a shared int var (fix #25986) (#25988)
  • Ensure type of global exists (fix #25910) (#25998)
  • Ensure fn pointer cannot be used as non-fn argument (fix #26017) (#26022)
  • Make sure $for eval body statements at least once to set types and avoid markused issues later (fix #26058) (#26063)
  • Fix return static method name (fix #26105) (#26110)
  • Support gotodef for struct init and sumtype rhs (#26157)
  • Detect circular type references in sumtype declarations (fix #24511) (#26162)
  • Add interface type handling and new testcase (fix #24116) (#26165)
  • Allow enum fields to reference previously declared fields (fix #25241) (#26173)
  • Clear all ref from autostr receiver_type (needed by #25857) (#26202)
  • Allow for _ being used as both import x as _ and fn f(_ int) { (fix (#26219) #26230

Parser improvements

  • Fix vls mode strut mut keyword (fix #25548) (#25551)
  • Fix vfmt comment in struct init after the update expr (fix #24361) (#25668)
  • Fix infix expr comment in middle (fix #24183) (#25671)
  • Disallow using generic functions as a field type name inside struct decl (fix #25452) (#25705)
  • Warn on @[deprecated_after] used without a corresponding @[deprecated] attribute (#25712)
  • Fix last stmt is fn call in or_expr (fix #25732) (#25739)
  • Allow for |mut x, y|expr (fix #25734) (#25735)
  • Allow using a, b and it as var names, when using the builtin array methods (fix #25729) (#25755)
  • Disallow generic function to be exported (fix #25794) (#25806)
  • Support -d trace_parse to ease diagnosing problems related to the order of parsing of .v files in modules
  • Fix the language support for a nested anonymous C.struct (fix #25807) (#25789)
  • Disallow untyped chan used as a fn parameter type (fix #25818) (#25854)
  • Improve the unused import warning message (add fixing alternatives) (#25880)
  • checker,parser,ast: make type MyBuilder = strings.Builder work (part 1); add mod fields to ast.SumTypeDecl and ast.AliasTypeDecl (#25943)
  • Remove dead code in Parser.is_array_type/0 (#26080)
  • Check invalid struct name in struct_init() (fix #26030) (#26093)
  • Remove the support for the obsolete generic fn call syntax f() (first deprecated in 2022/11) (#26126)
  • Fix comptime for lock shared field (fix #26143) (#26146)
  • checker,parser: add multifile gotodef support for -line-info (#26167)
  • Optmize Parser.call_kind (#26196)

Compiler internals

  • markused: fix markused struct heap (#25542)
  • markused: fix array.prepend C code dependency (fix #25573) (#25582)
  • markused: fix fn marked as used when variable and fn uses same name (fix #25649) (#25650)
  • checker,transformer: add always true/false branch detection for the if and match constructs (#25674)
  • v.util: measure more precisely how long a new tool recompilation lasts in launch_tool, when using v -d trace_launch_tool self
  • transformer: fix struct init comparison turning into boolean (#25724)
  • v.builder: support V_NO_RM_CLEANUP_FILES=1, to ease debugging of -usecache issues
  • v.builder: make it easier to reproduce the exact specific stages of -usecache module compilation by logging the full CLI options for each
  • v.builder: fix .vsh mode doing an implicit import os, now only for .vsh file itself (fix issue spotted in #25736) (#25745)
  • v.builder: improve diagnostic information for a failed build_thirdparty_obj_file
  • transformer: transform ArrayInit into a function call for C and native backends (part 1)
  • builder,pref: add -file-list support (implement feature #25707) (#25749)
  • pref: for -usecache, set .parallel_cc = false and .no_parallel = true to make compilations more deterministic and ease CI diagnostics
  • markused: fix missing builtin__memdup definition, when an option struct field is used (fix #25801) (#25802)
  • transformer: move array logic to array.v
  • v.builder: improve the error message for failing cgen; suggest -g and -show-c-output
  • v.pref: fix GitHub download URL for the photonwrapper .so file (fix #25708) (#25831)
  • v.pref: use v download for downloading the prebuilt photonwrapper shared library (#25849)
  • markused: fix const as fn mark as used (fix #25888) (#25895)
  • transformer: disable generic str_intp opt (fix #25896) (#25897)
  • v.scanner: remove obsolete .is_crlf and .is_vh fields (#25918)
  • v.scanner: use a named return for decode_XXX_escape_single methods, to reduce the generated C diff churn, during scanner code updates
  • markused: add new auto_str() used funcs for bootstrap (#25938)
  • v.builder: provide more detailed error message, on msvc: failed to build a thirdparty object, not just the failed command
  • v.builder: improve formatting of the failed to build a thirdparty object message for msvc
  • scanner: remove old generic check logic (fix #25959) (#25997)
  • transformer: fix the setting of a generic flag for fixed array type with -new-transformer (#26009)
  • transformer: add file/line info for fn with expand_simple_interpolation (#26135)
  • transformer: add early return to avoid transform getting applied twice for a for x < y { body (#26153)
  • markused: fix option none markused (fix #26147) (#26151)
  • v.builder: enable gc back with msvc, build separate .debug.obj thirdparty files when -g is passed, to prevent linking issues (#26215)
  • v.builder: support compiling asm .S files to .o files, mentioned in #flag directives (needed for #26185) (#26211)
  • v.builder: fix compile asm file, followup of PR #26211 (#26227)

Standard library

  • arrays: fix rotate_left() and rotate_right(), add test (#25539)
  • encoding.base58: fix encoding, add test (#25538)
  • x.crypto.chacha20poly1305: move up responsibility for allocs into higher caller (#25574)
  • crypto.cipher: fix decryption in CBC mode, add test (#25584)
  • os: use @[noinline] on os.create/1 to workaround a -cc gcc -prod panic (fix #25549)
  • time: fix non-digit checks for parse_rfc3339() (#25597)
  • gg: add explicit bounds checking for image caching methods in gg (fix #25590) (#25591)
  • time: fix quarter calculation in custom_format() (#25608)
  • rand: fix randomness in shuffle() (#25617)
  • gg: destroy unused GPU resources before replacing cached images (#25615)
  • encoding.binary: fix serialize skip struct shared fields (related to issue #25600) (#25613)
  • x.crypto.chacha20poly1305: make implementation use fixed sized arrays more (#25627)
  • builtin: make result stri...
Read more

weekly.2025.01

30 Dec 03:25
weekly.2025.01
8f8a491

Choose a tag to compare

releases: weekly.2025.01