Skip to content

Releases: vlang/v

weekly.2024.14

02 Apr 02:22
weekly.2024.14
c086bee
Compare
Choose a tag to compare
releases: weekly.2024.14

weekly.2024.13

25 Mar 09:16
weekly.2024.13
6b23b1d
Compare
Choose a tag to compare
releases: weekly.2024.13

0.4.5

20 Mar 04:23
Compare
Choose a tag to compare

V 0.4.5

20 March 2024

Improvements in the language

  • Add map update-init syntax: new_map := {...old_map, 'k1': 1, 'k2': 5} (#20561)
  • Improve coroutines, Photon vcpu creation, coroutines + GC fixes (#20549)
  • Update Boehm GC libs/headers to the latest version 8.3.0 (#20772)
  • $dbg statement - native V debugger REPL (#20533)
  • Implement @[_linker_section] attribute (#20629)
  • Enable @[export] for global variables too (#20649)
  • Add callstack support on v.debug (#20680)

Breaking changes

  • sokol: the sokol wrapper was updated, to match its upstream version at commit 058a4c5, several of its APIs no longer exist
  • templating.dtm: compile_template_file is no longer public
  • v.trace_calls: pub fn on_c_main() {, is now pub fn on_c_main(should_trace_c_main bool) {
  • v.transformer: Transformer.fn_decl is now Transformer.fn_decl_trace_calls
  • x.vweb: Context.redirect(url string, redirect_type RedirectType) is now Context.redirect(url string, params RedirectParams)

Checker improvements/fixes

  • Check invalid lambda expr (#20461)
  • Fix comptime if with comptime smartcast (#20466)
  • Fix anon struct init with const fields (fix #20452) (#20463)
  • Disallow option or result return type, for infix operator overloading (#20494)
  • Cleanup the const variable evaluate for fixed array fields of structs (#20503)
  • Fix missing check for struct initialization with @[noinit] attribute, through using T{} (#20516)
  • Fix mark methods into used-list, when generics as receivers (fix #20509) (#20527)
  • Modify comments on generic receiver type storage (#20539)
  • Fix checking give const map as default or init value to struct fields (fix #20512) (#20546)
  • Fix return map index with or_block (#20544)
  • Cleanup the generic tests (#20553)
  • Fix @[deprecated] attribute for consts (fix #20523) (#20550)
  • Cleanup in method_call() (#20554)
  • Disallow non_opt_array << optvalue (#20573)
  • Fix non dereferenced enum in match statements (fixes #10045) (#20591)
  • Fix .variant smartcast on non-comptime variables (#20575)
  • Disallow static maps: mut static x := map[string]int{} (#20596)
  • Allow #define X and asm riscv64 {} blocks in .v files, with -freestanding (make embedded usecases easier)
  • Add cast overflow checks (#20641)
  • Disallow assigning none to _ (#20646)
  • Fix checking for option matching with non-option (#20673)
  • Disallow (x) := 10 (#20695)
  • Disallow none as match cond (#20688)
  • Fix comptime ident checking on defer stmt (fix #20719) (#20723)
  • Add error for x as Y.field, suggesting using (x as Y).field instead for clarity (#20725)
  • Disallow sum type holding alias ptrs (#20786)
  • Optimise out calls to arg_typ_sym.embed_name() when there are no errors (#20820)
  • Fix if branch option type mismatch (fix #20809) (#20830)
  • Fix auto deref arg when fn expects ref (#20846)
  • Fix struct field init with generic fn variable (fix #20847) (#20878)
  • Cleanup in assign_stmt() (#20880)
  • Check assigning immutable reference struct field (fix #20814) (#20883)
  • Fix struct field init with generic anon fn (add the test from #18294) (#20888)
  • Fix checking match branch call expr twice (#20910)
  • Support Flags.bit ^ Flags.bit1 and ~Flags.bit (flagged enums) (fix #20925) (#20929)
  • Fix some specific interface generic inference within generics struct and method (#20932)
  • Remove notice when shifting signed int for @[translated] (#20935)
  • Silence "assigning 0 to a reference field" and "uninitialized fn struct fields" notices for @[translated]\nmodule ... files (#20938)
  • Fix missing check for interface cast of option type (#20961)
  • Silence more warnings for @[translated] files (#20964)
  • Fix comptimeselector passing to generic argument (#20985)
  • Remove unnecessary string interpolation in deprecation method calls (#21007)
  • Disallow void return value lambdas in array.map method calls (#21011)
  • Cleanup and simplify check_ref_fields_initialized methods (#21016)
  • Cleanup and simplify struct processing p1 (#21009)
  • Add support for deprecation messages for structs and struct fields (#21017)
  • Cleanup and simplify struct processing p2, extend test (#21025)
  • Fix undefined reference to interface struct field regression (after #21025) (#21030)
  • Add test for interface embedding and interface with erroneous implementation (test related to #21030) (#21033)
  • Disallow Optional and Result high val in a for x in low..high { loop (#21043)
  • Fix missing incompatible pushval type for chan <- operator (#21040)

Parser improvements

  • Fix close_scope() missing, when field.name is sort or sorted (fix#20436) (#20485)
  • Check non-generic interface defining generic method (#20545)
  • vast,ast: output map init update expression (#20574)
  • Implement MyEnum.from(1)! generic static method (#20411)
  • Fix MyEnum.from(0)!, implement MyFlaggedEnum.zero() (#20623)
  • vfmt,parser: keep the original import name in ast.Import, and use it without modifications for paths unders ~/.vmodules
  • Allow double quotes in @include template directives (#20628)
  • Fn type declaration does not check already registered name (#20732)
  • Fix global const ordering with string inter literal (fix #20760) (#20770)
  • Disallow option alias with option parent type (#20769)
  • Make Scope.find methods more robust, when called on default initialised scope &Scope = unsafe { nil } fields (#20774)
  • Fix parsing of cgen.v, in normal mode, when the table is empty (no files in builtin are preparsed) (fix #20606) (#20611)
  • Fix infinite loop in Parser.sql stmt in -silent -print-watched-files mode (used by v watch) (#20873)
  • Disallow defining map key more than once (#20905)
  • Fix formatting comptime if expr, after inc expr (fix #20927) (#20931)
  • Fix for comptime with fully type name (fix #20948) (#20988)
  • Allow lock prefix instructions and numbered reg in inline asm blocks (#21022)
  • Add better error for mut variadic fn argument (#21063)

Compiler internals

  • v.util: make launch_tool failures more detailed (for the Text file busy; code: 26 case), bump tool_recompile_retry_max_count from 3 to 7
  • v.util: make launch_tool more robust, when multiple v -b js file.v commands are run at the same time (all trying to recompile the JS backend program) (#20631)
  • builder: allow for ./v -freestanding -cc riscv64-elf-gcc -d no_main -no-builtin -no-preludes -showcc -keepc x.v
  • pref: support file_notd_freestanding.v + file_d_freestanding.v, remove dependency to os, of $embed_file(), when compiling with -freestanding (#20712)
  • v.builder: reduce the default noise from successfully rebuilding cached thirdparty object files
  • pref: allow fetching the photonwrapper .so (for the coroutines) with curl too, or print details for manual download (#20855)
  • scanner: disallow a shebang line, that is not at the top of a file (#21029)
  • strings.textscanner: fix off-by-one error in skip method (#21045)

Standard library

  • x.crypto.chacha20: speed up the core functionality of the ChaCha20 stream cipher (#20470)
  • log: enhance log time format setting (#20484)
  • encoding.csv: add a new utility fn new_reader_from_file/2 (#20530)
  • readline: add completion support (#20559)
  • builtin: add is_hex(), is_int(), is_bin(), and is_oct() methods to the string type (#20540)
  • builtin: add empty string verification for the new string .is_oct() etc methods, suggested on PR #20540 (#20564)
  • json: fix struct with option enum field (fix #20597) #20597
  • x.json2: fix panic on calling json2.decode of an optional enum (fix #20593) (#20603)
  • vlib: add a compress.zstd module (#20616)
  • io: ensure BufferedReader.read_line() returns io.Eof, instead of error('none') (#20619)
  • log: add support for l.set_short_tag/1 (#20652)
  • Update error checking for new error io.Eof (#20656)
  • io: allow BufferedReader.read_line() to accept custom line delimiters (#20655)
  • builtin: implement unbuffer_stdout/0 (#20662)
  • x.crypto: add sm4 module (#20651)
  • crypto.aes: optimise performance (#20674)
  • os: add proper process termination with p.signal_term() (#20671)
  • bitfield: enhance operation with multiple flags (#20683)
  • os: fix File.read() in JS backends (fix #20501) (#20633)
  • os: add error_posix() and error_win32() for explicit platform error handling and default behavior (#20694)
  • log: implement set_always_flush/1 for log.Log, log.ThreadSafeLog and log.Logger (#20698)
  • x.vweb: error() and simpler redirect(); comptime: a clearer error
  • builtin: add a string.u8_array() method (#20736)
  • os: add os.stat() and helpers (#20739)
  • os: make os.SystemError struct public so the os.error_* functions can be used by other modules (#20754)
  • os: refactor to use os.stat and os.lstat instead of unsafe C calls (#20759)
  • os: make os_stat_test.v more robust to reporting false positives
  • x.crypto: add poly1305 message authentication code (mac) in pure v (#20752)
  • encoding.binary: add _fixed variants for the conversion fns, that accept fixed arrays (#20766)
  • x.crypto.sm4: make sm4 use the encoding.binary _fixed fns (#20773)
  • builtin: add gc_collect/0, gc_get_warn_proc/0, gc_set_warn_proc/1. Use them to turn off GC warnings by default. (#20788)
  • builtin: support -d gc_warn_on_stderr, to show the GC warnings, without installing a custom warn fn callback
  • x.crypto: add AEAD ChaCha20Poly1305 algorithm in pure v (#20817)
  • x.crypto.chacha20: remove deprecated math.max_u32 in favour of builtin max_u32, remove unneceseary bits, reorder (#20838)
  • json: fix decode struct ptr (#20828)
  • time: add a .http_header_string() method on Time (#20861)
  • json2: reorganize encode string (#20862)
  • vlib: add encoding.txtar (port of Go's txtar module) (#20874)
  • gg: handle dpi change, when moving window to another monitor (#20886)
  • time: add a tm_gmtoff field to C.tm (a BSD and GNU extension) (#20907)
  • x.json2: add skippable ...
Read more

weekly.2024.12

18 Mar 09:24
weekly.2024.12
a36c693
Compare
Choose a tag to compare
releases: weekly.2024.12

weekly.2024.11

11 Mar 05:08
weekly.2024.11
386bd77
Compare
Choose a tag to compare
releases: weekly.2024.11

weekly.2024.10

04 Mar 21:49
weekly.2024.10
60b4fb3
Compare
Choose a tag to compare
releases: weekly.2024.10

weekly.2024.09

27 Feb 09:27
weekly.2024.09
d8c4a84
Compare
Choose a tag to compare
releases: weekly.2024.09

weekly.2024.08

19 Feb 11:03
weekly.2024.08
Compare
Choose a tag to compare
releases: weekly.2024.08

weekly.2024.07

12 Feb 17:57
weekly.2024.07
c9933da
Compare
Choose a tag to compare
releases: weekly.2024.07

weekly.2024.06

05 Feb 16:57
weekly.2024.06
a374d25
Compare
Choose a tag to compare
releases: weekly.2024.06