Skip to content

Releases: vlang/v

0.4.6

20 May 21:22
Compare
Choose a tag to compare

V 0.4.6

20 May 2024

Improvements in the language

  • Experimental x.vweb is now veb, the official and recommended way to build web apps in V. Built on top of pico.v.
  • autofree: -print_autofree_vars command line flag for printing variables autofree couldn't free
  • Add @VMODHASH comptime variable to store the commit sha of a V module (#21091)
  • Fix sumtype support for option variant types (#21101)
  • Utilize new diff functions in errors (expected/found) (#21431)
  • Add @[_linker_section] for global variables

Breaking changes

  • checker: disallow initializing private struct fields outside structs module (#21183)
  • vlib: update handling of imports whose symbols are not directly used in imported file, remove pub const is_used = 1 workarounds (#21160)
  • net.ftp: allow to choose a different port than port 21 (change FTP.connect to accept host:port, not just a host address) (#21185)

Checker improvements/fixes

  • Ambiguous expression notice for & << >>, similar to && ||
  • Disallow using aliases of ?Type as !Type (#21128)
  • Fix option checker arg validation for ptr passing on non expected ptr (#21087)
  • Optimize option and result type check, add more typinfo to error details (#21105)
  • Move error handling for any type to the checker to resolve parsing issues (#21146)
  • Move error handling for user defined type duplicates to the checker to resolve parsing issues (#21147)
  • Detect redundant ref when assigning call expr with ref return (#21141)
  • Fix multi return using nil and voidptrfix (fix #17343) (#21144)
  • Fix C struct embedded init fields checking (#21137)
  • Remove resolved vfmt workaround and TODO (#21175)
  • Move more match validation from the parser into the checker, add error for match without branches (#21181)
  • Improve the error message for an unknown type (#21207)
  • Allow passing none to fn f(arg ?&Type) { (fix #21213) (#21231)
  • Fix -parallel-cc regression (part 1, workaround .filter(fn[c]) used in checker/orm.v) (#21238)
  • Detect and error on unreachable code in loops, after continue and break statements (#21294)
  • Disallow Result callbacks functions like map/filter/all/any (#21055)
  • Fix missing check for or expr on string interpolation (#17566)
  • Allow pass array as mut param to spawn fn (#21283)
  • Turn array assign warning into error (#21341)
  • Ignore last semicolon on or-expr (#21361)
  • Disallow structs with @[params] attribute as mutable function parameters (#21206)
  • Set auto Return pos correctly; cgen: autofree fix for optional returns
  • Disallow invalid ptr operations (#21515)
  • Fix wrong checking for heap struct (#21511)
  • Allow alias enum flagged to have bit operations (#21532)
  • Simplify, utilize pref.vroot (#21096)
  • Fix option interface member checking when none is passed (#21509)

Parser improvements

  • Fix option as possible match case for sumtype (#21079)
  • orm: disallow invalid infix for where clause in delete and update (#21113)
  • Fix case of falsely registering imports as used, remove unused imports (#21156)
  • Remove redundant comments_mode field (#21198)
  • Update file path fields; use more expressive name for file path, remove obsolete file_name_dir field (#21202)
  • Add missing docstrings for vlib/v/ast/comptime_const_values.v functions (#21219)
  • Allow struct init on for in Iterator{} { (fix #21179) (#21282)
  • Fix for x in Iterator{} {, when there are no field initialisations (#21333)
  • Add check for result type on chan init (#21363)
  • Fix comptime panic for $tmpl("x.html"), when the template file contained % at the end (#21402)
  • Parse string and array typ idx of ScopeVar and Ident (#21523)

Compiler internals

  • v.util: use tmp instead of cache dir for temporary diff files (#21075)
  • v.util: fix module lookup if module import parts end with the word modules (#21083)
  • v.util: update githash to be able to get the githash of every passed project (#21178)
  • v.util: improve detection for opendiff when automatically searching difftools (#21241)
  • v.util: improve color_compare_files (#21247)
  • v.util: improve find_diff_cmd: don't add spaces to result without env opts (#21242)
  • v.util: fix diff coloring, add test (#21260)
  • v.util: polish off diff utils after recent updates and fixes, add doc comments to pub fns (#21275)
  • v.builder: suggest using v wipe-cache, when the object files are not recognized
  • pref: be more conservative when generating code using -cross, allow for $if cross ? {
  • builder: use cc enum in CcompilerOptions, fix cc detection, enable cc guessing without prod flag (#21370)
  • pref: fix version flag handling (#21377)
  • pref: make minor performance related changes / simplify (#21379)
  • builder: simplify generic cc detection (#21380)
  • pref: extract architecture related code into arch.c.v; rename pref.c.v to pref.v (#21387)
  • pref: update os_from_string, add missing qnx, remove deprecated wasm options that used - instead of _ (#21390)
  • v.util: rewrite diff module, deprecate old functions (#21403)
  • v.util: fix color when auto tool is diff (#21435)
  • v.util: make diff_test.v more robust to the color settings for the chosen local diff tool
  • v.util: fix performance with v test-cleancode, when a slower diff tool is installed (#21447)
  • v.util: remove fast path in diff.compare_text (#21458)
  • v.pref: error for v file.v --unknown-option (#21391)

Standard library

  • builtin,dlmalloc: fixes for v vlib/v/gen/c/coutput_test.v for gcc14.1, which is stricter
  • Min window width and height
  • builtin: str.last_index(); pref: hide-auto-str;
  • toml: update the alexcrichton and BurntSushi repos to their successors toml-rs, and toml-test, record new exceptions (#21152)
  • json: allow i32 decoding and encoding (#21162)
  • json2: add ability to decode arrays (#21163)
  • json2,checker,toml: allow field.typ compile-time checking with MatchExpr and add array of option checking (#21171)
  • gg: draw_text with custom fonts
  • x.json2: add a way to decode an array (#21186)
  • os: clarify some doc comments (#21209)
  • os: fix double free in os.get_raw_line() (used by os.input), with -autofree (#21204)
  • time: extract Duration related code into duration.v (#21229)
  • builtin: implement an at_exit(cb) wrapper for C.atexit (part 1) (#21254)
  • os: format readme, fix markdown inside html (#21286)
  • time: update unix time acces, fix issues related to deviating unix times (#21293)
  • vlib: refactor empty string checks to use s == '' or s != '', instead of s.len == 0 (#21300)
  • cli: update command_test.v (#21307)
  • cli: extend control over defaults (#21308)
  • thirdparty/sokol: bump _SGL_DEFAULT_MAX_VERTICES and _SGL_DEFAULT_MAX_COMMANDS again; mark them with __v_ start and __v_ end
  • sync: add Gentoo paths for libatomic
  • sync.stdatomic: add flag lines for gcc 14 too
  • gg: make PenConfig fields public (#21353)
  • builtin: fix undefined read s[0], from ''.is_lower() and ''.is_upper() in c7af2c2
  • builtin: fix empty string lower / upper assert (#21358)
  • cli: simplify flag parsing (#21392)
  • os,runtime: workaround for v.c generation instability
  • datatypes: fix for set - operator, union and intersection, now they no longer change the receiver (fix #21315) (#21362)
  • sync.stdatomic: add paths for compilation with musl on Gentoo (#21400)
  • os: fix os.execute stderr redirection (fix #20986) (#21404)
  • time: fix the string representation of a negative Duration (#21407)
  • cli: make program outputs using the cli module testable in cli/testdata (#21456)
  • math.unsigned: permit _ separators in Uint128 decimal strings passed to uint128_from_dec_str (#21461)
  • cli: fix default flags when their command equivalents are disabled (#21469)
  • toml: simplify decode_quoted_escapes (#21472)
  • os: fix join-path (#21425)
  • builtin: simplify MessageError.msg() (#21524)
  • all: replace usages of C.atexit(cb) with at_exit(cb) or {} (part 2) (#21263)
  • math.unsigned: fix some Uint256 bugs and add tests (#21528)

Web

  • Update mbedtls to latest compatible version v3.3.0 (#21118)
  • veb.auth: a minor find_token fix
  • Improve descriptions (#21155)
  • ci: change listen ports in vweb_should_listen_on_both_ipv4_and_ipv6_by_default_test.v for both vweb and x.vweb, to reduce probability of network errors
  • ci: mark both vweb and x.vweb versions of vweb_should_listen_on_both_ipv4_and_ipv6_by_default_test.v as flaky
  • x.vweb: accept query params as method arguments (#21201)
  • net.http.file: support index_file (index.html by default), and auto_index (true by default) parameters to file.serve()
  • veb: copy x.vweb to veb, and make it work with comptime
  • ci: fix the ubuntu-docker-musl job by skipping veb_app_test.v
  • pref: support a shortcut: v -http for v -e "import net.http.file; file.serve()" .
  • net: add a .port()! method for net.Addr (#21412)
  • net: improve error message in .port()
  • picoev: handle EAGAIN or EWOULDBLOCK quietly (#21480)
  • net.unix: remove debug/trace eprintln (#21517)

ORM

  • Add error for unchecked option multi return types, fix undefined behavior (#21106)

Database drivers

  • db.mysql: fix invalid memory access in exec_one for returned rows with NULL fields (#21317)

C backend

  • Enable autofree for option (#21051)
  • Force C struct types which does not implement str() to be passed as ptr (#21054)
  • Improve diagnostic information for ORM queries with invalid types
  • Allow static call on generic type (#21071)
  • Fix code generation for a struct field, having a type of fixed array of options field [5]?Type (#21082)
  • Add the _M_ARM64 macro to endianness check (#21109)
  • Fix return code when returning interface result type (fix #21115) (#21130)
  • Fix const initialized with array (#21131)
  • Fix infix array heap comparison (#21145)
  • Fix C struct sumtype support (#21129)
  • Add autofree comptime check (#21197)
    ...
Read more

weekly.2024.20

13 May 18:58
weekly.2024.20
58a8fc6
Compare
Choose a tag to compare
releases: weekly.2024.20

weekly.2024.19

06 May 21:44
weekly.2024.19
d6d0f9b
Compare
Choose a tag to compare
releases: weekly.2024.19

weekly.2024.18.2

02 May 14:32
weekly.2024.18.2
0459519
Compare
Choose a tag to compare
releases: weekly.2024.18.2

weekly.2024.18

29 Apr 09:36
weekly.2024.18
f33b712
Compare
Choose a tag to compare
releases: weekly.2024.18

weekly.2024.17

22 Apr 19:21
weekly.2024.17
3b0c620
Compare
Choose a tag to compare
releases: weekly.2024.17

weekly.2024.16.1

17 Apr 14:31
weekly.2024.16.1
27cc277
Compare
Choose a tag to compare
releases: weekly.2024.16.1

weekly.2024.16

16 Apr 00:06
weekly.2024.16
0b83ea7
Compare
Choose a tag to compare
releases: weekly.2024.16

weekly.2024.15

08 Apr 12:11
weekly.2024.15
c4c6b9f
Compare
Choose a tag to compare
releases: weekly.2024.15

weekly.2024.14

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