Releases: killme2008/aviatorscript
Releases · killme2008/aviatorscript
AviatorScript 5.4.1
What's Changed
- compelet the compile api by @DangHT in #504
- fix typo by @nesuk in #516
- set
ScriptEngineFactory.getLanguageName
return aviator by @qiukeren in #525 - Improve class cache performance when class not found by @jiudc in #522
- fix: capitalize java bean property names
by @killme2008 in #540 - feat: impl serialization for compiled expression by @killme2008 in #524, close #451
- fix: elsif parser by @killme2008 in #574, close #554 #566
- (fix): check innerClazz while get property by @human-user in #571
- fix: recursive function can't work #568
New Contributors
- @DangHT made their first contribution in #504
- @nesuk made their first contribution in #516
- @qiukeren made their first contribution in #525
- @jiudc made their first contribution in #522
- @human-user made their first contribution in #571
Full Changelog: aviator-5.3.3...aviator-5.4.1
AviatorScript 5.3.3
AviatorScript 5.3.2
Several bugs fixed:
- #466 constant folding do not work when operator is overrided
- #484 Stackoverflow in ArrayUtils
- #483 A corner case in parser.
- #476
Expression#getVariableFullNames()
returns the class names when the script has anew
statement.
Thank you for all these bug reports.
It's recommended to upgrade.
AviatorScript 5.3.1
Main changes:
- Adds new method
AviatorEvaluatorInstance.aliasOperator(OperatorType, String)
to set an alias token for logical&&
and||
operator, read the doc. - Improve
[]
index operator and seq functions performance when processing arrays. - Fixed #431
Expression#getVariableNames
returns wrong result in nested scope. - Fixed
AviatorEvaluator.execute(String, Map)
not work with global caching.
主要改动:
AviatorScript 5.3.0
Release 5.3.0 officially, main changes:
- Supports interpreter mode, you can use aviatorscript on android(or other not-standard JVM) right now. See InterpreterExample and doc. #403 #334 #29
- Fixed assign and define operator can't work when enable
TRACE_EVAL
. #408 - Implements
ApplicationContextAware
forSpringContextFunctionLoader
. NowSpringContextFunctionLoader
can be managed by spring container.
AviatorScript 5.2.7
Main changes:
- Fixed a concurrent issue in
Expression#getVariableNames
andExpression#getVariableFullNames
. - Should throw no such property exception if property not found when using variable
a.b.c
dot syntax.
AviatorScript 5.2.6
A strongly recommended upgrading version if you are using 5.x versions.
Main changes:
- Fixed:
- New features:
- New function:
partial(f, &args)
that takes a function f and fewer than the normal arguments to f, and returns a fn that takes a variable number of additional args. When called, the returned function calls f with args + additional args. - Use soft reference for caching reflection result #386
- Added key info to exception message when sequence is null in
seq.get
function.
- New function:
[Deprecated] AviatorScript 5.2.5
Main changes:
[Deprecated] AviatorScript 5.2.4
New features:
- Define anonymous function by fn syntax (instead of
lambda ... -> ... end
),let add = fn(x, y) { x + y); add(1, 2)
for example. - Unpacking arguments(as sequence) by
*args
syntax like python, for example:
fn test(a, b, c, d) {
a * b + c * d
}
let a = tuple(1, 2);
let list = seq.list(3, 4);
p(test(*a, *list));
- Adds
AVIATOR_DEPS
environment variable to point third-party jar files directory foraviator
shell command-line, default is$HOME/.aviatorscript/deps
, all jar files under this directory will be added to JVMCLASSPATH
. - Improve for statement, supports index( List/Array sequence etc.) and key/value(Map) iterating:
let a = tuple(1, 2, 3, 4, 5, 6, 7, 8, 9);
for i, x in a {
assert(i + 1 == x);
}
let m = seq.map("a", 1, "b", 2, "c", 3);
for k, v in m {
if k == "a" {
assert(v == 1);
}elsif k == 'b' {
assert(v == 2);
}elsif k == 'c' {
assert(v == 3);
}else {
throw "should not happen";
}
}
seq.array_of(Class, dimension1, dimension2, ...dimensions)
to create a multidimensional array.- New functions to add/retrieve/remove object's metadata:
let a = 1;
## retrieve meta ,null if not found
p(meta(a));
## associate key/value metadata to any objects by with_meta(obj, key, value)
a = with_meta(a, "key", tuple(1, 2, 3));
p(meta(a)); ## {"key" => [1, 2, 3]}
p(meta(a, "key")); ## [1, 2, 3]
## remove metadata by without_meta(obj, key)
a = without_meta(a, "key");
p(meta(a));
- Bugs fixed:
- Wrong size number of Range .
- JUnit dependency issue, Thanks to DQinYuan
Change log details.
[Deprecated] AviatorScript 5.2.3
Main changes:
- Removed commons-beanutils #340
- Fixed
AviatorString#toString()
may print warning message. - Fixed missing source file and line number in string interpolation expression when throws exception.
- New function
is_distinct(seq)
returns true when a sequence doesn't have duplicated elements. - Focus on performance turning
Aviator 5.2.3:
Benchmark Mode Cnt Score Error Units
PerfBenchmark.testArith thrpt 5 108126.155 ± 6304.752 ops/ms
PerfBenchmark.testArithByAviator thrpt 5 2565.933 ± 105.076 ops/ms
PerfBenchmark.testArithByBeetl thrpt 5 1625.887 ± 291.247 ops/ms
PerfBenchmark.testArithByScript thrpt 5 7050.305 ± 69.529 ops/ms
PerfBenchmark.testCond thrpt 5 93099.759 ± 8554.585 ops/ms
PerfBenchmark.testCondByAviator thrpt 5 1667.093 ± 112.807 ops/ms
PerfBenchmark.testCondByBeetl thrpt 5 1617.045 ± 93.373 ops/ms
PerfBenchmark.testCondByScript thrpt 5 6926.106 ± 267.292 ops/ms
PerfBenchmark.testObject thrpt 5 8537.937 ± 272.512 ops/ms
PerfBenchmark.testObjectByAviator thrpt 5 1025.725 ± 30.846 ops/ms
PerfBenchmark.testObjectByBeetl thrpt 5 860.873 ± 33.559 ops/ms
PerfBenchmark.testObjectByScript thrpt 5 4552.307 ± 199.507 ops/ms
Aviator 5.2.2:
Benchmark Mode Cnt Score Error Units
PerfBenchmark.testArith thrpt 5 105095.308 ± 3861.646 ops/ms
PerfBenchmark.testArithByAviator thrpt 5 2405.785 ± 78.325 ops/ms
PerfBenchmark.testArithByBeetl thrpt 5 1628.726 ± 45.332 ops/ms
PerfBenchmark.testArithByScript thrpt 5 7513.704 ± 286.090 ops/ms
PerfBenchmark.testCond thrpt 5 92518.914 ± 1961.141 ops/ms
PerfBenchmark.testCondByAviator thrpt 5 952.022 ± 32.184 ops/ms
PerfBenchmark.testCondByBeetl thrpt 5 1647.736 ± 19.300 ops/ms
PerfBenchmark.testCondByScript thrpt 5 7631.465 ± 404.298 ops/ms
PerfBenchmark.testObject thrpt 5 8847.069 ± 261.799 ops/ms
PerfBenchmark.testObjectByAviator thrpt 5 873.944 ± 26.327 ops/ms
PerfBenchmark.testObjectByBeetl thrpt 5 826.758 ± 30.071 ops/ms
PerfBenchmark.testObjectByScript thrpt 5 4647.178 ± 237.783 ops/ms
• Benchmark improvements:
• testArithByAviator 6.7%
• testCondByAviator 75%
• testObjectByAviator 17.4%