Please recommend good reading about Squirrel [closed]
Asked Answered
S

2

11

Please, share your favorite links on this language where one can learn the best of it.
And also, please describe in few words the most important features of this language differing it form others languages like Lua.

I just cannot understand why to reinvent another Lua/Python/etc. Maybe I just missed something...
But I like the idea of performance+scripting, so I have to understand it!

Sensitometer answered 18/11, 2009 at 11:30 Comment(0)
C
11

The best (and almost only) resource about the Squirrel language is it's official web site and forums: http://squirrel-lang.org

Compare to other well developed languages, Squirrel is still in it's early stage with a very small community, but it is very promising in certain ways among other modern scripting languages:

  • Inspired from Lua, with the usual concepts of tables, Lua stack etc, but with a MUCH cleaner syntax and C API.

  • Reference counting with supplementary garbage collector. The design of the run-time encourage the user to remove cyclic reference rather than totally rely on garbage collection (which can be slow or non-deterministic). The user can even re-compile the run-time with garbage collector disabled.

  • It's a language with C/C++ like syntax. It's kind of taste but it's the main reason of why I will favour Squirrel over Lua.

  • Build-in support of class, where in Lua you need to do some magic to simulate it.

  • Supporting C# like attribute, therefore you can supply meta-data to your class and properties. I use this feature to expose my script objects to .net property grid.

  • Undefined variables result in exceptions instead of silently creating a new null value like Lua.

  • Other features like lambda function, generator and co-routines are all built-in in this little but powerful scripting language which just made from ~6000 line of C++ code.

To conclude, the Squirrel language is suitable for interfacing with low level modules in a performance critical application (ie. a game engine), it absolutely can serve as a better Lua. Where as language like python is more towards a general purpose, day to day handy problem solving language.

Catadromous answered 19/1, 2010 at 9:25 Comment(4)
It's terribly lacking in documentation though. The official docs are hardly beginner-friendly, with virtually no examples, and mostly just lexical definitions.Kassi
That's not true, As side of the well written 5k lines documentation and API reference you just have to look at the sqstd source, if you can't realize that then you should consider another hobby/occupation.Tournai
The documentation is there, but it's sorely lacking in examples and tutorials. Even installing squirrel is not explained! If you're learning something new, LUA is far better documented and has tons of examples to learn from.Jempty
squirrel docs are horrible compared with lua and others, this is simply a factMorbidezza
I
2

emo framework, a free, open source game development framework for iOS and Android, is based on Squirrel. Its source code contains a few example programs/demos, as well as some library code written in Squirrel. Reading the source of them can be educational, I reckon.

I sincerely recommend having a look at emo for anybody wishing to learn the Squirrel language while having fun developing games or other apps for iOS and Android.

Instal answered 4/9, 2012 at 20:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.