Juniper is a functional reactive programming language currently being developed at Tufts University by Caleb Helbling and Louis Ades.
The grammar in EBNF (extended Backus-Naur Form) is available in grammer.bnf
The purpose of Juniper is to provide a functional reactive programming platform for designing Arduino projects. FRP's high-level approach to timing-based events fits naturally with Arduino, with which programming almost entirely revolves around reacting to realtime events. Juniper transpiles to Arduino C++, which is then compiled to an Arduino executable.
- Compiler written in F#
- Transpiled to C++
- Statically typed
- Algebraic datatypes
- Use of records as datatypes (the equivalent of structs in C++)
- First class functions
- Type inference
- Use of templates to create maximum capacity length lists.
- Microsoft Visual F# Solution used for developing this project
- Juniper Grammar and Concrete Syntax
- This is the grammar used for our language in this repository. It is represented in Extended Backus-Naur Form (EBNF), a metasyntax language used for the planning of Juniper's concrete syntax.
- Contains the code used for the compiler
To get started using Juniper, you'll first need to build the compiler using the source in this repository.
- If you do not have it already, download and install Microsoft Visual Studio, 2015 edition or later.
- Clone this repository to your local machine.
- Open /Juniper.sln in Visual Studio.
- When the solution opens, go to the Solution Explorer and find the "References" tab underneath the "Juniper" project. Right click on "References", and select "Manage NuGet Packages." Verify that FParsec and QuickGraph are installed as part of your solution.
- Build the Juniper project (either in Debug mode or Build mode).
- The result should be a built .exe file called "Juniper.exe".
- (Optional) Add Juniper.exe to PATH variables so that it can be run from any directory.
- Follow these instructions for F# installation on Linux. Choose the option that works best for you.
- Open the Juniper.sln solution file. Check the references, and refresh them if necessary. Verify that FParsec and QuickGraph work. Update NuGet packages.
- If the target framework version is not supported, open Juniper.fsproj, and change the TargetFrameworkVersion tag to v4.8.
- Build the Juniper project.
- Follow these instructions (Option 3: Install Visual Studio for Mac) is tested, but choose the option that works best for you. The package manager is NuGet and has not been updated to paket.
- Open the Juniper solution. Check the references, and refresh them if necessary. Verify that FParsec, FParsecCS and QuickGraph work. Update Nuget packages.
- If the target framework version is not supported, open Juniper.fsproj, and change the TargetFrameworkVersion tag to v4.8.
- Build the Juniper project.
- Install Mono.
- Run Juniper using Mono:
mono Juniper.exe -s examples/Blink.jun -o Blink.cpp
.
You can write Juniper files in any text editor, but the Atom text editor supports a plugin for Juniper text highlighting, which is very useful for code readability. Install Atom, and install the package "language-juniper" from inside the editor.
- From the command line, run "Juniper.exe -s [.jun modules as arguments] -o [output file]"
- This should build your .cpp file. Compile and upload to your Arduino (with your preferred method, such as PlatformIO).