Commit Graph

111 Commits (830fc0f4531512e3c3e170bc4ce8a8e84942b141)

Author SHA1 Message Date
pca006132 c93f79f94a basic escape analysis for assignment statements 2022-04-05 22:19:23 +08:00
ychenfo a38cc04444 nac3core: assert statement 2022-03-29 06:56:40 +08:00
ychenfo 26a4834254 fix warnings 2022-03-26 18:52:08 +08:00
ychenfo 80631fc92b Option type support (#224)
Co-authored-by: ychenfo <yc@m-labs.hk>
Co-committed-by: ychenfo <yc@m-labs.hk>
2022-03-26 15:09:15 +08:00
ychenfo f7e62ab5b7 nac3ast/parser/core: use i128 for u64 constants 2022-03-08 18:21:14 +08:00
ychenfo 142e99a0f1 nac3core: fix broken tests 2022-03-08 13:34:08 +08:00
ychenfo 79c469301a basic unsigned integer support 2022-03-08 13:34:02 +08:00
pca006132 63b0f29728 Fix broken tests 2022-03-05 00:27:51 +08:00
Sebastien Bourdeauducq 59ac5aae8a fix error message string (2) 2022-03-02 08:33:13 +08:00
pca006132 846d1726ef nac3core: fixed keyword arguments handling 2022-02-26 16:34:30 +08:00
pca006132 d3cb5d6e52 Fixed type error messages 2022-02-22 17:22:15 +08:00
pca006132 ede3706ca8 type_inferencer: special case tuple index error message 2022-02-21 18:41:42 +08:00
pca006132 f97f93d92c applied rustfmt and clippy auto fix 2022-02-21 18:27:46 +08:00
pca006132 d9cb506f6a nac3core: refactored for better error messages 2022-02-21 18:24:19 +08:00
pca006132 352831b2ca nac3core: removed legacy location definition 2022-02-13 22:39:24 +08:00
pca006132 b18626b149 Fix compilation and test failures 2022-02-12 22:50:32 +08:00
pca006132 e303248261 nac3core: exception type check and codegen 2022-02-12 22:50:32 +08:00
pca006132 b267a656a8 nac3core: added exception type and fixed primitive representation
- Added `Exception` primitive type and some builtin exception types.
  Note that all exception types share the same layout, and should
  inherit from the base `Exception` type. There are some hacks in the
  toplevel module for handling exception types, we should revisit and
  fix them later.
- Added new primitive types to concrete type module, otherwise there
  would be some weird type errors.
- Changed the representation of strings to CSlice<u8>, instead of
  CString.
2022-02-12 22:13:59 +08:00
Sebastien Bourdeauducq fd4bf12808 fix grammar of some type error messages 2022-01-14 16:56:23 +08:00
ychenfo ae8f82ccb0 nac3core: fix broken tests 2022-01-14 16:28:37 +08:00
ychenfo 4a1a4dc076 nac3core/artiq/standalone: symbol resolver return error msg for type error of host variables 2022-01-14 16:28:34 +08:00
ychenfo eba9fc8a69 nac3core: add missing location for type inference 2022-01-14 03:05:11 +08:00
ychenfo 1ee857de6a nac3core: format, fix clippy warning 2022-01-09 01:12:18 +08:00
ychenfo 9b3b47ce50 fix broken tests 2021-12-28 01:38:16 +08:00
Sebastien Bourdeauducq 80d3ab1b0f remove bigints 2021-12-26 00:23:54 +08:00
ychenfo ff27a1697e nac3core: fix for loop type inference 2021-12-19 18:01:49 +08:00
pca006132 4b17511b4a Merge branch 'master' into KernelInvariant 2021-11-27 21:29:27 +08:00
ychenfo 4587088835 Constant Default Parameter Support (#98)
Add support for constant default parameter

Reviewed-on: M-Labs/nac3#98
Co-authored-by: ychenfo <yc@m-labs.hk>
Co-committed-by: ychenfo <yc@m-labs.hk>
2021-11-23 07:32:09 +08:00
pca006132 ba08deada6 nac3core: refactor codegen 2021-11-20 19:50:25 +08:00
ychenfo 8ab3ee9cce nac3core: AugAssign support (#82) 2021-11-13 12:24:22 +08:00
pca006132 b1e83a1fd4 nac3core: type check invariants
This rejects code that tries to assign to KernelInvariant fields and
methods.
2021-11-06 22:48:08 +08:00
ychenfo b239806558 nac3core: adapt to ast change due to comment support 2021-11-04 15:02:51 +08:00
Sebastien Bourdeauducq bf7e2c295a integrate nac3parser 2021-11-03 17:11:00 +08:00
Sebastien Bourdeauducq 47f563908a basic string support (#30) 2021-11-02 23:22:49 +08:00
Sebastien Bourdeauducq 613020a717 test: add missing id_to_name entry 2021-11-02 18:34:48 +08:00
pca006132 083eacc268 with parallel/sequential support
Behavior of parallel and sequential:
Each function call (indirectly, can be inside a sequential block) within a parallel
block will update the end variable to the maximum now_mu in the block.
Each function call directly inside a parallel block will reset the timeline after
execution. A parallel block within a sequential block (or not within any block) will
set the timeline to the max now_mu within the block (and the outer max now_mu will also
be updated).

Implementation: We track the start and end separately.
- If there is a start variable, it indicates that we are directly inside a
parallel block and we have to reset the timeline after every function call.
- If there is a end variable, it indicates that we are (indirectly) inside a
parallel block, and we should update the max end value.

Note: requires testing, it is difficult to inspect the output IR
2021-10-31 23:54:37 +08:00
pca006132 fb92b6d364 nac3core: supports range iterator 2021-10-23 23:53:36 +08:00
pca006132 c4259d14d1 fixed some clippy warnings 2021-10-16 18:08:13 +08:00
pca006132 26076c37ba nac3core/typecheck: supports recursive type inference 2021-10-16 15:56:49 +08:00
pca006132 11144301ca nac3artiq: added simple host value support 2021-10-06 16:07:42 +08:00
pca006132 693ac7d336 nac3core/toplevel: added personality symbol config 2021-09-25 21:44:00 +08:00
pca006132 799ed58d21 nac3core/type_inferencer: avoid type var for assign 2021-09-22 19:25:47 +08:00
pca006132 105d605e6d nac3core: fix clippy warnings 2021-09-22 18:04:06 +08:00
pca006132 97f5b7c324 fixed performance regression 2021-09-22 18:04:06 +08:00
pca006132 7d48883583 fixed tests 2021-09-22 18:04:06 +08:00
pca006132 084efe92af nac3core: use string interning 2021-09-22 18:04:06 +08:00
pca006132 1b5ac3cd25 nac3core: do not alloc call if it is monomorphic 2021-09-22 18:04:06 +08:00
pca006132 5ed2b450d3 nac3core/typecheck: no type variable for monomorphic functions 2021-09-22 18:04:06 +08:00
ychenfo 1c170f5c41 nac3core: type inferencer fix the pass statement 2021-09-21 13:19:13 +08:00
pca006132 3c930ae9ab fixed #12 2021-09-20 15:51:42 +08:00