qscript 0.7.2

A Simple Scripting Language


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

QScript

A fast, static typed, scripting language, with a syntax similar to D Language.

Setting it up

To add QScript to your dub package or project, run this in your dub package's directory:

dub add qscript

After adding that, look at the source/demo.d to see how to use the QScript class to execute scripts.

Getting Started

To get started on using QScript, see the following documents:

  • spec/syntax.md - Contains the specification for QScript's syntax.
  • spec/functions.md- Contains a list of predefined QScript functions.
  • source/demo.d- A demo usage of QScript in D langauage. Shows how to add new functions
  • examples/ - Contains some scripts showing how to write scripts.

The code is thoroughly documented. Separate documentation can be found here.

Building Demo

To be able to run basic scripts, you can build the demo using:

dub build -c=demo -b=release

This will create an executable named demo in the directory. To run a script through it, do:

./demo path/to/script

You can also use the demo build to see the generated NaVM byte code for your scripts using:

./demo "path/to/script" "output/bytecode/file/path"

Features

  1. Simple syntax
  2. Dynamic arrays
  3. Fast execution
  4. Static typed
  5. Function overloading
  6. References

TODO For Upcoming Versions

Coming in next version:

  1. Structs
  2. Enums
  3. Global Variables
  4. Scripts as libraries for other scripts

Planned for sometime later:

  1. bitshift operators
  2. More data types

Hello World

This is how a hello world would look like in QScript. For more examples, see examples/.

function void main(){
	writeln ("Hello World!");
}

writeln is not included in QScript, programs that use QScript are to provide their own functions, QScript only provides the very basic functions. However, writeln is provided in the demo program so any example scripts can be run using that

Authors:
  • Nafees Hassan
Dependencies:
utils, navm
Versions:
0.7.2 2020-Oct-27
0.7.1 2020-Mar-14
0.7.0 2020-Jan-31
0.6.12 2020-Jan-13
0.6.11 2019-Dec-31
Show all 21 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 123 downloads total

Score:
2.0
Short URL:
qscript.dub.pm