Need to ensure that you have the following software installed.
ocaml = 4.13.1 (group lets discuss...)
dune >= 3.0
llvm = 11.0.0 or Docker installed to build our container image with LLVM installed (see below)
Either the user could have LLVM locally installed (kinda complicated) or install and run our Docker container (prepackaged with LLVM). We need LLVM in order to compile our code to IR, and ultimately to build and run the executable. Follow the below instructions
Make sure that you have Docker Desktop downloaded and running, and then use the following commands to build our viz container.
# build our container
docker build -t viz .
# if you see the below error, when building the viz containen then rune the below command
if "ERROR [7/9] COPY ./viz.opam ." upon docker build
dune build
- Start the container if it's not running.
docker start <container_name>
- launch the container
This command will place you inside the container at the root, and you can run any
of the tests in the next section without fear of software dependency issues.
# from /viz root directory
./launch-container.sh
At this point you should have built the Viz Docker Image, and be inside the container. That will ensure no issues with running any of the following commands.
dune clean /* clean the Dune _build folder */
dune build /* build our compiler code */
We leverage the Dune Build system to compile our program with different flags
and show the corresponding output. Check viz/bin/vc.ml for more details.
# from /viz root directory
dune exec -- vc <program-name>.viz -ts /* scan tokens and print to stdout */
dune exec -- vc <program-name>.viz -a /* abstract syntax tree */
dune exec -- vc <program-name>.viz -s /* semantically checked abstract syntax tree */
dune exec -- vc <program-name>.viz -l /* LLVM IR */
# from /viz root directory
cd test/scanner
./script-token-scanning.sh
# from /viz root directory
cd test/parser
./script-parsing.sh
# from /viz root directory
cd test/semantic
./script-semantic.sh
# from /viz root directory
./script-test-programs.sh
This shell script will run all of the tests across all of the test/*
directories.
# from /viz root directory
./run_viz_tests.sh
./viz test/programs/helloworld.viz
We have implemented an online text editor for our language in order to provide Viz programming language users a more interactive way of developing code. With this deployed web application, the user doesn’t have to worry about having Dune, Ocaml, and LLVM installed locally on their machine. VizOnline affords users the ability to write, compile, and run viz source code in an online text editor. Furthermore, we provide a look into what happens under the hood during compilation through 6 different run options:
- Running the code and displaying output
- A look at the full build process
- Displaying the parsed abstract syntax tree
- Presenting the syntactically checked abstract syntax tree
- Viewing the LLVM IR assembly code
- Seeing how programs are scanned into tokens
http://ec2-23-22-206-12.compute-1.amazonaws.com/
We have the frontend application located at the below repo. The code is ready to clone and run locally, and instructions are present there.
https://github.com/jakobgabrield/vizonline