Functional Reactive Programming for the Arduino

View the tutorial » Install the compiler» Read the paper»

Lightweight and Effective

Not only does functional programming allow for strong scalability of compact, readable and effective code, but functional reactive programming is specifically designed to handle timing based events in an intuitive way. Juniper is designed to carry these advantages, as well as be lightweight enough to function viably on Arduino.


Juniper supports many features typical of functional programming languages, including algebraic data types, tuples, records, pattern matching, immutable data structures, parametric polymorphic functions, and anonymous functions (lambdas).

Some imperative programming concepts are also present in Juniper, such as for, while and do while loops, the ability to mark variables as mutable, and mutable references.

Completely Open Source

The Juniper compiler, standard library and documentation are all open sourced under the MIT License. The Juniper compiler itself is written in F#, an open source language originally developed by Microsoft Research.

Latest News

Juniper 2.3.0 Released

June 2, 2020

New features:

  • Juniper now uses the Arduino setup and loop functions instead of using a custom main function. This fixes a long standing bug where programs would shut down unexpectedly after a certain time period.
  • Instead of a single main function, Juniper now uses a setup and loop function, much like C/C++ Arduino programs.

FARM Presentation now on YouTube!

November 22, 2016

Juniper 2.2.0 Released

November 22, 2016

New features:

  • Bug fixes for type inference
  • Added more useful functions to the Signal standard library module

Juniper 2.1.0 Released

October 14, 2016

New features:

  • Strings and character lists added.
  • Print to console functions added.
  • Pipe syntax added.
  • Improved type inference. Type variables no longer need to be explicitly declared to create generic functions. Instead the necessary type variables can be directly inferred.

FARM Presentation

September 24, 2016

Juniper will be presented at the ACM SIGPLAN International Workshop on Functional Art, Music, Modelling and Design (FARM) in Nara, Japan.

The presentation will provide a brief overview of the Juniper language along with typical Juniper design patterns. Juniper will be compared to the existing Arduino language of choice - C++. Existing Juniper projects will be demonstrated. In the spirit of the Maker Movement, there will be a “hands on” portion of the presentation, in which audience members will receive (at no cost) an Arduino compatible microcontroller and the components necessary to build a small project. By the end of the presentation, audience members will be able to construct the circuit and write the program for this project in Juniper.

The source code for the demo project can be found here:

Here are the PDF versions of the FARM presentations:

Juniper 2.0.0 Released

September 23, 2016

New features:

  • New type checker: type inference now supported!
  • New parser: improved parsing error messages.
  • Performance improvements: compiling a project can now be done nearly instantaneously.

FARM Paper

July 15, 2016

Our paper on the Juniper programming language was accepted to the ACM SIGPLAN International Workshop on Functional Art, Music, Modelling and Design (FARM)! The pre-print copy of the paper can be downloaded here: juniper_farm_preprint.pdf


This paper presents the design and implementation of Juniper: a functional reactive programming language (FRP) targeting the Arduino and related microcontroller systems. Juniper provides a number of high level features, including parametric polymorphic functions, anonymous functions, automatic memory management, and immutable data structures. Also included is a standard library which offers many useful FRP signal processing functions. Juniper is translated to standard C++ and compiled with the existing Arduino development tools, allowing Juniper programs to fit on resource-constrained devices, and enabling seamless interoperability with existing C++ libraries for these devices.