Commit Graph

79 Commits

Author SHA1 Message Date
whitequark da01a03a6e Fix b91822ff. 2018-09-20 10:01:32 +00:00
whitequark b91822ffe6 firmware: migrate to Rust 1.28.0.
See 2648b1b7 and bdd18de2.
2018-09-20 09:45:19 +00:00
whitequark 77d511dc37 compiler: skip functional values in attribute writeback.
Fixes #1088.
2018-08-10 23:27:41 +08:00
whitequark d0e5aec862 compiler: handle direct calls to class methods.
Fixes #1005.
2018-05-25 10:07:50 +08:00
whitequark 44e5d0804e compiler: don't crash printing locations of specialized functions.
Fixes #987.
2018-04-28 09:57:59 +08:00
whitequark 2c12e150f3 compiler: do not try to re-coerce fully coerced numerics. 2018-04-21 23:01:05 +00:00
whitequark 4c65fb79b9 Commit missing part of b4e3c30d. 2018-04-21 11:55:10 +00:00
whitequark fbb58b5c8a compiler: reject calls with unexpected keyword arguments.
Fixes #924.
2018-02-21 19:39:50 +08:00
whitequark d419ccdeca compiler: do not permit str(...). (#878) 2017-12-27 11:48:21 +08:00
whitequark db8300c990 compiler: disallow op= on mutable values (fix #835).
In general, we can't reallocate a value in earlier stack frames,
or fixup references to it. This mainly impacts lists.
2017-10-02 11:03:03 +08:00
whitequark ce7e30edfe compiler: implement ~ operator (fix #836). 2017-10-02 11:03:02 +08:00
whitequark 1521231b1b compiler: correct semantics of floating point % operator (fix #830). 2017-10-02 11:03:02 +08:00
whitequark 67997d8955 compiler: correct semantics of integer % operator (#830). 2017-10-02 11:03:02 +08:00
whitequark ea7549cfa4 compiler: coerce `while` condition to bool.
Fixes #768.
2017-07-01 18:59:07 +00:00
whitequark ad2ee714c2 compiler: do not permit iterating str values.
This currently breaks badly on UTF-8, and doesn't even return
a value of a correct type.
2017-06-09 07:29:31 +00:00
whitequark 5d841d08e9 compiler: do not permit mutation of bytes values (#714). 2017-06-09 07:29:28 +00:00
whitequark 9ed4e9c1cd compiler: add support for printing of bytearray values (#714). 2017-06-09 07:15:25 +00:00
whitequark e9564b15c8 compiler: add support for bytearray type (#714). 2017-06-09 07:15:24 +00:00
whitequark 5b4fde30a8 compiler: unbreak subscripts for bytes values (#714). 2017-06-09 07:10:48 +00:00
whitequark 778e7dc2ab compiler: add support for concatenating bytes values (#714). 2017-06-09 07:10:48 +00:00
whitequark 7b2da5294f compiler: add support for printing of bytes values (#714). 2017-06-09 07:10:48 +00:00
whitequark dba4e1a28b compiler: add support for bytes type and b"x" literals (#714). 2017-06-09 07:10:48 +00:00
Sebastien Bourdeauducq 5ccca74a3f fold comm device into core device 2017-05-22 15:45:45 +08:00
Sebastien Bourdeauducq 8cf0628435 fix lit tests 2017-05-18 23:41:01 +08:00
Sebastien Bourdeauducq cd757c0f16 generate device database from executable python file 2017-05-18 23:14:55 +08:00
whitequark c5d7445973 compiler: reject reachable implicit return if not returning TNone.
Fixes #718.
2017-04-21 18:11:14 +00:00
whitequark 3a1fc729cf compiler: refactor type annotations recognizing in kernels.
The new implementation is much more generic, more robust,
and shares code with the same for syscalls as well as RPCs.

Fixes #713.
2017-04-13 08:26:10 +00:00
whitequark 31048f4b6a compiler: fix monomorphization of coerced integer literals.
Fixes #703.
2017-04-12 04:11:47 +00:00
Sebastien Bourdeauducq 7d6ebabc1b reorganize core device communication code 2017-02-27 18:37:30 +08:00
whitequark 3a1f14c16c compiler: fix overly strict constness analysis.
Before this commit, the following code would fail to compile...
  obj.foo.bar = True
... if foo is marked kernel_invariant in obj, even if bar is not
marked as such in obj.foo.
2017-02-26 01:58:21 +00:00
whitequark d04e611232 firmware, compiler: rename rpc functions to be more consistent. 2017-02-25 14:12:58 +00:00
whitequark c39394b4d5 firmware: port the exception handling routines to Rust. 2017-02-04 08:21:07 +00:00
whitequark fd8b11532f compiler, firmware: use Pascal strings everywhere.
This removes a large amount of very ugly code, and also simplifies
the compiler and runtime.
2017-02-03 11:53:27 +00:00
whitequark ab71c9a0ba compiler: the len builtin is not polymorphic, coerce the result.
Fixes #659.
2017-01-31 21:28:20 +00:00
whitequark 2f37b1d1c0 compiler: support methods defined on singleton instances.
Fixes #638.
2017-01-30 10:10:21 +00:00
whitequark 68de724554 compiler: monomorphize int64(round(x)) to not lose precision.
This applies to any expression with an indeterminate integer type
cast to int64(), not just round().
2016-12-02 15:02:44 +00:00
whitequark 55ea68da7f compiler: unbreak casts to int32/int64. 2016-11-21 14:20:28 +00:00
whitequark 35f4449ef2 inferencer: significantly improve the op-assignment diagnostic.
Before this commit, it displayed incorrect output if an error
appeared on 2nd run and beyond, and displayed messages for trying
to do "num32 -= num64" that made very little sense.
2016-11-21 14:20:24 +00:00
whitequark 009d396740 Move mu_to_seconds, seconds_to_mu to Core. 2016-11-21 05:37:30 +00:00
whitequark 7af41bd29c llvm_ir_generator: handle no-op coercions. 2016-11-21 02:25:34 +00:00
David Nadlinger bfbdba9205 compiler: Emit all-kernel_invariant objects as LLVM constants
This enables constant propagation optimisations, as verified by
the included test case. This is only a first stop-gap measure, though;
we should support optimisation based on kernel invariants on a more
fine-grained level.
2016-11-09 14:50:48 +00:00
David Nadlinger 7dcc987dd7 compiler: Fix break/continue targets in loop else blocks
Previously, they would still target the respective labels in the
just-exited loop.

Signed-off-by: David Nadlinger <code@klickverbot.at>
2016-11-05 02:35:01 +00:00
whitequark cd68577dbc compiler: add support for async RPCs. 2016-10-30 00:57:31 +00:00
whitequark feeb089505 compiler: warn about unused kernel_invariant entries.
Fixes #543.
2016-09-14 23:28:55 +00:00
whitequark 1a518ea7eb compiler.embedding: implement string concatenation.
Fixes #526.
2016-08-08 04:05:52 +00:00
whitequark 5a79fcf9ba embedding: reimplement 373578bc properly.
The core of the problem that 373578bc was attempting to solve is
that diagnostics sometimes should be chained; one way of chaining
is the loc.expanded_from feature, which handles macro-like expansion,
but another is providing context.

Before this commit, context was provided using an ad-hoc override
of a diagnostic engine, which did not work in cases where diagnostic
engine was not threaded through the call stack. This commit uses
the newly added pythonparser context feature to elegantly handle
the problem.
2016-07-07 11:49:21 +00:00
whitequark 933ea53c77 compiler: add basic numpy array support (#424). 2016-07-06 09:51:57 +00:00
whitequark fa71b40c80 compiler: print the builtin type int(width=...) as np.int... 2016-07-06 04:22:51 +00:00
whitequark 6155f65366 compiler: remove now()/at().
Fixes #490.
2016-06-28 04:39:14 +00:00
whitequark 33e8e59cc7 compiler: implement min()/max() as builtins.
Fixes #239.
2016-06-22 01:09:41 +00:00