1
1
mirror of https://github.com/github/semantic.git synced 2025-01-02 20:41:38 +03:00
Commit Graph

2056 Commits

Author SHA1 Message Date
joshvera
8dd5a7e295 WIP remove current scope and frame from Heap and ScopeGraph
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-28 13:31:40 -05:00
joshvera
b6e789fff7 Use a Reader for the scope address and frame address
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-27 14:16:27 -05:00
joshvera
57015e94cc Type apply value instead of address in currentFrame
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-26 19:57:19 -05:00
joshvera
ccb044ac6b Export scopeLookup
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-26 19:54:49 -05:00
joshvera
af0184a195 Store names as params in Closure
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-26 19:53:58 -05:00
joshvera
0cf8bb1b87 Throw UninitializedAddress from deref
Co-Authored-By: Rob Rix <rob.rix@github.com>
2018-11-26 12:31:41 -05:00
joshvera
bf4401d79b Revert newFrame changes 2018-11-26 12:04:49 -05:00
joshvera
fd979562ff Revert "Throw UninitializedAddress from value"
This reverts commit 36e1e09af13f8a0cbab286dc5724af5dd11213db.
2018-11-26 12:03:12 -05:00
joshvera
f1ea66012b Initialize the slots of a frame when creating it 2018-11-20 20:03:17 -05:00
joshvera
9b2355b521 Throw UninitializedAddress from value 2018-11-20 19:28:15 -05:00
joshvera
0a7dd5c187 Remove makeNamespace for now 2018-11-20 19:28:04 -05:00
joshvera
d485923816 Return Maybe from deref
So we can case on uninitialized slots in the heap
2018-11-20 19:27:51 -05:00
joshvera
2f904a3791 Add dealloc to delete slots 2018-11-16 18:53:06 -05:00
joshvera
edf444eff9 Remove address 2018-11-16 18:22:31 -05:00
joshvera
fb0e7e3407 Add object to AbstractValue 2018-11-16 16:11:39 -05:00
joshvera
3de1cbce5b Change scopedEnvironment to return the address of an Object 2018-11-15 20:24:06 -05:00
joshvera
5c82345816 Add putDeclarationSpan to ScopeGraph 2018-11-15 19:29:01 -05:00
Rick Winfrey
46d39a25c8 A lot of warnings. ALOT 2018-11-15 15:04:28 -08:00
Rick Winfrey
97545f0ae7 Remove redundant constraints and imports 2018-11-15 14:18:36 -08:00
joshvera
78d543c60f Return the currentScope' if pathDeclarationScope is a DPath
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-15 14:39:59 -05:00
joshvera
b0d0e2706b Add putSlotDeclarationScope
so we can set the associated scope of a slot

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-14 19:15:39 -05:00
joshvera
4c2716f817 Add lookupDeclarationFrame 2018-11-14 15:14:50 -05:00
joshvera
6877ef1a5e Add lookupDeclarationScope 2018-11-14 15:14:43 -05:00
joshvera
1f09735902 Add insertFrameLink
in order to add frames that are reachable from the current frame

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-13 17:58:37 -05:00
joshvera
0a35a5eee7 Add bindFrames to merge heap frames for now
This may not be an ideal solution but populates the current heap with enough information to traverse frames to correct slots

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-13 17:58:06 -05:00
Rick Winfrey
d020f71862 Set currentScope and currentFrame after running an initial action
Co-Authored-By: Josh Vera <vera@github.com>
2018-11-09 12:43:35 -08:00
Rick Winfrey
cbafcd8114 Add (Show address) for debugging
Co-Authored-By: Josh Vera <vera@github.com>
2018-11-09 12:42:43 -08:00
joshvera
ce91cf71db Remove self argument from call effect
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-09 13:04:52 -05:00
joshvera
90f37e206b throw heap errors on Hole paths
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-09 11:47:15 -05:00
joshvera
af8918046e Export Scope and Path from Control.Abstract.ScopeGraph
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-09 11:37:58 -05:00
joshvera
eebcc9c9ee Fix up runFunction carriers
function effect now takes parameters as terms

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-08 20:47:04 -05:00
joshvera
22bdbdfafe Fix up import conflicts
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-08 12:55:42 -05:00
joshvera
7da4d50492 Rename LookupError to LookupScopeError
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-08 12:54:46 -05:00
joshvera
6af58e5f92 Rename LookupError/LookupPathError to LookupAddressError/LookupLinkError 2018-11-08 12:54:25 -05:00
joshvera
0c35a8a95c Start fixing up tests
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-07 18:27:56 -05:00
Rick Winfrey
657b2db1fd Parameterize ModuleResult by Heap
We think it'll be helpful to keep the Heap around when we evaluate a Module

Co-Authored-By: Josh Vera <vera@github.com>
2018-11-06 17:06:08 -08:00
Rick Winfrey
f8380e2583 Add show for debugging
Co-Authored-By: Josh Vera <vera@github.com>
2018-11-06 16:37:55 -08:00
Rick Winfrey
7eddec8521 Merge branch 'master' into heap-frames 2018-11-06 11:26:39 -08:00
joshvera
2958d2578e Return currentFrame in Maybe
and throw CurrentFrameError and CurrentScopeError in terms that require a current scope and frame

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-06 13:43:14 -05:00
joshvera
e561bf1da7 Add declaration to LookupPathError
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-11-06 13:05:10 -05:00
joshvera
e6cf810822 Merge remote-tracking branch 'origin/master' into heap-frames 2018-11-06 11:26:11 -05:00
joshvera
1818a74060 Return ValueRef everywhere 2018-11-05 19:43:14 -05:00
joshvera
11a64f043e return value refs 2018-11-05 17:25:51 -05:00
Patrick Thomson
bdc5db555b rename and prune 2018-11-05 16:56:49 -05:00
joshvera
652461a65f asArray returns values 2018-11-05 16:08:56 -05:00
joshvera
cb0c4ac8f2 address returns a slot 2018-11-05 16:08:50 -05:00
joshvera
9a1fc0f063 Return () from declare 2018-11-05 16:08:34 -05:00
joshvera
cd78a2aaa7 expose runAllocator 2018-11-05 16:08:20 -05:00
joshvera
fc6c21c85e Rename address to frameAddress 2018-11-05 16:08:06 -05:00
joshvera
2beb576dd7 assign to the correct slot in define 2018-11-05 16:07:44 -05:00
joshvera
b3b7d2e5ff fix constraints 2018-11-05 16:07:23 -05:00
joshvera
1f43f15c1d Remove deref from python package 2018-11-05 16:06:18 -05:00
Patrick Thomson
15f5319252 fix stray indent 2018-11-05 12:17:05 -05:00
Patrick Thomson
688219e380 Arrow instance, why not 2018-11-05 11:06:59 -05:00
Patrick Thomson
292a268b00 better name for infix operator 2018-11-04 14:46:19 -05:00
Patrick Thomson
a84b25ad6e remove Data.Algebra import 2018-11-04 14:39:38 -05:00
Patrick Thomson
8e4f9ea119 better docs 2018-11-02 19:43:12 -04:00
Patrick Thomson
7ea52dbfe3 Give Control.Matching API better ergonomics.
Given that @tclem and I have found the matcher API frustrating, I've
taken a stab at improving its ergonomics, and I've found some success
in separating composition of matchers from predicate-based narrowing
thereof.

The biggest change here is the elimination of the old `match`
combinator, which proved to be clumsy in that it complected narrowing
and composition. Top-down matching combinators are now written with
the `need` combinator and the `>>>` combinator, which is more readable
and more versatile. Here's a matcher that accepts functions with
Python docstrings:

```haskell
docstringMatcher :: ( Decl.Function :< fs
                    , [] :< fs
                    , Lit.TextElement :< fs
                    , term ~ Term (Sum fs) ann
                    ) => Matcher term term
docstringMatcher = target <*
               (need Decl.functionBody
                >>> narrow @[]
                >>> mhead
                >>> narrow @Lit.TextElement
                >>> ensure Lit.isTripleQuoted))
```

Pretty readable, right? Each step of the tree regular expression -
choosing function bodies, ensuring said bodies are lists, examining
the first element, and choosing only TextElements containing
triple-quoted strings - is made implicit. The old way would have
looked something like this:

```haskell
docstringMatcher = target <* match Decl.functionBody
                           $ narrow
                           $ matchM listToMaybe
                           $ target <* ensure Lit.isTripleQuoted
```
which is a good deal more disorganized and less flexible
in the quite-common case of applying functions during a
matching pass. Separating the act of composition from
function application is a big win here.

Further comments are inline.
2018-11-02 19:25:29 -04:00
joshvera
29383adf7a currentScope returns in Maybe 2018-11-02 16:18:35 -04:00
joshvera
cb8a1222c0 forLoop in terms of withLexicalScopeAndFrame 2018-11-02 16:17:32 -04:00
joshvera
595b3d8747 Add withLexicalScopeAndFrame 2018-11-02 16:17:10 -04:00
joshvera
02bcc64102 Fix Env constraints 2018-11-02 16:17:01 -04:00
joshvera
f50329ced4 fix up Abstract, Type, and Value 2018-11-02 15:33:45 -04:00
joshvera
d93f2adcd5 fix up primitive, value, and heap 2018-11-02 15:03:10 -04:00
joshvera
e2f9773f7f type signatures 2018-11-01 23:09:03 -04:00
joshvera
4e2126611b Remove allocator from Heap 2018-11-01 23:08:57 -04:00
joshvera
e30239123d port State ScopeGraph to fused effects 2018-11-01 23:08:45 -04:00
joshvera
2c4c53904b No effectful constraint 2018-11-01 22:33:43 -04:00
joshvera
82c50ed96d remove pureeffect 2018-11-01 22:32:46 -04:00
joshvera
5234688d9c circular imports 2018-11-01 22:32:30 -04:00
joshvera
ef9a54cabe add value back to Modules 2018-11-01 22:28:21 -04:00
joshvera
a1bdbccb53 parameterize LoopControl by value 2018-11-01 22:28:10 -04:00
Rick Winfrey
9e753a1757 Remove conflict markers 2018-11-01 15:39:09 -07:00
Rick Winfrey
4750d51bf6 Merge branch 'master' into heap-frames
Co-Authored-By: Josh Vera <vera@github.com>
2018-11-01 15:29:45 -07:00
joshvera
ef67897838 Make it compile 2018-10-31 15:37:13 -04:00
Patrick Thomson
f0d9ba3f8a one last import 2018-10-31 09:36:04 -04:00
Patrick Thomson
27a9ae546a Merge branch 'master' into add-data-coerce-to-prologue 2018-10-31 09:09:37 -04:00
joshvera
09ab5d74a0 Fix some Graph module errors 2018-10-30 19:47:22 -04:00
joshvera
8c41511c87 lowerBound for Heap 2018-10-30 18:19:06 -04:00
Rick Winfrey
e7d94f9555 Add insert edge combinators 2018-10-30 13:22:49 -07:00
Patrick Thomson
cb54dd7aed Merge remote-tracking branch 'origin/master' into repl-effect 2018-10-30 15:58:00 -04:00
Patrick Thomson
c4698ff96c Merge branch 'master' into add-data-coerce-to-prologue 2018-10-30 15:40:14 -04:00
Patrick Thomson
a16822e7c3 oops, wrong file 2018-10-30 15:39:04 -04:00
Patrick Thomson
2d91f7e263 stray pragma 2018-10-30 15:24:47 -04:00
Patrick Thomson
3caa753808 Add Data.Coerce to the Prologue.
This is ubiquitous enough that we should just export it.
2018-10-30 15:12:45 -04:00
Patrick Thomson
3cb8608703 Merge remote-tracking branch 'origin/master' into add-purely-to-matching 2018-10-30 15:00:37 -04:00
Patrick Thomson
da1704af56 Extract the REPL effect into its own module.
I need this for the refactoring OKR.
2018-10-30 14:55:23 -04:00
joshvera
44b7e7640e Remove more constraints 2018-10-30 13:53:03 -04:00
Patrick Thomson
6b476d0eb7 Add 'purely' combinator to Matching and rename it.
@tclem and I found ourselves wanting an arrow-like combinator that
promotes a given function to a Matcher. While I think an Arrow
instance is going a little overboard, there's no harm in adding a
'purely' function, the naming of which is commensurate with the
rewriting DSL.

This also renames the module, since there's not anything really
abstract about matching (indeed, it is quite concrete).
2018-10-30 11:04:11 -04:00
joshvera
25dae2319a Fix up a couple more eval instances
and comment out even more
2018-10-29 18:08:56 -04:00
Rob Rix
636eec364e Update to fused-effects, replace \/ with handleSum and bundle Interpose. 2018-10-29 09:52:48 -04:00
Rob Rix
2fd8bcad92 🔥 some unused language extensions. 2018-10-26 13:11:20 -04:00
Rob Rix
4aae4db57d Implement python packaging directly in the carrier. 2018-10-26 12:37:26 -04:00
Rob Rix
197ef61386 Rename the carrier to PythonPackagingC. 2018-10-26 12:30:49 -04:00
Rob Rix
37d4fea7b2 Simplify the carrier for runPythonPackaging. 2018-10-26 12:30:06 -04:00
Rob Rix
3979ea4e86 🔥 disjunction. 2018-10-25 22:56:08 -04:00
Rob Rix
d4c6edb156 🔥 Disjunction. 2018-10-25 22:54:00 -04:00
Rob Rix
bc08525229 Don’t specialize disjunction. 2018-10-25 22:50:16 -04:00
Rob Rix
4cad9bc45e Re-export Control.Abstract.ScopeGraph from Control.Abstract. 2018-10-25 16:42:53 -04:00
Rob Rix
4531c9afc7 🔥 Prologue’s re-export of MonadError. 2018-10-25 10:21:14 -04:00
Rob Rix
775bc6ef80 Bump higher-order-effects for interposition. 2018-10-25 09:27:40 -04:00
Rob Rix
49d7068f46 Define hmap with a LambdaCase. 2018-10-24 15:39:52 -04:00
Rob Rix
fc935058a5 Define handle with a LambdaCase. 2018-10-24 15:39:25 -04:00
Rob Rix
f2473d2807 handleCoercible. 2018-10-24 15:35:46 -04:00
Rob Rix
95d200426d 🔥 redundant parens. 2018-10-24 15:35:03 -04:00
Rob Rix
66466448ec Simplify the reinterpretation in ScopeEnvC. 2018-10-24 15:26:20 -04:00
Rob Rix
2d71e0b6fc Parameterize ScopeEnvC by the address type. 2018-10-24 15:23:59 -04:00
Rob Rix
cc97e57b01 Align the ScopeEnvC cases. 2018-10-24 15:21:07 -04:00
Rob Rix
b353f88ec5 Define the ScopeEnvC algebra with LambdaCase. 2018-10-24 15:20:09 -04:00
Rob Rix
277b7ad906 handleCoercible. 2018-10-24 15:16:50 -04:00
Rob Rix
676b5b5105 🔥 some redundant parens. 2018-10-24 15:16:30 -04:00
Rob Rix
d559aa1162 Use uncurry. 2018-10-24 15:09:34 -04:00
Rob Rix
8c4853eb9b Use LambdaCase for the Modules handler. 2018-10-24 15:08:58 -04:00
Rob Rix
15a8917c84 Simplify the FunctionC carrier instances. 2018-10-24 11:00:54 -04:00
Rob Rix
25b2c3c4e9 Encapsulate the state effects inside EnvC. 2018-10-24 10:21:29 -04:00
Rob Rix
bff13c7272 Parameterize EnvC by the address type. 2018-10-24 10:14:04 -04:00
Rob Rix
c4aaa86230 Generalize disjunction over the carrier. 2018-10-23 11:39:09 -04:00
Rob Rix
21f17ff56f Clean up a bunch of algebras. 2018-10-22 20:30:07 -04:00
Rob Rix
314aff5d56 Bump higher-order-effects for Resource & some handler helpers. 2018-10-22 20:18:36 -04:00
Rob Rix
5ea78e922e Simplify the Modules carrier. 2018-10-22 12:57:58 -04:00
Rob Rix
56eae42043 Simplify the While carriers. 2018-10-22 12:49:01 -04:00
Rob Rix
ee077944ca Generalize the Abstract.Boolean smart constructors. 2018-10-22 12:45:36 -04:00
Rob Rix
9b3fb906ae Simplify the BooleanC carriers. 2018-10-22 12:38:43 -04:00
Rob Rix
a06ede905e 📝 raiseHandler. 2018-10-22 12:27:50 -04:00
Rob Rix
3dcdf3f769 The triumphant return of raiseHandler. 2018-10-22 12:21:10 -04:00
Rob Rix
d45cfbdcdc Define a raiseHandler helper. 2018-10-22 12:15:08 -04:00
Rob Rix
c3623b16c7 Simplify the AddressError carriers. 2018-10-22 11:59:31 -04:00
Rob Rix
6b15bf489c Simplify the EnvironmentError carriers. 2018-10-22 11:58:46 -04:00
Rob Rix
6dac2fee6e Simplify the LoadError carrier. 2018-10-22 11:56:59 -04:00
Rob Rix
e0bb0fd094 Simplify the ResolutionError carriers. 2018-10-22 11:53:31 -04:00
Rob Rix
f20324b064 Simplify the ScopeEnv carrier. 2018-10-22 11:50:31 -04:00
Rob Rix
727cbbbf94 Simplify the DerefC carriers. 2018-10-22 11:46:42 -04:00
Rob Rix
d86f676856 Derive a bunch of instances for AllocatorC/DerefC. 2018-10-22 11:45:44 -04:00
Rob Rix
d92fd391fd Simplify the carrier for Env. 2018-10-22 11:19:07 -04:00
Rob Rix
02b92a5962 Simplify the carrier for Allocator. 2018-10-22 11:14:40 -04:00
Rob Rix
77ca843a52 Simplify the carriers for LoopControl & Return. 2018-10-22 11:03:09 -04:00
Rob Rix
034e2469ff Bump higher-order-effects. 2018-10-22 10:26:15 -04:00
Rob Rix
3ef2efa73a Merge branch 'master' into higher-order-effects 2018-10-22 09:45:57 -04:00
joshvera
e32804e0fa Add putCurrentScope 2018-10-19 17:52:03 -04:00
Rob Rix
1bb04f5446 Interpose in the runPythonPackaging mechanism. 2018-10-19 14:46:18 -04:00
Rob Rix
8a5cfbd250 Reformat the Modules handler. 2018-10-19 14:43:52 -04:00
joshvera
afbc2d7bfc Add insertScope, insertImportReference, insertEdge
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-10-17 18:19:54 -04:00
joshvera
6ebbfe268a Export lookupDeclaration
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-10-17 17:19:11 -04:00
joshvera
6e7e5cffbe Add lookupDeclaration and lookupFrameAddress
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-10-17 14:41:56 -04:00
joshvera
4e65b1ec23 Add lookupScopePath to ScopeGraph 2018-10-17 14:41:00 -04:00
Patrick Thomson
f911b43b63 fix lints 2018-10-17 14:38:30 -04:00
Patrick Thomson
ac543651ee Add NFData instances to enable more accurate benchmarking.
Because we're getting serious about benchmarking in the run-up to
Windrose, it's time to bring in the `deepseq` package to ensure that
benchmarks can fully evaluate the result of a test case.

The `deepseq` package provides an `NFData` typeclass:

```
class NFData a where
  rnf :: a -> ()
```

Instances use the `seq` combinator to ensure that the argument to
`rnf` is fully evaluated, returning (). If there is a `Generic`
instance for `a`, the implementation can be omitted. This patch adds
NFData for every syntax node, graph vertex, environment data
structures, and exceptions. It is long, but the work is very
straightforward, so don't panick.

The benchmark suite (`stack bench`) now produces more accurate
results. The benchmarks previously mimicked `rnf` by calling `show` on
the result of an evaluation or graph construction; now that we have
actual `NFData` instances we can use the `nfIO` combinator from
criterion. This has sped up the evaluation benchmarks and reduced
their memory consumption, while it has slowed down the call graph
benchmarks, as those benchmarks weren't evaluating the whole of the
graph.

Unfortunately, this patch increases compile times, as we have to
derive a few more Generic instances. I wish this weren't the case, but
there's little we can do about it now. In the future I have some plans
for how to reduce compile time, and I bet that those gains will at
least nullify the speed hit from this patch.

Now that we have NFData instances for every data type, we can start
benchmarking assignments, in preparation for fixing #2205.

This patch also pulls in updates to `effects` and `fastsum` that add
appropriate NFData instances for the data they vend.
2018-10-17 14:08:47 -04:00
Rob Rix
c9e6912068 Port most of the system over to higher-order-effects. 2018-10-16 18:48:08 -04:00
joshvera
ae6b1ba788 Change bindAll to merge the old scope graph into the current scope graph 2018-10-16 11:12:19 -04:00
joshvera
cbd77eeb0e Remove Env constraints 2018-10-16 11:04:25 -04:00
joshvera
911cd0b7f0 docs 2018-10-16 11:03:53 -04:00
joshvera
cc7b65d3fb use define and withChildFrame in makeNamespace 2018-10-04 20:06:59 -04:00
joshvera
4546729aff store values and addresses in klasses 2018-10-04 20:06:26 -04:00
joshvera
f3247cfa0f Implement bindAll and lookupScope effects 2018-10-04 20:06:09 -04:00
joshvera
07f684fa13 Replace define and binds with call to withChildFrame 2018-10-04 20:05:46 -04:00
joshvera
7a3b019271 Move define and withChildFrame to Heap 2018-10-04 20:05:23 -04:00
joshvera
6cec0be9b2 parameterize ValueRef with value 2018-10-02 16:40:00 -04:00
joshvera
4978ea18ce klass captures a frame address 2018-10-02 16:39:51 -04:00
joshvera
9a9faaa521 Bring back subtermValue 2018-10-02 16:39:38 -04:00
joshvera
48d19477ca Remove Env constraints in defineNamespace and defineClass 2018-10-02 16:39:18 -04:00
joshvera
151fa2af00 Take a set of values in defineClass 2018-10-02 16:38:58 -04:00
joshvera
5e6694d38f Remove Environment constraints from builtInPrint 2018-10-02 16:38:43 -04:00
joshvera
5f81398920 Remove bind call from define
We now write the value to the address in the heap
2018-10-02 16:38:04 -04:00
joshvera
65f8153902 Remove EnvironmentError constraint 2018-10-02 16:36:42 -04:00
Charlie Somerville
ef93c452c6 remove subtermValue and subtermAddress 2018-10-02 11:11:12 +10:00
joshvera
e29a93dcc5 Parameterize Rval by value 2018-10-01 18:50:32 -04:00
Rob Rix
5c2dac35e8 Merge branch 'master' into first-order-closures 2018-09-27 13:37:25 -05:00
joshvera
2d05eedd02 include scopedtypevariables 2018-09-26 13:58:19 -05:00
joshvera
44d016ceac clean up constraints 2018-09-26 13:58:11 -05:00
joshvera
c6d1626ad1 type apply in builtInPrint 2018-09-26 13:58:01 -05:00
joshvera
be44a501e0 currentScope' always returns an address now 2018-09-26 13:57:46 -05:00
joshvera
910ba23e6a Return effects store values 2018-09-26 13:57:09 -05:00
joshvera
020a179b11 calls take a list of values as params 2018-09-26 13:56:58 -05:00
Rob Rix
891f238179 Merge branch 'master' into first-order-closures 2018-09-25 16:53:41 -05:00
Rob Rix
086b3b5624 🔥 some unnecessary language extensions. 2018-09-25 16:40:07 -05:00
Rob Rix
0653832d9d Swap the order of the parameters to Value. 2018-09-25 16:38:05 -05:00
joshvera
a537f5d641 Function effect takes an m value 2018-09-25 16:30:37 -05:00
joshvera
0c5d3e4316 Export ScopeGraph from Control.Abstract 2018-09-25 16:30:24 -05:00
joshvera
ce29b4acd9 formatting 2018-09-25 16:30:11 -05:00
joshvera
d706d2e4be Replace ScopeEnv with ScopeGraph 2018-09-25 16:30:00 -05:00
joshvera
cf36fa6685 remove builtInExport 2018-09-25 13:35:14 -05:00
joshvera
74d9e95a38 Implement withScopeAndFrame 2018-09-25 12:57:41 -05:00
joshvera
46c83d2b94 Move Allocator to ScopeGraph 2018-09-25 12:57:28 -05:00
joshvera
7267ab619a Add LookupError, scopeLookup, withScopeAndFrame 2018-09-25 12:01:58 -05:00
joshvera
fc025082e5 Move address to scopegraph 2018-09-25 12:01:44 -05:00
joshvera
1b376c2a8a export currentFrame 2018-09-25 11:46:04 -05:00
joshvera
35c2ebf140 Construct a new frame with frameEdges in lambda' 2018-09-25 11:45:52 -05:00
joshvera
fc05b19077 Don't export linksOfScope 2018-09-25 11:45:27 -05:00
joshvera
2fc3942b90 Add ScopeError constraints to builtins 2018-09-25 11:39:23 -05:00
joshvera
a8c490b043 export newFrame 2018-09-25 11:38:56 -05:00
joshvera
d3f34d83a9 Replace ScopeEnv with State ScopeGraph 2018-09-25 11:38:43 -05:00
joshvera
f1ce70218e remove declaration param to deref 2018-09-24 14:12:51 -05:00
joshvera
a41f707bef Implement lambda' by declaring a new scope 2018-09-24 14:12:42 -05:00
joshvera
153a7ad7cb Use declare in define implementation 2018-09-24 14:12:26 -05:00
joshvera
b2a2486059 Comment out address and subtermAddress 2018-09-24 14:11:43 -05:00
joshvera
2eca3593e4 Declare returns Addresses 2018-09-24 14:11:09 -05:00
joshvera
47ff1b8a9a Add currentFrame 2018-09-24 14:10:42 -05:00
joshvera
f0fc0080a7 Add HeapError 2018-09-24 14:10:28 -05:00
joshvera
8e7560be2c what if we don't need letrec or variable 2018-09-24 14:10:14 -05:00
Timothy Clem
38a4bb38f2 WIP - replace Record across the project
Not quiet there with Diff and decorators yet
2018-09-21 13:46:25 -07:00
Rob Rix
605687fe37 Define built-ins as part of the Function effect. 2018-09-21 16:21:27 -04:00
Rob Rix
c6769d2e01 Resume using a first-order definition of functions. 2018-09-21 14:42:57 -04:00
Rob Rix
98b1b1e16b 🔥 builtInExport. 2018-09-20 15:22:09 -04:00
Timothy Clem
4a84736162 Docs 2018-09-20 10:31:13 -07:00
Rob Rix
c75defc821 📝 Open. 2018-09-20 13:02:24 -04:00
Rob Rix
8b41c2bdfb Move the Open synonym to Evaluator. 2018-09-20 13:02:00 -04:00
Rob Rix
038b56970e Parameterize Evaluator by the term type. 2018-09-20 12:43:59 -04:00
Timothy Clem
741a3b25d6 Implement doWhile in terms of the new while effect 2018-09-20 09:42:55 -07:00
Timothy Clem
fdfc47e168 Implement runWhile for Abstract and Type semantics 2018-09-20 09:14:34 -07:00
joshvera
85bf290471 deref takes an Address address 2018-09-20 12:14:13 -04:00
joshvera
0d4c32f3d3 Need to pass address to namespace for now 2018-09-20 12:08:32 -04:00
joshvera
8fa5c283cf what if we don't need rvalBox 2018-09-20 12:08:16 -04:00
joshvera
6f15861dc1 Declaring a declaration returns a position 2018-09-20 12:08:04 -04:00
joshvera
305d5a47d3 or box 2018-09-20 12:07:25 -04:00
joshvera
d49c574253 what if we don't need letrec 2018-09-20 12:07:13 -04:00
Timothy Clem
ceead75b69 Get interpose working and an abort to our loopcontrol effect 2018-09-20 08:41:17 -07:00
Timothy Clem
0341f21901 WIP - implement while/looping as an effect 2018-09-19 15:00:51 -07:00
Patrick Thomson
2998c8f8cc last few changes 2018-09-19 11:03:59 -04:00
joshvera
03b4a80feb All functions have names now 2018-09-18 19:29:28 -04:00
joshvera
a09fd44869 klass takes a Declaration 2018-09-18 18:49:25 -04:00
joshvera
a50b1c84d9 Take declarations in Control.Abstract.Primitive 2018-09-18 18:49:14 -04:00
joshvera
f8f4c03dee Add address param to Heap 2018-09-18 18:48:53 -04:00
joshvera
d7a219a0d6 what if we don't need these 2018-09-18 18:34:31 -04:00
joshvera
be8684e2eb Pass Declarations to namespace 2018-09-18 18:24:10 -04:00
joshvera
ae08c27853 Add name functions to Declaration and Reference 2018-09-18 18:23:57 -04:00
joshvera
e3d1876627 Take Declarations in letrec 2018-09-18 18:22:34 -04:00
joshvera
2fad026665 Deref and assign declarations in the heap effects 2018-09-18 18:04:09 -04:00
Patrick Thomson
79c29a7006 Address Tim's suggestions: things are looking way nicer. 2018-09-18 17:46:05 -04:00
Patrick Thomson
efb0b0a0f7 Change Rule to RuleM and PureRule to Rule. 2018-09-18 17:33:01 -04:00
Patrick Thomson
8da5bcf973 just a bit more context 2018-09-18 15:46:51 -04:00
Patrick Thomson
2dc8bb0041 Merge branch 'master' into term-rewriting-mk2 2018-09-18 15:18:21 -04:00
Rob Rix
13993af2c7 Merge branch 'master' into heap-widening 2018-09-18 14:46:36 -04:00
joshvera
b29573bd2b Merge remote-tracking branch 'origin/scopes-and-frames' into heap-frames 2018-09-18 12:28:43 -04:00
joshvera
8c917e3523 Add lowerBound instance 2018-09-18 12:25:43 -04:00
Rob Rix
51be2081ae 🔥 Control.Abstract.Configuration. 2018-09-18 10:10:03 -04:00
Rob Rix
32d683fb20 Don’t re-export Configuration. 2018-09-18 10:05:03 -04:00
Rob Rix
d15790bce7 🔥 some trailing whitespace. 2018-09-18 10:04:53 -04:00
joshvera
9dce4ad6a0 WIP 2018-09-17 14:44:19 -04:00
joshvera
8e1e9579da lints 2018-09-14 18:16:54 -04:00
joshvera
ce2263d5e5 Set a declaration's scope on assignment 2018-09-14 15:12:29 -04:00
Patrick Thomson
b8b8fe01c9 port over Control.Rewriting 2018-09-14 12:47:21 -04:00
joshvera
423a82481d Pass an action to create so we can pop child scopes off 2018-09-13 17:42:18 -04:00
joshvera
360a9b0317 Store the Span of last evaluated child term in a State
So we can declare a child term's range in the scope graph when a declaration occurs.

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-09-12 19:56:02 -04:00
joshvera
d6e98cc08a Add class declarations to the scope graph 2018-09-12 17:01:12 -04:00
joshvera
95ac3655cb add helper functions 2018-09-12 16:28:39 -04:00
joshvera
d5926dfabf don't specialize to Name 2018-09-12 16:22:23 -04:00
joshvera
daa64439f3 simplify 2018-09-12 16:19:26 -04:00
joshvera
0cdb6f9707 Add scope graph to ModuleResult 2018-09-12 12:48:58 -04:00
joshvera
ba3ae715fe Store Spans in the scope graph 2018-09-12 11:51:17 -04:00
joshvera
a6f300813a Allow creating scopes 2018-09-12 11:11:14 -04:00