Trisha Shetty (Editor)

Squirrel (programming language)

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Designed by
  
Alberto Demichelis

Typing discipline
  
Dynamic

First appeared
  
2003

OS
  
Cross-platform

Paradigm
  
Multi-paradigm: scripting, imperative, functional, object-oriented

Stable release
  
3.1 / March 27, 2016 (2016-03-27)

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 and hardware such as Electric Imp.

Contents

MirthKit, a simple toolkit for making and distributing open source, cross-platform 2D games, uses Squirrel for its platform. It is used extensively by Code::Blocks for scripting and was also used in Final Fantasy Crystal Chronicles: My Life as a King. It is also used in Left 4 Dead 2, Portal 2 and Thimbleweed Park for scripted events.

Language features

  • Dynamic typing
  • Delegation
  • Classes, inheritance
  • Higher order functions
  • Generators
  • Cooperative threads (coroutines)
  • Tail recursion
  • Exception handling
  • Automatic memory management (mainly reference counting with backup garbage collector)
  • Weak references
  • Both compiler and virtual machine fit together in about 7k lines of C++ code
  • Optional 16-bit character strings
  • Syntax

    Squirrel uses a C-like syntax.

    Factorial in Squirrel
    Generators
    Classes and inheritance

    Non-game applications using Squirrel

  • Electric Imp
  • Attract Mode
  • Enduro/X Cluster Application server
  • ICRTouch TouchPoint 2013 and Above EPOS Program for Touch Screen Till Systems - Badged as Etal for Dealers to make custom changes to the operation and functionality of the program.
  • Games using Squirrel

  • Vice City Multiplayer (a mod for Grand Theft Auto: Vice City)
  • Left 4 Dead 2
  • Portal 2
  • Alien Swarm
  • OpenTTD
  • V-Multiplayer
  • GTAIV's IV-MP
  • Mafia II's M2-Multiplayer
  • Counter Strike: Global Offensive
  • Shadow Warrior
  • War Thunder
  • SuperTux
  • Liberty Unleashed (a mod for Grand Theft Auto III)
  • Sonic Unleashed (PS2/Wii)
  • Contagion (PC)
  • Thimbleweed Park
  • Simutrans
  • Grief Syndrome
  • History

    The language was made public in 2003 under the zlib/libpng license. In November 2010, the license was changed to MIT license to enable the project to be hosted on Google Code. It is developed and maintained by Alberto Demichelis.

    References

    Squirrel (programming language) Wikipedia