Commit Graph

1132 Commits

Author SHA1 Message Date
Abdelhakim Qbaich
1bbf662609 Preparation for the Gambit Scheme backend 2020-05-01 23:27:36 -04:00
Edwin Brady
45d02a11b7 Cache locals after case inspection in evaluator
Without this, we have to recompute them every time they're inspected,
which might be on lots of recursive calls.
Fixes #338
2020-05-01 00:57:47 +01:00
Edwin Brady
4a913752ba Add some more IRs for back ends to use
ANF, in which everything is applied to variables only, and VMCode, in
which everything is reduced to a list of assignments.
I don't plan to add a defunctionalisation step. I've tested with with a
quick hack C backend, though I don't intend to commit that (not here at
least) because even though it basically works, it's Very Slow.
2020-04-30 22:15:04 +01:00
Edwin Brady
409357c302 Fix type in LambdaLift
Fixes #325
2020-04-28 15:14:37 +01:00
Edwin Brady
6fcf861bc1 Change argument unification order
Solving later arguments first means that they can refer to solutions of
earlier arguments. This isn't really the best solution for ensuring that
metavariables refer to things defined earlier, but it helps, and it does
fix #304.
2020-04-28 11:31:18 +01:00
Edwin Brady
4fe2018d93
Merge pull request #331 from ziman/record-compat
Add compatibility with the original record update syntax.
2020-04-27 18:10:40 +01:00
Edwin Brady
f64b94516a Merge branch 'andrevidela-remove-RigCount' 2020-04-27 17:51:50 +01:00
Edwin Brady
062a0846f2 Fix getRelevantArg
IORes is a newtype again, so the chez tests are working again now
2020-04-27 17:49:50 +01:00
Matus Tejiscak
82a23afae7 Add compatibility with the original record update syntax. 2020-04-27 18:02:25 +02:00
Edwin Brady
bdefd1a195 Merge branch 'remove-RigCount' of https://github.com/andrevidela/Idris2 into andrevidela-remove-RigCount 2020-04-27 16:07:25 +01:00
Edwin Brady
e9c4a5a99d
Merge pull request #312 from LibreCybernetics/add-name-show-instance
Basic Show instance of NameMap
2020-04-27 15:32:01 +01:00
Edwin Brady
184c0752f5
Merge pull request #323 from LibreCybernetics/remove-uneeded-test-dependency
Remove uneeded dependency on tests.ipkg
2020-04-27 15:31:27 +01:00
Edwin Brady
085f6806da
Merge pull request #322 from rbarreiro/copy_json_from_idris_dev
added json
2020-04-27 15:29:44 +01:00
Edwin Brady
f2a41d5afa
Merge pull request #311 from Kaiepi/racket
Make a couple improvements for the Racket backend
2020-04-27 15:28:17 +01:00
Edwin Brady
d0a9f9e9a6 Move takeBefore/takeUntil to Data.Stream
They're not total, so shouldn't be exported from the Prelude - they are
kept there for range syntax though.
2020-04-27 15:25:25 +01:00
Edwin Brady
df9e4771e8
Merge pull request #318 from ska80/fix-get-line-and-eof
Check for EOF when reading from an input port
2020-04-27 15:25:06 +01:00
Edwin Brady
61fae5c040
Merge pull request #310 from Kaiepi/bsd-builds
Fix builds on *BSD
2020-04-27 15:21:37 +01:00
Edwin Brady
cbd88c9f2e
Merge pull request #316 from abdelq/master
Adding corresponding toFileError for FileExists
2020-04-27 15:17:34 +01:00
Edwin Brady
2fd1c40056
Merge pull request #314 from MarcelineVQ/using-fix
'using' multiple named instances in scope fix
2020-04-27 15:16:12 +01:00
Edwin Brady
c75af6d116 Update test output 2020-04-27 14:45:06 +01:00
Edwin Brady
2362e40f6b Fix for multiplicities in holes
Still not perfect, but usages in holes were wrongly reported in nested
case blocks due to checking their usage count too often.
2020-04-27 14:28:30 +01:00
Edwin Brady
e208ea7129
Merge pull request #298 from ziman/records
RFC: Dot syntax for records
2020-04-27 14:28:19 +01:00
Edwin Brady
9391b72507
Merge pull request #305 from ska80/prelude-inline-doc
Port prelude's inline API documentation from Idris 1
2020-04-27 13:38:40 +01:00
Edwin Brady
c95c4c6c0c
Merge branch 'master' into prelude-inline-doc 2020-04-27 13:38:29 +01:00
Edwin Brady
1262ca2fde
Merge branch 'master' into records 2020-04-27 13:36:18 +01:00
Edwin Brady
b9907fbb21
Merge pull request #254 from jfdm/literate-modes
Enhance literate mode to recognise multi-modes.
2020-04-27 13:33:55 +01:00
Edwin Brady
ff86f6f834 Implement occurs check properly (finally!)
Instead of the previous unreliable hack, actually look for occurrences
of the solved metavariable. Block if there are any, and fail if there
are any under a constructor. I had expected this to hurt performance
quite a bit, but it seems it doesn't.
This was prompted by #304, which is now partly fixed, but there's still
a refinement to unification needed to fix it fully (and at least it
doesn't segfault due to the cycle now!)
2020-04-27 12:17:45 +01:00
Fabián Heredia Montiel
73ce287cb4 Remove uneeded dependency on tests.ipkg 2020-04-25 15:30:24 -05:00
Rui Barreiro
bb6aaad373 added json 2020-04-25 19:45:29 +01:00
Edwin Brady
19426ecd14 Better compiling for newtypes
If it's a newtype with an erased WorldVal, turn any case blocks into
non-inlinable let bindings, which is more accurate than the fiddly thing
it was doing.
Also better usage calculation in the inliner (but we still can't inline
lets because we don't know yet which 'case' functions are guaranteed
safe to inline because they don't duplicate variables anywhere. That's
coming!)
2020-04-25 15:54:53 +01:00
Edwin Brady
4947a9981a Fix lambda multiplicity check
A bug found via the very handy, but occasionally bad for performance so
off by default, --debug-elab-check. The multiplicity of a lambda type
needs to be checked against the expected multiplicity, not the given
multiplicity. Oops!

If you have any (\0 x => e) or similar, you may find you need to fix a
type error after this update...
2020-04-24 22:28:52 +01:00
Edwin Brady
2a0e5a4254 Don't fully normalise LHS
We no longer need to do this since we now expand fromInteger. And, we
didn't even need to do it fully, because we never needed to normalise
the pattern variable types. This is a big win on code which has a lot of
type level computation.
2020-04-24 20:26:37 +01:00
Matus Tejiscak
07bb57d3a1 Stop using :exec in record004. 2020-04-24 19:14:22 +02:00
Matus Tejiscak
4baa09a7de Sidestep the question of printing floats. 2020-04-24 19:10:23 +02:00
Matus Tejiscak
04a79d0a69 Update CHANGELOG. 2020-04-24 18:01:41 +02:00
Edwin Brady
838e5cbe9e realloc slightly better than malloc+free
Since it may be possible to reuse the space in place, and this all but
eliminates the remaining sys time.
2020-04-24 16:09:31 +01:00
Edwin Brady
0688728eb3 Run time system improvements
We shouldn't free the old heap if it's the right size, because that'll
execute a system call that could be costly. We can just reuse it!
2020-04-24 15:52:12 +01:00
Edwin Brady
2f0c6722e3 Note which holes a constraint is blocking on
Now only retry the constraint if at least one of the blocking holes has
some new information (either that it has been flagged invertible, or
that it is now defined). This can lead to big performance gains on
programs which use dependent types heavily.
2020-04-24 13:40:54 +01:00
Kamil Shakirov
cce312bb15 Check for EOF when reading from an input port
1) Check for EOF when reading from an input port (Chez backend).

2) Fix `getLine` to read and return a string without the trailing newline.
2020-04-24 12:32:58 +06:00
Abdelhakim Qbaich
55bc68a10e Add missing FileExists in toFileError 2020-04-23 23:16:14 -04:00
Abdelhakim Qbaich
4298b50df4 Typo fixes 2020-04-23 23:14:55 -04:00
Matus Tejiscak
8d1a813938 Fix printing namespaced dotted projections. 2020-04-23 23:12:26 +02:00
Matus Tejiscak
682ebbffb5 Wording. 2020-04-23 23:11:13 +02:00
Matus Tejiscak
d4ac7b6f52 Update typesfuns.rst. 2020-04-23 23:05:11 +02:00
Matus Tejiscak
bd1a9e2c04 Fix printing qualified record field names. 2020-04-23 22:29:33 +02:00
Edwin Brady
819c9d7af1 Evaluate primitives (fromInteger etc)
At least as long as the number is small enough (currently set to < 100).
This is because it can open up further evaluation opportunities when
typechecking, and can make the term we're working with smaller - it also
makes display a bit neater.
Overall this makes some pathological cases of terrible performance much
better, without hurting anything else.
2020-04-23 21:21:08 +01:00
Matus Tejiscak
eb5af61ebf Add reference for the dot record syntax. 2020-04-23 21:57:03 +02:00
Edwin Brady
3d8d07621d Some inlining changes
Flags can now be set on implementations too, where the flags get passed
to each of the methods in the implementation. We might want something a
bit more fine grained than this later. Also some small changes to the
way inlining lets is done in the compiler.
2020-04-23 20:01:20 +01:00
MarcelineVQ
896cd486d1 update 'using' regression test
have implementation 'using' regression test also check for multiple named implementations
2020-04-22 16:53:02 -07:00
MarcelineVQ
4b878a8a53 change where openHints is snapshotted
clearing the open hints at the end of elabImplementation was missing the
'using' hints
2020-04-22 16:51:09 -07:00