1
0
mirror of https://github.com/exaloop/codon.git synced 2025-06-03 15:03:52 +08:00

98 Commits

Author SHA1 Message Date
Ibrahim Numanagić
e4c7956fde Fix #337 2025-02-25 19:34:44 -08:00
Ibrahim Numanagić
d63d472317 Fix #105 2025-02-25 18:05:55 -08:00
Ibrahim Numanagić
6665d863a7 Fix 'typecheck too long' message; Fix ScopingVisitor handling of Dot/Index assignments; Fix translate.cpp's __ptr__ 2025-02-07 19:04:30 -08:00
Ibrahim Numanagić
d47e17a02a Fix TypeWrap wrappers 2025-02-03 11:54:50 -08:00
Ibrahim Numanagić
d4069fae4f Merge branch 'develop' of github.com:exaloop/codon into typecheck-v2 2025-01-28 09:14:37 -08:00
Ibrahim Numanagić
7422f46f72 Fix incorrect context retrieval from unrelated realizations 2025-01-26 15:03:58 -08:00
Ibrahim Numanagić
bd0933074a Fix ExprTime initialization; Reduce function realizations; Wrap captured functions as Partials; Fix hasattr with arguments; Add Attr::ExprDoNotRealize 2025-01-26 11:58:37 -08:00
Ibrahim Numanagić
740815f2b8 Track statement times to properly reference names in case of delayed typechecking; Static short-circuiting; Tiered delayed generic resolution 2025-01-18 21:30:37 -08:00
Ibrahim Numanagić
04913cd405 Fix NTuple handling 2024-12-12 19:13:54 -08:00
Ibrahim Numanagić
2cff95109d ScopingVisitor new error handling 2024-12-08 12:20:55 -08:00
Ibrahim Numanagić
ecaa8d906e New f-strings (fix #304; fix #359); Better (but slower) capture-aware function type instantiation 2024-12-03 12:23:44 -08:00
Ibrahim Numanagić
48c848cf52 Fix #250 (raise ... from) 2024-11-26 10:47:57 -08:00
Ibrahim Numanagić
0dee70c175 Add TypeWrap to support passing instantiated types 2024-11-08 10:50:44 -08:00
Ibrahim Numanagić
ccd26997d7 Refactor wrapExpr (make it pure) 2024-10-21 13:50:36 -07:00
Ibrahim Numanagić
37ff25a907
Fix underscore float parsing (#596)
* Fix underscore float parsing

* Add tests

* Update float parsing

---------

Co-authored-by: A. R. Shajii <ars@ars.me>
2024-10-01 15:35:11 -04:00
Ibrahim Numanagić
efbc26a3b5 Fix variardic tuples 2024-09-07 11:31:01 -07:00
Ibrahim Numanagić
6e4c639e3f Merge branch 'develop' into typecheck-v2 2024-09-03 17:38:17 -07:00
Ibrahim Numanagić
5a484ea76e Fix auto-deduce classes 2024-09-02 18:16:07 -07:00
Ibrahim Numanagić
128ec5229c Refactor field access (getters/setters); Remove direct access to cache; Use raw pointers for types 2024-08-31 11:49:42 -07:00
Ibrahim Numanagić
3ce5295f45 Refactor CallExpr routing 2024-08-14 18:56:02 -07:00
Ibrahim Numanagić
b3bfdc8655 Refactor CallExpr routing [wip] 2024-08-14 09:32:03 -07:00
Ibrahim Numanagić
94b623d174 Refactor CallExpr routing [wip] 2024-08-12 08:00:17 -07:00
Ibrahim Numanagić
ac309a6900 Refactor CallExpr routing [wip] 2024-08-10 13:51:52 -07:00
Ibrahim Numanagić
2928713a7c Refactor CallExpr routing [wip] 2024-08-09 21:47:42 -07:00
Ibrahim Numanagić
843644f04f Merge branch 'develop' into typecheck-v2 2024-05-03 21:09:08 -07:00
Ibrahim Numanagić
f73e974a3d Remove default inits; various bugfixes 2024-04-21 14:05:06 -07:00
Ibrahim Numanagić
547c744b53 Fix infer [wip] 2024-03-28 14:56:25 -07:00
Ibrahim Numanagić
03cbed7c31 Fix constructor passing 2024-03-22 06:47:27 -07:00
Ibrahim Numanagić
127bca6cf3 Fix methodcaller 2024-03-21 15:39:30 -07:00
Ibrahim Numanagić
e737536b38 Fix polymorphism 2024-03-18 16:15:36 -07:00
Ibrahim Numanagić
df94b9061c Remove RecordType 2024-03-09 18:18:10 -08:00
Ibrahim Numanagić
d02775dec0 Fix statics [wip] 2024-03-08 16:51:18 -08:00
Ibrahim Numanagić
c16dfb5654
Fix sub-imports (#538)
* Fix sub-imports

* Fix sub-imports

* Remove log lines

---------

Co-authored-by: A. R. Shajii <ars@ars.me>
2024-02-07 10:36:07 -05:00
Ibrahim Numanagić
9a1c2741ee Fix imports and Python [wip] 2024-01-17 21:33:13 -08:00
A. R. Shajii
d23c8c7a75
Support "key" argument on min() and max() builtins (#505)
* Support "key" argument on min() and max() builtins

* Delay overload selection when arguments are not known (delayed dispatch)

* Delay 'is None' for 'Optional[T]' until type is known

* Fix union overload selection

* Add static string slicing

* Fix itertools.accumulate

* Fix list comprehension optimization ( minitech:imports-in-list-comprehensions )

* Fix match or patterns

* Fix tests and faulty static tuple issue

* Fix OpenMP reductions with new min/max functions

* Fix domination of dominated bindings; Fix hasattr overloads; Fix arg=None handling

* Fix empty return handling; Mark generators with an attribute

* Fix #487

* Fix test

* Fix IR pass

---------

Co-authored-by: Ibrahim Numanagić <ibrahimpasa@gmail.com>
2024-01-12 19:27:29 -05:00
Ibrahim Numanagić
10503d3c2a Fix loops 2024-01-09 12:31:45 -08:00
Ibrahim Numanagić
cdc8e17955 Fix static issues 2024-01-08 23:09:29 -08:00
A. R. Shajii
d609629489
Format 1-element tuples as "(x,)" (#521)
* Format 1-element tuples as "(x,)"

Currently, single-element tuple "repr" / "str" gives "(x)", but it should really give "(x,)" according to Python.

* Fix tests
2024-01-02 13:35:55 -05:00
Ibrahim Numanagić
416cc5fa59
Bugfixes (Dec 2023) (#515)
* Delay overload selection when arguments are not known (delayed dispatch)

* Delay 'is None' for 'Optional[T]' until type is known

* Fix union overload selection

* Add static string slicing

* Fix itertools.accumulate

* Fix list comprehension optimization ( minitech:imports-in-list-comprehensions )

* Fix match or patterns

* Fix tests and faulty static tuple issue
2023-12-26 09:35:03 -05:00
Ibrahim Numanagić
cff38ea734 Fix cond tests [wip] 2023-12-13 17:23:50 -08:00
Ibrahim Numanagić
bef36e016a Fix call tests [wip] 2023-12-09 18:13:07 -08:00
A. R. Shajii
b4a3f890ff
Property setters (#501)
* Fix __from_gpu_new__

* Fix GPU tests

* Update GPU debug codegen

* Add will-return attribute for GPU compilation

* Fix isinstance on unresolved types

* Fix union type instantiation and pendingRealizations placement

* Add float16, bfloat16 and float128 IR types

* Add float16, bfloat16 and float128 types

* Mark complex64 as no-python

* Fix float methods

* Add float tests

* Disable some float tests

* Fix bitset in reaching definitions analysis

* Fix static bool unification

* Add property setters

* Remove log

* Add Union hasattr support

* Fix union bugs; Move union logic to internal.codon; Add fn_can_call for any expression

* Fix isinstance(x, Union)

---------

Co-authored-by: Ibrahim Numanagić <ibrahimpasa@gmail.com>
2023-12-04 11:14:08 -05:00
A. R. Shajii
78a3d7d982
Union hasattr (#500)
* Fix __from_gpu_new__

* Fix GPU tests

* Update GPU debug codegen

* Add will-return attribute for GPU compilation

* Fix isinstance on unresolved types

* Fix union type instantiation and pendingRealizations placement

* Add float16, bfloat16 and float128 IR types

* Add float16, bfloat16 and float128 types

* Mark complex64 as no-python

* Fix float methods

* Add float tests

* Disable some float tests

* Fix bitset in reaching definitions analysis

* Fix static bool unification

* Add property setters

* Remove log

* Add Union hasattr support

---------

Co-authored-by: Ibrahim Numanagić <ibrahimpasa@gmail.com>
2023-11-27 12:24:21 -05:00
A. R. Shajii
7fdbc7f21e
Property setters (#499)
* Fix __from_gpu_new__

* Fix GPU tests

* Update GPU debug codegen

* Add will-return attribute for GPU compilation

* Fix isinstance on unresolved types

* Fix union type instantiation and pendingRealizations placement

* Add float16, bfloat16 and float128 IR types

* Add float16, bfloat16 and float128 types

* Mark complex64 as no-python

* Fix float methods

* Add float tests

* Disable some float tests

* Fix bitset in reaching definitions analysis

* Fix static bool unification

* Add property setters

* Remove log

---------

Co-authored-by: Ibrahim Numanagić <ibrahimpasa@gmail.com>
2023-11-22 10:43:25 -05:00
A. R. Shajii
1e6382c564
Fix domination within deeply nested blocks (#485)
Co-authored-by: Ibrahim Numanagić <ibrahimpasa@gmail.com>
2023-10-03 17:04:15 -04:00
Ibrahim Numanagić
ce459c5667
New Tuple machinery (#462)
* Refactor Tuple class

* Add Tuple[N,...] support; Fix inline operators with list brackets

* Fix Tuple[N,...] support

* Merge Sequre SIMD changes

* Fix repeat-tuple unification

* Fix staticlen in OpenMP

* Fix isinstance unification

* Fix delayed unification with static realization

* Fix CI

* Cleanup

* Use "fcmp une" in float.__ne__()

---------

Co-authored-by: A. R. Shajii <ars@ars.me>
2023-09-26 10:49:14 -04:00
Ibrahim Numanagić
502eed22f4 Add missing tests 2023-09-22 10:11:00 -07:00
Ibrahim Numanagić
9e6a4e5515 Fix access tests 2023-09-22 10:10:24 -07:00
Ibrahim Numanagić
750bb28c9c
Bugfixes 2023-08 (#440)
* Fix type argument overload issue; Fix Cython version for CI

* Add __contains__ for kwargs

* Add get() for kwargs

* Add static <<, >> and unary ~

* Fix CI

* Fix OpenMP "ordered" clause

* Fix static ~

* Fix Cython 3 issues

* Fix Python MANIFEST.in

---------

Co-authored-by: A. R. Shajii <ars@ars.me>
2023-08-12 10:39:45 -04:00
Ibrahim Numanagić
c6faa0ecfa Fix tests 2023-08-09 12:40:27 +02:00