This repository gathers Flix code examples coming from various websites. It also includes several build scripts (Ant files, Bash scripts, batch files, Gradle scripts, Make scripts) for experimenting with Flix on a Windows machine. |
Ada, Akka, C++, COBOL, Dafny, Dart, Deno, Docker, Erlang, Golang, GraalVM, Haskell, Kafka, Kotlin, LLVM, Modula-2, Node.js, Rust, Scala 3, Spark, Spring, TruffleSqueak, WiX Toolset and Zig are other topics we are continuously monitoring.
☛ Read the document "Did You Know?" from the Flix documentation to know more about the Flix ecosystem.
This project depends on the following external software for the Microsoft Windows platform:
- Apache Maven 3.9 (requires Java 8+) (release notes)
- Flix 0.54 (requires Java 21+) (release notes)
- Git 2.47 (release notes)
- Gradle 8.11 (requires Java 8+) (release notes)
- Temurin OpenJDK 21 LTS (release notes, Shipilev's notes, Java 21 API)
Optionally one may also install the following software:
- Apache Ant 1.10 (requires Java 8) (release notes)
- ConEmu 2023 (release notes)
- Flix nightly builds 1
- mdBook 0.4 2 (changelog)
- MSYS2 2024 (change log)
- Scala 2.13 (release notes)
- Temurin JDK Mission Control 9.0 3 (release notes)
- Visual Studio Code 1.95 (release notes)
☛ Installation policy
When possible we install software from a Zip archive rather than via a Windows installer. In our case we definedC:\opt\
as the installation directory for optional software tools (in reference to the/opt/
directory on Unix).
For instance our development environment looks as follows (December 2024) 4:
C:\opt\apache-ant\ ( 43 MB) C:\opt\apache-maven\ ( 10 MB) C:\opt\ConEmu\ ( 26 MB) C:\opt\flix\ ( 37 MB) C:\opt\Git\ (393 MB) C:\opt\gradle\ (144 MB) C:\opt\jdk-temurin-21.0.5_11\ (326 MB) C:\opt\jmc\ ( 99 MB) C:\opt\mdBook\ ( 10 MB) C:\opt\msys64\ (5.5 GB) C:\opt\scala-2.13.15\ ( 25 MB) C:\opt\VSCode\ (381 MB)
Directory structure ▴
This project has the following directory structure :
bin\ docs\ examples\{README.md, areas, arrays, channels, ..} flix\ (Git submodule) lutz-examples\{README.md, channels, datalog, etc.} CONTRIBUTIONS.md BUILD.md DEPS.md QUICKREF.md README.md RESOURCES.md setenv.bat UBUNTU_WSL.md
where
- directory
bin\
provides several utility batch files. - directory
docs\
contains Flix related papers/articles. - directory
examples\
contains Flix code examples (seeREADME.md
). - directory
flix\
contains our fork of theflix/flix
repository as a Github submodule. - directory
lutz-examples\
contains Flix code examples from Lutz Hühnken's article (seeREADME.md
). - file
CONTRIBUTIONS.md
presents ongoing works and contributions to the Flix project. - file
BUILD.md
presents the Flix build. - file
DEPS.md
lists library dependencies of published Flix distributions. - file
QUICKREF.md
gathers Flix language features. - file
README.md
is the Markdown document for this page. - file
RESOURCES.md
gathers Flix related documents. - file
setenv.bat
is the batch script for setting up our environment. - file
UBUNTU_WSL.md
presents a Flix code examples in Ubuntu WSL.
Bash/Batch commands ▴
We distinguish different sets of batch commands:
-
setenv.bat
– This batch command makes external tools such asgit.exe
andgradle.bat
directly available from the Windows command prompt (see section Project dependencies).> setenv help Usage: setenv { <option> | <subcommand> } Options: -debug print commands executed by this script -verbose print progress messages Subcommands: help print this help message
-
examples\*\build.bat
– Code examples can be built/run/tested using thebuild.bat
command.> build Usage: build { <option> | <subcommand> } Options: -debug print commands executed by this script -nightly use latest Flix nightly build if locally available -verbose print progress messages Subcommands: clean delete generated files compile generate program executable help print this help message run execute the generated program "areas" test run the unit tests
-
examples\*\build.gradle
– Code examples can be built/run/tested using thegradle.bat
build tool. -
examples\*\build.sh
– Code examples can be built/run/tested using thebash.exe
scripting tool.> sh build.sh help Usage: build.sh { <option> | <subcommand> } Options: -debug print commands executed by this script -nightly select latest Flix nightly build if locally available -verbose print progress messages Subcommands: clean delete generated files compile compile Flix source files decompile decompile generated code with CFR help print this help message run execute Flix program "areas" test run the unit tests
Usage examples ▴
We execute command setenv.bat
once to setup our development environment; it makes external tools such as git.exe
, gradle.bat
, make.exe
and sh.exe
directly available from the command prompt:
> setenv Tool versions: java 21.0.5, javac 21.0.5, scalac 2.13.15, flix 0.54.0, gradle 8.11, make 3.81, mdbook v0.4.43, mvn 3.9.9, git 2.47.1, diff 3.10, bash 5.2.37(1) > where git gradle make sh C:\opt\Git\bin\git.exe C:\opt\Git\mingw64\bin\git.exe C:\opt\gradle\bin\gradle C:\opt\gradle\bin\gradle.bat C:\opt\make-3.81\bin\make.exe C:\opt\Git\bin\sh.exe C:\opt\Git\usr\bin\sh.exe
Command setenv.bat
with option -verbose
displays additional information:
- the download of the Flix nightly build to directory
%FLIX_HOME%
(if not yet done), - the tool paths (which may not contain the version suffix, i.e.
C:\opt\Git\bin\git.exe
in some installations), - the environment variables defined locally within this session,
- and the path associations (i.e.
F:\
in this case, but other drive names may be displayed as path associations are globally defined).
> setenv -verbose Assign path C:\Users\michelou\workspace-perso\flix-examples to drive F: Download file "flix-2024-11-30.jar" to directory "C:\opt\flix" Tool versions: java 21.0.5, javac 21.0.5, scalac 2.13.15, flix 0.54.0, gradle 8.11, make 3.81, mdbook v0.4.43, mvn 3.9.9, git 2.47.1, diff 3.10, bash 5.2.37(1) Tool paths: C:\opt\jdk-temurin-21.0.5_11\bin\java.exe C:\opt\jdk-temurin-21.0.5_11\bin\javac.exe C:\opt\scala-2.13.15\bin\scalac.bat C:\opt\gradle\bin\gradle.bat C:\opt\make-3.81\bin\make.exe C:\opt\mdBook\mdbook.exe C:\opt\apache-maven\bin\mvn.cmd C:\opt\Git\bin\git.exe C:\opt\Git\usr\bin\diff.exe Environment variables: "ANT_HOME=C:\opt\apache-ant" "FLIX_HOME=C:\opt\flix" "GIT_HOME=C:\opt\Git" "GRADLE_HOME=C:\opt\gradle" "JAVA_HOME=C:\opt\jdk-temurin-21.0.5_11" "MAKE_HOME=C:\opt\make-3.81" "MAVEN_HOME=C:\opt\apache-maven" "MDBOOK_HOME=C:\opt\mdBook" "SCALA_HOME=C:\opt\scala-2.13.15" Path associations: F:\: => %USERPROFILE%\workspace-perso\flix-examples
Footnotes ▴
[1] Flix nightly builds ↩
-
Our installation directory
%FLIX_HOME%
looks as follows on November 30, 2024 :> tree /a /f c:\opt\flix | tail -n +3 C:\opt\flix flix-2024-11-30.jar flix.jar
Commandbuild.bat
in our Flix projects features the-nightly
option to choose the latest Flix nightly build archive file locally available instead of the release version (archive fileflix.jar
above).
[2] mdBook ↩
-
We use
mdbook.exe
to work on our local copy of the online book "Programming Flix" generated from the GitHub projectflix/book
.
[3] JDK Mission Control ↩
- Each vendor provides his own distribution of the JDK Mission Control tool, e.g. Adoptium JDK Mission Control (our choice), Zulu Mission Control, Liberica Mission Control or Oracle JDK Mission Control.
-
We use
jmc.exe
to investigate issues occuring during the build of our GitHub fork of theflix/flix
repository.> %JMC_HOME%\bin\jmc.exe -vm %JAVA_HOME%\bin
[4] Downloads ↩
- In our case we downloaded the following installation files (see section 1):
-
apache-ant-1.10.15-bin.zip ( 9 MB) apache-maven-3.9.9-bin.zip ( 10 MB) ConEmuPack.230724.7z ( 5 MB) flix.jar ( 39 MB) flix-2024-11-30.jar ( 39 MB) gradle-8.11.bin.zip (103 MB) mdbook-v0.4.43-x86_64-pc-windows-msvc.zip ( 4 MB) msys2-x86_64-20240727.exe ( 94 MB) org.openjdk.jmc-9.0.0-win32.win32.x86_64.zip ( 90 MB) OpenJDK21U-jdk_x64_windows_hotspot_21.0.5_11.zip (191 MB) PortableGit-2.47.1-64-bit.7z.exe ( 46 MB) scala-2.13.15.zip ( 22 MB) VSCode-win32-x64-1.95.2.zip (131 MB)