# aviatorscript
**Repository Path**: blake2002/aviatorscript
## Basic Information
- **Project Name**: aviatorscript
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: LGPL-3.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-03-12
- **Last Updated**: 2024-07-01
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# AviatorScript
[](https://travis-ci.org/killme2008/aviatorscript)
[](https://lgtm.com/projects/g/killme2008/aviator/context:java)
[](https://search.maven.org/search?q=g:com.googlecode.aviator%20AND%20aviator)
📖 English Documentation | [📖 䏿–‡æ–‡æ¡£](README.md)
----------------------------------------
`AviatorScript` is a lightweight, high performance scripting language hosted on the JVM.
It compiles script to java byte code and evaluate it on the fly.
# Feature Intro
1. Suppport number,string, boolean and regular expression etc. [basic types](https://www.yuque.com/boyan-avfmj/aviatorscript/lvabnw?translate=en),support all java operators and their priorities.
2. [Function](https://www.yuque.com/boyan-avfmj/aviatorscript/gl2p0q?translate=en) is first-class, supports closure and functional programming.
2. Supports bigint/decmal for big integer and big decimal operations, using normal arithmetic operators `+-*/` by [operator overloading](https://www.yuque.com/boyan-avfmj/aviatorscript/ydllav?translate=en#5hq4k).
3. Full-featured scripting language syntax, such as multi statements, conditional statement ,`for/while` loop, lexical scope and exception handling.
4. Processing collections/array conveniently by [sequence abstract](https://www.yuque.com/boyan-avfmj/aviatorscript/yc4l93?translate=en) and [functional programming](https://www.yuque.com/boyan-avfmj/aviatorscript/ksghfc?translate=en).
5. Lightweight [module system](https://www.yuque.com/boyan-avfmj/aviatorscript/rqra81?translate=en)。
6. [Call Java methods](https://www.yuque.com/boyan-avfmj/aviatorscript/xbdgg2?translate=en) conveniently,supports Java [Scripting API](https://www.yuque.com/boyan-avfmj/aviatorscript/bds23b?translate=en)。
7. A wide range of customization options to be used as a secure runtime scripting sandbox or full-featured scripting language.
8. Lightweight and high performance.
# News
* [5.2.4](https://github.com/killme2008/aviator/releases/tag/aviator-5.2.4),unpacking arguments, define anonymous by `fn` and improve `for` statement etc.
* [5.2.3](https://github.com/killme2008/aviator/releases/tag/aviator-5.2.3),Removed commons-beantuils dependency, performance turning and fixed `AviatorString#toString` print warn log etc.
* [5.2.2](https://github.com/killme2008/aviator/releases/tag/aviator-5.2.2),Fixed `Expression#getVariableNames()` returns wrong result, added `Feature.StaticMethods`, `Feature.StaticFields` etc.
# Dependency
```xml
com.googlecode.aviator
aviator
{version}
```
Check available versions at [search.maven.org](https://search.maven.org/search?q=g:com.googlecode.aviator%20AND%20a:aviator&core=gav).
# Quick Start
1. Download [aviator](https://raw.githubusercontent.com/killme2008/aviator/master/bin/aviator) shell script to a directory in system `PATH` environment variable,such as `~/bin/aviator`:
```sh
$ wget https://raw.githubusercontent.com/killme2008/aviator/master/bin/aviator
$ chmod u+x aviator
```
2. Execute `aviator` command,it will download the latest aviator jar to `~/.aviatorscript` directory:
```sh
$ 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
```
3. Save the script below in file `hello.av`:
```js
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)}");
```
4. Execute the script with `aviator` command:
```sh
$ aviator hello.av
Hello, AviatorScript!
sum of a is: 15
The year is: 120
The month is: 3
```
See [user guide](https://www.yuque.com/boyan-avfmj/aviatorscript/cpow90?translate=en) for details.
# Links
* downloads:
* documents:
* javadoc:
* author: dennis (killme2008@gmail.com)
* spring boot: