Shiro is a dataflow programming language designed to be embedded into applications to help to support reuse and the exploration of alternatives. The language is part of Jeff's PhD thesis. This is research code. Use with a sense of humour and lots of patience.
The Shiro runtime is designed to be used as the computational engine for applications like parametric CAD tools, vector editors, and spreadsheets. The runtime provides an API to modify a program.
A Quick Sample
Here's an example that describes a pool with three alternatives layouts:
node Layout begin input width Double output length Double end node Pool[basin] begin option singleLane Layout(width: 10.0, length: 30.0) option basin Layout(width: 20.0, length: 20.0) option olympic Layout(width: 25.0, length: 30.0) end node Box begin input length Double input width Double input height Double output volume Double( length * width * height) end node Cost begin input volume Double output cost Double(volume * 12.0) end graph poolCosts begin pool Pool b Box(length: pool.active.length, width: pool.active.width, height: 10.0) c Cost(b.volume) end state singleLane begin graph poolCosts pool[singleLane] end state basin begin graph poolCosts pool[basin] end state olympic begin graph poolCosts pool[olympic] end
examples, you'll find folders with example Shiro programs. Checked examples
run in Shiro Playground.
Color_Schemes - shows how to create a color scheme
ColorScheme_OnColor.srocreates alternatives on individual colors
ColorScheme_OnScheme.srocreates alternatives on the entire scheme
Data_Analysis - example of processing a CSV file and viewing the result in a table
poverty.sroanalysis of the world's population in poverty
Drawing - shows how to draw in Shiro
Costume_Selection.sroshows how to render differty costumes for a character
FlowerOfLife.srouses traces of the Flower of Life, a patterns of circles to create images
shapes.srois collage of the shapes you can draw in Shiro
Finance - financial calculations
Investment.sroshows how to compare two investment products
Logo - create alternative versions of a logo
- 'EverClean_logo.sro' defines a design for a logo
Old_Examples - examples written in the old syntax to be ported
Syntax_Examples - short snippets demonstrating bits of the syntax
- Includes - demonstrates the use of
- Options - desmonstrates the use of
- Recursion - demonstrates how to do recursion
arthimetic.srodemonstrates basic arithmetic
list.srosyntax for a literal list
map.srodemonstrates how to use the map function to iterate over a list.
- Includes - demonstrates the use of
Shiro is designed to be integrated into applications as a scripting language. See the Playground for an example of what it takes.
The latest version of Shiro is 0.5.0
Add via maven
|Group ID||Artifact ID||Version|
To add Shiro to your project manually, add the fat jar to the classpath of your application.
Shiro is implemented in Java. Gradle is used as the
build system and dependency manager. The interpreter depends on ANTLR
4.5 to generate the parser, lexer and parse tree event
build.gradle is setup to automatically generate the Java code at
compile time. You can use gradle from the commandline or use your favourite Java IDE.
The awesome ANTLR plugin for IntelliJ makes it an easy choice.
You can start the Shiro Playground application that allows you to load and run Shiro code using this command:
$ gradle run
Currently, you cannot run execute Shiro code from the commandline. If a REPL is a priority for you, add an issue and we can explore what it will take to make one.
To create an executable for your OS, use the javafx-gradle plugin:
$ gradle jfxDeploy
The executable bundle will be found in
A helpful command to remember if you just want to regenerate the parser, lexer, and base listener is:
$ gradle generateGrammarSource
Ways You Can Help
Because this code is being developed for my thesis, I'm responsible for its design and implementation. That said, there are ways you can help give the language the polish it is needed.
Give feedback on both the implementation and the language syntax
Help write functions for the standard library
This is one of the biggest and most important parts of the project after the basic language design is complete. We need a good library of multi-functions to make the language helpful to people in a variety of domains.
- Jeffrey Guenther - Designer and Implementer
- Robert Woodbury - PhD Committee member
- Chris Shaw - PhD Supervisor
- Siniša Kolarić - Research Group Colleague
- Ankit Gupta - Research Group Colleague
- Maher Elkhaldi - Research Group Colleague
Mailing list: firstname.lastname@example.org
Shiro is licensed under the MIT license