serbian

::News
Squirrel 3.0.6 stable has been released, it is an hot fix for a bug introduced in version 3.0.5.

"Squirrel is a high level imperative, object-oriented programming language, designed to be a light-weight scripting language that fits in the size, memory bandwidth, and real-time requirements of applications like video games."
  Overview

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

  • Open Source MIT licence
  • dynamic typing
  • delegation
  • classes & inheritance
  • higher order functions
  • lexical scoping
  • generators
  • cooperative threads(coroutines) 
  • tail recursion
  • exception handling
  • automatic memory management (CPU bursts free; mixed approach ref counting/GC)
  • both compiler and virtual machine fit together in about 7k lines of C++ code and add only around 100kb-150kb the executable size.
  • optional 16bits characters strings
  • powerful embedding api
    • eg. function/classes can be defined by scripts or in C
    • eg. objects can fully exist in the VM or be bound to native code
    • eg. classes created in C can be extended by scripts or vice-versa
    • and more

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


    What Does it look 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)
    	{
    		base.constructor("Player",entityname)
    	}
    	function DoDomething()
    	{
    		::print("something");
    	}
    	
    }
     
    local newplayer = Player("da playar");
     
    newplayer.MoveTo(100,200,300);			
    

    Development state
      The current stable release is 3.0.6
      The project has been compiled and run on Windows(x86 & x64), Linux(x86 & x64), Solaris(x86 & x64), Mac OS X, FreeBSD, iOS and Android.
      Has been tested with the following compilers:

      MS Visual C++ 6.0,7.0,7.1,8.0,9.0 and 10.0(x86 & x64)
      MinGW gcc 3.2 (mingw special 20020817-1)
      Cygwin gcc 3.2
      Linux gcc 3.x
      Linux gcc 4.x
      Solaris gcc 3.x
      XCode 4


      The documentation has to be improved.

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


    Work in Progress

    In the next release(3.1 stable):

    • api impovements
    • performance tuning
    • additional documentation


    Documentation

    Squirrel 3.x

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

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

    both manuals are included in the language distribution


    Squirrel 2.x

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

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

    both manuals are included in the language distribution


    Download

    stable release

    You can download Squirrel 3.0.6 stable here
    Released April 2, 2014.

    beta release

    You can download Squirrel 3.1 beta 1 here
    Released August 30, 2013.

    older 2.x stable release

    You can download Squirrel 2.2.5 stable here
    Released November 28, 2011.

    Author

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





QN SoftwareQN Software Blog