Skip to content

Commit

Permalink
Add many enhancements and new layout on the landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaprieto committed Sep 16, 2023
1 parent 360df81 commit f1f6259
Show file tree
Hide file tree
Showing 10 changed files with 196 additions and 53 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ docs: pre-build
@mkdocs build -v --config-file ${MKDOCSCONFIG}

.PHONY: serve
serve: docs
serve:
@mkdocs serve --dev-addr localhost:${PORT} --config-file ${MKDOCSCONFIG}

# In case you want to serve the docs using Python's built-in server.
Expand Down
49 changes: 25 additions & 24 deletions docs/blog/.authors.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
chris:
name: Christopher Goes
description: Heliax
avatar: https://github.com/cwgoes.png
authors:
jonathan:
name: Jonathan Cubides
description: Heliax
avatar: https://github.com/jonaprieto.png

jonathan:
name: Jonathan Cubides
description: Heliax
avatar: https://github.com/jonaprieto.png
jan:
name: Jan Mas Rovira
description: Heliax
avatar: https://github.com/janmasrovira.png

jan:
name: Jan Mas Rovira
description: Heliax
avatar: https://github.com/janmasrovira.png
paul:
name: Paul Cadman
description: Heliax
avatar: https://github.com/paulcadman.png

paul:
name: Paul Cadman
description: Heliax
avatar: https://github.com/paulcadman.png
lukasz:
name: Łukasz Czajka
description: Heliax
avatar: https://github.com/lukaszcz.png

lukasz:
name: Łukasz Czajka
description: Heliax
avatar: https://github.com/lukaszcz.png
artem:
name: Artem Gureev
description: Heliax
avatar: https://github.com/vrom911.png

veronika:
name: Veronika Romashkina
description: Heliax
avatar: https://github.com/vrom911.png
veronika:
name: Veronika Romashkina
description: Heliax
avatar: https://github.com/vrom911.png
23 changes: 23 additions & 0 deletions docs/index.juvix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module index;

import Stdlib.Prelude open;
import Stdlib.Data.Nat.Ord open;

--8<-- [start:exponentiation]
module FastExponentiation;

{-# unroll: 30 #-}
terminating
power' (acc a b : Nat) : Nat :=
let
acc' : Nat := if (mod b 2 == 0) acc (acc * a);
in if (b == 0) acc (power' acc' (a * a) (div b 2));

power : Nat → Nat → Nat := power' 1;

end;
--8<-- [end:exponentiation]

--8<-- [start:intent]
-- ss
--8<-- [end:intent]
101 changes: 95 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,107 @@ hide:

# Welcome to the Juvix documentation!

<div style="text-align:center">
<img src="assets/images/tara-smiling.svg" width="250" />
</div>
<div class="grid cards" markdown>

Juvix is an open-source, ever-evolving functional language for creating
privacy-focused decentralized apps. It allows developers to write high-level
programs that compile to WASM or, via [VampIR][vampir], to circuits for private
execution using [Taiga][taiga] on [Anoma][anoma] or Ethereum.
</div>


<div class="grid cards" markdown>

<div markdown>

## :material-content-duplicate: Intents in Juvix for Anoma

An intent is a high-level description of a transaction the user wants to
perform. It is a program that describes the conditions under which a transaction
is valid. For example, Alice wants to exchange 2 B or 1 A for 1 Dolphin.

Read more on Anoma's intents [here](https://anoma.net/blog/intents-arent-real).

<div style="text-align:center" markdown>

<div style="text-align:center">
<img src="assets/images/tara-smiling.svg" width="250" />
</div>


[Try Juvix now on Codespaces](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=102404734&machine=standardLinux32gb&location=WestEurope){ .md-button .md-button--primary }

</div>


</div>

<div style="padding: 1rem 0 0 0" markdown>


:octicons-mark-github-16: [`anoma/juvix-workshop`](https://github.com/anoma/taiga-simulator)

```juvix
...
-- Alice is willing to exchange either 2 B or 1 A for 1 Dolphin.
module Apps.TwoPartyExchange;
--- Definitions related to Alice's intent
module AliceIntent;
logicFunction : LogicFunction
| kind tx :=
let
{- check if the resource associated to
this logic function is among the created (output) resources.
Then check if alice's intent is satisfied. -}
createdRs : List Resource := createdResources tx;
createdHashes : List LogicHash :=
map logicHash createdRs;
in isCreated kind
|| quantityOfDenom Dolphin.denomination createdRs == 1
&& quantityOfDenom A.denomination createdRs == 1
|| quantityOfDenom Dolphin.denomination createdRs == 1
&& quantityOfDenom B.denomination createdRs == 2;
...
```

</div>

</div>


## :material-graph-outline: Juvix Compilation to Arithmetic Circuits

<div class="grid cards" markdown>

<div markdown>

A significant feature of Juvix includes compiling programs into arithmetic circuits for confidential execution, achieved via the in-house [VampIR][vampir] compiler. Arithmetic circuits model the computation of Juvix programs by representing polynomial computations. These circuits can be executed privately using [Taiga][taiga]. Essentially, arithmetic circuits are systematic polynomial equations expressed in a universal, canonical form.

See more [Compiling Juvix programs to arithmetic circuits via Vamp-IR](./blog/posts/vampir-circuits.md).

</div>

<div markdown>

```juvix
module FastExponentiation;
{-# unroll: 30 #-}
terminating
power' (acc a b : Nat) : Nat :=
let acc' : Nat := if (mod b 2 == 0) acc (acc * a);
in if (b == 0) acc (power' acc' (a * a) (div b 2));
power : Nat → Nat → Nat := power' 1;
end;
```

</div>

</div>


This documentation covers various topics, including a concise introduction to
the Juvix ecosystem, which can be found in the [overview
section](./about/overview.md).
## :material-firework: Juvix is growing fast!

<div class="grid cards" markdown>

Expand Down
55 changes: 38 additions & 17 deletions docs/juvix-packages.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,61 @@
---
title: Juvix Packages and Projects
hide:
- navigation
- toc
---

## Juvix Packages
<div class="grid cards" markdown>

### [`anoma/juvix-containers`](https://github.com/anoma/juvix-containers)
- :octicons-mark-github-16: [`anoma/juvix-containers`](https://github.com/anoma/juvix-containers)

Immutable container types for Juvix.
***

- [x] BinaryTree, Map, Queue, Set, Tree, UnbalancedSet, and much more to come.
- [x] Tests using [anoma/juvix-test](#anomajuvix-test).
Immutable container types for Juvix.

### [`anoma/juvix-quickcheck`](https://github.com/anoma/juvix-quickcheck)
- [x] BinaryTree, Map, Queue, Set, Tree, UnbalancedSet, and much more to come.
- [x] Tests using [anoma/juvix-test](#anomajuvix-test).

This package provides property-based testing for the Juvix programming language inspired by the popular Haskell library, QuickCheck.
- :octicons-mark-github-16: [`anoma/juvix-quickcheck`](https://github.com/anoma/juvix-quickcheck)

- [x] Automated testing: Generate random test cases to validate properties of Juvix code.
***

### [`anoma/juvix-stdlib`](https://github.com/anoma/juvix-stdlib)
This package provides property-based testing for the Juvix programming language inspired by the popular Haskell library, QuickCheck.

Shipped with Juvix, the standard library provides a set of useful functions
and types for writing Juvix programs.
- [x] Automated testing: Generate random test cases to validate properties of Juvix code.

### [`anoma/juvix-test`](https://github.com/anoma/juvix-test)
- :octicons-mark-github-16: [`anoma/juvix-stdlib`](https://github.com/anoma/juvix-stdlib)

A unit testing framework for Juvix programs.
***

Shipped with Juvix, the standard library provides a set of useful functions
and types for writing Juvix programs.

- :octicons-mark-github-16: [`anoma/juvix-test`](https://github.com/anoma/juvix-test)

***

A unit testing framework for Juvix programs.

</div>

## Projects using Juvix

### [`anoma/taiga-simulator`](https://github.com/anoma/taiga-simulator)
<div class="grid cards" markdown>

- :octicons-mark-github-16: [`anoma/taiga-simulator`](https://github.com/anoma/taiga-simulator)

***

The Taiga Simulator is a [Juvix](https://juvix.org) function that simulates the [Taiga](https://github.com/anoma/taiga) execution model.

- :octicons-mark-github-16: [`anoma/juvix-e2e-demo`](https://github.com/anoma/juvix-e2e-demo)

A simulator for [Taiga execution model](https://github.com/anoma/taiga) written in Juvix.
***

### [`anoma/juvix-e2e-demo`](https://github.com/anoma/juvix-e2e-demo)
A project for demostrating the process of generating arithmetic circuits from high-level specifications. This CodeSpace includes all the necessary compilers for circuit generation, such as Juvix, GEB, and VampIR. Furthermore, it features the Juvix VSCode extension to simplify writing Juvix programs and allows users to interact with and evaluate the resulting GEB/VampIR programs.

A project for demostrating the process of generating arithmetic circuits from high-level specifications. This CodeSpace includes all the necessary compilers for circuit generation, such as Juvix, GEB, and VampIR. Furthermore, it features the Juvix VSCode extension to simplify writing Juvix programs and allows users to interact with and evaluate the resulting GEB/VampIR programs.
</div>

!!! info

Expand Down
Empty file added docs/juvix.yaml
Empty file.
2 changes: 1 addition & 1 deletion docs/reference/language/aliases.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
icon: material/rename-outline
comments: true
comments: false
---

# Aliases
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/language/axioms.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
icon: material/axe
comments: true
comments: false
---

# Axiom
Expand Down
6 changes: 6 additions & 0 deletions mkdocs.insiders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ plugins:
- trimmer
- social
- tags
- typeset
- blog:
enabled: true
blog_dir: blog
blog_toc: true
draft: false
authors: true
authors_file: blog/.authors.yml
draft_on_serve: true
post_date_format: short
post_readtime: true
Expand Down Expand Up @@ -86,8 +88,12 @@ extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/anoma/juvix
- icon: fontawesome/brands/discord
link: https://discord.gg/jwzaMZ2Sct
name: Juvix Discord
- icon: fontawesome/brands/twitter
link: https://twitter.com/juvixlang
name: Juvix Twitter
extra:
consent:
title: Cookie consent
Expand Down
9 changes: 6 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,19 @@ theme:

custom_dir: "docs/overrides"
font:
text: Incosolata
text: Roboto Flex
code: JetBrains Mono

favicon: assets/images/favicon/favicon.ico
logo: assets/logo-juvix.svg

icon:
repo: fontawesome/brands/github
edit: material/pencil
view: material/eye
edit: material/file-eye
view: material/file-edit
search: octicons/search-16
previous: octicons/arrow-left-16
next: octicons/arrow-right-16

markdown_extensions:
- abbr
Expand Down

0 comments on commit f1f6259

Please sign in to comment.