Commit graph

931 commits

Author SHA1 Message Date
Joe C
a63f3e6f77
coroutines: use photon work_pool when nr_jobs > 0, and use photon libc fn wrappers (#19711) 2023-10-31 20:12:52 +03:00
Larpon
775b25e11b
sokol: update to match uptream at 9e0f1b4 (#19687) 2023-10-28 17:15:46 +03:00
Larpon
95509cf8fb
all: make all struct C.XYZ -> pub struct C.XYZ (#19651) 2023-10-25 15:01:50 +03:00
Turiiya
9051ac8921
all: fix typos (#19634) 2023-10-23 21:21:15 +03:00
Delyan Angelov
0fb38edcb6
ci: fix vcreate_input_test.v on FreeBSD (expect is in /usr/local/bin there, if installed) (#19578) 2023-10-16 10:11:51 +03:00
Alexander Medvednikov
545ee1ae23 checker: stricter rules for C types; C aliases; sokol fixes 2023-10-14 18:31:44 +03:00
pomid
5f1e6815cd
examples: fix net_udp_server_and_client.v with latest V and latest net module (listen on 0.0.0.0, and dial to 127.0.0.1) (#19564) 2023-10-14 17:08:26 +03:00
Turiiya
c4ee940047
tests: fix input tests with expect, not covering false negatives (#19518) 2023-10-10 20:37:21 +03:00
Alexander Medvednikov
4f85b49bb5 all: new int fixes 2023-10-08 14:12:38 +03:00
Larpon
3c68e78f32
sokol: fix usage of sokol sampler (#19527) 2023-10-07 21:05:30 +03:00
Alexander Medvednikov
0bf85d049e sokol: upgrade to latest version, fix all related issues 2023-10-05 20:22:49 +03:00
Tim Marston
756075380b
orm: add null handling and option fields (#19379)
* orm: added is none and !is none handling

* orm: added NullType, support option fields and deprecate [nonull]

Nullable DB fields are now determined by corresponding option struct field.  The
[nonull] attribute is deprecated and fields are all NOT NULL now, unless they
are option fields. New orm primitive, NullType, added to support passing none
values to db backends, which have been updated to support it.  Also, empty
string and 0 numberic values are no longer skipped during insert (since they may
be valid values).

* orm: fix [nonull] deprecation warning

* orm: add null handling to update and select

also, improved formatting for orm cgen, and removed optimised operand handling
of orm `is` and `!is` operators

* sqlite: read/report NULLs using new orm NullType

* postgres: returning data primitives now returns new orm.NullType

* orm: initialise NullType Primitives properly

* orm: do not smart cast operands inside sql

* orm: fix bad setting of option value

* orm: improve orm_null_test.v, adding/fixing selects

* orm: cleanup: rename NullType->Null, use serial const, cgen output

* orm: handle automatically generated fields more explicitly

During insert, fields which are
* [sql: serial]
* [default: whatever]
and where the data is a default value (e.g., 0, ""), those fields are not sent
to the db, so that the db can generate auto-increment or default values.  (This
was previously done only for [primary] fields, and not in all circumstances, but
that is not correct -- primary and serial/auto-increment fields are differnet.)

* orm: udpated README

* orm: select cgen fixes: read from uninit res; fail to init res

* orm: udpated tests

* orm: fix option sub-struct fields

* orm: fixed joins to option structs

Changed orm.write_orm_select() so that you pass to it the name of a resut
variable which it populates with the result (or not) and changed use of it in
sql_select_expr() and calls in write_orm_select() to populate substructs.

* orm: fix pg driver handling of NULL results

* orm: move runtime checks to comptime checker; cache checked tables

* orm: vfmt :(

* orm: markdown formatting

* orm: renamed orm.time_ and orm.enum_; updated db drivers

* checker: updated orm tests

* orm: fix issue setting up ast option values as orm primitives

* checker: ORM use of none/options and operations (added tests)

* orm: fixed tests

* db: clean code

* examples: remove orm nonull attributes

* orm: skip test memory santisation for orm_null_test.v

* orm: make the type-to-primitive converstion fns not public

* orm: mv object var c-code from checker->cgen; fix memory corruption

Code in checker/orm.v used the SqlStmtLine object field name to store c-specific
referenecs to option and array fields (for arrays of children).  I moved this
logic to cgen.  And fixed an issue introduced with option fields, where an array
of children was unpacked into a non-array result which could corrupt memory.

* orm: fixed vast error

* orm: skip 2 tests on ubuntu-musl which require sqlite3.h

* cgen: prevent casting a struct (string)

* v fmt orm_fkey_attribute.vv, orm_multidim_array.vv, orm_table_attributes.vv; run `VAUTOFIX=1 ./v vlib/v/compiler_errors_test.v`
2023-10-05 19:09:03 +03:00
Delyan Angelov
7a49f24eb1
examples: fix brainvuck.v (handle [ and ] properly); allow both brainvuck.v wasm_codegen/bf_compiler.v to work with .b files too 2023-10-03 17:01:55 +03:00
l-m
7ebee2ed36
examples: add a brainfuck->wasm compiler example (#19492) 2023-10-02 14:42:02 +03:00
Alexander Medvednikov
5cc1db8318 0.4.2 changelog 2023-09-30 14:41:41 +03:00
Delyan Angelov
6fc3a3d088
examples: add examples/gg/sample_count.v, showing the influence of the sample_count gg.Config parameter 2023-09-29 12:06:06 +03:00
Keito Tobichi
86a2917fdd
examples: add another graph example for bread first search with backtracking (#19463) 2023-09-28 14:23:58 +03:00
Delyan Angelov
edc9ff4f12
examples: add more .obj files for 06_obj_viewer (#19406) 2023-09-22 09:59:52 +03:00
Delyan Angelov
c075e44ec1
ci,examples: fix v examples/sokol/simple_shader_glsl/simple_shader.v, ensure it compiles on the misc-tooling job (#19404) 2023-09-21 19:44:58 +03:00
yuyi
55ca8d8d8e
fmt: align the custom values of the enum fields (#19331) 2023-09-12 14:44:38 +03:00
Turiiya
1e38cc0986
checker: disallow module name duplicates in local names (#18118) 2023-09-08 23:33:35 +03:00
Delyan Angelov
c44a89649a
examples: add examples/fetch_ip.v, showing how to contact http://ifconfig.co/json and parse the result 2023-09-06 12:24:01 +03:00
yuyi
18e60e77de
fmt: remove inline comments (#19263) 2023-09-03 23:51:56 +03:00
Delyan Angelov
6fb4a481f8
log: improve the most common use case (#19242) 2023-08-31 06:44:11 +03:00
Mustafa Ateş Uzun
8b0a1e2c71
gg, sokol.sapp: fix typo (.files_droped -> .files_dropped), add deprecation tags for the old value (#19190) 2023-08-21 22:32:24 +03:00
Delyan Angelov
be1270540b
gg: use html5_canvas_name as the name of the canvas in gg.js.v too, similarly to gg.c.v 2023-08-13 17:45:19 +03:00
Delyan Angelov
33965bc29b
examples/2048: remove the emscripten specific code from examples/2048/2048.v (moved to gg.c.v) 2023-08-13 17:31:29 +03:00
Delyan Angelov
ca0f589310
examples/tetris: add instructions, on how to compile the game through Emscripten and v -os wasm32_emscripten 2023-08-13 17:28:27 +03:00
Delyan Angelov
88d3326a60
ci: fix v check-md examples/2048/ 2023-08-13 13:04:00 +03:00
Delyan Angelov
dad93f8fab
examples/2048: add instructions, on how to compile the game through Emscripten and v -os wasm32_emscripten 2023-08-13 11:13:17 +03:00
jacksonmowry
76b4c92848
db.sqlite: make functions return results, breaking change (#19093) 2023-08-10 05:39:32 +03:00
Everton J. Carpes
357ac0bb5a
examples: show how to call a simple v module from ruby (#19073) (#19073)
This is a copy/adaptation of the python example (#13105)
2023-08-07 07:07:00 +03:00
Delyan Angelov
b9a523cefd
time: store time with nanosecond resolution in time.Time, deprecate Time.microsecond, add utility methods and tests (#19062) 2023-08-05 23:41:23 +03:00
Lucas V. Araujo
ecca3b155e
net.mbedtls: add SSLListener to allow creating SSL servers (#19022) 2023-08-01 20:45:50 +03:00
Turiiya
c4a679186f
examples, readme: fix typos (#18994) 2023-07-29 15:27:03 +03:00
Delyan Angelov
d25e213aa8
tools, examples: add --only-watch=*.v option to v watch (#18974) 2023-07-27 09:50:26 +03:00
Delyan Angelov
41f99c1abf
tools: add cmd/tools/show_ancient_deprecations.v, to cleanup ancient functionality, deprecated over an year ago (#18946) 2023-07-22 19:13:58 +03:00
Turiiya
0915d87c7c
examples: cleanup process_script.v (#18899) 2023-07-18 17:22:26 +03:00
Casper Kuethe
a43064af07
picoev, picohttparser: reimplement in V (#18506) 2023-07-12 09:40:16 +03:00
Delyan Angelov
e7af25ec14
examples: add examples/gg/many_thousands_of_circles.v, thanks to @xjunko, document how to use ctx.end(how:.passthru). (#18832) 2023-07-10 15:33:14 +03:00
kbkpbot
b3a6b73306
eventbus: add generic support for event name (#18805) 2023-07-07 22:33:57 +03:00
Turiiya
a27f2ddcc3
term.ui, vweb, v: update deprecated functions (#18726) 2023-07-02 09:38:33 +03:00
Turiiya
b2ca3ac089
net.html: fix semantic inconsistencies of tag retrieving functions (#18558) 2023-06-27 20:10:31 +03:00
Turiiya
af4e113f6c
vweb: use <head> instead of <header> in the html templates (#18516) 2023-06-22 11:11:02 +03:00
yuyi
1623cc3a51
fmt: fix functions with short arguments (fix #18398) (#18459) 2023-06-16 09:47:40 +03:00
Turiiya
285000699b
tools: remove residues that specify size for tab indents (#18426) 2023-06-13 08:53:12 +03:00
Mark aka walkingdevel
f634f7b01f
mysql: connection fixes (#18428) 2023-06-13 08:49:41 +03:00
Alexander Medvednikov
f73e99cddd examples: add http.get and file writes to the coroutines example 2023-06-12 13:05:59 +03:00
Alexander Medvednikov
16ce94e13c examples: fix ci (vfmt) 2023-06-08 01:51:40 +03:00
Alexander Medvednikov
e55175fcaa examples: no longer use printf in the coroutines example 2023-06-07 16:48:33 +02:00