Commit Graph

111 Commits

Author SHA1 Message Date
Zoe Stafford
0ecbd517e8
[ improvement ] VMCode (#1662) 2021-07-07 17:06:59 +01:00
Stiopa Koltsov
9c63e90fd2 Write compiler version into generated files 2021-07-06 09:35:48 +01:00
Edwin Brady
00107730ae More version number updates 2021-06-23 18:46:38 +01:00
Robert Wright
a8264f8f05 Add ability to extend RefC backend to create further backends 2021-06-18 16:59:35 +01:00
Stefan Höck
c04835c436
[ cleanup ] Reuse Tarjan's algorithm in JS backend and some other cleanups (#1504) 2021-06-17 12:43:10 +01:00
Fabián Heredia Montiel
a28bc65544
Fix deadlocks [Rebased, Squashed] (#1536)
Co-authored-by: Arnaud Bailly <arnaud.oqube@gmail.com>
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
Co-authored-by: Fabián Heredia Montiel <fabianhjr@protonmail.com>
Co-authored-by: Ruslan Feizerakhmanov <me@russoul.me>
2021-06-15 14:31:31 +01:00
Nick Drozd
4a0a5759b8
Return Maybe from strengthen (#1540)
Co-authored-by: Fabián Heredia Montiel <303897+fabianhjr@users.noreply.github.com>
2021-06-14 10:59:49 +01:00
Fabián Heredia Montiel
0df331690a [cleanup] Remove Libraries.Data.Bool.Extra 2021-06-10 08:29:49 -05:00
Fabián Heredia Montiel
da4ee92530 [ cleanup ] Remove unnecessary Libraries.Utils.Either 2021-05-29 09:30:04 +01:00
Guillaume ALLAIS
ee7956b318 [ cleanup ] move DocString to Doc.String 2021-05-21 18:23:13 +01:00
G. Allais
349308396c
[ fix #621 ] add warnings for shadowed global definition (#1407) 2021-05-14 17:35:21 +01:00
Matúš Tejiščák
4de7b2133a
[ new ] Add chez-sep codegen (#1359)
Co-authored-by: Johann Rudloff <johann@sinyax.net>
2021-05-11 08:20:19 +01:00
Ohad Kammar
e58bcfc7ef
Semantic highlighting (#1335)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-05-10 09:05:43 +01:00
Edwin Brady
ad78f8210a
Merge pull request #903 from cypheon/mkdoc
WIP: Generate documentation from source code (aka `--mkdoc` support)
2021-05-01 16:26:19 +01:00
Edwin Brady
c3e5689a62 Add case+lambda transformation
If all branches in a case block are a lambda, lift the lambda out. In
many cases, this can save creating a closure then evaluating it
immediately, because the function is already applied to the extra
argument.

This happens in particular with IO based code, where the extra argument
is the world token. One place where this transformation has a big effect
is 'evalRef' so the evaluator is now a bit faster (about 20% on the
small benchmark I tried it on - but no guarantees that's going to happen
on other examples!)
2021-04-29 13:44:13 +01:00
Johann Rudloff
8012736e83 [ fix ] Add new module to the ipkg file 2021-04-29 11:29:37 +02:00
Johann Rudloff
a012e64ef2 Add Libraries.Text.PrettyPrint.Prettyprinter.Render.HTML to idris2api's modules list 2021-04-26 22:59:23 +02:00
Ruslan Feizerakhmanov
70158b9dd1
REPL commands: load-package & fuzzy-search (#1318)
REPL commands: load-package & fuzzy-search
Move REPL-related code over to its own namespace
2021-04-25 09:13:55 +01:00
Zoe Stafford
c75b3f7f14
Add Agda-like builtins (#1253)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-04-22 13:08:32 +01:00
Tung Alissa
1bf46bc458
[ REPL ] Improving :doc (fixity, totality, colours) (#1316)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-04-21 09:39:18 +01:00
Robert Wright
735b5bef98 Split RefC CC functions into their own file 2021-04-19 16:04:41 +01:00
Giuseppe Lomurno
76697e7f85 New interval map data structure for FC search in metadata 2021-04-19 16:02:52 +01:00
G. Allais
5946442dc2
[ new ] idris2 --init (#1299) 2021-04-15 14:08:50 +01:00
G. Allais
238eb62da6
[ fix #1230 ] Better error messages for out-of-scope identifiers (#1233) 2021-03-29 10:45:48 +01:00
Stefan Höck
4c7d0db4bc
[ fix #1148 ] Support hyphenated package names (#1151) 2021-03-04 19:09:15 +00:00
Edwin Brady
1d8166b1b2 Version number constraints in 'depends' field
Now reporting an error if we can't find a package that satisfies the
constraints. The version number field can still be a string (as it used
to be) but will give a deprecation warning - and the old style version
string wasn't used anyway.

Version constraints can have an upper and/or lower bound, which can be
inclusive or not.
2021-02-27 17:58:52 +00:00
G. Allais
fcd834c423
[ fix #110 ] Check the LHS' head is not shadowed (#1121) 2021-02-25 08:51:27 +00:00
Andy Lok
404fe5fd19 lexer: add a language-composable tokenizer 2021-02-05 17:21:21 +08:00
Giuseppe Lomurno
4e2f0a58e9 Internalized contrib libraries and removed dependency 2021-01-21 14:56:53 +01:00
Stiopa Koltsov
2eb8f4149c idris2 --help now prints env variables used by the compiler
Until yesterday I did not know Idris2 accesses environment variables.
Mentioning them in `--help` would educate other users.

Not all descriptions make sense, I tried my best to guess them.

Output is: [link](https://gist.github.com/stepancheg/7d1dff344a0dd35b9d07fb4a417ecb32).
2021-01-18 10:40:47 +00:00
Guillaume ALLAIS
5de647cc3f [ refactor ] use difference list for efficient append 2020-12-08 13:07:53 +00:00
Edwin Brady
a76a1322eb Initial merge of reference counting C back end
Written by Volkmar Frinken (@vfrinken). This is intended as a
lightweight (i.e. minimal dependencies) code generator that can be
ported to multiple platforms, especially those with memory constraints.

It shouldn't be expected to be anywhere near as fast as the Scheme back
end, for lots of reasons. The main goal is portability.
2020-10-11 15:05:00 +01:00
Ruslan Feizerahmanov
1d99a28176
Add Bifunctor interface (#701) 2020-09-30 10:51:07 +01:00
G. Allais
3df1f9c476
[ fix #63 ] interleaving let binders and local declarations (#691) 2020-09-28 13:15:22 +01:00
Guillaume ALLAIS
364ff73a1f [ refactor ] split up Core.Context
`Core.Context` is 2k+ LoC and contains a *lot* of different thins.
Rather than moving the `log` functions above of `addData` to be able
to add logging there, fork them off to independent files to make the
whole thing more readable.
2020-09-16 15:45:16 +01:00
G. Allais
937aa8fc43
[ refactor ] introducing Namespace (#638)
Until now namespaces were stored as (reversed) lists of strings.
It led to:

* confusing code where we work on the underlying representation of
  namespaces rather than say what we mean (using `isSuffixOf` to mean
  `isParentOf`)

* potentially introducing errors by not respecting the invariant cf.
  bug report #616 (but also name generation in the scheme backend
  although that did not lead to bugs as it was self-consistent AFAICT)

* ad-hoc code to circumvent overlapping interface implementation when
  showing / pretty-printing namespaces

This PR introduces a `Namespace` newtype containing a list of strings.
Nested namespaces are still stored in reverse order but the exposed
interface aims to support programming by saying what we mean
(`isParentOf`, `isApproximationOf`, `X <.> Y` computes to `X.Y`, etc.)
irrespective of the underlying representation.
2020-09-05 09:41:31 +01:00
Guillaume ALLAIS
529944267b Revert "[ refactor ] Introducing Namespace and ModuleIdent (#631)"
This reverts commit 481dc431e7.
2020-09-04 09:16:06 +01:00
G. Allais
481dc431e7
[ refactor ] Introducing Namespace and ModuleIdent (#631)
Until now namespaces were stored as (reversed) lists of strings.
It led to:

* confusing code where we work on the representation rather than say
  what we mean (e.g. using `isSuffixOf` to mean `isParentOf`)

* potentially introducing errors by not respecting the invariant cf.
  bug report #616 (but also name generation in the scheme backend
  although that did not lead to bugs as it was self-consistent AFAICT)

* ad-hoc code to circumvent overlapping interface implementations when
  showing / pretty-printing namespaces

This introduces a Namespace newtype containing non-empty lists of
strings. Nested namespaces are still stored in reverse order but the
exposed interface aims to support programming by saying what we mean
(`isParentOf`, `isApproximationOf`, `X <.> Y` computes to `X.Y`, etc.)
irrespective of the underlying representation.
2020-09-02 20:05:33 +01:00
G. Allais
da78ac4783
[ new ] topics for logging levels (#569) 2020-08-20 18:45:34 +01:00
Niklas Larsson
24d4ccf007 Add missing Text.Bounded to ipkg 2020-08-19 01:21:32 +02:00
Giuseppe Lomurno
42404c2d9d Automatic console width detection 2020-08-18 19:25:36 +01:00
Giuseppe Lomurno
df4f990b3c PTerm and error intial prettyprinting 2020-08-18 19:25:36 +01:00
Niklas Larsson
a5b101dc3c Update ipkg files 2020-07-10 11:03:21 +02:00
Edwin Brady
ff46a8db14 Initial implementation of :doc
It's not pretty, but at least it exists now
2020-07-08 15:52:57 +01:00
Niklas Larsson
5221954aca Prepare for additional codegens
The idea is to make everything accessible via the API, so
codegen implementors will be able to reuse all infrastructure by calling
the appropriate function in Idris.Driver supplying their codegen.
2020-06-15 16:11:05 +02:00
Edwin Brady
d6e3f1f746
Merge pull request #100 from ska80/use-contrib
Use Control.Delayed from the 'contrib' package
2020-06-08 12:07:09 +01:00
Edwin Brady
3d2765e930 Add top level %runElab
This invokes a script of type Elab (). %runElan in a term invokes a
script of type Elab TT. The elaborator now pushes in that type, so that
it'll report an appropriate error if you give it a script of the wrong
type.
2020-06-01 19:06:10 +01:00
Edwin Brady
e1dbcad2fc Make a start on reflection
Don't get too excited yet - I want this in so that it doesn't get too
out of sync, but I still have to think about exactly how it's going to
work in practice.
2020-05-29 22:40:29 +01:00
Kamil Shakirov
d43850d86e Merge branch 'master' into use-contrib 2020-05-29 15:05:18 +06:00
Niklas Larsson
696db7f58f
Merge pull request #169 from andylokandy/pathcom
Use Path in the compiler
2020-05-27 21:23:29 +02:00
andylokandy
fa902932fc Use Path in compiler 2020-05-26 17:43:27 +08:00
Kamil Shakirov
d5743911fe Sync idris2api.ipkg with idris2.ipkg 2020-05-26 12:24:42 +06:00
Kamil Shakirov
a3d57cd4fc Merge branch 'master' into use-contrib 2020-05-25 13:01:15 +06:00
Fabián Heredia Montiel
731a416043 Split Package Specific Lexer/Rules from Lexer/{Common,Source} and Refactor Idris/Package
Co-authored-by: Matus Tejiscak <ziman@functor.sk>
2020-05-24 16:01:17 -05:00
Kamil Shakirov
6cd6594510 Use Control.Delayed from the 'contrib' package 2020-05-22 01:27:50 +06:00
Fabián Heredia Montiel
af85cbefa7 Extract Common Lexer Utilities 2020-05-21 12:52:26 -05:00
Fabián Heredia Montiel
5265c70c71 Extract Common Lexer Rules 2020-05-21 12:52:26 -05:00
Fabián Heredia Montiel
acaddc1e9d Rename module Parser.Rule to Parser.Rule.Source 2020-05-21 12:52:26 -05:00
Fabián Heredia Montiel
662782503f Rename module Parser.Lexer to Parser.Lexer.Source 2020-05-21 12:52:26 -05:00
Fabián Heredia Montiel
6a5d6647c1 Split Parser.Support 2020-05-20 15:00:42 -05:00
Edwin Brady
0cd484fa09 Add idris2api.ipkg
This is a small variation that installs all the modules as a library,
which could be used by external tools, eg fancy REPLs, code generators,
etcs.
2020-05-20 16:38:46 +01:00