Commit Graph

54 Commits (6c6bb085479338931ee2f1772504e05708674dc5)

Author SHA1 Message Date
Alexander Ivanov 0386f2bbea
checker: add an interface check for mutability, fixes #1081, fixes #7038 (#11963) 2021-10-11 15:41:31 +03:00
playX 82f187e5e0
js: fix `rand` build, properly use key values on map, add `rand.string` (#12020) 2021-10-01 21:23:49 +03:00
Delyan Angelov 8837712f2b
rand: fix leaks with -autofree 2021-09-23 12:24:03 +03:00
playX 0121c8b4fd
v.gen.js: fix method calls and other codegen parts, rand module compiles (#11205) 2021-08-18 11:33:37 +03:00
playX 659f823c5c
js: initial work on porting rand module to JS backend (#11188) 2021-08-15 18:09:51 +03:00
Delyan Angelov efa8dcf4d2
time: turn Time.unix to i64, so it can represent times before 1970-01-01, fix time operators, add more tests (#11050) 2021-08-04 13:12:02 +03:00
Daniel Däschle ad3835b598
parser: deprecate short struct init (#10842) 2021-07-20 11:17:08 +03:00
Uwe Krüger 60c880a0cc
vlib: use `malloc_noscan()` where possible (#10465) 2021-06-15 14:47:11 +03:00
Uwe Krüger bd467f94ab
encoding: append `0` to strings for compatibility (#10249) 2021-05-29 16:31:52 +03:00
Delyan Angelov 8a380f4699
tools: make `v test-cleancode` test everything by default (#10050) 2021-05-08 13:32:29 +03:00
Uwe Krüger d26ac5692e
all: various fixes for [heap]/auto-heap handling (#10033) 2021-05-07 15:58:48 +03:00
Subhomoy Haldar 08da33fa5a
rand: add non uniform distributions in the `rand.dist` module (#9274) 2021-03-12 21:24:43 +02:00
Subhomoy Haldar a5dd7faf3c
rand: add PRNG interface and unit-tests (#9083) 2021-03-03 13:41:00 +02:00
Delyan Angelov b89c6d7826
Revert "rand: use static instead of __global (#9057)"
This reverts commit ec2f731801.
2021-03-03 08:36:56 +02:00
Delyan Angelov ec2f731801
rand: use static instead of __global (#9057) 2021-03-03 07:47:47 +02:00
Subhomoy Haldar 745b40c0a3
rand: refactor string sampling functions to remove redundancy (#8830) 2021-02-19 11:16:02 +02:00
Nick Treleaven ea803113c3
checker: check `unsafe` V function calls (#8752) 2021-02-14 19:31:42 +01:00
cbracketdash c636a7080d
rand: add rand.ascii (#8675) 2021-02-11 08:32:40 +02:00
cbracketdash eb7009b60a
rand: generate hexadecimal numbers (#8664) 2021-02-10 11:01:25 +01:00
Subhomoy Haldar 7e3b3a9efc
rand: update byte() (#8442) 2021-01-30 14:19:14 +01:00
Delyan Angelov dd96852515
ci: fix compilation of term.ui examples on windows 2021-01-26 19:26:05 +02:00
Subhomoy Haldar 97103f680a
rand: separate rand.util and rand.seed submodules (#8353) 2021-01-26 15:55:09 +02:00
Lukas Neubert ac2c3847af
all: update copyright to 2019-2021 (#8029) 2021-01-18 13:20:06 +01:00
Larpon ed6ba0a2b8
rand: document all functions, document range notation form, fix copy-pasta (#7619) 2020-12-27 20:06:17 +02:00
Delyan Angelov 5d4cce3e95 ci: fix failing tests 2020-10-15 15:42:16 +03:00
Henrixounez c324169af0
all: remove intermediate handling for both global definition syntaxes (#6546) 2020-10-03 15:41:45 +02:00
Delyan Angelov 36eae1c175
builtin: x.vstring() instead of string(x) (#6102) 2020-08-10 18:05:26 +02:00
Delyan Angelov dfa01d8877 rand: add rand.ulid_at_millisecond/1, use it in rand.ulid/0 2020-07-26 14:17:29 +03:00
penguindark 7d52d612ce
rand: add rand.ulid() (#5979)
* removed debug println

* added newline to the end of the file

* time: add .unix_time_milli() method; rand,time: add tests

* rand: add more ulid tests; move tests to a separate file random_identifiers_test.v

* run vfmt over vlib/rand/random_identifiers_test.v

* speed up time.unix_time_milli

* simplify and speedup time.unix_time/0 and time.new_time/1

* update comment about rand.ulid()

* fix terminating 0 off by 1 issue in rand.ulid()

* optimize time.new_time()

* restore the master version of vlib/time/parse.v

* make test_unix_time more robust

Co-authored-by: Delyan Angelov <delian66@gmail.com>
2020-07-26 13:10:56 +03:00
Delyan Angelov 6fcc6cdc75 rand: add comments for rand.uuid_v4, apply some more perf tweaks 2020-07-25 21:39:54 +03:00
Delyan Angelov ee3ebed23c rand: further speed up of rand.uuid_v4 2020-07-25 20:21:44 +03:00
Delyan Angelov d5b837e808 rand: speed up rand.uuid_v4() ~7x, with -prod 2020-07-25 13:09:05 +03:00
Delyan Angelov 289974dd15 rand: use time microseconds too in default rand initialization; generate proper uuid_v4 2020-07-24 14:33:58 +03:00
Delyan Angelov bba0edf9a3 rand: add rand.uuid_v4() 2020-07-24 13:59:24 +03:00
Alexander Medvednikov ec443c65a8 tests: fix some tests 2020-07-24 01:55:55 +02:00
Nick Treleaven ee349691f9
v/checker: Warn about pointer indexing outside unsafe {} (#5918) 2020-07-22 20:28:53 +03:00
Alexander Medvednikov c563168d69 rand: string() 2020-07-15 21:36:09 +02:00
Hungry Blue Dev e649cf84e3
rand: reorganize: phase 2 2020-06-09 15:06:07 +02:00
ka-weihe 13c68eb81e
rand: fix warnings 2020-06-02 06:39:38 +02:00
Hungry Blue Dev a7c84834f4
rand: reorganize (step 1) 2020-06-01 21:13:56 +02:00
Hungry Blue Dev e89ae7e194
rand: refactor rand.v and random_numbers_test.v 2020-05-28 02:16:17 +03:00
div72 48cc8dd86b
rand: cleanup of rand_f32xxx and rand_f64xxx functions 2020-05-27 20:13:57 +03:00
Larpon 8c753ddf8d
rand: add random functions for f32 and f64, [0,max] and [min,max] versions 2020-05-27 16:41:37 +03:00
Alexander Medvednikov e9177faf17 checker: allow `*x = y` only inside unsafe blocks 2020-05-11 16:05:59 +02:00
Alexander Medvednikov 153ac230ec tests: use new array init syntax, fix mutability 2020-04-26 11:56:30 +02:00
Alexander Medvednikov a9a8f8c804 rand: remove duplicate C fn 2020-04-13 20:11:44 +02:00
Alexey ef339a4896
rand: update module 2020-04-03 08:53:57 +02:00
Alexander Medvednikov 07ea1eff81 glfw: more fn definitions 2020-04-02 02:02:12 +02:00
joe-conigliaro 7f709c3285
update copyright years 2020-02-03 05:00:36 +01:00
Alexander Medvednikov 6210984c97 run vfmt 2019-12-20 02:09:56 +03:00