Alexander Medvednikov
7008059c89
builtin: use isize in memdup
2023-10-07 03:39:28 +03:00
Alexander Medvednikov
e957e5c089
cgen: do not generate unnecessary memdup() definition
2023-10-07 03:31:24 +03:00
Spydr
32bb8cf86d
all: implement @VCURRENTHASH
to replace C.V_CURRENT_COMMIT_HASH
( #19514 )
2023-10-05 18:14:36 +03:00
Sudoer
5c37c312b0
builtin,math: add more missing doc strings for public functions ( #19509 )
2023-10-05 00:35:37 +03:00
Spydr
8cfe9e81fc
native, builtin: implement little improvements from #19498 and remove vcommithash()
in favor of @VHASH
( #19508 )
2023-10-05 00:30:55 +03:00
Spydr
6d1558b006
native, builtin, ast: handle ast.HashStmt
correctly and reduce macro usage in builtin
( #19498 )
2023-10-04 16:42:15 +03:00
Delyan Angelov
c79f84d406
builtin: add input_character/0 and print_character/1 ( #19502 )
2023-10-04 04:40:03 +03:00
Delyan Angelov
fae46a8d85
builtin: extract vlib/builtin/result.v from vlib/builtin/option.v
2023-10-03 08:36:13 +03:00
Delyan Angelov
a79c574cb9
ci: fix v -cstrict vlib/builtin/array_test.v
2023-10-01 09:18:07 +03:00
Delyan Angelov
ec9ac7715a
builtin: add an unsafe { a.reset() }
method, for quickly setting all bytes in an array to 0
2023-10-01 07:22:42 +03:00
Delyan Angelov
c030c5efa8
builtin: extract backtraces.c.v, backtraces_nix.c.v, backtraces_windows.c.v ( #19480 )
2023-09-30 19:24:31 +03:00
yuyi
ec30256c7f
builtin: cleanup obsolete function in string.v and array.v ( #19451 )
2023-09-27 19:49:33 +03:00
yuyi
981f76cd04
builtin, cgen: fix printing slice of fn call string ( #19450 )
2023-09-27 14:53:56 +03:00
Delyan Angelov
e115d4461c
checker: allow for each(a, |x| println(x))
, i.e. using lambda expressions, when expecting fn (x int)
2023-09-27 11:49:12 +03:00
Ikko Eltociear Ashimine
7e08a50ea5
builtin: fix typo in string.v ( #19431 )
2023-09-24 15:11:47 +03:00
Delyan Angelov
a685088fbd
checker: support lambda expressions in array methods like a.map(|x|x*10)
too ( #19424 )
2023-09-23 22:08:48 +03:00
Delyan Angelov
f93d257d29
all: support short lambda expressions like a.sorted(|x,y| x > y), in all callsites that accept a fn callback ( #19390 )
2023-09-20 17:22:16 +03:00
Delyan Angelov
7ffa8c13bf
vlib: remove functions and fields, deprecated before 2023-03-20
...
* remove []int.reduce in favour of arrays.fold
* remove datatypes.Set.equal in favour of datatypes.Set.==
* remove datatypes.Set.difference in favour of datatypes.Set.-
* remove gg.Context.set_cfg in favour of gg.Context.set_text_cfg
* remove gg.Context.timage_pip in favour of gg.Context.pipeline.alpha
* remove os.is_writable_folder in favour of os.ensure_folder_is_writable
Discovered with `v run cmd/tools/show_ancient_deprecations.v 180`
2023-09-16 17:16:54 +03:00
shuankio
a0490f2b67
net.http: fix post error with https on windows ( #19334 )
2023-09-12 15:43:13 +03:00
yuyi
55ca8d8d8e
fmt: align the custom values of the enum fields ( #19331 )
2023-09-12 14:44:38 +03:00
Kim Shrier
621cb6dde0
builtin: use libgc-threaded
on FreeBSD, to get the threaded version of libgc ( #19294 )
2023-09-07 12:26:46 +03:00
Delyan Angelov
fca8092523
builtin: fix the wording of panic messages, about sorting not working with -freestanding
...
Thanks @MPetr for spotting it.
2023-09-01 10:04:29 +03:00
Delyan Angelov
58b6ba81d1
builtin: implement array.sorted() and array.sorted_with_compare() methods, that do not modify their receivers ( #19251 )
2023-09-01 09:12:00 +03:00
Delyan Angelov
803001edaa
builtin: add support for -d bultin_writeln_should_write_at_once
and -d bultin_write_buf_to_fd_should_use_c_write
( #19243 )
2023-08-30 23:44:33 +03:00
Delyan Angelov
d503435dd4
builtin: always show the assert message, if it was defined in the source, in non test programs too ( fix #19240 )
2023-08-30 21:05:23 +03:00
Turiiya
f755118e7c
vlib: update doc comments ( #19231 )
2023-08-30 08:50:00 +03:00
yuyi
815439a381
checker: fix assigning an array slice ( fix #19120 ) ( #19137 )
2023-08-15 20:37:51 +03:00
shove
11a8a46ade
tests: cleanup test cases ( #19104 )
2023-08-13 13:36:08 +03:00
Delyan Angelov
eef9b5f168
builtin,os: fix compiling V programs with latest clang 16 on windows (clang 16 is stricter than clang 14) ( #19095 )
2023-08-09 15:04:44 +03:00
katekyy
b622dca915
builtin: fix split_nth() and rsplit_nth() on an empty delimeter ( #19005 )
2023-07-30 00:12:51 +03:00
Alexander Medvednikov
b29a084257
builtin: move array.data to the top of the struct
2023-07-23 18:53:19 +03:00
Delyan Angelov
466c80f80a
vlib: remove methods deprecated before 2022-07-22 ( #18944 )
2023-07-22 18:11:12 +03:00
Kim Shrier
64a8c14a3c
builtin: fix the comments about flushing on print/1
and println/1
( #18927 )
2023-07-21 18:44:13 +03:00
l-m
c422919481
wasm: remove dependency on thirdparty/binaryen, webassembly backend rewrite ( #18120 )
2023-07-12 15:24:38 +03:00
Delyan Angelov
ded6c38061
vlib: add a new module builtin.wchar
, to ease dealing with C APIs that accept wchar_t*
( #18794 )
2023-07-07 02:40:11 +03:00
Delyan Angelov
884fbb0a98
builtin: implement string_from_wide/1 and string_from_wide2/2 on *nix too ( #18776 )
2023-07-04 15:49:15 +03:00
Delyan Angelov
9bf2449a7b
cgen: fix memleak for [][]T{len: x}, or []Struct{len: x} ( #18763 )
2023-07-04 06:32:19 +03:00
Delyan Angelov
4c9c515f8b
parser: remove hardcoded check for function calls for C.stat
, C.sigaction
, etc ( #18535 )
2023-06-24 08:03:12 +03:00
yuyi
d7a50b4a22
builtin: minor cleanup in sorted_map.v ( #18502 )
2023-06-21 12:34:05 +03:00
Ethan Hansen
5001b17336
docs: add docstring for map.move() ( #18430 )
2023-06-16 09:45:16 +03:00
Delyan Angelov
6806086bf1
builtin: zero out internal map/array pointers on m.free(), to reduce the work for the GC mark phase for non escaping maps/arrays, used in hot loops ( #18415 )
2023-06-14 15:00:36 +03:00
sandbankdisperser
e97aff8742
time: add more detailed error descriptions, add custom format parsing with time.parse_format ( #18257 )
2023-06-06 18:43:10 +03:00
Delyan Angelov
d47c722c1f
builtin: fix byte deprecation warnings for v test-all
(the -freestanding compilation)
2023-05-29 13:20:29 +03:00
Alexander Medvednikov
f22ba836fd
prealloc: use u8 instead of byte
2023-05-29 01:42:52 +02:00
Ikko Eltociear Ashimine
abcbba1e81
builtin: fix typo in string.js.v ( #18213 )
2023-05-21 02:46:11 +03:00
Petr Makhnev
9d0a1d8496
builtin: speed up string methods with vmemcpy instead of for
loop for copying data ( #18211 )
2023-05-19 21:24:23 +03:00
Petr Makhnev
a39c26507c
builtin: speed up string concatenation and repeat()
method with vmemcpy instead of for
loop for copying data ( #18206 )
...
These changes almost do not speed up the program with the `-prod` flag,
since modern С compilers can do such optimization on their own, but in
normal mode, the performance gain is from 1.6 (concatenation) to 1.8 (repeat) times.
Concatenation:
Old (`for` loop):
Time (mean): 3.699 s +- 0.071 s [User: 3.629 s, System: 0.069 s]
Range (min ... max): 3.548 s ... 3.741 s 10 runs
New (vmemcpy):
Time (mean): 2.305 s +- 0.065 s [User: 2.263 s, System: 0.041 s]
Range (min ... max): 2.172 s ... 2.355 s 10 runs
`vmemcpy version` ran 1.60 +- 0.05 times faster than 'for loop version'
2023-05-19 16:18:23 +03:00
Felipe Pena
47761a42e9
all: attr for enum fields (+ json encode/decode) ( #18163 )
2023-05-13 01:08:30 +02:00
Felipe Pena
5008515b03
builtin: heap memory usage api ( #18103 )
2023-05-03 20:33:52 +03:00
Swastik Baranwal
d3de7adcc0
builtin: add C.scanf
fn decl to cfns.c.v
( #17965 )
2023-04-16 08:00:19 +03:00