Commit Graph

1252 Commits

Author SHA1 Message Date
Edwin Brady
3d56ec62b4 Update ipkgs
Algebra modules were missing
2020-05-16 19:05:26 +01:00
Edwin Brady
f0a87e88c2 Remove extra Show TokenData definition 2020-05-16 19:03:30 +01:00
Edwin Brady
c7f893f6aa Reorganise optimisation options for C
It should be -O2 for the rts, but -O2 takes ages for idris2.c so should
be saved for releases (also OPT should be able to be edited easily for
e.g. adding profiling)
Also default to clang (perhaps it would be better if we could check
whether clang was available first, but it does a better job as the
default overall).
2020-05-16 18:08:00 +01:00
Edwin Brady
6ef86bc5d6 Fix check in findOffset 2020-05-16 18:05:45 +01:00
Edwin Brady
7259743f99 Update docs; options now in config.mk 2020-05-16 17:35:55 +01:00
Edwin Brady
4c35210025
Merge pull request #370 from ska80/fix-makefiles
Refactor makefiles
2020-05-16 17:34:51 +01:00
Edwin Brady
79d52c5207 Switch to List Char for the lexer
Surprisingly, this doesn't affect performance - it shows up as about the
same in the profile. But more importantly, it ports more directly to
Idris 2, which can't guarantee that 'strTail' doesn't allocate at
runtime, so using a List Char here is much more efficient.

This probably points to the need for better string primitives. Later...
2020-05-16 16:30:51 +01:00
Edwin Brady
560449e087 Check bounds on substring
Fixes #379
2020-05-16 13:50:37 +01:00
Edwin Brady
19bcefb25e contrib shouldn't be in the default search path
Sorry, I should look more carefully... contrib is a space for incoming
experimental libraries that might get sorted into something better, so
it shouldn't be a place for things that are in the default library path
(this is consistent with Idris 1 behaviour)
2020-05-16 13:08:07 +01:00
Edwin Brady
debe5f6fc3 Add chmod to System.File
Idris 2 needs it - Windows probably needs something else (patches for
Windows support will be very much welcomed!)
2020-05-16 13:02:48 +01:00
Edwin Brady
263d5fa3a1 More system functions
exit, and getting the whole environment
2020-05-16 13:02:48 +01:00
Edwin Brady
34802b9304 Add some Strings functions
strM for nicer matching on head and tail, and functions for parsing
numbers
2020-05-16 13:02:48 +01:00
G. Allais
306aea32b8
[ test ] add test for defaulting peculiarity (#376) 2020-05-16 00:43:17 +01:00
Edwin Brady
6f4a36e84b Add octal literals 2020-05-15 22:31:02 +01:00
Edwin Brady
a3790d8442 Remove a couple of libraries Racket doesn't need
These affect startup time, and are no longer needed now they're done in
libidris2_support
2020-05-15 15:55:50 +01:00
Edwin Brady
3a9823e32a Add --verbose flag
Sometimes it's nice to see what's building even if other flags like -o
override it
2020-05-15 15:55:50 +01:00
Edwin Brady
7edef68739
Merge pull request #374 from ska80/fix-chez017-test
Fix tests/chez/chez017 test
2020-05-15 15:55:35 +01:00
Edwin Brady
21507e64f3 Some Racket CG fixes
libc needs a version number, and we need to make sure we're not
generating FFI definitions more than once
2020-05-15 12:43:31 +01:00
Kamil Shakirov
109feaaf2f Fix tests/chez/chez017 test 2020-05-15 16:03:34 +06:00
Edwin Brady
02ce7b568d Reorganise TTC to make code generation faster
Before compilation we need to decode all the relevant definitions from
the TTC, but the only bit we actually need is the compiled IR. So, put
that first, and leave a dummy definition for the rest, then replace it
when we're done.
Chasing all the definitions now takes about 20% of the time it did
before (at least on the program I'm most interested in)
2020-05-14 20:25:17 +01: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
80e6dfa31c Merge branch 'master' into fix-makefiles 2020-05-14 10:59:00 +06:00
Kamil Shakirov
33aa321127 Include config.mk in the source distribution 2020-05-14 01:35:00 +06:00
Kamil Shakirov
3acd7a0805 Remove Chicken CG deps from CI tests 2020-05-14 01:19:52 +06:00
Edwin Brady
18b6449657 Match on names for typecase
This is instead of generating unique integer tags when generating IR to
pass to a back end. The reason is that this way requires whole program
compilation - to make sure the tags are unique - but it would be
beneficial to build the IR when checking a module, not all at once at
the end.
So, this is to support separate compilation.
It does mean the API for IRs has changed slightly - tags are now Maybe
Int rather than Int. If a tag is 'Nothing' you should generate something
to match on based on the name. The Scheme back ends currently do this
just by printing the string.

Matching on types is likely to be rare, but if this does turn out to be
a bottleneck, a backend can generate unique ids at that point, which is
a lot cheaper than doing it before building, inlining, optimising, etc.
2020-05-13 20:10:41 +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
0e7e05382a Merge branch 'master' into fix-makefiles 2020-05-13 23:37:40 +06:00
Edwin Brady
a6e7326ab7
Merge pull request #373 from buzden/docs-idiom-brackets-fix
Idiom brackets syntax was fixed in the docs
2020-05-13 13:31:02 +01:00
Edwin Brady
5285b36a4f Update CHANGELOG and CONTRIBUTORS
Trying to keep both up to date - apologies if I'm missed anyone. I got
the list from the git logs, but feel free to edit yourself in or out as
you prefer.
2020-05-13 13:12:41 +01:00
Edwin Brady
68081ed86c Some scheme generation fixes
In racket, importing date and srfi/19 fails. Also some minor edits to
gambit support code.
2020-05-13 12:41:38 +01:00
Edwin Brady
18dff43d2b Move Concurrency.Raw to new FFI 2020-05-13 12:18:21 +01:00
Edwin Brady
9a0608b01f Add idris_crash function
Because sometimes all you can do is give up (e.g. failing to allocate
memory for some crucial thing).
2020-05-13 12:05:00 +01:00
Kamil Shakirov
75a4564a96 Suppress some expected warnings 2020-05-13 17:02:55 +06:00
Denis Buzdalov
5088cb621c Idiom brackets syntax was fixed in the docs 2020-05-13 13:39:09 +03: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
a451dcd171 CHANGELOG updates
Noting recent langauge changes for optimisations. Full documentation
still to come.
2020-05-13 00:12:58 +01:00
Edwin Brady
2d1d7be949 Move directory code to C
...and remove the scheme support for it on the way
2020-05-13 00:09:52 +01:00
Edwin Brady
cadd7e1322 Move more support code to C
System mostly calls C now, except for getting command line arguments,
which may be too back end dependent so maybe we should think of another
approach here later.
2020-05-12 23:31:39 +01:00
Edwin Brady
3ab68fb7c8 Add some more file operations
I've also added some windows support headers (taken straight from the
rts/Idris 1) but I have no way to test, and the Makefile doesn't build
them. Please can someone who is familiar with windows fix this? Thanks!
2020-05-12 22:49:58 +01: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
a474396691 Merge branch 'master' into fix-makefiles 2020-05-12 20:38:12 +06:00
Kamil Shakirov
1c8036dc58 Fix building shared libraries with correct extensions 2020-05-12 20:34:49 +06:00
G. Allais
f72f91c67a
[ fix ] build by installing support before tests (#369) 2020-05-12 15:23:42 +01: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