8 ms·
Given that Lua and Squirrel are quite similar due to meta tables resembling each other, what does Squirrel provide compared to Lua except for the C-Style syntax
by justusw 10y ago
Given that Lua and Squirrel are quite similar due to meta tables resembling each other, what does Squirrel provide compared to Lua except for the C-Style syntax?
- SamReidHughes 10y agoIt looks like arrays are different from tables and they start at 0.
- gyoza 10y agoI am guessing that it is used in Valve games..
- xufi 10y agoI wonder if parts of it were used in TF2 updates since that hasn't gotten an update in a while
- mwcampbell 10y agoThe combination of reference counting and tracing GC looks interesting. There have been a couple of attempts to retrofit reference counting into Lua, but nothing stable or widely used AFAIK.
- qwertyuiop924 10y agoIt'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.
- theseoafs 10y agoLua can't be multithreaded in any real sense (by "real", I mean "OS threads"). If Squirrel can that's a big advantage.
- qwertyuiop924 10y agoI thought it could, but I think I might have been wrong... Nope, just coroutines. Sorry for being wrong. However, as it is small and embeddable, it's trivial to spin up multiple instances of the interpreter. But Lua and TCL are just as good at that.
- iamcreasy 10y agoWhat does it mean by a language can be multiplexed trivially?
- qwertyuiop924 10y agoYou can run multiple interpreters, embedded in the same application, in separate threads: multiplexing, as you have multiple instances, as opposed to multithreading, where you have a single instance.
- safewayclubcard 10y agoIs that what https://github.com/rvirding/luerl https://github.com/rvirding/luerl is doing in the erlang VM? From the docs: > It should give you a Lua environment that allows you to effortlessly run tens of thousands of Lua processes in parallel, leveraging the famed microprocesses implementation of the Erlang VM. The empty Luerl State footprint will be yet smaller than the C Lua State footprint.
- qwertyuiop924 10y agoYes. Lua does it quite well by default. Apparently, luerl aspires to do it better.
- duaneb 10y agoIt really speaks more to the runtime than the language. There's nothing fundamentally anti-parallel about lua, but even just concurrent GC is difficult to execute well. Look at how big of a deal Go's recent low latency claims are.
- unit91 10y agoIn short, Squirrel is small, nimble and has features that are pretty nuts. Looking for something else? You're barking up the wrong tree.
- trynumber9 10y agoIs it actually faster though? https://github.com/r-lyeh/scriptorium https://github.com/r-lyeh/scriptorium Perhaps these results are due to poor coding practices in the example code.
- qwertyuiop924 10y agoHuh. Weird. That shouldn't be right. Squirrel can do a lot of optimizations Lua can't. Maybe it's just that problem...
- bsder 10y ago0-index. I tried to like Lua, but indexing from 1 is just too painful when you have to talk to C.
- GadgetJax 10y agoIn 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.
- bsder 10y agoNo, it's not. See here: http://lua-users.org/wiki/CountingFromOne http://lua-users.org/wiki/CountingFromOne I made a comment on that wiki MOONS ago, and it still holds.
- petra 10y agoI think squirrel offers much better C++ integration.