Commit Graph

358 Commits

Author SHA1 Message Date
Edwin Brady
24fed4feea Rename everything idris2boot, increment version
From here on, this repo is intended only as a bootstrapping step for the
self hosted Idris 2. It will - as long as possible - be kept up to date
enough that it can build Idris 2, but won't be maintained beyond that.
2020-05-20 13:23:00 +01:00
Edwin Brady
c0b7c6a9d8
Merge pull request #367 from cypheon/bugfix/ttc-bigint-unmarshalling
Fix unmarshalling of Integer values in TTC (Fixes: #345)
2020-05-19 19:38:15 +01:00
Edwin Brady
c197c0f777 Update Buffer+File libraries
Adding primitives - it's useful to distinguish between 32 bit and 64 bit
integers when writing to buffers.
2020-05-19 16:06:05 +01:00
Edwin Brady
a130952928 Switch buffers back to scheme FFI
It's just easier to deal with the memory management! But we should do
something more flexible here later.
2020-05-17 22:49:41 +01:00
Edwin Brady
4c35210025
Merge pull request #370 from ska80/fix-makefiles
Refactor makefiles
2020-05-16 17:34:51 +01:00
G. Allais
306aea32b8
[ test ] add test for defaulting peculiarity (#376) 2020-05-16 00:43:17 +01:00
Johann Rudloff
735395f403 Fix expected values of arithmetic test
These are the correct results, verified by performing the calculations
"manually" in both Python 3 and Chez Scheme.
2020-05-15 15:48:57 +02:00
Kamil Shakirov
109feaaf2f Fix tests/chez/chez017 test 2020-05-15 16:03:34 +06:00
Edwin Brady
dc67515611 Fix and test directory code 2020-05-14 12:40:48 +01:00
Edwin Brady
87c54caa27 Do compiling/inlining per module
Compiled and inlined code is now written to the ttc, to save having to
compile everything at the end even if some definitions don't need
recompiling.
2020-05-14 11:42:09 +01:00
Kamil Shakirov
5dfa853352 Merge branch 'master' into fix-makefiles 2020-05-14 00:13:47 +06:00
Edwin Brady
f5962e1ea4 Update test output 2020-05-13 19:06:22 +01:00
Kamil Shakirov
982629509b Merge branch 'master' into fix-makefiles 2020-05-13 16:25:15 +06:00
Kamil Shakirov
2ad471a5e3 Refactor makefiles to use some common options 2020-05-13 16:23:07 +06:00
Edwin Brady
1b36dd99b1 Move putChar, getChar etc primitives to C
Back ends can still shortcut these and use their own primitives, but
doing things this way gives consistent behaviour between the simple IO
primitives and file IO, and allow us to use stdin/stdout consistently
(e.g. to flush stdout).
This also fixes the behaviour of 'replWith' to be consistent with the
Idris 1 version.
2020-05-13 11:09:05 +01:00
Kamil Shakirov
8261b361e0 Merge branch 'master' into fix-makefiles 2020-05-13 09:05:29 +06:00
Edwin Brady
38e43f2c17 Move file management to C support library
This removes the need for some external primitives, and allows the
details to be shared between all the backends (plus we don't have to do
things a certain way just because Scheme chooses to)
2020-05-12 22:35:14 +01:00
Kamil Shakirov
1c8036dc58 Fix building shared libraries with correct extensions 2020-05-12 20:34:49 +06:00
Edwin Brady
e7d0b33e64 Do another round of inlining, and io_bind
A big cost in IO heavy programs is io_bind, and we can often inline it
away and turn it into just sequencing operations. Things have to be
lined up right to do that though - ideally, case inlining and the
newtype optimisation will know just a little bit more to be able to do
it automatically, but for now, the inliner treats io_bind as a special
case.

Also do another round of inlining, since lots more things can become
inlinable (io_bind especially, becoming fully applied to the %World)
after the first pass.
2020-05-12 11:33:29 +01:00
Edwin Brady
9328579575 Hack for optimising some enumerations
Really this should be generalised to any type that looks like an
enumeration after erasure, but this catches the most common options
quickly.
2020-05-11 18:10:08 +01:00
Edwin Brady
7adb4d3342 Move buffer API to C
It's slightly different wrt to file reading and writing, and now
requires the created buffer to be explicitly freed (since unlike Idris 1
the run time can't be told to manage C values) but this makes the buffer
code more portable by not requiring it to run via scheme.
Performance appears more or less the same as before.
2020-05-11 18:10:08 +01:00
Christian Rasmussen
0694b6c0ef Update chez016 test to not rely on realpath 2020-05-09 23:19:38 +02:00
Edwin Brady
0c1e428435 Fix laziness bookkeeping in unification
Need to note we can't add a laziness coercion under 'unifyInvertible',
which is where we unify things under metavariables which are known to
stand for constructor forms. Fixes #360
2020-05-09 19:19:26 +01:00
Christian Rasmussen
69aff544b6 Add test of noNewtype 2020-04-29 21:01:33 +02:00
Edwin Brady
6fcf861bc1 Change argument unification order
Solving later arguments first means that they can refer to solutions of
earlier arguments. This isn't really the best solution for ensuring that
metavariables refer to things defined earlier, but it helps, and it does
fix #304.
2020-04-28 11:31:18 +01:00
Matus Tejiscak
82a23afae7 Add compatibility with the original record update syntax. 2020-04-27 18:02:25 +02:00
Edwin Brady
2fd1c40056
Merge pull request #314 from MarcelineVQ/using-fix
'using' multiple named instances in scope fix
2020-04-27 15:16:12 +01:00
Edwin Brady
c75af6d116 Update test output 2020-04-27 14:45:06 +01:00
Edwin Brady
e208ea7129
Merge pull request #298 from ziman/records
RFC: Dot syntax for records
2020-04-27 14:28:19 +01:00
Edwin Brady
c95c4c6c0c
Merge branch 'master' into prelude-inline-doc 2020-04-27 13:38:29 +01:00
Edwin Brady
1262ca2fde
Merge branch 'master' into records 2020-04-27 13:36:18 +01:00
Edwin Brady
b9907fbb21
Merge pull request #254 from jfdm/literate-modes
Enhance literate mode to recognise multi-modes.
2020-04-27 13:33:55 +01:00
Edwin Brady
ff86f6f834 Implement occurs check properly (finally!)
Instead of the previous unreliable hack, actually look for occurrences
of the solved metavariable. Block if there are any, and fail if there
are any under a constructor. I had expected this to hurt performance
quite a bit, but it seems it doesn't.
This was prompted by #304, which is now partly fixed, but there's still
a refinement to unification needed to fix it fully (and at least it
doesn't segfault due to the cycle now!)
2020-04-27 12:17:45 +01:00
Edwin Brady
4947a9981a Fix lambda multiplicity check
A bug found via the very handy, but occasionally bad for performance so
off by default, --debug-elab-check. The multiplicity of a lambda type
needs to be checked against the expected multiplicity, not the given
multiplicity. Oops!

If you have any (\0 x => e) or similar, you may find you need to fix a
type error after this update...
2020-04-24 22:28:52 +01:00
Matus Tejiscak
07bb57d3a1 Stop using :exec in record004. 2020-04-24 19:14:22 +02:00
Matus Tejiscak
4baa09a7de Sidestep the question of printing floats. 2020-04-24 19:10:23 +02:00
Edwin Brady
819c9d7af1 Evaluate primitives (fromInteger etc)
At least as long as the number is small enough (currently set to < 100).
This is because it can open up further evaluation opportunities when
typechecking, and can make the term we're working with smaller - it also
makes display a bit neater.
Overall this makes some pathological cases of terrible performance much
better, without hurting anything else.
2020-04-23 21:21:08 +01:00
MarcelineVQ
896cd486d1 update 'using' regression test
have implementation 'using' regression test also check for multiple named implementations
2020-04-22 16:53:02 -07:00
Jan de Muijnck-Hughes
e091ca5701
Update tests/idris2/literate012/expected
Co-Authored-By: G. Allais <guillaume.allais@ens-lyon.org>
2020-04-22 20:37:07 +01:00
Kamil Shakirov
1d2250062b Fix tests 2020-04-22 11:56:08 +06:00
Matus Tejiscak
f44d384d63 Fix tests. 2020-04-21 23:47:34 +02:00
Matus Tejiscak
934cb29a80 Fix paths in record004. 2020-04-21 23:45:55 +02:00
Matus Tejiscak
e49364ff56 Merge branch 'master' into records 2020-04-21 23:11:40 +02:00
Matus Tejiscak
cb02395acb Rename record003 to record004. 2020-04-21 22:56:20 +02:00
Jan de Muijnck-Hughes
af27bce2e2 Enhance literate mode to recognise multi-modes.
While Bird Style literate mode is useful, it does not lend itself well
to more modern markdown-like notations such as Org-Mode and CommonMark.

This commit extends Idris2's existing literate mode to recognise both
'visible' and 'invisible' code blocks and lines in predefined markdown
styles.

The styles and their elements are:

+ Bird Style :: `>` denotes a visible code line, `<` a hidden code
                line.

+ OrgMode :: Org Mode source blocks for idris are recognised as
             visible code blocks, and comment blocks are invisible
             code blocks. Invisible code lines are denoted with
             `#+IDRIS:`.

+ CommonMark :: Only code blocks denoted by standard code blocks
                labelled as idris are recognised.

For backwards compatibility, we recognise literate modes by file
extension:

+ Bird Style :: `.lidr`
+ OrgMode :: `.org`
+ CommonMark :: `.md`

In future we should add support for literate `LaTeX` files, and more
intelligent processing of literate documents using a pandoc like
library in Idris such as: [Edda](https://github.com/jfdm/edda).
2020-04-21 19:27:46 +01: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
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