Commit Graph

36 Commits

Author SHA1 Message Date
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
4a1a4dc076 nac3core/artiq/standalone: symbol resolver return error msg for type error of host variables 2022-01-14 16:28:34 +08:00
fa04768a77 redo "nac3core: fix #84"
This reverts commit 86005da8e1.
2021-12-27 22:56:26 +08:00
86005da8e1 Revert "nac3core: fix #84"
This reverts commit 0902d8adf4.
2021-12-26 08:35:27 +08:00
0902d8adf4 nac3core: fix #84 2021-12-23 15:26:48 +08:00
66320679be improve error messages
#112, #110, #108, #87

Reviewed-on: M-Labs/nac3#145
Co-authored-by: ychenfo <yc@m-labs.hk>
Co-committed-by: ychenfo <yc@m-labs.hk>
2021-12-22 08:52:19 +08:00
dfd3548ed2 TypeVar and virtual support in Symbol Resolver (#99)
Add `TypeVar` and `virtual` support for Symbol Resolver in nac3artiq and nac3standalone

Reviewed-on: M-Labs/nac3#99
Co-authored-by: ychenfo <yc@m-labs.hk>
Co-committed-by: ychenfo <yc@m-labs.hk>
2021-12-01 22:44:53 +08:00
4b17511b4a Merge branch 'master' into KernelInvariant 2021-11-27 21:29:27 +08:00
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
ba08deada6 nac3core: refactor codegen 2021-11-20 19:50:25 +08:00
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
bf7e2c295a integrate nac3parser 2021-11-03 17:11:00 +08:00
279f47f633 nac3core/codegen: avoid sending unifiers
Previously, we have to copy types from one unification table to another,
and make the table sendable. This requires cloning (processing) the
whole table 3 times per function call which is not efficient and uses
more memory than required when the unification table is large.

We now use a concrete type table to only copy the type we need. This
reduces the overhead as we only need to process the unification table
for once (when we do the function codegen), and reduces memory usage by
a bit (but not noticeable when the unification table is small, i.e. the
types are simple).
2021-10-17 13:02:18 +08:00
11144301ca nac3artiq: added simple host value support 2021-10-06 16:07:42 +08:00
084efe92af nac3core: use string interning 2021-09-22 18:04:06 +08:00
87f25e1c5d nac3core: remove mutex on dyn symbol resolve 2021-09-08 19:27:32 +08:00
55335fc05d nac3core: top level simple type var handled 2021-09-08 02:27:12 +08:00
235b6e34d1 nac3core: top level derive fmt::Debug, fix dead lock 2021-09-07 00:20:40 +08:00
54b4572c5f nac3core: allow interior mutability to dyn symbolresolver, add add_id_def to symbolresolver trait, remove primitive from top level def list 2021-09-06 19:23:04 +08:00
e2a9bdd8bc nac3core: toplevel no duplicate type var too early 2021-08-30 14:15:36 +08:00
32773c14e0 move top level related things to a separate module 2021-08-24 17:19:17 +08:00
c356062239 symbol_resolver: handle list and tuples 2021-08-24 14:58:19 +08:00
56f082ca7c handle type var associated with class/function partially, change llvm version of nac3embedded to 11
format
2021-08-23 17:00:32 +08:00
7b1fe36e90 formatted 2021-08-23 11:13:45 +08:00
364054331c handle class fields and methods 2021-08-23 02:54:45 +08:00
40b062ce0f change the parse type annotation parameter type, refactoring top level 2021-08-23 02:54:45 +08:00
cb01c79603 removed Arc from TypeEnum 2021-08-13 13:33:59 +08:00
1db8378f60 formatting 2021-08-12 16:36:23 +08:00
8c7ccb626b fixed symbol_resolver blanket implementation 2021-08-12 14:44:50 +08:00
3a93e2b048 TypeEnum::TObj.param is now RefCell for interior mutability 2021-08-12 13:17:51 +08:00
d46a4b2d38 symbol_resolver: fixed type variable handling 2021-08-12 10:25:32 +08:00
de8b67b605 refactored symbol resolver 2021-08-11 17:28:29 +08:00
99276c8f31 formatted 2021-08-11 15:18:21 +08:00
82ce816177 refactored top level parsing, need review 2021-08-10 10:37:06 +08:00
86ca02796b function parameter handling 2021-08-07 17:25:14 +08:00
c405e46b00 moving location and symbol_resolver out from typecheck 2021-08-07 10:28:41 +08:00