What is Monster?
Monster Script (or just Monster) is an advanced scripting language
made for game programming.
(Or it will be, when it is finished.)
Monster is an object oriented programming language with syntax
similar to D, C++ and Java. It is a byte-code compiled language (like
Java) and scripts must be run through a virtual machine (VM). Rather
than being a stand-alone program, however, the Monster VM is a
library. It is meant to be integrated into an existing client program
(written in D or C++, for example), where the VM runs side-by-side
with "native" code.
Monster is meant to be a control language - it should give you a
simple but flexible language to express high-level behavior, and let
you put the low-level "back end" code in native code. Exactly where
you draw the line between scripted code and native code is up to
you.
The Monster compiler and VM are written entirely in the D programming language, but
bindings to C++ are included. You do not need a D compiler og any
knowledge of D to use Monster in C++. The language is still in the
early stages of development, and many key features are not implemented
yet. However, I have clear goals for what Monster should become:
- Easy but powerful. Through its high-level focus and
clean syntax, Monster should give a simplified and intuitive way of
defining object behavior. Simplicity gives faster development times,
fewer bugs and more maintainable code. At the same time, the language
should be powerful enough to let every important aspect of a game or
program be implemented completely in script language.
- Focused on what, not on how. Monster aims to
be a high-level control language with a focus on game logic and
interaction between objects. Implementation details, such as hardware
access, file I/O, concurrency, memory management and even networking
should all be handled behind the scenes and be transparent to the
script programmer.
- Easily plugged into any application. Monster will let you
tie your script code in with your native program through a completely
customized interface. The Monster language and the library should be
flexible with regard to architecture and programming language. It
should be fully independent of any specific game or graphics engine
and adaptable to any system. Even though Monster is designed as a game
language, it should not be limited to any specific use.
- Secure and extendable. Community developed game
modifications have become very popular in recent years. Setting up an
environment where user extensions are both natural, powerful and
secure at the same time, is one of the chief aims of the Monster
language. The OO nature of Monster will mean that all code can be
easily extended by using subclasses and polymorphism.
- Platform independent. The Monster code base will support
various computer platforms. Script code will be truly platform
independent, in the sense that code written on any platform will run
on any other supported platform without recompiling.
Short example
import io;
writeln("Hello world! ", 1, 2, 3);
A more 'classy' example
This example uses a class and a function to get the same result:
class Hello;
import io;
char[] string = "Hello world!";
int a = 1;
main()
{
int b = 2;
writeln(string, a, b, 3);
}
More examples
You'll find more examples, code snippets and tutorials in the Monster wiki.