Commit Graph

852 Commits

Author SHA1 Message Date
Edwin Brady
e342559afd Postpone (don't give up) on laziness mismatch
If there's a conversion failure in unification, there could still be a
way to rescue it if one of the terms is a lazy type, so postpone rather
than giving up. Fixes #225
2020-03-10 11:58:27 +00:00
Edwin Brady
0d7f241847
Merge pull request #224 from chrrasmussen/fix-macos-build
Fix build on macOS
2020-03-09 23:07:34 +00:00
Edwin Brady
288a92424a Unifier mustn't resolve things which aren't holes
For example, delayed elaborators. If it resolves one, and it's not a
complete solution, we might end up with unsolved holes. Or - possibly
worse - we might end up with an error in a program that is silently
fixed rather than reported!

Fixes #223
2020-03-09 23:04:02 +00:00
Christian Rasmussen
645f0a809e Add import to fix build on macOS 2020-03-09 22:47:04 +01:00
Edwin Brady
1b5c763265 Fix for linearity/case/hole interaction
If there's a 'case' with multiple branches, some of which have holes, we
don't know what the effect on the usage should be, so leave it alone and
just update the hole types. It's get fully checked when all the holes
are resolved.
2020-03-09 21:24:23 +00:00
Edwin Brady
5bc11e4698 Add 'new1' to Control.App
Sometimes useful in App1 programs to add new state.
2020-03-09 21:23:56 +00:00
Matus Tejiscak
4dc0625237 Adapt Data.Sorted{Map,Set} from Idris 1. 2020-03-08 22:03:32 +01:00
Edwin Brady
b0d640fa55 Some tiny updates
Most importantly: Case operators should not be inlined indiscriminately,
because that might duplicate work (e.g. via a variable pattern for the
scrutinee, where the variable is used more than once)
2020-03-08 20:10:08 +00:00
Matus Tejiscak
9f793c31aa Change Lazy to Inf. 2020-03-08 20:53:39 +01:00
Matus Tejiscak
a32d1ca50f Make the applicative combinators in Text.Parser.Core lazy. 2020-03-08 20:35:08 +01:00
Matus Tejiscak
952d5c3c00 Add Text.{Lexer,Parser}.Core to the list of installed modules. 2020-03-08 20:23:27 +01:00
Edwin Brady
25843793c7 Improve linearity in Control.App
There are a few things that have linear usage but wasn't explicit in
types, so this will make some things easier to use in linear protocols.
2020-03-08 12:53:59 +00:00
Matthew Wilson
6c11d7a162
various copyedits 2020-03-07 23:18:49 -05:00
Edwin Brady
34044597c0
Merge pull request #213 from ska80/prelude/getchar-putchar
Add getChar, putChar and putCharLn to prelude
2020-03-07 14:15:22 +00:00
Edwin Brady
1bcc428147
Merge pull request #211 from ska80/repl-cwd
Add 'cwd' REPL command to show the current working directory
2020-03-07 14:14:15 +00:00
Edwin Brady
28f47963df
Merge pull request #215 from ska80/fix-bsd-sed
Make BSD 'sed' happy
2020-03-07 14:06:38 +00:00
Edwin Brady
dcaaed2060 Remove -DHAS_PTHREAD from rts
We don't use it (the performance overhead is too much) so don't require
it to be linked in.
2020-03-06 15:48:01 +00:00
Edwin Brady
2eb9a52727 Tests need to know where to find idris_net.so 2020-03-06 15:38:47 +00:00
Edwin Brady
09447e3dc6 Add our own version of fileModifiedTime
This is needed to get the time correctly on 32 bit systems (for example,
a Raspberry Pi!) otherwise it reports a negative number for the current
time...
2020-03-06 09:30:33 +00:00
Kamil Shakirov
2d1f35ab21 Fix indentation 2020-03-06 12:36:43 +06:00
Kamil Shakirov
0e01c2aa0b Make BSD 'sed' happy 2020-03-06 12:32:16 +06:00
Edwin Brady
edc3e2a4cd Need the network libs in the path for tests 2020-03-05 18:46:26 +00:00
Edwin Brady
9060b24f2f Move network test to chez test suite 2020-03-05 18:03:12 +00:00
Edwin Brady
2c2acdcfac Reorganise build system to go via generating C
This has two main advantages: firstly, it actually makes the build slightly
faster and less memory intensive, because Idris doesn't fork a new
process and eat all the memory! Secondly, it means we can build a
distribution with the C file, for building on machines which don't have
Idris 1 available.

Also includes a script for building such a distribution.

I expect someone who is better a writing Makefiles than me can tidy this
up. There are almost certainly problems on Windows too - please help if
you can!

There are new Make targets 'all-fromc' and 'install-fromc' which don't
require building from Idris source, so that we can build with no Idris 1
available.

A small consequence: make install-exec no longer builds the idris2
executable, just installs it.
2020-03-05 17:16:20 +00:00
Edwin Brady
1dd81ff10b Look under . for function name on lhs
Need this to rule out some ambiguous names. Fixes #204.
2020-03-05 11:22:48 +00:00
Edwin Brady
fc0cfcb22b
Merge pull request #210 from ska80/chez010-test-makefile
Use Makefile for tests/chez/chez010
2020-03-05 10:31:45 +00:00
Edwin Brady
2653a7f7fb
Merge pull request #209 from ska80/chez013-test-makefile
Use Makefile for tests/chez/chez013
2020-03-05 10:31:17 +00:00
Edwin Brady
67dc71f3c9
Merge pull request #208 from ska80/network-test
Simplify 'test' target in libs/network/Makefile
2020-03-05 10:30:18 +00:00
Edwin Brady
aef66099b5
Merge pull request #207 from ska80/update-gitignore
Improve .gitignore patterns
2020-03-05 10:29:11 +00:00
Edwin Brady
e52b8ef8e8
Merge pull request #206 from chrrasmussen/update-gitignore
Only ignore the executables in the root folder
2020-03-05 10:28:44 +00:00
Edwin Brady
f38dd50b3f
Merge pull request #203 from m-bd/path-lookup
Add PATH lookup to find Chez Scheme
2020-03-05 10:17:33 +00:00
Kamil Shakirov
c8c0c5fb49 Add getChar, putChar and putCharLn to prelude 2020-03-05 14:55:20 +06:00
Kamil Shakirov
dbb4505b2f Refactor 2020-03-04 20:16:07 +06:00
Kamil Shakirov
5d21f00828 Add 'cwd' REPL command to show the current working directory 2020-03-04 18:13:11 +06:00
Edwin Brady
0e98f6383f Small fixes in readline ffi tutorial 2020-03-03 23:35:19 +00:00
Edwin Brady
1616879c3e Some FFI documentation
Explaining how to write the most basic Idris bindings for readline,
taking account of how to allocate Strings in the completion callback.
Also adds the basic API as a sample, which can be used as a starting
point for other packages containing C bindings.
2020-03-03 23:23:49 +00:00
Edwin Brady
10c70711f4 Initial documentation of back ends 2020-03-03 19:33:37 +00:00
Edwin Brady
fd7a2e5435 Some reorganisation of chez generation
For an output file 'f', now generate a subdirectory in the executable
directory 'f_app', and put 'f.so' and 'f.ss' in there, along with any C
libraries we might have needed. Then generate a shell script 'f' to set
the library path to `f_app` and invoke `f.so`.

In :exec mode, f = _tmpchez, so we're using the executable directory for
the temporary files.

This means all the libraries and code needed to run the generated
program are copied to a single relocatable target directory.

This almost certainly won't work on Windows. Please help! Thanks :)
2020-03-03 18:59:55 +00:00
Edwin Brady
6023889115 Note on String in FFI docs 2020-03-03 17:39:13 +00:00
Kamil Shakirov
ac827222e8 Use Makefile for tests/chez/chez010 2020-03-03 18:11:47 +06:00
Kamil Shakirov
b14559c08c Use Makefile for tests/chez/chez013
Fixes running tests on MacOS where dlopen(3) loads shared libraries with 'dylib' extension.
2020-03-03 14:57:45 +06:00
Edwin Brady
526c5f7d3a Add missing bit of example in ffi docs 2020-03-02 15:30:50 +00:00
Edwin Brady
21a7b46ca1 More FFI doc typos 2020-03-02 14:54:27 +00:00
Edwin Brady
ea7e8c38f6 Fix ffi text 2020-03-02 14:49:28 +00:00
Edwin Brady
2893e6f9e8 Initial FFI documentation 2020-03-02 14:29:26 +00:00
Edwin Brady
63847ca69f C struct pointer support in racket back end 2020-03-02 12:23:47 +00:00
Kamil Shakirov
30830de5b7 Simplify 'test' target in libs/network/Makefile 2020-03-02 16:27:55 +06:00
Kamil Shakirov
d3820e1197 Improve .gitignore patterns 2020-03-02 14:21:43 +06:00
Edwin Brady
a5c356f998 Basic support for struct in FFI
Just in the Chez backend for now, and not allowing strings or functions
due to limitations of Chez.
2020-03-01 23:23:21 +00:00
Christian Rasmussen
1b7d8b0d4a Only ignore the executables in the root folder
The previous rule accidentally ignored all files in tests/idris2
2020-03-01 19:10:04 +01:00