* Create a separate Makefile for the Idris 2 support libraries.
* Update INSTALL.md
* satisfy natural language linter
* Add to CHANGELOG
* Update CHANGELOG.md
* implement popen and pclose (to an extent) for NodeJS
* bring node020 back into tests.
* ah, I see what was being done here. Fix the idris for the test.
* fix test's unreachable clause warning
* fix expectation
* Add note to CHANGELOG
* small tweaks to get popen into merge-ready state.
* Fix symbom mangling
* Revert "Fix symbom mangling"
This reverts commit 6481e80155.
* Fix typo
* [RefC] Add missed prims of setBuffer* .
* [ fix ] formatting
* [ re #2609 ] Use 'UInt' instead of 'Word'
More descriptive/to the point / Less assumed knowledge.
There are no *LE suffixes for UInt8, since endianness is to do with
multiple bytes and UInt8 is a single one.
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
Co-authored-by: Thomas E. Hansen <teh6@st-andrews.ac.uk>
* [ re #2742 ] Count no. processors online rather than configured
Seems there might be some oddities with what is reported when, e.g.
reporting the maximum number of processors supported by the currently
installed motherboard, regardless of which processor is socketed.
* [ #2754 ] Update CHANGELOG
* first pass at signal support for node backend
* change signal values to int's
* implements defaultSignal
* return -1 as expected by calling API if any error is raised by nodejs runtime
* finishes signal support for nodejs
* extract repetitive foreign import identifiers
* fix comments
e79e4277 ("[ fix ] Make Bits types use int switch statement in RefC")
made the RefC backend generate code calling `extractInt` with Bits
types, bit did not add the extra cases to `extractInt`. This commit adds
the missing cases.
Fixes#2452
Modern compilers should be smart enough regardless and generate
efficient code for the sequence of ifs, this is really just a syntax
change to make the code shorter.
* RefC backend improvements
1. OnCollect had the wrong number of arguments. The code creator expects
3 arguments, but onCollect in prim.h expected 4 arguments. The first of which
was an erased arguments. That is now fixed.
2. OnCollect did not call `newReference` when creating a new reference to the pointer
and the freeing function
3. OnCollect and OnCollectAny still had a spurious printf statement
Those issues have been fixed, the test case can be found in
tests/refc/garbageCollect
4. The IORef mechanism expects that the %World token will be passed around
consistently. This is not the case. States in Control.App make use of
IORefs, but the function created from Control.App.prim_app_bind
had the world token erased to NULL.
Now, IORefs are managed using a global variable,
IORef_Storage * global_IORef_Storage;
referenced in cBackend.h, defined in the created .c file, and set to NULL
in main();
5. While multithreading and forking is still not supported, compiling a program
that makes use of Control.App demands a C implementation of prim_fork.
Files support/refc/threads.c and support/refc/threads.h provide a
dummy implementation for it, so that Control.App programs compile and run.
A test for these 2 issues is given in tests/refc/issue2424
* format changes
to make the linter happy
* format changes
to make the linter happy
* format changes
to make the linter happy
* spelling mistake braket -> bracket
Co-authored-by: Volkmar Frinken <volkmar@onutechnology.com>
* support for system command via node backend.
* Add env var set/unset
* fix env unset function
* Update libs/base/System.idr
* modify system test to cover node and chez.
* Add base tests for env get/set
I was getting a stack overflow on the tailrec002 test, caused by this
primitive being recursive. I've made it iterative. I'm no JS expert but
I've tested its behaviour against the old version.
* [ fix ] Fix returned status of the `system` function
* [ re #238 ] Fix program error condition of `git diff` call in `Golden`
According to documentation, not only negative exit code means error
Previously, the RefC files were located in IDRIS2_PREFIX. This is
decoupled to allow users to change the prefix (for ad-hoc library
install locations, for example).
* 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...
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