Squirrel (programming language)
   HOME

TheInfoList



OR:

Squirrel is a high level imperative,
object-oriented Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of ...
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
, designed to be a
lightweight Lightweight is a weight class in combat sports and rowing. Boxing Professional boxing The lightweight division is over 130 pounds (59 kilograms) and up to 135 pounds (61.2 kilograms) weight class in the sport of boxing. Notable lightweight boxe ...
scripting language A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled. A scripting ...
that fits in the size, memory bandwidth, and real-time requirements of applications like
video game Video games, also known as computer games, are electronic games that involves interaction with a user interface or input device such as a joystick, controller, keyboard, or motion sensing device to generate visual feedback. This feedba ...
s. 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 ''Left 4 Dead 2'' is a 2009 first-person shooter game developed and published by Valve. The sequel to Turtle Rock Studios's ''Left 4 Dead'' (2008) and the second game in the ''Left 4 Dead'' series, it was released for Microsoft Windows and Xbox ...
'', '' Portal 2'' and '' Thimbleweed Park'' for scripted events and in NewDark, an unofficial '' Thief 2: The Metal Age'' engine update, to facilitate additional, simplified means of scripting mission events, aside of the regular C scripting.


Language features

* Dynamic typing *
Delegation Delegation is the assignment of authority to another person (normally from a manager to a subordinate) to carry out specific activities. It is the process of distributing and entrusting work to another person,Schermerhorn, J., Davidson, P., Poole ...
* Classes,
inheritance Inheritance is the practice of receiving private property, titles, debts, entitlements, privileges, rights, and obligations upon the death of an individual. The rules of inheritance differ among societies and have changed over time. Of ...
* Higher order functions * Generators *Cooperative threads (
coroutines Coroutines are computer program components that generalize subroutines for non-preemptive multitasking, by allowing execution to be suspended and resumed. Coroutines are well-suited for implementing familiar program components such as cooperative ...
) * Tail recursion *
Exception handling In computing and computer programming, exception handling is the process of responding to the occurrence of ''exceptions'' – anomalous or exceptional conditions requiring special processing – during the execution of a program. In general, an ...
*Automatic memory management (mainly
reference counting In computer science, reference counting is a programming technique of storing the number of references, pointers, or handles to a resource, such as an object, a block of memory, disk space, and others. In garbage collection algorithms, refer ...
with backup
garbage collector A waste collector, also known as a garbageman, garbage collector, trashman (in the US), binman or (rarely) dustman (in the UK), is a person employed by a public or private enterprise to collect and dispose of municipal solid waste (refuse) and ...
) * Weak references *Both
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs tha ...
and
virtual machine In computing, a virtual machine (VM) is the virtualization/ emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized h ...
fit together in about 7k lines of C++ code *Optional
16-bit 16-bit microcomputers are microcomputers that use 16-bit microprocessors. A 16-bit register can store 216 different values. The range of integer values that can be stored in 16 bits depends on the integer representation used. With the two ...
character strings


Syntax

Squirrel uses a C-like syntax. ;Factorial in Squirrel: function factorial(x) ;Generators: function not_a_random_number_generator(max) local randtor = not_a_random_number_generator(100); for(local i = 0; i < 10; i += 1) print(">"+resume randtor+"\n"); ;Classes and inheritance: class BaseVector class Vector3 extends BaseVector local v0 = Vector3(1,2,3) local v1 = Vector3(11,12,13) local v2 = v0 + v1; v2.Print();


Applications


Applications using Squirrel

* Code::Blocks, integrated development environment *
Enduro/X Enduro/X is an open-source middleware platform for distributed transaction processing. It is built on proven APIs such as X/Open group's XATMI and XA. The platform is designed for building real-time microservices based applications with a c ...
, cluster application server *
Electric Imp Electricity is the set of physical phenomena associated with the presence and motion of matter that has a property of electric charge. Electricity is related to magnetism, both being part of the phenomenon of electromagnetism, as described by ...
, an end-to-end IoT platform


Games using Squirrel

* '' Alien Swarm'' * ''
Antinomy of Common Flowers , often abbreviated to AoCF, is a fighting video game developed by Twilight Frontier and published by Team Shanghai Alice for Microsoft Windows in 2017. It is the latest fighting game in the ''Touhou Project'' series, being a continuation of th ...
'' * '' Apex Legends'' * '' Battle Brothers'' * '' Contagion'' (PC) * '' Counter Strike: Global Offensive'' * '' CRSED: F.O.A.D.'' * '' Final Fantasy Crystal Chronicles: My Life as a King'' * '' GTA IVs IV-MP * ''
Left 4 Dead 2 ''Left 4 Dead 2'' is a 2009 first-person shooter game developed and published by Valve. The sequel to Turtle Rock Studios's ''Left 4 Dead'' (2008) and the second game in the ''Left 4 Dead'' series, it was released for Microsoft Windows and Xbox ...
'' * ''Liberty Unleashed'' * '' Mafia IIs M2-Multiplayer * '' Nuclear Dawn'' * '' OpenTTD'' * '' Portal 2'' * '' Shadow Warrior'' * ''
Simutrans ''Simutrans'' is a cross-platform simulation game in which the player strives to run a successful transport system by constructing and managing transportation systems for passengers, mail and goods by land (rail, road, tram, monorail, magle ...
'' * ''
Sonic Unleashed ''Sonic Unleashed'' is a 2008 platform video game in the ''Sonic the Hedgehog'' series. The story follows Sonic the Hedgehog (character), Sonic as he attempts to restore the world after his nemesis Doctor Eggman shatters it with a powerful laser ...
'' (PS2/Wii) * '' SuperTux'' * ''
Team Fortress 2 ''Team Fortress 2'' is a 2007 multiplayer first-person shooter, first-person shooter game developed and published by Valve Corporation. It is the sequel to the 1996 ''Team Fortress'' Mod (video gaming), mod for ''Quake (video game), Quake'' and ...
'' * '' Thimbleweed Park'' * ''
Thief II ''Thief II: The Metal Age'' is a 2000 stealth video game developed by Looking Glass Studios and published by Eidos Interactive. Like its predecessor '' Thief: The Dark Project'', the game follows Garrett, a master thief who works in and aroun ...
'' (unofficial NewDark engine update) * '' Titanfall'' * ''Vice City Multiplayer'', a mod for '' Grand Theft Auto: Vice City'' * '' War Thunder'' * '' Zero no Tsukaima - Maigo no Period to Ikusen no Symphony'' (PS2) * '' Zero no Tsukaima - Muma ga Tsumugu Yokaze no Nocturne'' (PS2) * '' Zero no Tsukaima - Shou-akuma to Harukaze no Concerto'' (PS2)


History

The language was made public in 2003 under the zlib/libpng license. In November 2010, the license was changed to the
MIT license The MIT License is a permissive free software license originating at the Massachusetts Institute of Technology (MIT) in the late 1980s. As a permissive license, it puts only very limited restriction on reuse and has, therefore, high license comp ...
to enable the project to be hosted on
Google Code Google Developers (previously Google Code) , application programming interfaces (APIs), and technical resources. The site contains documentation on using Google developer tools and APIs—including discussion groups and blogs for developers usin ...
. It is developed and maintained by Alberto Demichelis.


See also

* Lua * AngelScript * Python *
ECMAScript ECMAScript (; ES) is a JavaScript standard intended to ensure the interoperability of web pages across different browsers. It is standardized by Ecma International in the documenECMA-262 ECMAScript is commonly used for client-side scripti ...
*
Ruby A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called ...


References


External links

* {{DEFAULTSORT:Squirrel (Programming Language) 2003 software Cross-platform free software Free computer libraries Free software programmed in C Object-oriented programming languages Procedural programming languages Programming languages Programming languages created in 2003 Scripting languages Software using the MIT license