1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-13 11:16:48 +03:00
Commit Graph

81 Commits

Author SHA1 Message Date
janmasrovira
8e1a4dc8b6
Give a proper type to literal natural numbers (#1453) 2022-08-12 17:31:15 +02:00
Paul Cadman
1ba72b4d9b
Add Towers of Hanoi and Pascal triangle examples (#1446)
* Add new examples of Juvix programs

* Build documentation for Hanoi and Pascal examples
2022-08-10 12:02:14 +01:00
janmasrovira
5c754846aa
Add initial support for examples in Html documentation (#1442)
* support examples in judoc

* fix line jumps

* make --open depend on the os
2022-08-09 19:09:47 +02:00
Jonathan Cubides
9543b06cf5 Add HelloWorld example and minor other fixes README 2022-08-08 12:13:27 +02:00
Paul Cadman
41af0f5394
Various documentation adjustments (#1434) 2022-08-04 12:50:30 +02:00
Paul Cadman
512211da8e
Setup Clang before building docs in CI (#1433)
* Setup Clang before building docs in CI

* Debug CI

* Debug CI

* Debug CI

* Debug CI

* Fix JS name

* Fix copying of webapp resources to output folder
2022-08-04 09:19:03 +01:00
Paul Cadman
98776997db
Add a Web version of TicTacToe (#1427)
* Add a Web version of TicTacToe

The web version demonstrates injecting host functions into the WASM
import table and call exported Juvix functions from JS.

The web version and the CLI version of the TicTacToe game use the same
game logic backend Juvix module.

* Build and publish web apps in documentation

* Add a link to the TicTacToe web app in example documentation

* Update Makefile to match the new format
2022-08-03 16:14:38 +02:00
janmasrovira
a47ade818a
add name and version to juvix.yaml (#1422)
* add name and version to package.yaml

* allow empty juvix.yaml file
2022-07-29 13:35:48 +02:00
janmasrovira
2532b34041
Implement an html documentation generator similar to haddock (#1413) (#1416) 2022-07-28 17:19:07 +02:00
Paul Cadman
6a45484e24
Remove Int from stdlib and update SimpleFungibleToken example (#1414)
* Update SimpleFungibleToken to use stdlib

We do not want to put an Int type into the standard library before we
have builtin support for arbitrary precision integers. So we include the
Int type locally in the project for now.

* Update reference to stdlib

* Fix shell-tests for SimpleFungibleToken
2022-07-27 10:24:25 +02:00
Paul Cadman
894dea4c6b
Adds Collatz sequence generator example (#1384) 2022-07-15 11:17:22 +01:00
Paul Cadman
cff01943f4
Add fibonacci sequence example program (#1375) 2022-07-14 17:03:44 +01: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
Paul Cadman
84732b281f
Updates tests to use the updated standard library (#253)
* Updates tests to use the updated stdlib

* Update to minijuvix-stdlib main
2022-07-07 15:35:56 +02:00
Paul Cadman
40287efabb
Support partial application and closure passing in C backend (#190)
* Add support for parital application eval/apply

* include string.h in libc runtime

* Add wasm SimpleFungibleTokenImplicit to tests

* Update VP example to new syntax

* propagate types from all reachable modules

* Change prelude import ordering to workaround minic issue

* Pre-declare inductive typedefs in C backend

This generates the typedefs corresponding to each inductive type.

e.g

```
inductive Bool { .. }
```

is translated to:

```
typedef struct Bool_3_s Bool_3_t;
```

This means that C code can reference these typedefs before they have
been fully defined. (all references to inductive types go through these typedefs
names).

This fixes an issue with the ordering of delcarations when modules are included.

* Use common Lib for MiniC tests

* libc runtime: flush stdout after writing to it

* Adds MiniTicTacToe example using common example lib

In MonoJuvixToMiniC we emit the inductive type typedefs before anything
else to support includes ordering

* Adds tests for mutually recrusive functions

* Add golden tests for milestone examples

* Example: Remove commented out code

* Test error handling behaviour in MiniTicTacToe

* Fail clang compilation on warnings

* Add test for Nested list types

* Add PrettyCode instances for NonEmpty and ConcreteType

* Ignore IsImplicit field in Eq and Hashable of TypeApplication

This is to workaround a crash in Micro->Mono translation when looking up
a concrete type

* Fix formatting

* hlint fixes

* Formatting fixes not reported by local pre-commit

* Refactor MonoJuvixToMiniC

* Fix shelltest

NB: We cannot check the order of the 'Writing' lines because this
depends on the order of files returned by the FS which is
non-deterministic between systems

* Refactor Base to CBuilder

* Refactor using applyOnFunStatement

Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
2022-06-28 10:25:43 +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
f9d9b10fc9
New target syntax and modular VP examples (#92)
* New target syntax and modular VP examples

* [ .gitignore ] updated

* Fix spaces new lines

* Remove outdated lab folder
2022-05-06 12:45:09 +02:00
Jonathan Prieto-Cubides
02de05830f [ clean-up ] new lab folder for experimentation 2022-03-24 13:25:50 +01:00
Jan Mas Rovira
c369eb6fa0 [stdlib] add MiniJuvix standard library as a submodule 2022-02-03 18:06:59 +01:00
Jan Mas Rovira
d6fd0ae4e0 [examples] add MiniJuvix Prelude as an example 2022-02-03 12:41:51 +01:00
Jonathan Prieto-Cubides
f2278c8947 [ examples ] added some test for modules 2022-01-23 22:03:11 -05:00
Jan Mas Rovira
82e23bb78c [example, test] fix syntax of example and add it to the test suite 2022-01-11 10:14:42 +01:00
Jonathan Prieto-Cubides
500783272a [ examples ] updated syntax examples conforming the implementation 2021-12-30 10:44:25 -05:00
Jonathan Prieto-Cubides
2322f24339 [ examples ] fixed some types 2021-12-28 12:37:06 -05:00
Jonathan Prieto-Cubides
e293deff03 [ examples/FirstMilestone ] added revisions 2021-12-28 12:26:19 -05:00
Jan Mas Rovira
8840f03155 Merge branch 'jan' into qtt 2021-12-28 10:42:11 +01:00
Jan Mas Rovira
40381f891f add FirstMilestone example and adapt concrete AST 2021-12-28 10:36:41 +01:00
Jonathan Prieto-Cubides
c6d012bd69 [ examples/ ] small revisions 2021-12-26 17:12:39 -05:00
Jonathan Prieto-Cubides
a6c2258ea8 [ examples ] Added examples based on juvix examples 2021-12-26 11:26:39 -05:00
Jonathan Prieto-Cubides
101b075a58 Added example of syntax, first revision 2021-12-25 09:43:24 -05:00
Jan Mas Rovira
cf82ce8a44 add syntax example (without usages). Adapt Language.hs 2021-12-24 18:58:20 +01:00