{"id":13511826,"url":"https://github.com/killme2008/aviatorscript","last_synced_at":"2025-04-09T03:09:23.870Z","repository":{"id":37640617,"uuid":"1541275","full_name":"killme2008/aviatorscript","owner":"killme2008","description":"A high performance scripting language hosted on the JVM.","archived":false,"fork":false,"pushed_at":"2024-07-30T21:45:10.000Z","size":13142,"stargazers_count":4781,"open_issues_count":64,"forks_count":871,"subscribers_count":172,"default_branch":"master","last_synced_at":"2025-04-02T02:08:55.405Z","etag":null,"topics":["aviatorscript","expression-evaluator","java","jvm-languages","programming-language","scripting-language"],"latest_commit_sha":null,"homepage":"http://fnil.net/aviator/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/killme2008.png","metadata":{"files":{"readme":"README-EN.md","changelog":null,"contributing":null,"funding":null,"license":"licenses.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-03-29T12:48:47.000Z","updated_at":"2025-04-01T02:16:27.000Z","dependencies_parsed_at":"2023-10-02T21:21:47.939Z","dependency_job_id":"22163d6f-9795-4df1-aebb-250146db5ac1","html_url":"https://github.com/killme2008/aviatorscript","commit_stats":{"total_commits":738,"total_committers":22,"mean_commits":33.54545454545455,"dds":0.07317073170731703,"last_synced_commit":"6426d8710742947af228cc6a802d47ec6313fd03"},"previous_names":["killme2008/aviator"],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killme2008%2Faviatorscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killme2008%2Faviatorscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killme2008%2Faviatorscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killme2008%2Faviatorscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/killme2008","download_url":"https://codeload.github.com/killme2008/aviatorscript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247968280,"owners_count":21025822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aviatorscript","expression-evaluator","java","jvm-languages","programming-language","scripting-language"],"created_at":"2024-08-01T03:01:12.546Z","updated_at":"2025-04-09T03:09:23.845Z","avatar_url":"https://github.com/killme2008.png","language":"Java","readme":"# AviatorScript\n\n![Build Status](https://github.com/killme2008/aviatorscript/actions/workflows/maven.yml/badge.svg)\n[![Maven Central](https://img.shields.io/maven-central/v/com.googlecode.aviator/aviator.svg?label=maven%20central)](https://search.maven.org/search?q=g:com.googlecode.aviator%20AND%20aviator)\n\n📖 English Documentation | [📖 中文文档](README.md)\n\n----------------------------------------\n\n`AviatorScript` is a lightweight, high performance scripting language hosted on the JVM (and Android platform).\nIt compiles script to java byte code and evaluate it on the fly.\n\n**It's not a game, it's a programming language. Please refrain from sending me any more unsolicited emails.RTFM**\n\n# Feature Intro\n\n1. Supports basic types such as numbers, strings, regular expressions, booleans, and more. Full support for all Java operators and precedence, etc. [Basic Types](https://www.yuque.com/boyan-avfmj/aviatorscript/lvabnw).\n2. [Functions](https://www.yuque.com/boyan-avfmj/aviatorscript/gl2p0q) are first-class, supporting [closures and functional programming](https://www.yuque.com/boyan-avfmj/aviatorscript/ksghfc).\n3. Built-in [bigint](https://www.yuque.com/boyan-avfmj/aviatorscript/lvabnw#a0Ifn)/[decimal](https://www.yuque.com/boyan-avfmj/aviatorscript/lvabnw#QbV7z) types for large integers and high-precision calculations. Supports [operator overloading](https://www.yuque.com/boyan-avfmj/aviatorscript/ydllav#5hq4k) to allow these types to use common arithmetic operators `+-*/`.\n4. Full script syntax support, including multiline data, conditional statements, loop statements, lexical scoping, and exception handling.\n5. [Functional programming](https://www.yuque.com/boyan-avfmj/aviatorscript/ksghfc) combined with [Sequence abstraction](https://www.yuque.com/boyan-avfmj/aviatorscript/yc4l93) for convenient collection handling.\n6. Lightweight [module system](https://www.yuque.com/boyan-avfmj/aviatorscript/rqra81).\n7. Multiple ways to easily [call Java methods](https://www.yuque.com/boyan-avfmj/aviatorscript/xbdgg2), with full support for the Java [script API](https://www.yuque.com/boyan-avfmj/aviatorscript/bds23b) (facilitating script calls from Java).\n8. Rich [customization options](https://www.yuque.com/boyan-avfmj/aviatorscript/yr1oau), usable as a secure language sandbox and a fully featured language.\n9. Dynamic compilation and execution, lightweight, and high performance. In ASM mode, it directly compiles scripts into JVM bytecode. [Interpretation mode](https://www.yuque.com/boyan-avfmj/aviatorscript/ok8agx) can run on non-standard Java platforms like Android.\n10. Supports [serialization of compiled results](https://github.com/killme2008/aviatorscript/blob/master/src/test/java/com/googlecode/aviator/example/SerializeExample.java), facilitating caching and compiling acceleration. Supports [execution timeout settings](https://github.com/killme2008/aviatorscript/blob/master/src/test/java/com/googlecode/aviator/example/TimeoutExample.java) to prevent resource exhaustion by disruptive scripts.\n\n\n**Recommend version 5.2.6 and above.**\n\n# News\n\n* [5.4.3](https://github.com/killme2008/aviatorscript/releases/tag/aviator-5.4.3)，add the `enableSandboxMode` to enable sandbox mode etc.\n* [5.4.2](https://github.com/killme2008/aviatorscript/releases/tag/aviator-5.4.2)，add the `getFunctionNames` method to retrieve a list of functions and set the evaluation timeout, etc.\n* [5.4.1](https://github.com/killme2008/aviatorscript/releases/tag/aviator-5.4.1)，Fixed recursive function can't work, fixed function can't be serialized etc.\n\n# Dependency\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.googlecode.aviator\u003c/groupId\u003e\n  \u003cartifactId\u003eaviator\u003c/artifactId\u003e\n  \u003cversion\u003e{version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nCheck available versions at [search.maven.org](https://search.maven.org/search?q=g:com.googlecode.aviator%20AND%20a:aviator\u0026core=gav).\n\n# Quick Start\n\n1. 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`:\n\n```sh\n$ wget https://raw.githubusercontent.com/killme2008/aviator/master/bin/aviator\n$ chmod u+x aviator\n```\n\n2. Execute  `aviator`   command，it will download the latest aviator jar to  `~/.aviatorscript`  directory：\n\n```sh\n$ aviator\nDownloading AviatorScript now...\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100   153  100   153    0     0    111      0  0:00:01  0:00:01 --:--:--   111\n100 1373k  100 1373k    0     0   689k      0  0:00:01  0:00:01 --:--:--  689k\nUsage: java com.googlecode.aviator.Main [file] [args]\n     : java com.googlecode.aviator.Main -e [script]\n     : java com.googlecode.aviator.Main -v\n```\n\n3. Save the script below in file `hello.av`:\n\n```js\np(\"Hello, AviatorScript!\");\n\nlet a = tuple(1, 2, 3, 4, 5);\n\np(\"sum of a is: \" + reduce(a, +, 0));\n\nlet date = new java.util.Date();\np(\"The year is: \"+ getYear(date));\np(\"The month is: #{getMonth(date)}\");\n```\n\n4. Execute the script with `aviator`  command：\n\n```sh\n$ aviator hello.av\nHello, AviatorScript!\nsum of a is: 15\nThe year is: 120\nThe month is: 3\n```\n\nA complex example is [calculator.av](https://github.com/killme2008/aviatorscript/blob/master/examples/calculator.av) which evaluates arithmetic expression in string.\n\nRead [user guide](https://www.yuque.com/boyan-avfmj/aviatorscript/cpow90?translate=en) for details.\n\n\n# Links\n\n* Releases: \u003chttps://github.com/killme2008/aviator/releases\u003e\n* Documents: \u003chttps://www.yuque.com/boyan-avfmj/aviatorscript\u003e\n* Changelog: \u003chttps://www.yuque.com/boyan-avfmj/aviatorscript/bggwx2\u003e\n* Javadoc: \u003chttp://fnil.net/aviator/apidocs/\u003e\n* Spring boot rule: \u003chttps://github.com/mengxiangrui007/spring-boot-rule-jsr94\u003e\n* Idea plugin: \u003chttps://github.com/yanchangyou/aviatorscript-ideaplugin\u003e\n","funding_links":[],"categories":["Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkillme2008%2Faviatorscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkillme2008%2Faviatorscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkillme2008%2Faviatorscript/lists"}