1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-14 17:32:00 +03:00
Commit Graph

79 Commits

Author SHA1 Message Date
Jonathan Cubides
6be62a0d72 v0.2.2 2022-07-25 18:54:48 +02:00
Łukasz Czajka
4c5fee3e95
Compute name dependency graph and filter unreachable definitions (#1408)
* Compute name dependency graph and filter unreachable declarations

* bugfix: recurse into type signatures

* positive tests

* make ormolu happy

* get starting nodes from ExportInfo

* make ormolu happy

* cosmetic refactoring of DependencyInfo

* fix tests & style
2022-07-25 18:38:44 +02:00
Jonathan Cubides
fc6a0bb001
Fix Changelog links and minors (#1371)
* Fix Changelog links and minors

* Use https for homepage link
2022-07-14 11:41:58 +02:00
Jonathan Cubides
3b3ea45da9
Rename MiniJuvix to Juvix (#259)
* Renaming MiniJuvix to Juvix

* Make Ormolu happy

* Make Hlint happy

* Remove redundant imports

* Fix shell tests and add target ci to our Makefile

* Make pre-commit happy
2022-07-08 13:59:45 +02:00
janmasrovira
57edf1077b
Unify MicroJuvix ASTs representation of types and expressions (#188)
* improve and add Universe to MicroJuvix expressions

* continue with the refactor

* refactor typechecker and aritychecker

* refactor Abstract to Micro

* format

* refactor type calls builder and monojuvix translation

* complete abstract translation

* traversals have betrayed me

* fix monomorphisation and traversals

* update tests

* format

* rename Function2

* remove obsolete comments

* fix comment
2022-07-04 18:15:35 +02:00
Jonathan Cubides
72b4c267a3
v0.2.0 (#198)
* Update package.yaml v0.2

* Update Changelog

* Update CLI version shellcheck to 0.2.0

Co-authored-by: Paul Cadman <git@paulcadman.dev>
2022-06-28 16:31:02 +02:00
Jonathan Cubides
a749575734
Add minijuvix version info and date to HTML output (#186)
* Add minijuvix version info and date to HTML output

* Fix pre-commit
2022-06-21 17:03:22 +02:00
Paul Cadman
69a7bf4b95
Update validity predicate milestone example to 0.2 syntax (#167)
* Update VP example to new syntax

* Ignore html folders and include assets for html rendering

Co-authored-by: Jonathan Cubides <jonathan.cubides@uib.no>
2022-06-15 13:04:14 +02:00
Jonathan Cubides
29c526833d
Revision for package.yaml and minor deletions (#135) 2022-06-01 11:53:06 +02:00
Jonathan Cubides
a4eb2124b2
Generic Errors and refactoring (#123)
* w.i.p adoption of generic error type

* harmonize

* Remove the use of Error effect for internal bugs

* add location information to expression atom list

* Add GenericError instance for PatternAtoms

* Remove Maybe GenericError occurrences

* [ci] fix draft job's condition

* minor changes

* [stack] macos support ghc-opts

* Fix reviewer's comments

* remove accidentally commited file

* refactor to avoid duplication

* fix

Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
2022-05-26 17:52:08 +02:00
Paul Cadman
cfc11fecc5
Add minic-runtime for linking without libc (#113)
* [minic] Add minic-runtime for linking without libc

The C generated by minic now depends on `minic-runtime.h`. There are two
versions of this, one that depends on libc and one that doesn't (i.e standalone).

The standalone runtime implements the minimal set of functions required for
the tests to compile and run.

The standalone runtime also contains a copy of
https://github.com/wingo/walloc, a small memory allocator that's
indended for use with WASM.

The benefit of using the standalone runtime is that the resulting
binaries are much smaller. For example the Nat example compiles to about
24k WASM binary with libc, the standalone version is 2.8k.

This commit adds a dependency on
https://hackage.haskell.org/package/file-embed for finding the path to
the minic-runtime directory in tests. It does not add any additional
transitive dependencies to the project.
2022-05-19 09:48:23 +02:00
janmasrovira
a24e0379d3
87 refactor warning related stuff (#91)
* remove all field selectors

* add local type signatures

* delete Wno-monomorphism-restriction and fix warnings

* [tests] inline two error messages

* remove Wno-missing-exported-signatures

* remove Wno-all-missed-specialisations

* remove Wno-missed-specialisations
2022-05-06 11:48:07 +02:00
Jonathan Prieto-Cubides
cb8e0fb911 v0.1.3 Update CHANGELOG 2022-05-05 18:37:06 +02:00
Jonathan Cubides
3004d1a404
Stricter stack builds and pedantic mode for CI (#78)
* Make CI even more pedantic

* remove aeson dependency

Co-authored-by: Paul Cadman <pcadman@gmail.com>
Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
2022-05-05 15:21:04 +01:00
Paul Cadman
60236e7b58
Add C code generation backend (#68)
* [cbackend] Adds an AST for C

This should cover enough C to implement the microjuvix backend.

* [cbackend] Add C serializer using language-c library

We may decide to write our own serializer for the C AST but this
demonstrates that the C AST is sufficient at least.

* [cbackend] Declarations will always be typed

* [cbackend] Add CPP support to AST

* [cbackend] Rename some names for clarity

* [cbackend] Add translation of InductiveDef to C

* [cbackend] Add CLI for C backend

* [cbackend] Add stdbool.h to file header

* [cbackend] Allow Cpp and Verbatim code inline

* [cbackend] Add a newline after printing C

* [cbackend] Support foreign blocks

* [cbackend] Add support for axioms

* [cbackend] Remove code examples

* [cbackend] wip FunctionDef including Expressions

* [parser] Support esacping '}' inside a foreign block

* [cbackend] Add support for patterns in functions

* [cbackend] Add foreign C support to HelloWorld.mjuvix

* hlint fixes

* More hlint fixes not picked up by pre-commit

* [cbackend] Remove CompileStatement from MonoJuvix

* [cbackend] Add support for compile blocks

* [cbackend] Move compileInfo extraction to MonoJuvixResult

* [minihaskell] Fix compile block support

* [chore] Remove ununsed isBackendSupported function

* [chore] Remove unused imports

* [cbackend] Use a Reader for pattern bindings

* [cbackend] Fix compiler warnings

* [cbackend] Add support for nested patterns

* [cbackend] Use functions to instantiate argument names

* [cbackend] Add non-exhaustive pattern error message

* [cbackend] Adds test for c to WASM compile and execution

* [cbackend] Add links to test dependencies in quickstart

* [cbackend] Add test with inductive types and patterns

* [cbackend] Fix indentation

* [cbackend] Remove ExpressionTyped case

https://github.com/heliaxdev/minijuvix/issues/79

* [lexer] Fix lexing of \ inside a foreign block

* [cbackend] PR review fixes

* [chore] Remove unused import

* [cbackend] Rename CJuvix to MiniC

* [cbackend] Rename MonoJuvixToC to MonoJuvixToMiniC

* [cbackend] Add test for polymorphic function

* [cbackend] Add module for string literals
2022-05-05 14:12:17 +01:00
janmasrovira
3acade4072
Monomorphization (#70)
* add TypeCallsBuilder and others

* implement propagation of type calls

* improve type propagation

* polymorphize fungible token

* sort type calls map pretty output

* use HashSet in TypeCallsMap

* renaming

* rename module

* improve indexing in type propagation

* draft monomorphization generation algorithm

* fix draft

* wip mono code generation

* wip code generation

* finish first candidate for code generation

* add monojuvix command

* fix MonoJuvix pretty printer to properly display name ids

* [monojuvix] improve clause pretty printing

* add support for function types in expressions

* properly translate function expressions

* ormolu

* add a basic positive test for monomorphization

* cleanup effect constraints

* collect type applications in axiom types

* apply some style improvements

* fix PolySimpleFungibleToken and add it to the test suite

* ignore polymorphic inductive definitions that are never used
2022-05-04 10:50:03 +02:00
janmasrovira
7392e8cc20
check if stderr supports ANSI and print accordingly (#67) 2022-04-29 12:18:09 +02:00
janmasrovira
ba47f11189
Implement type checker with polymorphism (#62) 2022-04-22 10:06:34 +02:00
Paul Cadman
2b283a2b8b [minihaskell] Output ANSI codes only if handle supports it
This adds `ansi-terminal` dependency to the Main target but this is
already a transitive dependency of `prettyprinter-ansi-terminal`.

We want to add this support globally which we will do in https://github.com/heliaxdev/minijuvix/issues/38.
2022-04-08 12:23:20 +01:00
Jonathan Prieto-Cubides
86162090ce merging conflicts 2022-04-07 12:13:03 +02:00
Jonathan Prieto-Cubides
4d918cd1fd [ CI ] New jobs: ormolu and hlint 2022-04-05 19:57:21 +02:00
Jan Mas Rovira
22b5de42f3 setup InfoTable for parser 2022-04-05 00:46:04 +02:00
Jan Mas Rovira
db8f8a98c9 fix package.yaml 2022-03-28 09:40:51 +02:00
Jonathan Prieto-Cubides
1e52e663ca Fixed merge conflicts 2022-03-25 18:30:37 +01:00
Jonathan Prieto-Cubides
4497c8bfe1 [ package.yaml ] update version 2022-03-25 18:26:22 +01:00
Jonathan Cubides
de6fabf625
v0.1.1 (#15)
* add references to the syntax and cleanup code

* [make] add .PHONY to Makefile targets

* [parser] add parser / pretty for axiom backends

* Pairing progress

* [scoper] Add support for Axiom backends

* [parser] Fix foreign block parsing

* [ app ] adds --no-colors flag for the scope command

* [ghc] upgrade to ghc 9.2.2

* use GHC2021

* [doc] Remove out-of-date comment

* [test] Add ambiguity tests

* [scoper] Improve resolution of local symbols

* [error] WIP improving ambiguity error messages

* [ clean-up ] new lab folder for experimentation

* [ app ] ixes the lint warning

* [ Termination ] removes Alga dependency

* [error] Add message for ambiguous symbol error

* [error] Add ambiguous module message

* [scoper] Remove ErrGeneric

* [test] Add test to suite

* [test] show diff when ast's are different

* [ lab ] folder organization

* [ Makefile ] add targets with --watch option (stack cmds) and remove unused things

* [ app ] add --version flag and fixed warnings and formatting

* [test] remove fromRightIO to fix ambiguity error

* [test] Add test of shadowing public open

* [scoper] Add visibility annotation for Name

* prepare buildIntoTable

* [ Concrete ] add instance of hashable for refs.

* add InfoTableBuilder effect

* [ scoper ] add InfoTableBuilder effect

* [ CHANGELOG ] updated v0.1.1

* [ README ] org version now

Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
Co-authored-by: Paul Cadman <git@paulcadman.dev>
2022-03-25 18:16:34 +01:00
Jonathan Prieto-Cubides
17a0577ee7 [ app ] add --version flag and fixed warnings and formatting 2022-03-25 00:52:30 +01:00
Jan Mas Rovira
eedf468261 [test] show diff when ast's are different 2022-03-24 17:04:22 +01:00
Jonathan Prieto-Cubides
e6bb422cea [ Termination ] removes Alga dependency 2022-03-24 13:25:50 +01:00
Jonathan Prieto-Cubides
02de05830f [ clean-up ] new lab folder for experimentation 2022-03-24 13:25:50 +01:00
Jan Mas Rovira
b3fe3de215 use GHC2021 2022-03-24 10:14:29 +01:00
Jan Mas Rovira
9cfbf6adac [ghc] upgrade to ghc 9.2.2 2022-03-23 23:25:55 +01:00
Jan Mas Rovira
1a23adc762 add references to the syntax and cleanup code 2022-03-23 11:40:03 +01:00
Jan Mas Rovira
fa95f8be82 separate MiniHaskell into MicroJuvix and 'new' MiniHaskell 2022-03-17 18:18:10 +01:00
Jan Mas Rovira
df5f6d2df0 [scoper] check that top modules are defined in the correct path 2022-03-16 13:58:07 +01:00
Jan Mas Rovira
4517dbf7c7 [extensions] add TemplateHaskell and DeriveGeneric 2022-03-09 14:33:36 +01:00
Jan Mas Rovira
14573c0927 Merge remote-tracking branch 'origin/qtt' into jan 2022-03-05 14:08:30 +01:00
Jan Mas Rovira
21261046ac [deps] add algebraic-graphs dependency 2022-02-28 18:29:14 +01:00
Jan Mas Rovira
7a421aa9e0 drop TupleSections language extension 2022-02-21 19:21:03 +01:00
Jan Mas Rovira
3b9b4ab43a [scoper] improve efficiency of infix parsing. Drop uniplate dependency 2022-02-18 11:14:17 +01:00
Jan Mas Rovira
4651906e32 [scoper] use atoms information instead of scope to parse infix operators 2022-02-18 01:53:10 +01:00
Jan Mas Rovira
4ffc7f368d [wip] incorporate singletons-th 2022-02-16 20:15:14 +01:00
Jan Mas Rovira
d91e35ab0f [deps] add tasty dependency to lib to avoid rebuilding when testing 2022-02-16 10:03:49 +01:00
Jan Mas Rovira
96930352aa [tests] setup basic testing 2022-02-15 14:12:53 +01:00
Jan Mas Rovira
0856327658 [errors] add not in scope error 2022-02-14 13:39:54 +01:00
Jan Mas Rovira
5929172e1e [package] remove unused 'word8' dependency 2022-02-13 12:30:20 +01:00
Jan Mas Rovira
edd47ad00b [pretty] implement pretty printer for parsed AST 2022-02-12 17:35:23 +01:00
Jan Mas Rovira
6da7dd8b30 add unified minijuvix errors 2022-02-12 12:29:25 +01:00
Jan Mas Rovira
1919c32417 [html] improve html pretty printing 2022-02-05 13:27:33 +01:00
Jan Mas Rovira
b48f00556a [pretty] add simple html output with links 2022-02-04 23:14:06 +01:00