24 Commits
Author SHA1 Message Date
a60d994e25 Improve Performance of the Type System (#824)
* export the checker and ensure no methods or fields are exported

* make Checker reusable

* add PatchAndCheck method to Checker, and reuse it in visitors

* avoid unnecessary map and consolidate structs

* make all Nature methods use pointer-receiver

* added cache for type and nature information

* optimize type and nature checks

* more aggressively cache some partial results and add cheap checks

* cache reused values

* reduce copying in Nature by breaking down optional fields

* enforce use of cache

* improve ergonomics of FromType and NatureOf

* improve struct method fetching

* make cache private to Nature

* first iteration improving struct reflect caching

* cleaned up struct fields data

* improve caching of functions data

* simplify checker code

* simplify and remove dead code

* add checker benchmarks

* address PR comments and minor improvements

* rename from SetCache to Bind

* make the benchmarks more fair

* fix benchmark option not being applied

* move Cache to be argument instead of field

* merge FuncData into Optional

* rename Optional to TypeData

* simplify struct logic

* cache builtin numeric types

---------

Co-authored-by: Anton Medvedev <[email protected]>
2025-09-18 14:38:27 +02:00
Anton MedvedevandGitHub d0aa2e9136 Improve types pkg (#668) 2024-06-05 01:14:25 +02:00
Anton MedvedevandGitHub c953d0dde1 Refactor types table (#667) 2024-06-04 00:08:01 +02:00
Anton MedvedevandGitHub 68e3148c1f Vendor testify (#642) 2024-05-08 00:24:35 +02:00
Anton MedvedevandGitHub 0d43107999 Add concat() builtin (#565)
* Add concat() builtin

* Use pkg deref in builtin

* Use pkg deref in checker

* Use pkg deref in types_table.go

* Use pkg deref in docgen.go

* Use pkg deref in vm
2024-02-16 22:32:35 +01:00
Anton Medvedev 551d2a7e0f Use expr-lang/expr 2023-12-03 21:53:01 +01:00
Anton Medvedev 32f5fde2eb Replace interface{} with any 2023-08-30 11:25:15 +02:00
Wytse VellemaandAnton Medvedev ba6cacc36c Add docgen types for most builtin types 2023-08-24 11:21:35 +02:00
Anton Medvedev 0b523f347e Sort imports 2022-10-22 13:39:04 +02:00
Anton Medvedev b00bc22be3 Remove litter dep 2022-10-20 21:24:01 +02:00
Alexander StankoandAnton Medvedev 2c9d20d599 fix docgen for ambiguous fields on nested structs 2020-05-19 10:34:49 +03:00
Alexander StankoandAnton Medvedev c3d0402581 fix docgen for ambiguous fields in embedded structs 2020-05-18 21:00:37 +03:00
Alexander StankoandAnton Medvedev 1a7fc268fc docgen: add package name to types 2020-04-23 22:34:31 +03:00
Anton Medvedev 7b2be0242a Output sorted fields in markdown 2020-03-27 15:25:51 +03:00
Anton Medvedev f29b494a24 Add markdown format to docgen 2020-03-21 13:41:18 +03:00
Anton Medvedev e5049dfda3 Make conf top-level package 2020-03-16 16:29:25 +03:00
Anton Medvedev 9f018f91d1 Add info about builtins and operators to docgen tool 2020-02-27 09:02:11 +03:00
Anton Medvedev bb54a08b53 Sort imports 2020-02-25 09:33:17 +03:00
Anton Medvedev aaf5d24ecb Reimplement expr parser 2020-02-25 09:33:17 +03:00
Anton Medvedev 344101a638 Fix func doc type 2019-08-26 19:01:48 +07:00
Anton Medvedev 79125033e5 Skip xxx 2019-08-26 18:53:51 +07:00
Anton Medvedev bdb0c89656 Improve docgen 2019-08-26 18:51:28 +07:00
Anton Medvedev f58b94ef0f Add docgen from map 2019-08-26 12:48:17 +07:00
Anton Medvedev 9aac713478 Add docgen 2019-08-26 11:34:51 +07:00