Commit Graph

1013 Commits

Author SHA1 Message Date
Edwin Brady
627d2c2f2b
Merge pull request #292 from ohad/fully-abstract-records
Fully abstract records
2020-04-21 10:59:51 +01:00
Edwin Brady
9aca77c5dd
Merge pull request #293 from gallais/casetree
Refactoring code as I read through it
2020-04-21 10:54:12 +01:00
Edwin Brady
60c4f8e178
Merge pull request #287 from Porges/patch-1
Fix Idris1 download link
2020-04-21 10:52:00 +01:00
Edwin Brady
afa90c6ddc
Merge pull request #284 from abailly/integral-operations
use quotient on scheme backends
2020-04-21 10:51:18 +01:00
Edwin Brady
8a0063a016
Merge pull request #280 from gallais/comments
[ fix #279 ] comment delimiters with more than one dash
2020-04-21 10:49:24 +01:00
Edwin Brady
69e774bd00 Merge branch 'jeetu7-master' 2020-04-21 10:48:11 +01:00
Edwin Brady
9930b64c1c Merge branch 'master' of https://github.com/jeetu7/Idris2 into jeetu7-master 2020-04-21 10:47:38 +01:00
Edwin Brady
ac277ce6d0 Erase the World, with care
We can erase things of type %World, which opens up more possibilities of
newtype and helps optimise IO, but we need to be sure that the side
effecting operations aren't optimised away as a result because we no
longer have to inspect the newtype. Therefore, if optimising away a case
analysis on a newtype with a %World deleted, add a let binding for the
scrutinee of the case, and flag it as non-inlinable.
2020-04-21 10:47:19 +01:00
Edwin Brady
5ea11cf0f5
Merge pull request #282 from abailly/network-binary
provide building blocks for binary network I/O
2020-04-21 10:45:52 +01:00
Edwin Brady
d3d5e22011
Merge pull request #274 from ska80/tutorial/typos
Fix some typos in the tutorial
2020-04-21 10:39:53 +01:00
Edwin Brady
4b65d8d6fc
Merge pull request #273 from jfdm/badges
Added a travis badge because it's good to have badges...
2020-04-21 10:39:09 +01:00
Edwin Brady
7cd9964d4f Comment correction
The comments don't get type checked, but this was rather important :).
2020-04-19 23:45:30 +01:00
Edwin Brady
f6bbfb3dee Remove costly 'swapBlocks' in lambda lifter
No need if we separate the context into arguments from the outer scope,
and arguments from the current scope. Needs care to compile correctly,
though.
2020-04-19 23:42:13 +01:00
Edwin Brady
1734841275 Add a lambda lifter
It's not actually used as part of any compilation pipeline yet, and I've
only tested it by eyeballing the output, but it'll be useful soon, and
it's good for it to be available to any new back ends that might need
it. It will need some optimisation.
2020-04-19 22:57:10 +01:00
Edwin Brady
8fccd5f2a3 Properly erase constructor arguments
That is, really erase the argument position rather than just putting
'erased there. It doesn't make a huge difference to the generated scheme
performance, but since we can always do this for constructors, we might
as well.
2020-04-19 19:43:51 +01:00
Edwin Brady
44c01f83d2 Move outermost lambdas to top level
This improves runtime performance a bit since it avoids creating some
unnecessary closures (and is a preliminary step to lambda lifting, which
might help for some back ends).
2020-04-19 16:49:25 +01:00
Ohad Kammar
767d9dc5f3 Add tests for default implict record type arguments 2020-04-17 12:22:36 +01:00
Ohad Kammar
5af82beb4e bugfix: actually include keyword "default" for default implict record type arguments 2020-04-17 12:07:20 +01:00
Ohad Kammar
3043ac0be4 Add support for default implicit arguments in record types 2020-04-17 10:28:51 +01:00
Ohad Kammar
f777531f52 Merge branch 'master' of github.com:edwinb/Idris2 into fully-abstract-records 2020-04-17 09:06:02 +01:00
Ohad Kammar
1fcac7a144 Add commits back to parser, simplify case-split for (auto)implict arguments in records
Ta @gallais !
2020-04-17 09:04:59 +01:00
Ohad Kammar
c5070eba19 Bugfix: In mapPTerm, correctly handle the parameter list in a PRecord
Ta @gallais !
2020-04-17 08:36:41 +01:00
Edwin Brady
884d4adad2 Fix buffer allocation error
Not calculating the needed space correctly, so sometimes not expanding
the buffer enough! This cause buffer data to be corrupted, leading to
issues like #114.
2020-04-16 22:17:01 +01:00
Guillaume Allais
2e0002535a Merge branch 'master' into casetree 2020-04-16 15:52:59 +01:00
Guillaume Allais
1b74c5fde4 [ cleanup ] removing a lot of useless polymorphism 2020-04-16 14:54:22 +01:00
Edwin Brady
9bc72a79c0 Need 'begin' around putstr primitive
This only becomes necessary after inlining, but Scheme needs to
understand it as one argument.
2020-04-16 13:59:23 +01:00
Edwin Brady
40980786e1 Ignoring the World is inadvisable
If IO operations don't return an updated world token, the inliner might
think they're not used at all. So if this turns out to be an overhead,
we'll have to work out another way of eliding it.
2020-04-16 13:39:55 +01:00
Kamil Shakirov
dfc7001bfc Ditto 2020-04-16 18:23:13 +06:00
Ohad Kammar
73d2e7bc29 Merge branch 'master' of github.com:edwinb/Idris2 into fully-abstract-records 2020-04-16 02:50:06 +01:00
Ohad Kammar
aa451022b5 Add tests for fully abstract records in Idris and Yaffle 2020-04-16 02:49:32 +01:00
Ohad Kammar
43634e3e01 Add support for record auto implicit parameters in parser 2020-04-16 02:47:17 +01:00
Ohad Kammar
cef456fa54 Bugfix: differentiate between implicit and explicit arguments in the return type of the constructor 2020-04-16 01:49:00 +01:00
Ohad Kammar
e6be2af83d Add syntax for implicit arguments to records 2020-04-16 01:07:47 +01:00
Edwin Brady
b665e6afbf Another small inlining improvement
Remove unused lets, and batch resolution of de Bruijn indices in case
branches
2020-04-15 23:59:54 +01:00
George Pollard
0a7d94babc
Fix Idris1 download link
This was pointing to the wrong place.
2020-04-16 08:58:08 +12:00
Edwin Brady
048bce23a6 Make inlining faster with One Weird Trick
Or, more accurately, by not doing a thing that's a waste of time. After
evaluating a local, if the result isn't applied to a stack, there's no
more reduction to do, so stop there.

Still go to the explicit named representation afterwards, since that's
an easier API for a code generator, and by then the names are guaranteed
unique.
2020-04-15 21:46:28 +01:00
Guillaume Allais
8eabc27dac [ refactor ] boolean expression 2020-04-15 20:55:18 +01:00
Ohad Kammar
95da5a8b74 Refactor to allow supporting implicit and rit annotations on records
(without adding syntax for them)

Somewhat of a surgical change, changing the AST and elaboration to
support it

Seems to pass all tests (including Frex)

Changes in `Idris/Desugar.idr` seem to be a bit challenging for the
type-checker in do-blocks, so I added type annotations.
Hopefully we could remove them in `idris2sh`.
2020-04-15 18:30:26 +01:00
Guillaume Allais
eabb23f8ce [ refactor ] remove redundant check isLet
The `isLet` check is essentially the disjunction of the `Maybe Bool`
and the function looking up the value to check whether it is a `Let`.
But:

* `getBinder` does the same lookup & then dispatches on Let
* the non-let cases in both branches of the if-then-else are equal

So we can actually get rid of that `isLet` and it should compute the
same result. We still use the `Maybe Bool` to potentially avoid running
`getBinder` if we already know the local value is not a let.
2020-04-15 14:15:02 +01:00
Guillaume Allais
9152caded1 [ cleanup ] use reverseOnto
Instead of essentially interleaving the proof that `reverseOnto`
and ̀`reverse _ ++ _` are equivalent, we embrace `reverseOnto` and
perform a single rewrite at the end.
2020-04-15 13:54:02 +01:00
Guillaume Allais
3ae4267de9 [ refactor ] following discussion with @ziman
Cf. 654ab0cbd0 (r38389015)
2020-04-15 13:53:51 +01:00
Guillaume Allais
b60fdf2c0d [ doc ] for the case tree constructors 2020-04-15 13:53:43 +01:00
Edwin Brady
d5bfb8f136 Use explicit named representation for compiling
Apologies to anyone who's working on a back end independently!

You can still use CExp for now, but I'm shortly going to try using
NamedCExp in inlining, to save the fairly large cost of maintaining the
de Bruijn indices when going under binders.

Names are kept unique in the translation, so you can assume you don't
need to worry about them.
2020-04-15 11:14:02 +01:00
Arnaud Bailly
5544919c31 use quotient on scheme backends
We compile divisions of Integers to quotient instead of '/' and add
some tests for numbers
2020-04-15 10:52:35 +02:00
Ohad Kammar
0254ff109c Merge branch 'master' of github.com:edwinb/Idris2 into fully-abstract-records 2020-04-15 08:46:12 +01:00
Arnaud Bailly
2b0cc2a592 provide building blocks for binary network I/O 2020-04-14 21:15:32 +02:00
Edwin Brady
843619790e Another small improvement in code generation
Use a variant of MkVar which has the name in the type and therefore
means it can be erased to a newtype, so just an Integer. Then use
'insertNames' rather than repeatedly thinning.
2020-04-14 20:03:35 +01:00
Guillaume Allais
f10edd51f5 [ fix #279 ] comment delimiters with more than one dash 2020-04-14 14:13:38 +01:00
Kamil Shakirov
d258584a9f Ditto 2020-04-14 18:28:06 +06:00
Edwin Brady
849a1da846 Erasure correctness
A bit of reorganisation to ensure that the context membership proofs are
erased. It's only a small overhead in general to keep the proofs, but
there are places where it's really noticeable, particularly when
compiling large programs.
2020-04-14 13:13:59 +01:00