Commit Graph

1260 Commits

Author SHA1 Message Date
Edwin Brady
8c9eec15a8 Calculate OS from scheme code
This way if you distribute scheme it won't have an OS hard coded based
on the machine it was generated on
2020-05-18 19:03:41 +01:00
Edwin Brady
0ef2885548 Use realpath in chez startup script
This gives the right location for finding libraries on the Mac, where
dirname has slightly different behaviour.
It does now require 'realpath' to be installed, which on the Mac is part
of 'coreutils' which can be installed via 'brew'
2020-05-18 18:12:56 +01:00
Edwin Brady
ea84eab2e6 Faster search for modules to build in packages
There was a lot of repeated work in packages, since it tried to build
the module tree starting from every listed module. Now, it skips the
ones where they're already in the tree.
2020-05-18 10:15:31 +01:00
Edwin Brady
c7ef44996a Fix codegen in Chez/Racket
Paths in the chez startup script need to be relative to allow it to be
relocatable; racket needs some libraries for buffers.
2020-05-18 09:43:16 +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
463f1b3233 Add foldlM
Needed for self hosting, and probably ought to be in the prelude by the
usual rule of thumb
2020-05-17 15:23:05 +01:00
Edwin Brady
1acbf1b67e Add Show for Either 2020-05-17 14:51:27 +01:00
Edwin Brady
a302be38f4 Add missing export modifier to ExitCode 2020-05-17 13:08:30 +01:00
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