Skip to content

Releases: killme2008/aviatorscript

[Deprecated] AviatorScript 5.0.1

03 Jun 12:19
Compare
Choose a tag to compare

Main changes:

  • Tweak variable accessing performance #238
  • Fixed can't overload assignment/define operator #245
  • Fixed function arguments( enabled by Opitons.CAPTURE_FUNCTION_ARGS) are wrong when invoking more than one functions.#236
  • Fixed array accessing operator can't work with Options.ALWAYS_PARSE_INTEGRAL_NUMBER_INTO_DECIMAL #237
  • Adds new function eval(script, [bindings], [cached]) to execute a script text string with binding map in scripts.
  • Adds overload functions reader(input_stream, [charset]) and writer(output_stream, [charset]) to IO module.

[Deprecated] Aviator 5.0.0 releases

26 Apr 13:35
Compare
Choose a tag to compare

Deprecated, please use 5.2.6 and above versions.

I am happy to announce that AviatorScript 5.0.0 is released. Main changes since 5.0.0-RC2:

  • Adds main class com.googlecode.aviator.Main to execute aviator scripts.
  • Adds bootstrap shell script aviator to wrap the main class and download/upgrade logics. See doc how to use it.
  • count(nil) returns 0 instead of throwing an exception.
  • AviatorFunction extends java Runnable and Callable interface, now you can pass a aviator function to Thread constructor:
let t = new Thread(lambda() -> p('run'); end);
start(t);
  • Fixed some bugs:
    • try statement can't only be with finally without catch statements.
    • NPE in parser.

[Deprecated] AviatorScript 5.0.0-RC2

22 Apr 13:17
Compare
Choose a tag to compare

Main changes:

  • new Class(args) statement to create an instance of special class with arguments, for example:
let s = new String("test");
p(type(s)); ## print string
  • throw exception statement to throw an exception.
  • try/catch/finally statement to handle exceptions, for example:
   try {
       throw "an exception";
   } catch(e) {
       pst(e);
   } finally {
       p("finally");
   }
  • Fixed #228 can't run on IBM jdk.
  • Fixed Opitons.MAX_LOOP_COUNT.
  • Make seq.get to support List.
  • AviatorEvaluatorInstance#aliasFunction(name, alias) to alias a function.
  • New function pst(e) to print stacktrace of an exception.
  • Alias function println to p.
  • Every statement has a value:
let a = if(true) {
   2
};

p(a);  ## print 2
  • Breaking changes:
    • Checking equality of two different types x == y or x !=y doesn't throw an exception any more but returns false.

[Deprecated] AviatorScript 5.0.0-RC1

12 Apr 03:56
Compare
Choose a tag to compare

Main changes since 5.0.0-beta2:

  • Release Programming AviatorScript 5.0 doc in chinese.
  • Options. MAX_LOOP_COUNT to control max loop count in for/while/sequence-iterate loop, default zero means no limitation.
  • Fixed __MODULE__.exports can't be assigned.
  • Use absolute file path as module caching key.
  • Fixed number overflow parsing error #219, thanks to @H123R
  • seq.get supports java.util.Set, return the element itself if it is in set, otherwise returns nil.
  • Reset classloader when calling AviatorEvaluatorInstance#clearExpressionCache().
  • Adds new method to set classloader AviatorEvaluatorInstance#setAviatorClassLoader(classloader)
  • Adds LRU cache for expression caching, enable it by AviatorEvaluatorInstance#useLRUExpressionCache(capacity).
  • Make parser token and avaitor objects implements Serializable interface #209
  • Remove global lock in BeanUtilsBean.getInstance by a bean cache. #222
  • Impl java scripting SPI #198 , supports Invocable and refactor script engine, see the programming doc.
  • New option Options.FEATURE_SET to set engine's syntax feature, valid features are listed in Feature enum.Default set is full feature set.
  • New functions:
    • seq.entry(key, value) to create a Map.Entry.
    • into(to_coll, from_coll) to add all elements in from_coll into to_coll by seq.add(to_coll, element).
    • bigint(x) to cast a value into bigint type.
    • decimal(x) to cast a value into decimal type.
  • Breaking changes:
    • Remove Options.ALWAYS_USE_DOUBLE_AS_DECIMAL, already replaced by Options. ALWAYS_USE_DECIMAL_AS_FLOATING_POINT_NUMBER.
    • Remove Options.TRACE, not supported any more.
    • Remove Options.DISABLE_ASSIGNMENT, please use feature API.
    • Default syntax feature set is full-featured, if you want to be compatible with old versions(before 5.0.0), please setOption(Options.FEATURE_SET, Feature.getCompatibleFeatures()), then the engine only supports assignment, lambda and internal variables, if/for/while/let etc. features are disabled.

AviatorScript 5.0.0-beta2

26 Mar 03:52
Compare
Choose a tag to compare
Pre-release

Main changes:

  • More examples for AviatorScript.
  • Fixed issue #212 in scopes for variable assignment.
  • A simple IO module, see example file_io.av.
  • A new method AviatorEvaluatorInstance#addModule to register custom modules.
  • Refactor sequence/reducer impl, and now string is a sequence too:
let s = "hello";
for c in s {
  println(c);
}

println(filter(s, seq.eq('l')));
  • New functions: type(x) to return x's type, is_def(x) returns true when variable x is defined, undef(x) to forgot a defined variable.
  • Performance turning: almost 60% speedup in quick-sort benchmark.
  • include(seq, x) is O(1) time complexity for java.util.Set now #214

AviatorScript 5.0.0-beta1

08 Mar 06:59
Compare
Choose a tag to compare
Pre-release

Since 5.0.0, aviator becomes a general-purpose scripting language, new features:

• Lexical scope by { }
return statement to return a value in a function or script.
if/elsif/else statement
for loop statement and supports break , continue
while loop statement
let to define lexical variable
fn syntax to define named function
## a comment for single line comment

Please see the documents AviatorScript UserGuide (in progress).

Breaking changes: TODO

You can try the examples by running RunScriptExample. All the examples are under examples folder.

Aviator 4.2.10 released

18 Feb 03:22
Compare
Choose a tag to compare

Main changes:

  • Added a new helper method AviatorEvaluator.newEnv(k1, v1, k2, v2, ...) to create an environment map.
  • Supports assigning value to object's property such as bean.x = y.
  • FIxed parsing scientific notation number error with Options.ALWAYS_PARSE_FLOATING_POINT_NUM #191
  • Allows new line(\r or \r\n) breaker in expression. #191
  • Function can be found by object's property syntax #191 , for example
m = seq.map('square', lambda(x)-> x*x end); 
m.square(100.0)

Aviator 4.2.9 released

02 Jan 07:21
Compare
Choose a tag to compare

Main changes:

  • Bug fixes:
    • Stackoverflow when calling AviatorFunction#toString, #184
    • getVariableNames result contains true/false/nil, #186
  • New features:
    • Supports array/list element assignment such as x[i]=y #187

Aviator 4.2.8 released

19 Dec 04:03
Compare
Choose a tag to compare

Main changes:

  • Fixed #181
  • Wraps function returned value to ensure it's not null (replaced by AviatorNil automatically). For example, it will throw a NullPointerException on runtime if the custom function returns java's null right now, you should return AviatorNil.Nil instead. But with this improvement, you can just return the null in custom functions, aviator will replace the null with AviatorNil automatically for you.

Aviator 4.2.7 released

04 Dec 03:48
Compare
Choose a tag to compare

Main changes:

  • Fixed parser bug #177