Skip to content

Commit

Permalink
Rename MiniJuvix to Juvix (#259)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jonaprieto authored Jul 8, 2022
1 parent 84732b2 commit 3b3ea45
Show file tree
Hide file tree
Showing 445 changed files with 2,436 additions and 2,132 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: MiniJuvix CI
name: The Juvix compiler CI

on:
pull_request:
Expand Down
4 changes: 2 additions & 2 deletions .github_changelog_generator
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
output=CHANGELOG.md
project=minijuvix
project=juvix
issues=false
pulls=true
user=heliaxdev
user=anoma
verbose=false
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ agda/
agda2hs/
docs/*.html
*.cabal
/src/MiniJuvix/Utils/OldParser.hs
/src/Juvix/Utils/OldParser.hs
CHANGELOG.md
UPDATES-FOR-CHANGELOG.org
.minijuvix-build
.juvix-build

# C Code generation
*.wasm
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "minijuvix-stdlib"]
path = minijuvix-stdlib
url = https://github.com/heliaxdev/minijuvix-stdlib.git
[submodule "juvix-stdlib"]
path = juvix-stdlib
url = https://github.com/anoma/juvix-stdlib.git
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: mixed-line-ending
exclude: tests/

- repo: https://github.com/heliaxdev/minijuvix
- repo: https://github.com/anoma/juvix
rev: 6f5c3fc2bc70cf65594d3b74fb62e75e8fcfac5b
hooks:
- id: ormolu
Expand Down
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ docs :
cd docs ; \
sh conv.sh

.PHONY: ci
ci:
make ci-build
make install
make ci-test
make test-shell

.PHONY : build
build:
stack build --fast --jobs $(THREADS)
Expand Down Expand Up @@ -128,7 +135,7 @@ install-watch:
stack install --fast --jobs $(THREADS) --file-watch

repl:
stack ghci MiniJuvix:lib
stack ghci Juvix:lib

.PHONY : install-pre-commit
install-pre-commit:
Expand All @@ -143,9 +150,9 @@ pre-commit :
update-submodules :
git submodule foreach git pull origin main

.PHONY : minijuvix-stdlib
minijuvix-stdlib:
git submodule update --init minijuvix-stdlib
.PHONY : juvix-stdlib
juvix-stdlib:
git submodule update --init juvix-stdlib

.PHONY : get-changelog-updates
get-changelog-updates :
Expand Down
48 changes: 24 additions & 24 deletions README.org
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
* MiniJuvix
* Juvix

#+begin_html
<a href="https://github.com/heliaxdev/MiniJuvix/actions/workflows/ci.yml">
<img alt="CI status" src="https://github.com/heliaxdev/MiniJuvix/actions/workflows/ci.yml/badge.svg" />
<a href="https://github.com/anoma/juvix/actions/workflows/ci.yml">
<img alt="CI status" src="https://github.com/anoma/juvix/actions/workflows/ci.yml/badge.svg" />
</a>
#+end_html

#+begin_html
<a href="https://github.com/heliaxdev/minijuvix/tags">
<img alt="" src="https://img.shields.io/github/v/release/heliaxdev/minijuvix?include_prereleases" />
<a href="https://github.com/anoma/juvix/tags">
<img alt="" src="https://img.shields.io/github/v/release/anoma/juvix?include_prereleases" />
</a>
#+end_html

#+begin_html
<a href="https://github.com/heliaxdev/minijuvix/blob/main/LICENSE">
<a href="https://github.com/anoma/juvix/blob/main/LICENSE">
<img alt="LICENSE" src="https://img.shields.io/badge/license-GPL--3.0--only-blue.svg" />
</a>
#+end_html

#+begin_html
<a href="https://github.com/heliaxdev/minijuvix/actions/workflows/pages/pages-build-deployment"><img
src="https://github.com/heliaxdev/minijuvix/actions/workflows/pages/pages-build-deployment/badge.svg"
<a href="https://github.com/anoma/juvix/actions/workflows/pages/pages-build-deployment"><img
src="https://github.com/anoma/juvix/actions/workflows/pages/pages-build-deployment/badge.svg"
alt="pages-build-deployment" /></a>
#+end_html

#+begin_html
<a href="https://github.com/heliaxdev/MiniJuvix">
<img align="right" width="300" height="300" alt="MiniJuvix Mascot" src="assets/seating-mascot.051c86a.svg" />
<a href="https://github.com/anoma/juvix">
<img align="right" width="300" height="300" alt="Juvix Mascot" src="assets/seating-mascot.051c86a.svg" />
</a>
#+end_html


** Description

MiniJuvix is a research programming language created by [[https://heliax.dev/][Heliax]] as a first step toward creating more robust and reliable alternatives for formally verified smart contracts than existing languages. The MiniJuvix language is constantly evolving, open-source, functional, and statically typed with special support for compiling [[https://anoma.network/blog/validity-predicates/][validity predicates]] to the =C= language, which can be deployed to various distributed ledgers including [[https://anoma.net/][Anoma]].
Juvix is a research programming language created by [[https://heliax.dev/][Heliax]] as a first step toward creating more robust and reliable alternatives for formally verified smart contracts than existing languages. The Juvix language is constantly evolving, open-source, functional, and statically typed with special support for compiling [[https://anoma.network/blog/validity-predicates/][validity predicates]] to the =C= language, which can be deployed to various distributed ledgers including [[https://anoma.net/][Anoma]].

The MiniJuvix programming language allows developers to write programs with a high degree of assurance that they will meet specific standards. This is due to the fact that several static analyses are performed during compilation, including, for example, scope, termination, arity, and type checking. As a result, functional programs, especially validity predicates, can be written with greater confidence that they will be free of runtime errors. [[https://github.com/heliaxdev/minijuvix/tree/main/examples/milestone][Here are some examples of MiniJuvix programs]].
The Juvix programming language allows developers to write programs with a high degree of assurance that they will meet specific standards. This is due to the fact that several static analyses are performed during compilation, including, for example, scope, termination, arity, and type checking. As a result, functional programs, especially validity predicates, can be written with greater confidence that they will be free of runtime errors. [[https://github.com/anoma/juvix/tree/main/examples/milestone][Here are some examples of Juvix programs]].

The language features:

Expand All @@ -47,48 +47,48 @@ The language features:
- holes in programs
- axioms for non-computable terms

Additionally, the foreign and compile blocks syntax enable developers to compile a program to different backends including the =C= language. The MiniJuvix module system further permits splitting programs into several modules to build libraries which can be later documented by generating HTML files based on the codebase, see for example, [[https://heliaxdev.github.io/minijuvix-stdlib/][the Minijuvix standard library's website]]. For futher details, please refer to [[https://heliaxdev.github.io/minijuvix/][the MiniJuvix book]] which icludes our [[https://heliaxdev.github.io/minijuvix/introduction/changelog.html][latest updates]].
Additionally, the foreign and compile blocks syntax enable developers to compile a program to different backends including the =C= language. The Juvix module system further permits splitting programs into several modules to build libraries which can be later documented by generating HTML files based on the codebase, see for example, [[https://anoma.github.io/juvix-stdlib/][the Juvix standard library's website]]. For futher details, please refer to [[https://anoma.github.io/juvix/][the Juvix book]] which icludes our [[https://anoma.github.io/juvix/introduction/changelog.html][latest updates]].

** Quick Start

To install MiniJuvix, you can download its sources using
To install Juvix, you can download its sources using
[[http://git-scm.com/][Git]] from the
[[https://github.com/anoma/juvix.git][Github repository]]. Then, the
program can be downloaded and installed with the following commands. You
will need to have [[https://haskellstack.org][Stack]] installed.

#+begin_src shell
git clone --recursive https://github.com/heliaxdev/minijuvix.git
cd minijuvix
git clone --recursive https://github.com/anoma/juvix.git
cd juvix
stack install
#+end_src

If the installation succeeds, you must be able to run the =minijuvix=
If the installation succeeds, you must be able to run the =juvix=
command from any location. To get the complete list of commands, please
run =minijuvix --help=.
run =juvix --help=.

** Usage Example

In the following example a MiniJuvix file is compiled using the C backend. The
In the following example a Juvix file is compiled using the C backend. The
result is compiled to WASM using [[https://llvm.org][Clang]] and then executed using [[https://wasmer.io][wasmer]].

NB: Set the =WASI_SYSROOT_PATH= environment variable to the root of the WASI
sysroot. See [[https://heliaxdev.github.io/minijuvix/getting-started/dependencies.html][Installing dependencies]] for instructions on how to install the
sysroot. See [[https://anoma.github.io/juvix/getting-started/dependencies.html][Installing dependencies]] for instructions on how to install the
sysroot.

#+begin_src shell
cd tests/positive/MiniC/HelloWorld
minijuvix compile Input.mjuvix
juvix compile Input.juvix
wasmer Input.wasm
#+end_src

You should see the output: =hello world!=

** The MiniJuvix Book
** The Juvix Book

The MiniJuvix language and related tools are documented in [[https://heliaxdev.github.io/minijuvix/][the MiniJuvix book]].
The Juvix language and related tools are documented in [[https://anoma.github.io/juvix/][the Juvix book]].

** Community

We would love to hear what you think of MiniJuvix! Join us on
We would love to hear what you think of Juvix! Join us on
[[https://discord.gg/nsGaCZzJ][Discord]]
16 changes: 8 additions & 8 deletions app/App.hs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
module App where

import GlobalOptions
import MiniJuvix.Pipeline
import MiniJuvix.Prelude hiding (Doc)
import MiniJuvix.Prelude.Error qualified as Error
import MiniJuvix.Prelude.Pretty hiding (Doc)
import Juvix.Pipeline
import Juvix.Prelude hiding (Doc)
import Juvix.Prelude.Error qualified as Error
import Juvix.Prelude.Pretty hiding (Doc)
import System.Console.ANSI qualified as Ansi

data App m a where
ExitMsg :: ExitCode -> Text -> App m ()
ExitMiniJuvixError :: MiniJuvixError -> App m a
ExitJuvixError :: JuvixError -> App m a
ReadGlobalOptions :: App m GlobalOptions
RenderStdOut :: (HasAnsiBackend a, HasTextBackend a) => a -> App m ()
RunPipelineEither :: Sem PipelineEff a -> App m (Either MiniJuvixError a)
RunPipelineEither :: Sem PipelineEff a -> App m (Either JuvixError a)
Say :: Text -> App m ()

makeSem ''App
Expand All @@ -29,7 +29,7 @@ runAppIO g = interpret $ \case
Say t
| g ^. globalOnlyErrors -> return ()
| otherwise -> embed (putStrLn t)
ExitMiniJuvixError e -> do
ExitJuvixError e -> do
(embed . hPutStrLn stderr . Error.render (not (g ^. globalNoColors)) (g ^. globalOnlyErrors)) e
embed exitFailure
ExitMsg exitCode t -> embed (putStrLn t >> exitWith exitCode)
Expand All @@ -38,7 +38,7 @@ runPipeline :: Member App r => Sem PipelineEff a -> Sem r a
runPipeline p = do
r <- runPipelineEither p
case r of
Left err -> exitMiniJuvixError err
Left err -> exitJuvixError err
Right res -> return res

newline :: Member App r => Sem r ()
Expand Down
10 changes: 3 additions & 7 deletions app/CLI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ where

import Command
import GlobalOptions
import MiniJuvix.Prelude hiding (Doc)
import Juvix.Prelude hiding (Doc)
import Options.Applicative
import Options.Applicative.Builder.Internal
import Options.Applicative.Help.Pretty
Expand Down Expand Up @@ -54,13 +54,9 @@ descr =
info
parseCLI
( fullDesc
<> progDesc "The MiniJuvix compiler."
<> headerDoc (Just headDoc)
<> progDesc "The Juvix compiler."
<> footerDoc (Just foot)
)
where
headDoc :: Doc
headDoc = dullblue $ bold $ underline "MiniJuvix help"

foot :: Doc
foot = bold "maintainers: " <> "The MiniJuvix Team"
foot = bold "maintainers: " <> "The Juvix Team"
22 changes: 11 additions & 11 deletions app/Command.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import Commands.Parse
import Commands.Scope
import Commands.Termination
import GlobalOptions
import MiniJuvix.Prelude hiding (Doc)
import MiniJuvix.Syntax.Concrete.Scoped.Pretty qualified as Scoper
import Juvix.Prelude hiding (Doc)
import Juvix.Syntax.Concrete.Scoped.Pretty qualified as Scoper
import Options.Applicative

data Command
Expand Down Expand Up @@ -68,28 +68,28 @@ commandCompile =
command "compile" $
info
(addGlobalOptions (Compile <$> parseCompile))
(progDesc "Compile a MiniJuvix file")
(progDesc "Compile a Juvix file")

commandHighlight :: Mod CommandFields CommandGlobalOptions
commandHighlight =
command "highlight" $
info
(addGlobalOptions (pure Highlight))
(progDesc "Highlight a MiniJuvix file")
(progDesc "Highlight a Juvix file")

commandHtml :: Mod CommandFields CommandGlobalOptions
commandHtml =
command "html" $
info
(addGlobalOptions (Html <$> parseHtml))
(progDesc "Generate HTML for a MiniJuvix file")
(progDesc "Generate HTML for a Juvix file")

commandMiniC :: Mod CommandFields CommandGlobalOptions
commandMiniC =
command "minic" $
info
(addGlobalOptions (pure MiniC))
(progDesc "Translate a MiniJuvix file to MiniC")
(progDesc "Translate a Juvix file to MiniC")

commandMicroJuvix :: Mod CommandFields CommandGlobalOptions
commandMicroJuvix =
Expand All @@ -103,35 +103,35 @@ commandMiniHaskell =
command "minihaskell" $
info
(addGlobalOptions (pure MiniHaskell))
(progDesc "Translate a MiniJuvix file to MiniHaskell")
(progDesc "Translate a Juvix file to MiniHaskell")

commandMonoJuvix :: Mod CommandFields CommandGlobalOptions
commandMonoJuvix =
command "monojuvix" $
info
(addGlobalOptions (pure MonoJuvix))
(progDesc "Translate a MiniJuvix file to MonoJuvix")
(progDesc "Translate a Juvix file to MonoJuvix")

commandParse :: Mod CommandFields CommandGlobalOptions
commandParse =
command "parse" $
info
(addGlobalOptions (Parse <$> parseParse))
(progDesc "Parse a MiniJuvix file")
(progDesc "Parse a Juvix file")

commandScope :: Mod CommandFields CommandGlobalOptions
commandScope =
command "scope" $
info
(addGlobalOptions (Scope <$> parseScope))
(progDesc "Parse and scope a MiniJuvix file")
(progDesc "Parse and scope a Juvix file")

commandShowRoot :: Mod CommandFields CommandGlobalOptions
commandShowRoot =
command "root" $
info
(liftParserCmd (pure DisplayRoot))
(progDesc "Show the root path for a Minijuvix project")
(progDesc "Show the root path for a Juvix project")

commandTermination :: Mod CommandFields CommandGlobalOptions
commandTermination =
Expand Down
Loading

0 comments on commit 3b3ea45

Please sign in to comment.