Bot releases are hidden (Show)
AviatorEvaluatorInstance#enableSandboxMode
to enable sandbox mode for security. https://github.com/killme2008/aviatorscript/commit/5de8560be9cbc88edb55c2d286cacfc97ec37b94
Full Changelog: https://github.com/killme2008/aviatorscript/compare/aviator-5.4.2...aviator-5.4.3
Published by killme2008 4 months ago
bigint/double/long
function by @shuailung in https://github.com/killme2008/aviatorscript/pull/615
Options.EVAL_TIMEOUT_MS
to set the execution timeout value in milliseconds. #629 AviatorEvaluator.setOption(Options.EVAL_TIMEOUT_MS, 100);
Throw the TimeoutException
when it exceeds. It's not precise and may hurt a little performance.
Expression#getVariableFullNames
returns the imported class names #597Expression#getFunctionNames
to get all function names in the compiled script by @killme2008 in https://github.com/killme2008/aviatorscript/pull/631
Full Changelog: https://github.com/killme2008/aviatorscript/compare/aviator-5.4.1...aviator-5.4.2
Published by killme2008 about 1 year ago
ScriptEngineFactory.getLanguageName
return aviator by @qiukeren in https://github.com/killme2008/aviatorscript/pull/525
Full Changelog: https://github.com/killme2008/aviatorscript/compare/aviator-5.3.3...aviator-5.4.1
Published by killme2008 about 1 year ago
Recommend using v5.4.1.
ScriptEngineFactory.getLanguageName
return aviator by @qiukeren in https://github.com/killme2008/aviatorscript/pull/525
Full Changelog: https://github.com/killme2008/aviatorscript/compare/aviator-5.3.3...aviator-5.4.0
Published by killme2008 almost 2 years ago
Main changes:
seq.add_all(seq1, seq2)
to add all elements of seq2
to seq1
. #500Published by killme2008 about 2 years ago
Several bugs fixed:
Expression#getVariableFullNames()
returns the class names when the script has a new
statement.Thank you for all these bug reports.
It's recommended to upgrade.
Published by killme2008 over 2 years ago
Main changes:
AviatorEvaluatorInstance.aliasOperator(OperatorType, String)
to set an alias token for logical &&
and ||
operator, read the doc.[]
index operator and seq functions performance when processing arrays.Expression#getVariableNames
returns wrong result in nested scope.AviatorEvaluator.execute(String, Map)
not work with global caching.主要改动:
AviatorEvaluatorInstance.aliasOperator(OperatorType, String)
方法用于给 &&
和 ||
逻辑运算符定义别名,比如定义成 and
或者 or
,参见文档
Expression#getVariableNames
在处理嵌套范围的时候返回错误结果AviatorEvaluator.execute(String, Map)
方法不支持全局缓存的 bugPublished by killme2008 almost 3 years ago
Release 5.3.0 officially, main changes:
TRACE_EVAL
. #408ApplicationContextAware
for SpringContextFunctionLoader
. Now SpringContextFunctionLoader
can be managed by spring container.Published by killme2008 about 3 years ago
Main changes:
Expression#getVariableNames
and Expression#getVariableFullNames
.a.b.c
dot syntax.Published by killme2008 over 3 years ago
A strongly recommended upgrading version if you are using 5.x versions.
Main changes:
continue
statement not work with if/else or nested if statements #394partial(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.seq.get
function.Published by killme2008 over 3 years ago
Main changes:
Published by killme2008 over 3 years ago
New features:
lambda ... -> ... end
), let add = fn(x, y) { x + y); add(1, 2)
for example.*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));
AVIATOR_DEPS
environment variable to point third-party jar files directory for aviator
shell command-line, default is $HOME/.aviatorscript/deps
, all jar files under this directory will be added to JVM CLASSPATH
.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.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));
Change log details.
Published by killme2008 over 3 years ago
Main changes:
AviatorString#toString()
may print warning message.is_distinct(seq)
returns true when a sequence doesn't have duplicated elements.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%
Published by killme2008 almost 4 years ago
Main changes:
Expression#getVariableNames()
and Expression#getVariableFullNames()
, they will return the global uninitialized variable names. #277 #335AviatorEvaluatorInstance#setCachedExpressionByDefault(boolean)
to configure whether to cache the compiled expression by default when invoke compile(string)
, execute(string, [env])
methods etc, default value is false. #330Options.ALLOWED_CLASS_SET
with a Set<Class>
value to control the allowed class list in new statement and static method/field invocation. #325Feature.StaticFields
and Feature.StaticMethods
. #326changelog https://www.yuque.com/boyan-avfmj/aviatorscript/bggwx2
Published by killme2008 almost 4 years ago
If you are trying 5.2.0, please upgrade to this version, sorry.
Published by killme2008 almost 4 years ago
See the 5.2.0 changelog.
Deprcated, please use 5.2.1
Published by killme2008 about 4 years ago
Main changes:
fn
syntax to define functions.AviatorEvaluatorInstance#removeModule(String)
to remove java module, and adds an example JavaModuleExample.Published by killme2008 about 4 years ago
Main changes:
**
(like ruby), for example:p(2**3); ## 8
p(2**-3); ## 0.125
The detail rule is in doc.
EnvProcessor
to process env before or after executing expression, #224Published by killme2008 about 4 years ago
A minor change:
__exp___
internal var to user pass-in env.Published by killme2008 about 4 years ago
==
/!=
operator can't work with variable syntax suger such as a.b.c
, it may returns wrong result.It's a recommended version to upgrade if you are using 5.x versions.