Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

fagiano

[ANN] Squirrel 1.0 beta 2 released

This topic is 5263 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Squirrel 1.0 beta 2 has been released: The release fiexes some minor bug in the the parser and adds several new features in the C API. "Squirrel is a high level imperative/OO programming language, designed to be a powerful scripting tool that fits in the size, memory bandwidth, and real-time requirements of applications like games. Although Squirrel offers a wide range of features like: dynamic typing,delegation,higher order functions,generators,coroutines, tail recursion ,exception handling ,automatic memory management and both compiler and virtual machine fit together in about 6k lines of C++ code. [released under zlib/pnglib licence]" http://squirrel.sourceforge.net ----------------------------- The programming language Squirrel http://squirrel.sourceforge.net

Share this post


Link to post
Share on other sites
Advertisement
Hey, so far squirrel looks really cool I''m still reading through the docs. Still curious about a lot of things, but I''m liking what I''m seeing so far.

Share this post


Link to post
Share on other sites
What''s differences between Squirrel and LUA?? I''ve looked at the site and some of the documentation and it looks very similar. What would make me want to pick this language over LUA. Sell it to me.

Denny.

Share this post


Link to post
Share on other sites
Well, squirrel and lua are surely the same category. I started designing squirrel while I was developing a game massively lua based(farcry). I started trying to do a refcounted lua but after I decided to create a brand new thing. I tried to change the aspects that were not really fitting my needs.
Still, there are quite a bit of semantic differences between squirrel and lua.

They main differences are:
-Squirrel has C-like syntax, in my prev team I realized designers were more confident with C syntax because most of them dealed with JavaScript making web pages. Lua as pascalish syntax.
-Squirrel is reference counted and has a determintistic garbage collector that can be called on demand to resolve cycles, but usually is not needed. Lua uses a mark and sweep GC.
-Squirrel has arrays as primary type, lua doesn't.
-Squirrel has integers and floats as separated types, for that also supports all bit manypulation C operators. Lua has only floats and no bit manypulation.
-In Lua is not possible to determinate if a table field doesn't exists or si 'nil', fields are created through the normal assignment operator = , so if you mistype a name you end up having a new variable you are not aware of. In Squirrel a table fiels is created through a the operator <- and deleted with the keyword 'delete'. This applies also to global variables.(no variable is created if someone mistype a filed name, an exception is thrown instead).
-Squirrel has built in delegation(sort of prototype based inheritance). Lua has a metatables and the "index" method.
-Squirrel has different scoping rules, there is not need for the 'self' in front of every table field etc... and you have to put ::varname to access globals explicitly. Lua requires the self.field and the rest is global.
-Squirrel implements generators(kinda light weight coroutines) and heavy duty coroutines. Lua has only coroutines.
-Squirrel types have default methods like array.append(), array.sort(). Lua uses a global api.
-Squirrel has exception handling(try/catch). Lua doesn't.
-Squirrel supports Unicode. Lua ascii only.
-According to some old benchmark I did squirrel is faster for certain stuff lua is faster for other. but the difference is minimal.(I have to make a new benchmark)

There are many other more subtle differences, but I would have to write a book to explain them all. Take a look at the squirrel manual on the website.

API wise they are similar but not quite the same.

ciao
Alberto

-----------------------------
The programming language Squirrel
http://squirrel.sourceforge.net




[edited by - fagiano on April 21, 2004 3:24:37 PM]

Share this post


Link to post
Share on other sites
Going once, going twice... I''m just about sold on Squirrel. So far sounds like it''s got pretty much everything I''ve been looking for in a Scripting Language.

If I may comment on your website though.. you really should setup a Forum on your site, as opposed to just a Yahoo mailing list, for support and user interaction.

It''d also be nice to see some kind of area for tutorials.. that''s one thing a lot of newer scripting languages are terribly short on. Maybe a Wiki or something, I dunno.

****************************************

Brian Lacy
ForeverDream Studios

Comments? Questions? Curious?


"I create. Therefore I am."

Share this post


Link to post
Share on other sites
Yep, I should probably set up a forum, good call(any suggestion on a good php based Furum engine?). Regarding tutorials, it was already in my plans, I din''t do it yet because I was still refining the API but probably now is time ot do it.
I was actually thinking about writing an article on how to set up a complete scripting architecture based on squirrel. The fact is that at the moment I''m on my own, so everything is stricly related on the amount of spare time I have.

thx
Alberto

-----------------------------
The programming language Squirrel
http://squirrel.sourceforge.net

Share this post


Link to post
Share on other sites
Sounds very interesting. Just one question though: Does the userdata work the same way as in Lua meaning do you also have to create a meta table to access the members and methods for a class? That wasn''t very clear in the manual.

Share this post


Link to post
Share on other sites
Yes, userdata more or less work like in lua. In squirrel is actually simpler, you can still use _set and _get but is easyer to place the methods directly in the userdata's delegate(equivalent to lua's metatable). If you put the methods in the delegate there are no performance penalties of calling _set/_get metamethods. With metamethods you can also allow to iterate your userdata contents with 'foreach' and override operators.


the following sample uses a table but applies also to userdata


local table = {
test = "I'm a test"
}
local thedelegate = {
function dostuff(a)
{
::print(test+" "+a);
}
}

table = delegate thedelegate : table;

table.dostuff("ciao")

//prints "I'm a test ciao"




Alberto

PS: I've created a forum on th website, I'll activate it soon; any suggestion about how to organize forums categories?


-----------------------------
The programming language Squirrel
http://squirrel.sourceforge.net



[edited by - fagiano on April 22, 2004 7:46:06 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by fagiano
Yep, I should probably set up a forum, good call(any suggestion on a good php based Furum engine?). Regarding tutorials, it was already in my plans, I din''t do it yet because I was still refining the API but probably now is time ot do it.
I think with an easily accessible forum setup (i.e. allowing guest access as GameDev does), people will be much more likely to flock to your project. People tend to get involved most easily when it is easy to communicate with the person(s) at the head of the project.

As for forum software, I always recommend (with great praise) the new SimpleMachines Forum (SMF) from the developers of YaBB SE. I won''t plug it more than that in the middle of your Squirrel Script thread, though.

****************************************

Brian Lacy
ForeverDream Studios

Comments? Questions? Curious?


"I create. Therefore I am."

Share this post


Link to post
Share on other sites
In Squirel, can I run the script for n intructions? sort of how SEER does it? I mean, can I run half a script, then do some stuff in the host program and then run the other half of the script? and do this every frame. like RunScript( 10 ); will run 10 instructions then return?

Denny.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!