All Projects → twineworks → tweakflow

twineworks / tweakflow

Licence: MIT License
Safe embeddable scripting for the JVM

Programming Languages

java
68154 projects - #9 most used programming language
HCL
1544 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
ANTLR
299 projects
HTML
75241 projects

Projects that are alternatives of or similar to tweakflow

grapevine
Fast, unopinionated, embeddable, minimalist web framework for .NET
Stars: ✭ 72 (+242.86%)
Mutual labels:  embeddable
purity
Oh-My-ZSH prompt inspired by robbyrussell theme + pure prompt
Stars: ✭ 14 (-33.33%)
Mutual labels:  pure
huginn
Programming language with no quirks, so simple every child can master it.
Stars: ✭ 41 (+95.24%)
Mutual labels:  embeddable
facile
Stupidly Simple Audio Streaming Library
Stars: ✭ 17 (-19.05%)
Mutual labels:  embeddable
luf
Statically typed, embeddable, scripting language written in Zig.
Stars: ✭ 26 (+23.81%)
Mutual labels:  embeddable
kyanite
A small purely functional library of curried functions, with great piping possibilities!
Stars: ✭ 26 (+23.81%)
Mutual labels:  pure
embed
An embeddable, tiny Forth interpreter with metacompiler.
Stars: ✭ 80 (+280.95%)
Mutual labels:  embeddable
lapisdb
A modern, easy-to-use and feature-rich TypeScript embedded database.
Stars: ✭ 21 (+0%)
Mutual labels:  embeddable
dreamy-db
🔥 Dreamy-db - A Powerful database for storing, accessing, and managing multiple database.
Stars: ✭ 25 (+19.05%)
Mutual labels:  embeddable
gsc
embeddable (game) scripting language in C
Stars: ✭ 25 (+19.05%)
Mutual labels:  embeddable
rust lisp
A Rust-embeddable Lisp, with support for interop with native Rust functions
Stars: ✭ 128 (+509.52%)
Mutual labels:  embeddable
http
Tiny, embeddable HTTP client with simple API for the browser
Stars: ✭ 21 (+0%)
Mutual labels:  embeddable
nullc
Fast C-like programming language with advanced features
Stars: ✭ 140 (+566.67%)
Mutual labels:  embeddable
qbit
qbit is a kotlin-multiplatform embeddable decentralized DBMS with object-relational information model
Stars: ✭ 40 (+90.48%)
Mutual labels:  embeddable
go-el
Expression language(EL) to navigate/manipulate in golang structure data
Stars: ✭ 42 (+100%)
Mutual labels:  expression-language
pybufrkit
Pure Python toolkit to work with WMO BUFR messages
Stars: ✭ 59 (+180.95%)
Mutual labels:  pure
remoting
Jetlang Remoting - asynchronous distributed messaging
Stars: ✭ 27 (+28.57%)
Mutual labels:  embeddable
indent.js
Pure code indentation for jsx, tsx, ts, js, html, css, less, scss.
Stars: ✭ 55 (+161.9%)
Mutual labels:  pure
ghost
The Ghost Programming Language
Stars: ✭ 43 (+104.76%)
Mutual labels:  embeddable
JitCat
A C++17 library for parsing and executing expressions. Allows easy exposure of variables and functions from C++ through built-in reflection functionality.
Stars: ✭ 16 (-23.81%)
Mutual labels:  expression-language

Tweakflow - safe embeddable scripting for the JVM

Java 8+ License Maven Central AppVeyor Build status Join the chat at https://gitter.im/twineworks/tweakflow

Applications can use tweakflow to expose runtime information to an expression-based scripting runtime, allowing users to safely interact with the provided data and collect scripted results.

Tweakflow keeps the application in control of the data exchange. Users cannot arbitrarily call into application internals.

Requirements

Java 8 or later is required. Builds are tested against JDK 8, 11, 13, 15 and 17.

Getting the jar

Get the latest release jar from github, or from maven central.

Getting started

Start the REPL using:

$ java -jar tweakflow-1.4.1.jar repl

Start typing expressions for the REPL to evaluate:

tweakflow interactive shell    \? for help, \q to quit
std.tf> 1+2
3

std.tf> "Hello " .. "World"
"Hello World"

std.tf> data.map([1, 2, 3], (x) -> x*x)
[1, 4, 9]

See the getting started guide for a short guided tour of language features.

Syntax Highlighting

Language features

A simple computation model

Tweakflow has values and functions acting on them. All language constructs like variables, libraries, and modules merely serve to name and organize values and functions into sensible groups. Application users do not have to learn any programming paradigms to start using tweakflow expressions.

Dynamically typed

Tweakflow is a dynamically typed language. Data types include booleans, strings, longs, doubles, exact decimal numbers, datetimes and functions, as well as nestable lists and dictionaries. All data types have literal notations.

All data is immutable

All values in tweakflow are immutable. It is always safe to pass values between user expressions and the host application without worrying about mutable state or object identity.

All functions are pure

All functions in tweakflow are pure and free of observable side-effects. A tweakflow function, given the same arguments, will always return the same result. The host application must take care of all non-pure operations like file I/O.

Batteries included

Tweakflow comes with a standard library that allows users to perform common tasks when working with data. Your application can limit or extend the standard library to suit its needs.

Test framework included

Tweakflow comes with an extensible spec framework similar to mocha, rspec, etc. The tests for the standard library are implemented with it.

Automatic dependency tracking

When the application changes an input variable, tweakflow efficiently recalculates the values of any user variables that depend on it. Much like a spreadsheet application updates dependent formula cells when a cell changes.

Inline documentation and meta-data

Tweakflow supports documentation annotations as well as arbitrary meta-data on variables, libraries and modules. This feature supports interactive help as well as automated generation of project documentation.

Using tweakflow standalone

Tweakflow is designed to be an expression language embedded in a bigger application. Much like formula languages are embedded in spreadsheet applications. However, for prototyping, development and testing, it can be handy to invoke tweakflow directly.

See the tools guide, for more information on the tweakflow REPL, runner, and documentation tool.

Embedding

Evaluating simple expressions is as easy as:

TweakFlow.evaluate("1+2"); // returns the Value 3

Or it can be more sophisticated, providing users with application variables they can reference. Your app is in control of functions and variables available to user expressions.

The host application can allow users to define variables, group them into libraries and even separate modules for reuse across their projects. How much sophistication is available to users depends on how much your application wants to expose.

We've embedded tweakflow as the expression engine in our data automation tool: Tweakstreet

See the embedding guide for more information and examples.

License

Tweakflow uses the business friendly MIT license.

Support

Open source does not mean you're on your own. Tweakflow is developed by Twineworks GmbH. Twineworks offers commercial support and consulting services. Contact us if you'd like us to help with a project.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].