https://github.com/crafttweaker/zenscript
https://github.com/crafttweaker/zenscript
hacktoberfest
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/crafttweaker/zenscript
- Owner: CraftTweaker
- License: mit
- Created: 2018-02-18T21:41:15.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-01-07T03:08:48.000Z (over 1 year ago)
- Last Synced: 2025-03-29T23:07:47.877Z (about 1 year ago)
- Topics: hacktoberfest
- Language: Java
- Size: 839 KB
- Stars: 81
- Watchers: 8
- Forks: 25
- Open Issues: 8
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# ZenScript library
### The goal of ZenScript was to provide a scripting system that fit several requirements:
* Be usable by people without any prior programming knowledge, for simple tasks
* Be usable for advanced tasks by experienced programmers
* Integrate easily with Java classes
* Provide sufficient syntax and libraries to integrate with its environment
* Be clear and concise in its operation
* Be typesafe, such that both small and large applications can be made with it
* It should be efficient to run
ZenScript originated from MineTweaker where I needed a simple programming
language that would allow users without programming knowledge to be able
to execute simple commands by following the tutorials for it.
Originally MineTweaker had a simple one-line-at-a-time parsed scripting system,
but it quickly became clear that it wasn't flexible enough, so a simple parsed
language was created. This parsed language worked quite well but was very
inefficient as each value was wrapped into its own object. As I wanted to
expand the capabilities, this language was not very efficient.
Additionally, it wasn't type-safe. There were no type definitions. On one hand,
this is handy, since I didn't want to bother people with types. Following the
tutorial was easy and the code was short. However, this gives a problem for the
more experienced user, wanting to go beyond the basic tutorials: what are these
values I'm working with, which properties does it have and which methods are
available no it? It's not clear.
As a balance, ZenScript allows mixed typed and typeless behavior. You don't
need to define types anywhere - the compile will infer them where possible
and exhibit typeless behavior when the type is effectively unknown. In nearly
all the cases, the type is perfectly known and execution runs at native java
speed. Since there are types, they can be documented and enforced.