All Projects → killme2008 → Aviatorscript

killme2008 / Aviatorscript

A high performance scripting language hosted on the JVM.

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Aviatorscript

xoom-cluster
The VLINGO XOOM platform SDK cluster management for Reactive, scalable resiliency of JVM tools and applications running on XOOM LATTICE and XOOM ACTORS.
Stars: ✭ 25 (-99.1%)
Mutual labels:  jvm-languages
pratt-calculator
A very simple expression evaluator written using a Pratt Parser
Stars: ✭ 22 (-99.21%)
Mutual labels:  expression-evaluator
Groovy
Apache Groovy: A powerful multi-faceted programming language for the JVM platform
Stars: ✭ 4,359 (+56.8%)
Mutual labels:  jvm-languages
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 (-99.42%)
Mutual labels:  expression-evaluator
Bracmat
Programming language for symbolic computation with unusual combination of pattern matching features: Tree patterns, associative patterns and expressions embedded in patterns.
Stars: ✭ 42 (-98.49%)
Mutual labels:  expression-evaluator
CASC
A Go Lang / V Lang / Rust syntax approach in JVM language.
Stars: ✭ 16 (-99.42%)
Mutual labels:  jvm-languages
KValidation
Validation library. Fluent syntax in Java, mini DSL in Kotlin
Stars: ✭ 20 (-99.28%)
Mutual labels:  jvm-languages
Mathjs
An extensive math library for JavaScript and Node.js
Stars: ✭ 11,861 (+326.65%)
Mutual labels:  expression-evaluator
expression-evaluator
A math expression evaluator built with JavaScript
Stars: ✭ 25 (-99.1%)
Mutual labels:  expression-evaluator
JBWAPI
Pure Java BWAPI Client implementation for JVM languages
Stars: ✭ 16 (-99.42%)
Mutual labels:  jvm-languages
rouziclib
This is my personal library of code that is common to my different projects (Photosounder, SplineEQ, Spiral and others)
Stars: ✭ 38 (-98.63%)
Mutual labels:  expression-evaluator
eval-estree-expression
Safely evaluate JavaScript (estree) expressions, sync and async.
Stars: ✭ 22 (-99.21%)
Mutual labels:  expression-evaluator
NCalc2
GitHub clone of NCalc from http://ncalc.codeplex.com/
Stars: ✭ 97 (-96.51%)
Mutual labels:  expression-evaluator
mjolnir
Thor Hammer and a way to express invokedynamic in Java
Stars: ✭ 17 (-99.39%)
Mutual labels:  jvm-languages
Haxe
Haxe - The Cross-Platform Toolkit
Stars: ✭ 4,665 (+67.81%)
Mutual labels:  jvm-languages
Sprache.Calc
Easy to use extensible calculator for .NET. Demonstrates Sprache toolkit grammar inheritance.
Stars: ✭ 42 (-98.49%)
Mutual labels:  expression-evaluator
iokk
International Obfuscated Kotlin Contest
Stars: ✭ 56 (-97.99%)
Mutual labels:  jvm-languages
Scala
Scala 2 compiler and standard library. For bugs, see scala/bug
Stars: ✭ 13,573 (+388.24%)
Mutual labels:  jvm-languages
Expr
Expression language for Go
Stars: ✭ 2,123 (-23.63%)
Mutual labels:  expression-evaluator
booleval
Header-only C++17 library for evaluating logical expressions.
Stars: ✭ 54 (-98.06%)
Mutual labels:  expression-evaluator

AviatorScript

Build Status Maven Central

📖 English Documentation | 📖 中文文档


AviatorScript 是一门高性能、轻量级寄宿于 JVM (包括 Android 平台)之上的脚本语言。

特性介绍

  1. 支持数字、字符串、正则表达式、布尔值、正则表达式等基本类型,完整支持所有 Java 运算符及优先级等。
  2. 函数是一等公民,支持闭包和函数式编程
  3. 内置 bigint/decmal 类型用于大整数和高精度运算,支持运算符重载得以让这些类型使用普通的算术运算符 +-*/ 参与运算。
  4. 完整的脚本语法支持,包括多行数据、条件语句、循环语句、词法作用域和异常处理等。
  5. 函数式编程结合 Sequence 抽象,便捷处理任何集合。
  6. 轻量化的模块系统
  7. 多种方式,方便地调用 Java 方法,完整支持 Java 脚本 API(方便从 Java 调用脚本)。
  8. 丰富的定制选项,可作为安全的语言沙箱和全功能语言使用。
  9. 轻量化,高性能,ASM 模式下通过直接将脚本翻译成 JVM 字节码,解释模式可运行于 Android 等非标 Java 平台。

使用场景包括:

  1. 规则判断及规则引擎
  2. 公式计算
  3. 动态脚本控制
  4. 集合数据 ELT 等 ……

推荐使用版本 5.2.6 及以上

News

  • 5.3.0解释器模式 可运行于 Android 等非标准 Java 平台。
  • 5.2.7,修复 Expression#getVariableNamesExpression#getVariableFullNames 方法存在的并发 bug等。
  • 5.2.6强烈推荐升级,修复 continue 语句无法在 if/else 或者嵌套 if 语句里正常工作的 work,增加 partial(f, &args) 函数等。

Dependency

<dependency>
  <groupId>com.googlecode.aviator</groupId>
  <artifactId>aviator</artifactId>
  <version>{version}</version>
</dependency>

可以在 search.maven.org 查看可用的版本。

快速开始

  1. 下载 aviator shell 到某个目录(最好是在系统的 PATH 环境变量内),比如 ~/bin/aviator:
$ wget https://raw.githubusercontent.com/killme2008/aviator/master/bin/aviator
$ chmod u+x aviator
  1. 执行 aviator 命令,将自动下载最新文档版本 aviator jar 到 ~/.aviatorscript 下的安装目录并运行:
$ aviator
Downloading AviatorScript now...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   153  100   153    0     0    111      0  0:00:01  0:00:01 --:--:--   111
100 1373k  100 1373k    0     0   689k      0  0:00:01  0:00:01 --:--:--  689k
Usage: java com.googlecode.aviator.Main [file] [args]
     : java com.googlecode.aviator.Main -e [script]
     : java com.googlecode.aviator.Main -v
  1. 将下面这个脚本保存为文件 hello.av:
p("Hello, AviatorScript!");

let a = tuple(1, 2, 3, 4, 5);

p("sum of a is: " + reduce(a, +, 0));

let date = new java.util.Date();
p("The year is: "+ getYear(date));
p("The month is: #{getMonth(date)}");

一个更复杂的计算器例子(求值算术表达式字符串)参见calculator.av

  1. 执行脚本:
$ aviator hello.av
Hello, AviatorScript!
sum of a is: 15
The year is: 120
The month is: 3

更详细的请阅读用户指南

Links

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].