![]() | This is not a Wikipedia article: It is an individual user's work-in-progress page, and may be incomplete and/or unreliable. For guidance on developing this draft, see
Wikipedia:So you made a userspace draft. Find sources:
Google (
books ·
news ·
scholar ·
free images ·
WP refs) ·
FENS ·
JSTOR ·
TWL |
Paradigm | Multi-paradigm: scripting, imperative, functional, object-oriented |
---|---|
First appeared | 2003 |
Stable release | 2.41.0
/ August 7, 2012 |
Typing discipline | Static |
OS | Cross-platform |
License | zlib License |
Filename extensions | .as |
Website | angelcode.com/angelscript |
Influenced by | |
C++ |
AngelScript is a scripting language designed to be inside C/C++ applications and games. AngelScript released as open source in permissive zlib license. It is cross-platform and known to work with many platforms and compilers. [1]
Library appeared in 2003, and still actively maintained.
Comments
// a single line comment start withs to slashes
/*
A multi-line comments start with slash and an asterisk, ends with slash and an asterisk
*/
Functions
void Foo()
{
// statements
}
Loops
for(uint i=0; i < 10; ++i)
{
//statements
}
while(boolean_var)
{
// statements
}
do
{
// statements
}while(boolean_var)
Classes
AngelScript supports object-oriented programming.
It has single inheritance for classes, and polymorphism with interfaces.
class Base
{
Base() // constructor
{
foo = 53;
}
int foo;
float Bar()
{
// statements
}
}; // semicolon optional
class Child : Base // inherits base
{
Child()
{
Base::Base(); // call Base constructor
}
~Child() // destructor. all methods are virtual
{
// statements
}
}
Handles
Handles are AngelScript's way of handling pointers.
Handles may be passed between script Virtual Machine and application without any change in address they point at.
Handles do not have pointer arithmetic.
Handles are reference counted. They are released when not needed automatically.
An incremental Garbage collector (computing) exists to resolve possible circular references.
Object obj;
Object @handle = obj; // handle holds a reference to obj
Object @handle2 = null; // handle2 is null. null is a built-in value that all handles can take
@handle2 = handle; // handle2 now holds reference to obj
@handle = null; // handle is now null. handle2 still holds reference to obj.
/* obj will not be released until handle2 is destroyed or has reference to another Object. */
![]() | This is not a Wikipedia article: It is an individual user's work-in-progress page, and may be incomplete and/or unreliable. For guidance on developing this draft, see
Wikipedia:So you made a userspace draft. Find sources:
Google (
books ·
news ·
scholar ·
free images ·
WP refs) ·
FENS ·
JSTOR ·
TWL |
Paradigm | Multi-paradigm: scripting, imperative, functional, object-oriented |
---|---|
First appeared | 2003 |
Stable release | 2.41.0
/ August 7, 2012 |
Typing discipline | Static |
OS | Cross-platform |
License | zlib License |
Filename extensions | .as |
Website | angelcode.com/angelscript |
Influenced by | |
C++ |
AngelScript is a scripting language designed to be inside C/C++ applications and games. AngelScript released as open source in permissive zlib license. It is cross-platform and known to work with many platforms and compilers. [1]
Library appeared in 2003, and still actively maintained.
Comments
// a single line comment start withs to slashes
/*
A multi-line comments start with slash and an asterisk, ends with slash and an asterisk
*/
Functions
void Foo()
{
// statements
}
Loops
for(uint i=0; i < 10; ++i)
{
//statements
}
while(boolean_var)
{
// statements
}
do
{
// statements
}while(boolean_var)
Classes
AngelScript supports object-oriented programming.
It has single inheritance for classes, and polymorphism with interfaces.
class Base
{
Base() // constructor
{
foo = 53;
}
int foo;
float Bar()
{
// statements
}
}; // semicolon optional
class Child : Base // inherits base
{
Child()
{
Base::Base(); // call Base constructor
}
~Child() // destructor. all methods are virtual
{
// statements
}
}
Handles
Handles are AngelScript's way of handling pointers.
Handles may be passed between script Virtual Machine and application without any change in address they point at.
Handles do not have pointer arithmetic.
Handles are reference counted. They are released when not needed automatically.
An incremental Garbage collector (computing) exists to resolve possible circular references.
Object obj;
Object @handle = obj; // handle holds a reference to obj
Object @handle2 = null; // handle2 is null. null is a built-in value that all handles can take
@handle2 = handle; // handle2 now holds reference to obj
@handle = null; // handle is now null. handle2 still holds reference to obj.
/* obj will not be released until handle2 is destroyed or has reference to another Object. */