1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00
Commit Graph

26227 Commits

Author SHA1 Message Date
Patrick Thomson
b9d4201ddb Merge branch 'master' into ghc-rtsopts 2018-10-18 13:05:37 -04:00
Josh Vera
efde121720 Merge branch 'master' into avoid-recompiling-git 2018-10-18 11:28:18 -04:00
Josh Vera
f458fe580c Merge pull request #2206 from github/quiet-parsing
New cli switch for quiet parsing with timing stats
2018-10-18 11:27:11 -04:00
Josh Vera
b5714f28c4 Merge branch 'master' into quiet-parsing 2018-10-18 10:55:45 -04:00
Rob Rix
b861e504ea We don’t need scoped type variables here any more. 2018-10-18 10:54:46 -04:00
Rob Rix
3b0c59eea5 Change the type to account for the eavesdropping. 2018-10-18 10:53:52 -04:00
Rob Rix
66fc361467 Account for SomeError instead of SomeExc. 2018-10-18 10:53:32 -04:00
Rob Rix
a2264fd16e Handle a bunch of resumable effects. 2018-10-18 10:53:23 -04:00
Rob Rix
78c037f4a6 Allow the interpose. 2018-10-18 08:28:31 -04:00
Rob Rix
6391f14de5 Run the continuation after the while loop. 2018-10-18 08:28:21 -04:00
Rob Rix
f22972904e Use a lambda case for the loop operator. 2018-10-18 08:22:26 -04:00
Rob Rix
b3d85f8832 Define an interpose effect. 2018-10-18 08:21:05 -04:00
Rob Rix
8e868cc886 Define an eavesdrop effect. 2018-10-18 08:20:58 -04:00
Rob Rix
b541a973a4 appendGraph requires a Monad. 2018-10-18 08:20:36 -04:00
Patrick Thomson
f4b5f0d44e [Experiment] Improve compile speed with larger GHC allocation area 2018-10-17 21:27:22 -04:00
Patrick Thomson
26da3d463a Merge pull request #2216 from github/split-up-haskell-syntax
Split up Language.Haskell.Syntax into child modules.
2018-10-17 21:27:03 -04:00
Patrick Thomson
379d75f284 Split up Language.Haskell.Syntax into child modules.
This was the longest (in terms of line count) file in the project.
Splitting it up will save on compile time, as it did for TypeScript.
I observe a ~20sec speedup from `stack clean semantic && stack build semantic:lib`
2018-10-17 18:57:29 -04:00
Patrick Thomson
bcc084f5ac move the TH import inside the ifdef 2018-10-17 17:38:35 -04:00
Patrick Thomson
b361c9ef79 Prevent unnecessary recompilation of Semantic.Version in dev mode.
Right now, Semantic.Version is recompiled on every invocation of
`stack build`, since we marked it as `-fforce-recomp` to ensure that
all deployments are tagged appropriately for haystack. However, this
entails a good deal of wasted time during development. With some
liberal application of `CPP`, we can make this recompilation only
happen on CI, thanks to the `release` flag and passing in a compiler
flag.

To test:

* apply the patch
* `stack build semantic`, then `stack exec semantic -- -v`. It should
  print `semantic version 0.4.0 (<development>)`.
* `stack clean semantic && stack build --ghc-options=-DCOMPUTE_GIT_SHA`.
  `stack exec semantic -- -v` should then print out the correct SHA.

Though it's probably not strictly necessary, I've marked the
`semantic` and `semanticd` executables to compile with
-DCOMPUTE_GIT_SHA, just in case.
2018-10-17 17:24:14 -04:00
Patrick Thomson
42bb569ba9 Merge pull request #2214 from github/nfdata-instances
Add NFData instances to enable more accurate benchmarking.
2018-10-17 16:43:12 -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
Timothy Clem
a19d8bd02e Revert removal of wait 2018-10-17 10:03:46 -07:00
Ayman Nadeem
1dce4b089b Merge branch 'quiet-parsing' of https://github.com/github/semantic into quiet-parsing 2018-10-17 12:12:23 -04:00
Ayman Nadeem
97b6c48c95 remove results 2018-10-17 12:12:12 -04:00
Timothy Clem
3b0a19238f Merge branch 'quiet-parsing' of github.com:github/semantic into quiet-parsing 2018-10-17 08:37:21 -07:00
Timothy Clem
070c15a947 Merge remote-tracking branch 'origin/master' into quiet-parsing 2018-10-17 08:18:33 -07:00
Patrick Thomson
abce41c1e1 Merge pull request #2211 from github/bracket-effect
Fix crash/race associated with `bracket` (#2207)
2018-10-16 23:34:04 -04:00
Patrick Thomson
d3db754004 weirdness in tests 2018-10-16 23:04:39 -04:00
Patrick Thomson
d56badfb29 Use upstream Resource effect. 2018-10-16 20:11:38 -04:00
Rob Rix
c9e6912068 Port most of the system over to higher-order-effects. 2018-10-16 18:48:08 -04:00
Ayman Nadeem
f0dcd1d2fc attempt to make this less manual 2018-10-16 18:01:28 -04:00
Timothy Clem
602432359b Merge remote-tracking branch 'origin/bracket-effect' into quiet-parsing 2018-10-16 14:57:14 -07:00
Patrick Thomson
ebda4bfaa1 Merge branch 'master' into bracket-effect 2018-10-16 17:52:30 -04:00
Patrick Thomson
a9ab40b7a5 Merge pull request #2197 from github/port-rewriting-examples
Port rewriting examples to the Rewrite DSL.
2018-10-16 17:46:02 -04:00
Patrick Thomson
1de1f0b5c1 try catching ParserTimedOut exceptions in parse-examples 2018-10-16 17:39:36 -04:00
Patrick Thomson
fb1806f3e9 whoops 2018-10-16 17:18:59 -04:00
Patrick Thomson
37522ddc35 lints 2018-10-16 17:15:36 -04:00
Patrick Thomson
1dfb4981cc warnings 2018-10-16 17:10:34 -04:00
Patrick Thomson
75bf696e47 Fix crash/race associated with bracket (#2207)
The bracket that I wrote inside effects does not properly handle
asynchronous exceptions, as it has no way to call the mask function.
As such, because the asynchronous exception is rethrown by both
`bracket` and `wait`, the exception handler will trigger twice. This
is what is causing the crash: `bracket` is passing the TSParser we
create in parseToAST to ts_parser_delete twice.

The best thing to do here is to create the new `Resource` effect,
which is interpreted down to `Control.Exception.bracket`, which has
the correct asynchronous-masking behavior, unlike the `bracket` in
`Control.Monad.Effect.Exception`, which I propose to remove in a patch
to `effects`.

This also bumps haskell-tree-sitter so that the
`ts_node_copy_child_nodes` function is considered `interruptible`.

To test:

1. Download [this file](https://gist.ghe.io/tclem/c2ffe3d20b248fdac59588aa98f168ae)
2. Run `TREE_SITTER_PARSE_TIMEOUT=1000 stack exec semantic -- --log-level=debug parse lexer.rb`

Before applying this patch, you will see a crash associated with a
double-free; afterwards, it should time out normally.
2018-10-16 17:05:29 -04:00
Ayman Nadeem
f9a3966a3c github universe results 2018-10-16 15:55:24 -04:00
Ayman Nadeem
2cb9b43ad5 entitlements results 2018-10-16 15:55:02 -04:00
Ayman Nadeem
66c397bd73 airflow results 2018-10-16 15:54:50 -04:00
Timothy Clem
0d762fba86 Include blob language in output too 2018-10-16 11:40:26 -07:00
Timothy Clem
4fc7bb59ae No need for double async (timeout already does this) 2018-10-16 11:28:53 -07:00
Patrick Thomson
5e52bede0a Fix the test suite. 2018-10-15 12:47:18 -04:00
Patrick Thomson
b7364f6df7 Merge remote-tracking branch 'origin/master' into port-rewriting-examples 2018-10-15 11:22:06 -04:00
Rob Rix
800c459bb0 Bump higher-order-effects for catchIO/bracket. 2018-10-14 22:16:07 -04:00
Patrick Thomson
14b4ed0bc7 Merge pull request #2204 from github/declaration-matching-improvement
Refactor: remove duplicate code in Analysis.Declaration
2018-10-12 20:22:34 -04:00
Rob Rix
a66788c682 Only re-export Generic/Generic1. 2018-10-12 17:54:57 -04:00