Skip to content

Commit 5cc1db8

Browse files
committed
0.4.2 changelog
1 parent ced5f21 commit 5cc1db8

File tree

4 files changed

+118
-3
lines changed

4 files changed

+118
-3
lines changed

CHANGELOG.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,115 @@
1+
## V 0.4.2
2+
*30 September 2023*
3+
4+
#### Improvements in the language
5+
- Short lambda expressions like `a.sorted(|x,y| x > y)` (#19390)
6+
- Support `-os plan9`, `$if plan9 {`, and `_plan9.c.v` (stage 1 for plan9) (#19389)
7+
- fmt: simplify the processing logic for removing inline comments (#19297)
8+
- Align the custom values of the enum fields (#19331)
9+
- Do not warn/error for `import flag as _`
10+
- Keep anon struct decl fields in interfaces (#19461)
11+
- Support -N, turning all notices into errors, to ease the process of finding places that may need attention/correction
12+
13+
#### Breaking changes
14+
- Remove inline comments (#19263)
15+
16+
#### Checker improvements/fixes
17+
- Disallow module name duplicates in local names (#18118)
18+
- Check enum fields with duplicate value (fix #19309) (#19310)
19+
- Disallow alias ptr cast of a map value (#19336)
20+
- Require `else` branch in `[flag]` enum match (#19375)
21+
- Disallow assigning pointer values to option struct fields (#19380)
22+
- Fix generic comparison for conditional assignment (#19401)
23+
- Allow using ! and ~ on aliased bool and integral types (#19403)
24+
- Warn -> error for uninitialized ref fields
25+
- Parser, checker: allow lambdas anywhere anonymous functions are expected (#19436)
26+
- Allow for `each(a, |x| println(x))`, i.e. using lambda expressions, when expecting `fn (x int)`
27+
- Check fixed array init with default expression (#19472)
28+
- Allow for `const source = $embed_file(@FILE).to_string()`
29+
- Fix C.type in imported modules
30+
31+
#### Parser improvements
32+
- parser: fix fixed array with eval const size (#19269)
33+
- parser: disallow using `sql` as name (#19298)
34+
- parser: fix `;` support for `module x;`
35+
- parser: fix fixed array of option values (`_ := [10]?int{}`) (#19392)
36+
- parser: fix assigning with in another module sumtypes 2 (#19415)
37+
- v.ast: improve Stmt.str(), showing more details about ast.Block, ast.DeferStmt, ast.ForInStmt, ast.GlobalDecl
38+
39+
#### Compiler internals
40+
- pref: support `-fast-math`, passing either -ffast-math or /fp:fast (for msvc) to the C backend, and `$if fast_math {` to detect it at comptime
41+
- parser, transformer: fix transformer.infix_expr() and cleanup parse_types.v (related #19269) (#19276)
42+
- pref,builder: support -use-os-system-to-run to workaround segfaults using not fully updated xcode command line tools
43+
- v.builder: fix compiling code, that imports modules from both `src/modules` and `modules` (#19437)
44+
- os, v.builder: show more details, when a program ran by `v run file.v`, exits by a signal (fix #19412) (#19471)
45+
46+
#### Standard library
47+
- math: speedup the pure V math.pow implementation for non-fractional powers (#19270)
48+
- math: add more C. fn overrides, for the default C backend (speed up examples/path_tracing.v) (#19271)
49+
- time: add `MMM` support for parse_format() (#19284)
50+
- os: include sys/sysctl.h on FreeBSD to avoid implicit definition of sysctl function (#19293)
51+
- crypto.md5: change the Digest.write return type, from `?int` to `!int` (#19311)
52+
- v.help: use os.executable() instead of @VEXE as an anchor, so `v help` will work more robustly.
53+
- toml: fix custom `to_toml` for complex structs (#19338)
54+
- all: support `;` statements, allowing for oneliners like `./v -e 'import os; println( os.ls(os.args[1])!.sorted(a > b) )' vlib/math` (#19345)
55+
- vlib: add net.http.file, allowing for `v -e "import net.http.file; file.serve()"` (#19348)
56+
- vlib: remove functions and fields, deprecated before 2023-03-20
57+
- toml: fix toml encoding of complex types (#19408)
58+
- arrays: add a partition function, that splits a given array, based on a criteria, passed as a callback fn (#19417)
59+
- toml: add decoding for struct fields of type map[string]T (#19447)
60+
- arrays: add arrays.each, arrays.each_indexed, and tests for them
61+
- encoding.html: implement `unescape()` (#19267)
62+
63+
#### Web
64+
- net.http: fix http.fetch(), without explicit method (default again to .get, not to .acl)
65+
- net.http: default explicitly to Method.get for http.Request and http.FetchConfig too
66+
- examples: add examples/fetch_ip.v, showing how to contact http://ifconfig.co/json and parse the result
67+
- net.http: fix post error with https on windows (#19334)
68+
- net.ssl: implement SSLConn.peer_addr() (#19333)
69+
70+
#### ORM
71+
- orm: add `references` attribute to allow foreign key declarations on fields (#19349)
72+
- orm: support different foreign key types, not just an integer id (#19337)
73+
- orm: add support for V enum struct fields (#19374)
74+
- orm: quote table and field name in `[references]` (#19387)
75+
76+
#### Database drivers
77+
- db.pg: allow postgres connection using service definitions (#19288)
78+
79+
#### Native backend
80+
- native: make native tests pass on windows; refactor PE file generation (#19140)
81+
- native: parse dll files to resolve extern symbols (#19433)
82+
83+
#### C backend
84+
- Fix printing struct with thread field (#19320)
85+
- Fix the logic around the definition of VNORETURN and VUNREACHABLE (less warnings on FreeBSD) (#19316)
86+
- Add support for `-d trace_cgen_stmt`, document it in CONTRIBUTING.md
87+
- Fix printing smartcast interface variable (fix #18886) (#19372)
88+
- Fix interface with multiple embedded fields (#19377)
89+
- Fix channel of interface (fix #19382) (#19383)
90+
- Fix fixed array of option type default (#19397)
91+
- Fix interface with option field (#19434)
92+
- Fix promoting an alias typed value, to a sumtype of the alias's base type (fix #19407) (#19423)
93+
- Remove the special plan9 support code, treat it instead as a posix system in cheaders.v (#19445)
94+
- Fix printing slice of fn call string (#19450)
95+
- Fix `type VType = &C.CType` (#19452)
96+
- Fix array of fns index call with direct_array_access mode (#19460)
97+
98+
#### Tools
99+
- bench: a new bench/ directory for language benchmarks
100+
- ci: test the pure V math versions without .c.v overrides on the CI too (#19292)
101+
- github: add automatically info about voting to all new issues (#19351)
102+
- tools: add -E flag to `v test-parser`, that will show the partial source that caused the parser to fail with `-no-builtin -check-syntax file.v`
103+
- ci: bring back gitly
104+
- github: improve the voting message for issues (#19448)
105+
- vcreate: update templates, add `lib` (#19444)
106+
107+
### Operating System support
108+
- builtin: use `libgc-threaded` on FreeBSD, to get the threaded version of libgc (#19294)
109+
110+
#### Examples
111+
- examples: add more .obj files for 06_obj_viewer (#19406)
112+
1113
## V 0.4.1
2114
*3 September 2023*
3115

cmd/tools/changelog_helper.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module main
22

33
import os
44

5-
const git_log_cmd = 'git log --pretty=format:"%s" --simplify-merges'
5+
const git_log_cmd = 'git log -n 500 --pretty=format:"%s" --simplify-merges'
66

77
enum Category {
88
checker
@@ -194,6 +194,7 @@ const category_map = {
194194
.comptime: '#### Comptime'
195195
.tools: '#### Tools'
196196
.compiler_internals: '#### Compiler internals'
197+
.examples: '#### Examples'
197198
}
198199

199200
fn (l Line) write_at_category(txt string) ?string {

examples/sokol/06_obj_viewer/show_obj.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ fn main() {
277277
obj_part: 0
278278
}
279279

280-
app.file_name = 'v.obj' // default object is the v logo
280+
// app.file_name = 'v.obj' // default object is the v logo
281+
app.file_name = 'utahTeapot.obj' // default object is the v logo
281282

282283
app.single_material_flag = false
283284
$if !android {

vlib/v/checker/checker.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4804,7 +4804,8 @@ fn (mut c Checker) ensure_type_exists(typ ast.Type, pos token.Pos) bool {
48044804
return false
48054805
}
48064806
sym := c.table.sym(typ)
4807-
if !c.is_builtin_mod && sym.kind == .struct_ && !sym.is_pub && sym.mod != c.mod {
4807+
if !c.is_builtin_mod && sym.kind == .struct_ && !sym.is_pub && sym.language == .v
4808+
&& sym.mod != c.mod {
48084809
c.error('struct `${sym.name}` was declared as private to module `${sym.mod}`, so it can not be used inside module `${c.mod}`',
48094810
pos)
48104811
return false

0 commit comments

Comments
 (0)