Commit Graph

6594 Commits

Author SHA1 Message Date
Dan Doel
40e2db5722 Merge branch 'trunk' into topic/mobile-code
- Fixes conflicts
2020-11-10 14:14:25 -05:00
Dan Doel
88ae6d8c08 Transcript changes for code ops 2020-11-10 11:19:43 -05:00
Dan Doel
b027ad67b4 Add code serialization API 2020-11-09 17:28:07 -05:00
Dan Doel
9f172927e8 Use a mutable code cache in the new runtime
- This is necessary for dynamically loading intermediate code during
  execution. Local assignments of various code are now stored in
  transactional variables that can be mutated as necessary.
- Various functions for adding to this cache have naturally been moved
  to the machine implementation rather than the interface. The interface
  mainly retains functions for keeping track of mappings between the
  surface and intermediate levels, which won't be updated during
  execution.
- Helper functions for finding references in intermediate code have been
  added, since we may not have surface terms for some intermediate code
  we're dealing with.
- Terms have been monomorphized to Symbol for this caching, just for
  simplicity.
2020-11-04 16:32:01 -05:00
Dan Doel
b45a516401 Implement serializer for ANF code 2020-10-29 15:40:39 -04:00
Rúnar
5ccb117b32
Merge pull request #1738 from unisonweb/fix/1737
Multi-argument `cases` now uses commas to separate patterns
2020-10-27 20:33:13 -04:00
Paul Chiusano
e721fc7d6f Fix #1737 2020-10-27 17:21:37 -04:00
Paul Chiusano
dfd722fda3
Merge pull request #1736 from unisonweb/fix/845
Fix to TDNR to verify that the suffix matches for any TDNR replacement
2020-10-26 11:34:35 -04:00
Paul Chiusano
f6296c3489 add some more tests of corner cases to the transcript 2020-10-23 10:01:18 -04:00
Paul Chiusano
809309ea16 More comments 2020-10-22 22:57:37 -04:00
Paul Chiusano
b9aaf7b890 Pick better variable name and add some verbiage 2020-10-22 22:40:38 -04:00
Paul Chiusano
e784107d64 Implement fix. There were lots of tests that were inadvertently relying on the bug. 2020-10-22 22:33:12 -04:00
Paul Chiusano
f90dc7bd58 Merge remote-tracking branch 'origin/trunk' into fix/845 2020-10-22 16:59:17 -04:00
Paul Chiusano
52c857349e
Merge pull request #1734 from unisonweb/fix/1390
Get rid of those weird synthetic variable names
2020-10-22 16:59:02 -04:00
Paul Chiusano
9081a4ed3a Add failing transcript 2020-10-22 16:58:33 -04:00
Dan Doel
20e10c6926 Keep track of let numbering in ANF
- A let may be classified as either Direct or Indirect. Indirect lets
  contain a number, so that we can represent their return location in a
  continuation. Direct indicates that this is not necessary.
- Currently, only simple direct lets are allowed, which may be turned
  into individual instructions. This is because anything else still
  requires stack/continuation management, and would require additional
  code forms to represent compound expressions that involve only local
  instructions.
- This obviates generating these numbers in the MCode translation.
  Instead, the relevant lets are numbered with Word16s, and each section
  gets 48 bits for numbering, while their lets use the low 16 bits for
  identification.
2020-10-22 14:55:02 -04:00
Paul Chiusano
5606c5dc20 refresh transcripts 2020-10-21 22:47:25 -04:00
Paul Chiusano
b176fbce3f Merge remote-tracking branch 'origin/trunk' into fix/1390 2020-10-21 22:43:25 -04:00
Paul Chiusano
54b59c1a2d okay, not too shabby 2020-10-21 22:42:35 -04:00
Paul Chiusano
954bc15277 have something working, but not sure I love the results 2020-10-21 20:57:58 -04:00
Rúnar
8c1c57e195
Merge pull request #1732 from unisonweb/fix/1578
Allow suffix-based name resolution to refer to definitions in the current file
2020-10-21 20:21:57 -04:00
Paul Chiusano
b017cc70ff transcript establishing current behavior 2020-10-21 15:36:51 -04:00
mergify[bot]
ffc9805b2c
Merge pull request #1733 from unisonweb/fix/handler-floating
In-line handlers were not being enclosed before floating
2020-10-21 16:24:34 +00:00
Paul Chiusano
46dd179567
Merge pull request #1730 from unisonweb/feature/popcount
Nat.popCount and Int.popCount
2020-10-21 11:50:06 -04:00
Dan Doel
6f8a365695 Add a small test case for proper handler floating 2020-10-21 11:05:12 -04:00
Dan Doel
fcbc9bd4cf In-line handlers were not being enclosed before floating 2020-10-20 19:58:28 -04:00
Paul Chiusano
0f037d643b Added comments 2020-10-20 19:05:16 -04:00
Paul Chiusano
15d8691caf Added clearer explanation of the resolution rule 2020-10-20 18:56:09 -04:00
Paul Chiusano
608ad4830c fix unit tests and regenerate transcripts
I was puzzled about the change to the blocks.md transcript at first. What's happening: the previous version of the transcript was going through TDNR, and was failing the cycle check for mutually recursive lambdas. The new version isn't going through TDNR at all, it's just doing ordinary typechecking of a cycle, and cycles don't have access to any abilities so it's failing with the expected error now. Arguably, the example should have used the FQN so TDNR wasn't involved in the previous example.
2020-10-20 18:26:46 -04:00
Paul Chiusano
b801522c27 Allow suffix-based resolution to resolve to definitions in the same file 2020-10-20 18:12:44 -04:00
Paul Chiusano
f26d81ae0e Improve test transcript and implement fix 2020-10-20 17:15:34 -04:00
Paul Chiusano
d157abafaf regression test (currently failing) 2020-10-20 16:34:13 -04:00
Paul Chiusano
ac5d374c88 added a bit more verbiage to the builtins test transcript 2020-10-20 11:08:18 -04:00
Paul Chiusano
4393a7d933 Nat.!= and Int.!= are not builtins 2020-10-20 11:00:08 -04:00
Paul Chiusano
d6391aa0c9 Filled in builtin tests for Nat and Int 2020-10-20 10:55:57 -04:00
Paul Chiusano
94539186d5 don't need two copies of Int.negate 2020-10-20 10:54:07 -04:00
Paul Chiusano
9bb592e21f popcount instruction, tests, and bugfixes 2020-10-19 17:56:51 -04:00
mergify[bot]
44cfdd1958
Merge pull request #1729 from unisonweb/fix/1542
Sort test results by name instead of by hash
2020-10-17 00:26:31 +00:00
Paul Chiusano
29e4d6dc5d Define sortNamed in terms of sortByText rather than the other way around 2020-10-16 17:47:22 -04:00
Paul Chiusano
f4c866e3cf fix #1542 2020-10-16 17:40:29 -04:00
Dan Doel
8ab24ed34e Relax normalization of ANormal
- Previously we were ensuring that a `let` does not immediately contain
  another `let`. However, there is actually no need for this from the
  perspective of the machine code. Removing this requirement makes the
  definition somewhat less complicated.
- Includes some preparation for numbering lets for continuation
  serialization.
2020-10-15 16:45:23 -04:00
Paul Chiusano
0d58b02976
Merge pull request #1722 from stew/fix/socketReceive
fix foreign call to socketReceive for new Bytes impl
2020-10-13 16:04:46 -04:00
Paul Chiusano
2f46316d7f
Merge pull request #1726 from unisonweb/dx/transcript-error-reporting
Fix transcript runner to show the actual error when it fails
2020-10-13 15:51:52 -04:00
Paul Chiusano
3b38e68c72
Merge pull request #1727 from unisonweb/cleanup/hashing-transcript
Cleanup hashing transcript to use hex literal strings
2020-10-13 15:51:21 -04:00
Paul Chiusano
0e045ce5e1 it IS now efficient 2020-10-13 14:19:23 -04:00
Paul Chiusano
7e291f90a3 cleanup transcript to use hex literal strings 2020-10-13 14:16:24 -04:00
Paul Chiusano
f730413d3a
Merge pull request #1705 from stew/feature/utf8-bytes
make conversion from Text to Bytes explicit
2020-10-13 13:44:57 -04:00
Paul Chiusano
13e1073251 output tweaks and regenerate transcripts 2020-10-13 09:44:49 -04:00
Paul Chiusano
a626cb5785 Don't just tell me the transcript failed on the above stanza, show me the error! 2020-10-13 09:35:35 -04:00
Stew O'Connor
d473aac05d change the examples so that the output matches the previous version of the transcript 2020-10-12 18:50:58 -07:00