Commit Graph

970 Commits

Author SHA1 Message Date
Thomas E. Hansen
9fc3ee79e1
Merge branch 'master' into pragma-topic. 2021-07-14 16:45:05 +02:00
Stiopa Koltsov
13a9676805 Use the same generated string in RefC backend as in other backends 2021-07-13 23:00:13 +01:00
Thomas E. Hansen
bfbe974254
[ doc ] Add topics (#1498) for pragmas. Implements --help pragma.
This adds the ability to do `idris2 --help pragma` and get a list of the
various pragmas and their options, similar to `idris2 --help logging`.
2021-07-13 17:52:40 +02:00
Niklas Larsson
eb0c59c908
Enable incremental compilation on Windows. (#1694) 2021-07-13 11:29:34 +01:00
stefan-hoeck
f6b4f188e1 [ new ] support compile time evaluation of new integer primops 2021-07-13 11:28:02 +01:00
Rujia Liu
9dfad52173
[fix] refc backend broken with msys2 (#1668) 2021-07-13 11:27:36 +01:00
CodingCellist
80e7e179ad
[ fix #1652 ] Save casefnty to TTC (#1686) 2021-07-13 11:04:07 +01:00
Edwin Brady
9bd32c4a3d Fix chez033 on windows
This prints lots of warnings since incremental compilation is not
available, so turn that off when running on windows for now.
2021-07-11 17:04:07 +01:00
Edwin Brady
c95ebd554d Disable incremental compilation on Windows
It currently doesn't work anyway, so fall back to whole program
compilation which at least means the test doesn't get in the way.
2021-07-11 16:20:47 +01:00
Edwin Brady
886962aa43 Need --script for incrementally compiled apps
Otherwise it doesn't load the compiled modules and can't find the
compiled definitions!
2021-07-10 23:55:45 +01:00
Edwin Brady
3e92863e1c
Merge pull request #1674 from edwinb/parameters
A couple of parameters block fixes
2021-07-10 21:18:07 +01:00
Edwin Brady
4ca8caeb13 Fix case split in parameter blocks
We need to make sure variables are bound as PVar, in the end, otherwise
the case split machinery doesn't know how to handle them.
2021-07-10 19:13:27 +01:00
Edwin Brady
26cdfc7830 Make records work in parameter blocks
This involves making 'unelab' aware of nested names so that it can
remove the parameters from names in the current block. It's a bit of a
hacky solution, but it is also the easiest one.
Ideally we'd build the getter types directly, rather than using unelab,
but that's one to save for another time.
Fixes #1482
2021-07-10 18:12:44 +01:00
Edwin Brady
8b45ccd264 Use chez --program rather than --script
We're running our executables as top level programs, so this gives more
scope for optimisations, doesn't use the Chez REPL, etc.
2021-07-10 16:40:19 +01:00
Stefan Höck
599d0635e9
[ refactor ] JS backend overhaul (#1609) 2021-07-10 11:15:21 +01:00
Zoe Stafford
0ecbd517e8
[ improvement ] VMCode (#1662) 2021-07-07 17:06:59 +01:00
Stiopa Koltsov
9c63e90fd2 Write compiler version into generated files 2021-07-06 09:35:48 +01:00
Edwin Brady
6a60680af6 Don't inline holes that are user defined names
We inline some holes when solving them if they pose no risk to breaking
sharing, since this can speed up a few things. But if the hole was
originally a user name, we might want to refer to it, and inlining it
menas we can't since it won't be saved to disk.
2021-07-02 15:59:56 +01:00
G. Allais
b0e297658c
[ cli ] make package file optional (#1651) 2021-07-01 14:16:29 +01:00
Alissa Tung
2865a70a6e
[ base ] add List functions (#1550)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-07-01 08:00:12 +01:00
Johann Rudloff
5e70a77310 [ docs ] Ignore empty record field docstrings 2021-06-30 22:01:26 +01:00
Johann Rudloff
7c1ab56ca0 [ docs ] Add record field docstrings to the RF-name as well
A record field can add two names to the context, a UN-name and an
RF-name.  The docstring is now saved for both names, so that it can
always be found when one of the names can be resolved.

Previously the docstring was only saved for the UN-name which led to the
docs missing when looking up the (.fieldName) version, e.g. when listing
docs for the record type.
2021-06-30 22:01:26 +01:00
Johann Rudloff
af9f72466f [ docs ] Fix record fields wrapped in parentheses in HTML doc
The (implicitly added) "."-prefix when calling `isOpName` with an RF-name
leads to `isOpName` always returning true (which is correct in most
cases, where the RF is displayed as such). In case of the docs however,
we only show the name root and thus should check the "real" name of the
field (without the added dot in the beginning).
2021-06-30 22:01:26 +01:00
Johann Rudloff
f2f83bd531 [ docs ] Fix HTML formatting for record projections
The `Decl` annotation should go directly on the name-type part. This
automatically fixes the `Decl` annotation being skipped, when no
docstring is found.
2021-06-30 22:01:26 +01:00
Nick Drozd
9cb20f3653
Clean up some assert_total instances (#1644) 2021-06-29 22:05:40 +01:00
Stiopa Koltsov
6be2a54c0a Delete tyspec functions
I suspect this function is left there accidentally after FFI was
refactored.

These functions can mislead about how FFI works.

Note these functions are private (not exported) and not used.  Idris
compiler could emit a warning about such functions.
2021-06-28 20:01:19 +01:00
Zoe Stafford
deb90a6de2 [ fix ] generate lower level IRs if the option to dump that use phase is selected 2021-06-28 16:55:19 +01:00
Tim Engler
05f28724ed
[ fix #1579 ] Nat hack for comparison operators (#1580)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-06-28 16:48:08 +01:00
Stepan Koltsov
8d7d13dd41
Insert @generated markers into generated launcher scripts (#1586)
Took me some time to figure out that `build/exec/idris2` is generated.
2021-06-28 16:44:33 +01:00
Nick Drozd
63a6b16517 Cut unneeded type specifications 2021-06-28 16:22:27 +01:00
Kamiλ Shakirov
8e30b296c0
[ refactor ] Remove Data.Strings module (#1607) 2021-06-28 13:48:37 +01:00
Zoe Stafford
af871967ef [ error message ] include space in missing methods error 2021-06-28 13:38:26 +01:00
Edwin Brady
d6370380e6 Missing interface methods now cause an error
This was always the intended behaviour, but until now not implemented!
This caught a couple of issues in contrib and a test.
2021-06-27 20:03:19 +01:00
Edwin Brady
627bce068e Better errors/warnings for --inc
If the code generator doesn't support incremental builds, report an
error.
2021-06-27 16:28:17 +01:00
Edwin Brady
94088bea80 Support for incremental compilation with Chez
This adds a new flag '--inc <backend>' which, if set, compiles all
modules incrementally, and for executables, links the incrementally
compiled modules rather than building the whole program.

Also, adds an environment variable IDRIS2_INC_CGS for providing a comma
separated list of backends to use for incremental builds.

Also, adds '--whole-program', which overrides incremental builds for an
executable.

Incremental builds are much faster if there's nothing to recompile, but
for the Chez backend, generate code which runs at about half the speed.

Currently only works for Chez - other backends ignore the flag.

Also, incremental building of an executable will only work if *all*
required modules have been built incrementally for the backend in use.
2021-06-27 15:40:23 +01:00
Edwin Brady
7d3e3e0719 Check sizes of buffers and strings in TTCs
They need to be positive or we can't make the buffer, which causes a
segfault. This happened when loading old TTCs with a different format.
Fixes #1503
2021-06-23 18:08:27 +01:00
Edwin Brady
bea175c09c
Merge pull request #1531 from Russoul/fc-name-at
Reconcile FC and IDE mode
2021-06-23 15:48:04 +01:00
Edwin Brady
7802b72dd5 Refine timeout mechanism
Set the maximum time when initialising the timer, which means we can
check in the middle of potentially expensive operations like
normalisation, rather than just at occasional points in expression
search.
2021-06-23 01:23:20 +01:00
Edwin Brady
4ef29da87e Fix expression search on already solved holes
If it's solved by unification, expression search should just print the
unified value. In fact it almost did this, but wasn't reducing the holes
so the result was being rendered incorrectly.
2021-06-23 00:59:26 +01:00
Edwin Brady
92066c24fe Add timeout for definition/expression search
This is set to 1 second by default. Usually if it hasn't found a result
by then, it never will, but given that we find the first batch of
results then sort them, the timeout also stops us fruitlessly searching
for more solutions.

Hopefully 1s is more than enough for CI too. There is a mechanism to
change the timeout (%search_timeout) so if it turns out that CI needs
longer in some cases, we can increase it there.

I haven't documented this yet, but proof/definition search needs
documenting in general. I'll get to that.

The timer mechanism may also be useful elsewhere - I'm considering it
for ambiguity warnings, because the ambiguity depth limit isn't working
very well for that.
2021-06-23 00:42:51 +01:00
G. Allais
49f8cefeff
[ cleanup ] Test.Golden (#1526) 2021-06-21 17:30:11 +01:00
Edwin Brady
a15136b3b2
Merge pull request #1590 from edwinb/eval-updates-take2
Some evaluator tidying, CBV evaluation (second attempt)
2021-06-21 14:10:43 +01:00
Matt Smith
95710c3a29 Add chezscheme binary to search path
The Gentoo Chez package and some versions of the Ubuntu package
install Chez scheme as `/usr/bin/chezscheme' which requires manually
setting the CHEZ environment variable.  Adding it to the search path
makes it easier for these users.

Closes: https://github.com/idris-lang/Idris2/issues/666
2021-06-21 11:20:12 +01:00
Edwin Brady
37f8c2c58f Merge github.com:idris-lang/Idris2 into eval-updates 2021-06-20 21:35:56 +01:00
Robert Wright
a8264f8f05 Add ability to extend RefC backend to create further backends 2021-06-18 16:59:35 +01:00
Tim Engler
68c6fe222c
[ Fix #1577 ] Actually use natMinus hack (#1578)
And also make sure that the output is truncated to 0.

Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-06-18 11:50:54 +01:00
G. Allais
f3177e0cc1
[ fix ] print postfix projections... postfix (#1557) 2021-06-18 00:00:51 +01:00
CodingCellist
55f8bc3b90
Improve case-splitting formatting to not introduce new whitespace; add a bit of comments+docs. (#1553) 2021-06-17 16:48:59 +01:00
Nick Drozd
3e3a4e1b78
Use truncated case notation (#1562) 2021-06-17 15:52:19 +01:00
Stefan Höck
c04835c436
[ cleanup ] Reuse Tarjan's algorithm in JS backend and some other cleanups (#1504) 2021-06-17 12:43:10 +01:00