Commit Graph

1257 Commits

Author SHA1 Message Date
Matus Tejiscak
e8166c2dc8 Fix schName. 2020-04-17 00:50:38 +02:00
Matus Tejiscak
ef826ff45c Use RF names for record projections. 2020-04-17 00:44:53 +02:00
Matus Tejiscak
4b986e8b61 Fix record dot syntax parser. 2020-04-17 00:35:39 +02:00
Matus Tejiscak
ca1ef8a882 Implement record dot syntax as Idris sugar. 2020-04-17 00:21:12 +02:00
Matus Tejiscak
10f9d02ecd Implement dot record syntax. 2020-04-16 23:37:45 +02: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
Matus Tejiscak
801da788ed Add the RecordProjection lexeme. 2020-04-16 22:47:21 +02: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
Matus Tejiscak
41ef3fdd2a Don't use exact-floor in cast-string-int. 2020-04-14 22:44:32 +02:00
Matus Tejiscak
c3b6b130fd Also fix up cast-string-int. 2020-04-14 22:44:32 +02:00
Matus Tejiscak
7a3ebd9a2f Use exact-floor. 2020-04-14 22:44:32 +02:00
Matus Tejiscak
18962eeacf Fix casting in integral division. 2020-04-14 22:44:32 +02:00
Matus Tejiscak
cf177f95a4 Fix conversion from Double to integral types. 2020-04-14 22:44:32 +02:00
Matus Tejiscak
b5689e5b25 Disable tests relying on cast-string-int. 2020-04-14 22:44:18 +02:00
Matus Tejiscak
1112f01dc6 Add reg016 to tests. 2020-04-14 22:12:36 +02:00
Matus Tejiscak
4827d0447b Add division tests. 2020-04-14 22:01:31 +02:00
Matus Tejiscak
c7fe4f1a63 Update the expectation file. 2020-04-14 21:36:14 +02:00
Matus Tejiscak
b20ae8d36b Add a test. 2020-04-14 21:30:04 +02: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
Jeetu
9a9101ab0f Merge https://github.com/edwinb/Idris2 into sync
Updating latest code from edwinb repo.
2020-04-13 17:53:28 +05:30
Jeetu
00fc9a603d Refactored the docs directory for latest sphinx_rtd_theme.
Source and build directory are seperate.
References and footnotes are named.
Other than that, tried to do no changes in the docs.
Fixed multi label in proofs-index.
Fixed most of the warnings in make html.
HTML and PDF are building.
2020-04-13 17:45:52 +05:30
Jeetu
5175743e78 Removed docs directory for adding new docs. 2020-04-13 17:41:59 +05:30
Jeetu
db25e81d48 Mostly references naming. Still footnotes are not coming on the same line as its number. 2020-04-13 16:40:23 +05:30
Edwin Brady
806e8d2569 Faster inlining phase of compiler
It's still too slow, but better than it was. Instead of all the
weakening, invent a new name when evaluating under a lambda and
substitute later.
Possibly we can improve this later by substituting in batches, like the
main evaluator does.
2020-04-12 22:37:11 +01:00
Edwin Brady
0ed9f6cee6 Occasional performance boost
Check for conversion without reducing names, before unifying arguments.
This is quick to check, and can save a lot of evaluation.
2020-04-12 18:01:45 +01:00