Squirrel

The programming language
Welcome to Squirrel Sign in | Join | Help
Overview - What does it looks like? - License - Development state - Work in progress - Documentation - Download - Questions & feedback   - Wiki - Forum - Author -

Overview

Squirrel is a high level imperative/OO programming language, designed to be a powerful scripting tool that fits in the size, memory bandwidth, and real-time requirements of applications like games. Although Squirrel offers a wide range of features like:

  • Open Source zlib/libpng license
  • dynamic typing
  • delegation
  • classes & inheritance
  • higher order functions
  • generators
  • cooperative threads(coroutines) 
  • tail recursion
  • exception handling
  • automatic memory management (CPU bursts free; mixed approach ref counting/GC)
  • weak references
  • both compiler and virtual machine fit together in about 6k lines of C++ code.
  • optional 16bits characters strings
  • compiles on both 32 and 64 bits architectures

Squirrel is inspired by languages like Python,Javascript and expecially Lua(The API is very similar and the table code is based on the Lua one)


What does it looks like?

squirrel's syntax is similar to C/C++/Java etc... but the language has a very dynamic nature like python/Lua etc...

			

local table = {
	a = "10"
	subtable = {
		array = [1,2,3]
	},
	[10 + 123] = "expression index"
}

local array=[ 1, 2, 3, { a = 10, b = "string" } ];

foreach(i,val in array)
{
	::print("the type of val is"+typeof val);
}

/////////////////////////////////////////////


class Entity
{	
	constructor(etype,entityname)
	{
		name = entityname;
		type = etype;
	}
									
	x = 0;
	y = 0;
	z = 0;
	name = null;
	type = null;
}

function Entity::MoveTo(newx,newy,newz)
{
	x = newx;
	y = newy;
	z = newz;
}

class Player extends Entity {
	constructor(entityname)
	{
		Entity.constructor("Player",entityname)
	}
	function DoDomething()
	{
		::print("something");
	}
	
}


local newplayer = Player("da playar");

newplayer.MoveTo(100,200,300);			

License

Squirrel is released under zlib/libpng license and is completely free for both commercial and non-commercial use


Development state

    The current stable release is 2.2
    The project has been compiled and run on Windows(Windows XP/2000 on Intel x86 32 and 64 bits) and Linux(Slackware 9.0 on Intel x86 and Fedora 4 Intel x86 64bits).
    Has been tested with the following compilers:

    MS Visual C++ 6.0,7.0,7.1 and 8.0(32 and 64 bits)
    MinGW gcc 3.2 (mingw special 20020817-1)
    Cygwin gcc 3.2
    Linux gcc 3.2.3 Linux gcc 4.0 (64 bits)

    Squirrel is known to run also on MacOS X, GameCube, PSP and XBOX


    The documentation has to be improoved.

    I'd like to have some feed back and maybe help to design/port/test it.


Work in progress

In the next release(3.x):

  • new features
  • api impovements
  • performance tuning
  • additional documentation


Documentation

Squirrel 2.x

Squirrel 2.2 reference manual(PDF/HtmlHelp/Html Online)

Squirrel 2.2 Standard Libraries manual(PDF/HtmlHelp/Html Online)

both manuals are included in the language distribution


Download

stable release

You can download Squirrel 2.2 stable  here
released February 17, 2008.

Additional downloads are available in the Wiki.

Check out SQDev the new eclipse based development environment/remote debugger.


Questions & Feedback

If you want ask me something, give me some feed back, ideas or ask a question, there is a public forum on this web site.


Author

My name is Alberto Demichelis if you want to know more about me, this is my personal homepage

Who is Online

There are 5 guest(s) online. Currently there are no online users.
Powered by Community Server, by Telligent Systems