Commit Graph

1275 Commits

Author SHA1 Message Date
Edwin Brady
a5c9ce9306 Some directory file function renamings
This allows us to build Idris2 proper again
2020-05-24 20:29:49 +01:00
Edwin Brady
e2ef9e05eb
Merge pull request #390 from ska80/fix-idris2sh-build
Fix building the latest self-hosted Idris 2
2020-05-22 11:07:12 +01:00
Kamil Shakirov
8a61f97ff6 Update .gitignore 2020-05-22 11:33:23 +06:00
Kamil Shakirov
27006bc516 Fix building the latest self-hosted Idris 2
* Add System.Path to the 'contrib' package
* Update Data.List in the 'base' package
2020-05-22 02:02:51 +06:00
Edwin Brady
fa92951af0 Update travis script 2020-05-20 13:59:55 +01:00
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
d2c84224c9
Merge pull request #389 from andylokandy/gambit
Build standalone executable via gambit backend
2020-05-19 22:38:13 +01:00
andylokandy
2fa61b8e33 Fix gambit codegen 2020-05-20 04:17:07 +08:00
Edwin Brady
e611161ec4 Update CONTRIBUTORS 2020-05-19 20:09:59 +01:00
Edwin Brady
149e6fbbaa Add blodwen-os to racket support 2020-05-19 19:38:37 +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
ba9f14a18c Don't collapse empty lines in 'lines' 2020-05-19 10:44:16 +01:00
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
Johann Rudloff
17b01b807e Fix unmarshalling of Integer values in TTC
Switch (un)marshalling of Integer values to Bits8 instead of Int.

Previously, in `fromLimbs`, the read values arrived as a list of
(32-bit) Ints. If any of the limbs had its MSB set, it would be
interpreted as a negative number and corrupt the result.

This commit fixes this by using a `List Bits8` instead, which has an
explicit (and direct) mapping to Bytes in the Buffer, where it's
eventually stored. This way no awkard casts need to happen.
2020-05-15 15:48:57 +02: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
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