* Fix casts in scheme evaluator
We really need test cases for all the primitives before we can use this
evaluator properly. Also test cases that run inside an environment,
which are a bit harder to construct.
* Add the cast fixes to racket support code
* More racket compile time evaluation fixes
We had the chez version of some primtives in the ct-support file. We
need a full set of tests for the primitives here too...
We recently changed the meaning of this (calculated during 'quote'
rather than after) and by experimentation it seemed to be too high. It
is a somewhat arbitrary heuristic to decide when to fully normalise, but
this seems to help as a better default in some cases.
* Normalise types fully at the REPL
It was a bit odd that we only normalised the scope of function types and
not the arguments, and I can't remember the reason for that if there
even was one.
* Better way of using nf_metavars_threshold
If a term is getting big and probably needs normalising, we now have a
sizeLimit flag in quote, so we can use that instead of checking the size
afterwards. This is a handy heuristic for speeding up unification when
there's a term with lots of suspended computation. Fixes#1991
* [ refactor ] user proper int types for Constant
* [ cleanup ] declare standalone TTC implementations for BitsN/IntN
Rather than doing the casting inline, have the (en/de)coding all
side by side in one place
* [ cleanup ] remove duplicated code
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
For error reporting purposes it's better to have an (approximate)
virtual location for code that was introduced by the elaborator
than to have an `EmptyFC` that does not help.
Without this change install-libs will not install the .so files, and
consequentially the test 'chez/chez033' fails with 'Error: INTERNAL
ERROR: Missing .so:Prelude/Cast.so' when it is run by an installed
executable.
Also add a test-installed makefile target to run the tests using the
installed executable.
* so much experimentation
* tests that show preliminary evidence the new stuff is working.
* small amount of cleanup
* more cleanup of various troubleshooting code.
* new test case added.
* only log unreachable indices if there are any.
* when traversing deeper simply skip over defaults since they have already been reviewed.
* Remove fallback clause that the changes in this PR correctly identified as unreachable.
* tidying up more.
* move some common functions to a new Core.Case.Util module.
* refer to case builder and case tree under new parent module.
* update imports to look for CaseTree in new submodule.
* update api ipkg
* remove unneeded application operators.
* remove or comment out unreachable default clauses caught by the changes in this PR.
* a bit of code documentation and renaming for clarity.
* bump previous version in CI.
* fix API usage of Util module.
* Add issue 1079 test cases.
* forgot to add new test cases file.
* remove commented-out lines by request of RefC author.
* Use a SortedSet instead of nubbing a list.
* update new case tree import.
* Update src/Core/Case/Util.idr
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
* remove function with nothing to offer above and beyond a differently named copy of the same code.
* replace a large tuple with a record; discover not all of the tuple's fields were needed.
* fix shadowing warning.
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
This is for compiled evaluation at compile-time, for full normalisation. You can try it by setting the evaluation mode to scheme (that is, :set eval scheme at the REPL). It's certainly an order of magnitude faster than the standard evaluator, based on my playing around with it, although still quite a bit slower than compilation for various reasons, including:
* It has to evaluate under binders, and therefore deal with blocked symbols
* It has to maintain enough information to be able to read back a Term from the evaluated scheme object, which means retaining things like types and other metadata
* We can't do a lot of the optimisations we'd do for runtime evaluation particularly setting things up so we don't need to do arity checking
Also added a new option evaltiming (set with :set evaltiming) to display how long evaluation itself takes, which is handy for checking performance.
I also don't think we should aim to replace the standard evaluator, in general, at least not for a while, because that will involve rewriting a lot of things and working out how to make it work as Call By Name (which is clearly possible, but fiddly).
Still, it's going to be interesting to experiment with it! I think it will be a good idea to use it for elaborator reflection and type providers when we eventually get around to implementing them.
Original commit details:
* Add ability to evaluate open terms via Scheme
Still lots of polish and more formal testing to do here before we can
use it in practice, but you can still use ':scheme <term>' at the REPL
to evaluate an expression by compiling to scheme then reading back the
result.
Also added 'evaltiming' option at the REPL, which, when set, displays
how long normalisaton takes (doesn't count resugaring, just the
normalisation step).
* Add scheme evaluation mode
Different when evaluating everything, vs only evaluating visible things.
We want the latter when type checking, the former at the REPL.
* Bring support.rkt up to date
A couple of missing things required for interfacing with scheme objects
* More Scheme readback machinery
We need these things in the next version so that the next-but-one
version can have a scheme evaluator!
* Add top level interface to scheme based normaliser
Also check it's available - currently chez only - and revert to the
default slow normaliser if it's not.
* Bring Context up to date with changes in main
* Now need Idris 0.5.0 to build
* Add SNF type for scheme values
This will allow us to incrementally evaluate under lambdas, which will
be useful for elaborator reflection and type providers.
* Add Quote for scheme evaluator
So, we can now get a weak head normal form, and evaluate the scope of
a binder when we have an argument to plug in, or just quote back the
whole thing.
* Add new 'scheme' evaluator mode at the REPL
Replacing the temporary 'TmpScheme', this is a better way to try out the
scheme based evaluator
* Fix name generation for new UN format
* Add scheme evaluator support to Racket
* Add another scheme eval test
With metavariables this time
* evaltiming now times execution too
This was handy for finding out the difference between the scheme based
evaluator and compilation. Compilation was something like 20 times
faster in my little test, so that'd be about 4-500 times faster than the
standard evaluator. Ouch!
* Fix whitespace errors
* Error handling when trying to evaluate Scheme
Even though the `Comment` aspect is not (currently) supported
in the IDEMode, this is crucial to get proper highlighting in
Katla's LaTeX & HTML backends.
* Version increment to 0.5.1
This is to remove the requirement on Chez >9.5
* Disable -Xcheck-hases, at least for the moment
If we're going to have this as an option, we need to have a portable way
of finding a sha256sum command. At the moment, we might find a command,
but different versions accept different options. We should at least
allow setting it via an environment variable, and we certainly shouldn't
fail if running the command fails.
* Update bootstrap code ready for 0.5.1 release
* Abandon auto search on undefined name
These might arise from names in other modules that haven't been
imported. But it's going to be an error whatever, so give up straight
away. Fixes#1925
* Fix typo
* Fix test source
* Record possible cause when we can't solve a goal
Normally, it's just because we searched and failed. But maybe sometimes,
it's because there's an undefined name, in which case, we can include
this in the error message.
This is good to record because it means we don't abandon elaboration at
the wrong time! Say, if a search fails due to an undefined name, but it
was only in one branch of an ambiguous elaboration.
* Add necessary arguments for perf009 test
* Remove __collect_safe from bootstrap chez
We don't need this for bootstrapping, and it prevents building on older
Chez, so we can just remove it. Also added a note to the release
checklist.
* Update Release/CHECKLIST
Co-authored-by: memoryruins <memoryruinsmusic@gmail.com>
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
Co-authored-by: memoryruins <memoryruinsmusic@gmail.com>
* Update version numbers and bootstrap scheme
* Use wall clock time for search timeouts
That was always the intention in any case, rather than the process time.
* Small fix for incremental compilation
In incremental mode we need to add the arity of a compiled definition to
the hash, because if that changes, we need to rebuild the dependencies
too to make sure the arity is correct at the call site
* Fix indentation in CHANGELOG