1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-13 19:49:20 +03:00
Commit Graph

45 Commits

Author SHA1 Message Date
Łukasz Czajka
43d114f9b1
Adapt Juvix programs to the new pipeline (#1746)
Progress for #1742 

* Remove putStr and putStrLn
* Remove named Nats (one, two, ...)
2023-01-23 14:57:01 +01:00
Łukasz Czajka
b95abeaada
Restructure the documentation and add a tutorial (#1718)
* Closes #1597 
* Closes #1624 
* Closes #1633 

The tutorial uses syntax which has not been implemented yet: it depends
on
- #1637, 
- #1716, 
- #1639,
- #1638.

The tutorial also assumes the following issues are done: 
- #1720, and
- #1701.

Co-authored-by: Jonathan Cubides <jonathan.cubides@uib.no>
2023-01-19 13:28:21 +01:00
Jonathan Cubides
8be1fccfbd Add missing juvix.yaml to Demo 2023-01-18 11:53:27 +01:00
Łukasz Czajka
742a0e53dd
Add a new example Juvix Demo (#1736) 2023-01-17 17:45:26 +01:00
Łukasz Czajka
638cd0ebb5
Nat builtins (#1686)
* Fixes #1678.
* Adds the `clean-juvix-build` Makefile target, which removes all
`.juvix-build` directories in the project (necessary to do after
changing the standard library).
* Depends on PR #1688. The tests go through without merging this PR, but
it's a bug. The present PR requires the possibility to use the
`terminating` keyword with the `div` built-in, which possibility is
provided by PR #1688.
2023-01-05 16:39:40 +01:00
Łukasz Czajka
6908ca9440
Remove unicode cons symbol (#1687) 2023-01-03 14:37:19 +01:00
Jonathan Cubides
3fbc9c7c55
Change syntax for ind. data types and forbid the empty data type (#1684)
Closes #1644 #1635
2023-01-03 13:49:04 +01:00
Paul Cadman
e41e0200d8
Add documentation for compiling/running the TicTacToe example (#1664)
* Add documentation for compiling/running the TicTacToe example

* Fix TicTacToe example steps
2022-12-13 11:14:56 +00:00
Paul Cadman
504b5ec799
Rename builtin natural to nat and boolean to bool (#1588) 2022-10-14 18:42:03 +02:00
janmasrovira
803d2008d9
remove ≔ from the language and replace it by := (#1563)
* remove ≔ from the language and replace it by :=

* revert accidental changes in juvix input mode

* update stdlib submodule

* rename ℕ by Nat in the tests and examples

* fix shell tests
2022-09-30 10:55:32 +10:00
Łukasz Czajka
2eb51ce1c3
Make comma a delimiter (#1525) 2022-09-12 11:39:11 +02:00
janmasrovira
ccce5a4a31
Disallow tab characters as spaces (#1523) 2022-09-07 13:59:41 +02:00
Jonathan Cubides
c6a43e63b1
Small changes for the presentation (#1456) 2022-08-17 18:27:42 +02:00
Paul Cadman
6ea7da9990
Fixes TicTacToe Web example (#1454)
Now that integer literals have the builtin int type we need an actual
IOUnit value to use in the IO sequence implementation.

This commit also adds the TicTacToe web example to the test suite. It is
a typecheck / C generation only test because it uses the Wasm browser APIs.
2022-08-15 14:11:30 +02:00
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