Commit Graph

1033 Commits

Author SHA1 Message Date
Fabián Heredia Montiel
7762c1b23f Basic Show instance of NameMap 2020-04-22 14:43:03 -05:00
Edwin Brady
be8b157ead
Merge pull request #290 from LibreCybernetics/minor-unicode-identifier-fixes
Refactor Parser.Lexer.{ident, OpCode} for reuse in IDEMode
2020-04-21 18:09:58 +01:00
Edwin Brady
1a41a265b9
Merge pull request #299 from chrrasmussen/fix-chez-in-folder-with-spaces
Allow spaces in file path for generated Chez programs
2020-04-21 17:04:37 +01:00
Fabián Heredia Montiel
6ea8b477ed Refactor ident to reuse in IDEMode, fixes out of sync bug.
Related: 1a4f424259 on 2019-September-28
2020-04-21 09:37:36 -05:00
Christian Rasmussen
2a3213d10a
Merge branch 'master' into fix-chez-in-folder-with-spaces 2020-04-21 15:01:01 +02:00
Edwin Brady
2b6000ecac Shuffle some tests around
Making sure that tests which use chez are run after we've checked chez
is installed
2020-04-21 12:03:49 +01:00
Edwin Brady
2ad1621a3e Regression test for using named implementations 2020-04-21 11:51:44 +01:00
Edwin Brady
d39c701f28 Add 'using' hints at the right time
They need to be added before checking the top level types of the
interface methods, because those types will use them.
Fixes #291
2020-04-21 11:47:35 +01:00
Edwin Brady
71cae356e2
Merge pull request #281 from ziman/fix-cast-double-int
Fix cast to integral types
2020-04-21 11:24:09 +01:00
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
Christian Rasmussen
4d2b270db6 Allow spaces in file path for generated Chez programs 2020-04-18 18:18:02 +02: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