Earlier quoted context omitted.
AngelScript too: http://www.angelcode.com/angelscript/
Also Lily https://github.com/jesserayadkins/lily recently discussed https://news.ycombinator.com/item?id=12015158
The Squirrel Programming Language
41–50 of 51 posts
Re: The Squirrel Programming Language
#42Re: The Squirrel Programming Language
#43Re: The Squirrel Programming Language
#44Earlier quoted context omitted.
Presumably the author of Squirrel agrees with (one of) the authors of Lua: "Local by default is wrong" [1]. "The problem is that without local declarations, you cannot say where the variable is local to" [2]. Take Python, for example, where "local by default" means "local to the current function". Variables are created in the current function's scope on assignment, which causes 2 problems: 1. It is awkward to modify…
If Lua did the decent thing and insisted that you declare every variable first, it wouldn't have this stupid problem. Squirrel should probably do it, too. Python certainly should! (Even Javascript , misguided as it is in so many respects, has strict mode!) This sort of static checking massively increases the amount of code you can look after without going insane. Add static types too, and you're even better off. (Las…
Re: The Squirrel Programming Language
#45Re: The Squirrel Programming Language
#46Ron Gilbert is using Squirrel as a scripting language in the game Thimbleweed Park [1]. For someone developing games for as long as he has, I think it lends some credibility to it (though I would still evaluate it before I choose to use it for my use cases). [1] https://blog.thimbleweedpark.com/text_tron_3000
Re: The Squirrel Programming Language
#47Earlier quoted context omitted.
Presumably the author of Squirrel agrees with (one of) the authors of Lua: "Local by default is wrong" [1]. "The problem is that without local declarations, you cannot say where the variable is local to" [2]. Take Python, for example, where "local by default" means "local to the current function". Variables are created in the current function's scope on assignment, which causes 2 problems: 1. It is awkward to modify…
If Lua did the decent thing and insisted that you declare every variable first, it wouldn't have this stupid problem. Squirrel should probably do it, too. Python certainly should! (Even Javascript , misguided as it is in so many respects, has strict mode!) This sort of static checking massively increases the amount of code you can look after without going insane. Add static types too, and you're even better off. (Las…
Re: The Squirrel Programming Language
#48Please could you explain to me, if Squirrel is "similar to Lua, but uses a C like syntax", why I wouldn't want to use C or Lua instead? Is this about Steam? If not, is this (even) faster than Lua? Is it easier or safer than C? Am I missing something? You better have something seriously good to offer if in your first breath you're pitching yourself alongside the very best of both interpreted and compiled languages.
You would use this in the same arena you'd use Lua, not where you'd use C. That is, you want something more flexible than compiled C for your particular application. Why you'd use it over Lua, I haven't figured out yet, but I don't use either so I have no basis for comparison.
Re: The Squirrel Programming Language
#49Earlier quoted context omitted.
0-index. I tried to like Lua, but indexing from 1 is just too painful when you have to talk to C.
In times like that, I would just assume the array size is +1, and ignore the first C Zero position. It's a pain but just setup something once and its done.
I made a comment on that wiki MOONS ago, and it still holds.
Re: The Squirrel Programming Language
#50Earlier quoted context omitted.
It's hyper-optimized, small, and can be multithreaded or multiplexed trivially, but that's true of lua as well. The array thing gives it a leg up in speed as well, as does 0-indexing. Finally, its gc algorithm doesn't have cpu bursts (it's not "stop the world"). I don't know of Lua has this feature, but it makes the language ideal for real-time applications. Like games.
Is it actually faster though? https://github.com/r-lyeh/scriptorium Perhaps these results are due to poor coding practices in the example code.