Commit Graph

651 Commits

Author SHA1 Message Date
Edwin Brady
412930522e Put idris version number in package install path
Since they'll be incompatible between different Idris2 versions, this
helps protect against importing the wrong thing by mistake. Also, it
means the canonical place for the version number is now the top level
Makefile.

You'll need to delete src/YafflePaths.idr before rebuilding, since it's
now generated slightly differently.
2019-09-04 16:20:26 +01:00
Edwin Brady
65db4fbf96 Put built ttcs in build/ttc, rather than build
This is so that we can put other build artefacts (e.g. executables) in
properly organised subdirectories of build, e.g. build/bin/chez,
build/bin/js, etc.
2019-09-04 12:41:16 +01:00
Edwin Brady
68b0d64879 Add parameterised pointer type
For at least a bit of safety in foreign APIs. AnyPtr has the old Ptr
behaviour.
2019-09-04 10:25:45 +01:00
Edwin Brady
de0a097a40 First attempt at a C FFI via Racket
This aims to be consistent with the notation for the way the Chez->C FFI
loads libraries.
2019-09-03 17:02:23 +01:00
Edwin Brady
25bbaf7d74 Add dynamic library extension
In the Chez back end, if the library spec is a name and a version
number, build an appropriate guess for the library file name based on
the system extension.
2019-09-03 14:37:16 +01:00
Edwin Brady
bb246a072a Experimenting with a new FFI
Functions can be declared as %foreign with a list of calling
conventions, which a backend will work through until it finds one it can
understand. Currently implemented only in Chez backend. If this works
out, I'll implement it for Racket too, and remove the old primitive
functions.

There's a bit more boiler plate here than before, but it has the benefit
of being more extensible and portable between different back ends.

Some examples, pending proper documentation:

%foreign "C:puts,libc" "scheme:display"
putline : String -> PrimIO ()

%foreign "C:exp, libm.so.6, math.h"
fexp : Double -> Double

%foreign "C:initscr, ncurses_glue.so, ncurses.h"
prim_initscr : PrimIO ()
2019-09-02 17:10:48 +01:00
lodi
ba7e0e01d3 Fixed #!/usr/bin/env shebang for Chez backend
On NixOS, idris2 can't find scheme in the usual locations, so it
defaults to generating the following shebang:

  #!/usr/bin/env scheme --script

The `env` program interprets `scheme --script` as one monolithic
command, instead of as a command and one argument.

  /usr/bin/env: ‘scheme --script’: No such file or directory
  /usr/bin/env: use -[v]S to pass options in shebang lines

The -S flag forces `env` to split on whitespace in the intuitive
manner.
2019-08-30 14:48:54 -04:00
Arnaud Bailly
3dcd48e08b
Merge branch 'master' into configurable-ide-mode-socket 2019-08-29 16:24:17 +02:00
Arnaud Bailly
09f71182b5
expose version components in Makefile 2019-08-29 14:37:38 +02:00
Arnaud Bailly
643fc9c4c7
provide Version command in ide-mode 2019-08-29 14:37:38 +02:00
Arnaud Bailly
558776c4c4
remove version number from banner at REPL startup
otherwise all tests will need to change every time version changes...
2019-08-29 14:37:04 +02:00
Arnaud Bailly
4646bb0d1c
expose current Idris2 version as a proper type 2019-08-29 14:37:04 +02:00
Edwin Brady
f123fcaf84 Display output on network test fail
This still seems to be failing on travis, so let's see what it looks
like!
2019-08-29 12:56:13 +01:00
Edwin Brady
6a0cfa125a Update network build test
Since it's just to check that it's built successful and we can send a
message back and forth, remove the diagnostic message that might come
out in a different order depending on scheduling.
2019-08-29 11:50:14 +01:00
Edwin Brady
ea75fd21a1 Merge branch 'master' of github.com:edwinb/Idris2 2019-08-29 11:10:44 +01:00
Edwin Brady
09b13eef21
Merge pull request #89 from chrrasmussen/fix-integerToNat
Fixes #88: integerToNat hangs for negative integers
2019-08-29 11:07:50 +01:00
Edwin Brady
2005b82f6d
Merge pull request #81 from clayrat/file-leak
Fix file handle leaks
2019-08-29 11:04:35 +01:00
Edwin Brady
93de7d69b4
Merge pull request #80 from timsueberkrueb/repl-allow-empty-lines
Ignore empty lines in REPL
2019-08-29 11:01:54 +01:00
Edwin Brady
02c5aa7b61
Merge pull request #76 from ska80/ignore-build-artifacts
Ignore build artifacts
2019-08-29 11:01:06 +01:00
Edwin Brady
dba128ae69
Merge pull request #73 from chrrasmussen/add-output-flag
Add output file flag (-o) to CLI
2019-08-29 10:57:22 +01:00
Edwin Brady
0a8b50d31f
Merge pull request #72 from jfdm/make-test-output-better
Print expected and given output when test fails.
2019-08-29 10:52:30 +01:00
Edwin Brady
718f5963ce
Merge pull request #70 from jfdm/expand-ipkg-contents
Align the IPKG format more with the previous Idris implementation.
2019-08-29 10:51:41 +01:00
Edwin Brady
8975eeafb7 Make a start on reflection 2019-08-27 15:49:21 +01:00
Arnaud Bailly
3a33dc3d7d
add specialised option to listen on different host/port 2019-08-26 17:42:15 +02:00
Arnaud Bailly
43d9c575e1
Merge branch 'master' of https://github.com/edwinb/Idris2 into configurable-ide-mode-socket 2019-08-26 08:20:37 +02:00
Edwin Brady
9fb820f659 Re-evaluate type on delayed alternative elab
Fixes #92, because it wasn't re-evaluating the type and establishing
that the thing it was looking for must be a Fin for fromInteger so
resorting to the default integer literal instead.
2019-08-22 12:36:36 +02:00
Edwin Brady
fb11b89a4e Make some things public export
Anything which might appear in types should be! Fixes #93
2019-08-21 17:44:17 +02:00
Keller, Bryn
d04333a7f6 Added note to INSTALL.md to recommend Mac OS X users install Chez from source since homebrew package appears to not support threading 2019-08-20 16:24:23 -07:00
Christian Rasmussen
14db785ebe Fixes #88: integerToNat hangs for negative integers 2019-08-20 18:26:13 +02:00
Arnaud Bailly
64b0c10356
Merge branch 'master' of https://github.com/edwinb/Idris2 into configurable-ide-mode-socket 2019-08-17 12:56:38 +02:00
Edwin Brady
c01986a62e Preserve order of arguments in unification
Sometimes we swap the arguments, to reduce code duplication, but we need
to remember we've done that since (1 x : a) -> b is valid for an
argument of type (x : a) -> b, but not vice versa (that is, we have a
teensy bit of subtying to deal with, for convenience...).

This fix seems a bit ugly, but we do at least now propagate the
information. Fixes #82.
2019-08-16 11:32:16 +01:00
Andre Kuhlenschmidt
20a2cc0f31 Add a case in the repl for empty command
Changes to be committed:
	modified:   src/Idris/REPL.idr
2019-08-14 16:41:58 -04:00
Alex Gryzlov
e7aafcc14a fix file handle leaks 2019-08-13 23:53:07 +03:00
Tim Süberkrüb
ae841108ef Ignore empty lines in REPL
This ignores empty lines in the REPL and doesn't show a parse error on
CTRL+D/EOF anymore.
Add NOP variant to REPLCmd to represent an empty command.
Split command in eoi or nonEmptyCommand. nonEmptyCommand is still
guaranteed to consume input. command may be eoi in which case it does
not consume input.
Print a newline after receiving EOF on the console. Since this is only
relevant in the REPL (quiet or not) this uses putStrLn rather than
iputStrLn.
2019-08-11 20:38:12 +02:00
Kamil Shakirov
a6f9fb5e18 Ignore build artifacts 2019-08-07 09:40:30 +06:00
Edwin Brady
a87a3c14c2 Delay should always delay, not just under Inf
I don't know why I originally made it 'Inf' only in the evaluator... but
we certainly want 'Lazy' delays to block too, especially if they're
guarding non-terminating computations.
2019-08-06 14:54:27 +01:00
Edwin Brady
9bb91b5656 Allow deferring definitions to other modules
This is supported by Idris 1 and is handy for breaking cycles in
modules. To achieve this, we just need to make sure that complete
definitions aren't overwritten with empty definitions on loading.
2019-08-06 13:33:30 +01:00
Edwin Brady
010ec7a757 Add :m/:metavars command to REPL 2019-08-06 11:50:11 +01:00
Arnaud Bailly
c40eabc7e5
provide a socket-based client REPL 2019-08-06 10:46:02 +02:00
Christian Rasmussen
7c858ec5ab Add output file flag (-o) to CLI 2019-08-03 22:18:49 +02:00
Jan de Muijnck-Hughes
41cbb4eb2f Print expected and given output when test fails. 2019-08-03 20:07:11 +01:00
Arnaud Bailly
6e8b5aa2d2
output test result when diff fails 2019-08-03 14:00:44 +02:00
Arnaud Bailly
74a27f3861
make Client actually work 2019-08-03 11:36:54 +02:00
Arnaud Bailly
c6ba34c770
really remove ide mode socket test 2019-08-02 19:46:58 +02:00
Arnaud Bailly
39a5c25fbc
remove ide socket mode test because it's hard to make reliable 2019-08-02 17:59:17 +02:00
Arnaud Bailly
b682accc0b
Merge branch 'master' of https://github.com/edwinb/Idris2 2019-08-02 07:08:34 +02:00
Jan de Muijnck-Hughes
9839664d32 Align the IPKG format more with the previous Idris implementation. 2019-08-01 12:47:08 +01:00
Edwin Brady
10b975184c
Merge pull request #69 from jfdm/fix-rtd-config
Improve RTD config.
2019-08-01 11:23:02 +01:00
Edwin Brady
6edd724531 Update %cg directives documentation 2019-08-01 11:22:16 +01:00
Edwin Brady
0b692e4379 Pack/unpack should be public export
They're likely to be useful when manipulating strings in proofs.
2019-08-01 11:18:04 +01:00