views:

103

answers:

1

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!

+2  A: 

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.

Ricky Lung