I saw some mention of moving from Squirrel to Nail. What would be the advantage? I don't know a thing about Nail. Squirrel seemed pretty reasonable. Maybe because I have a preference for C like OO languages. (Perl and C# are my favorites). I used LUA once apon a time and found it to be a bit of a hassle to code in.Blustuff wrote:I spoke with TrueBrain and about this project:Yexo wrote:But I never coded anything for nail, so your best bet is to ask either TrueBrain or Rubidium (and maybe glx/smatz).
It may not be a replacement at the begining. The important thing is that it would be a replacement at some point of the developpement. I think that even if I were alone on such a project it would take about one year to get a full replacement for Squirrel. All I need is some brainstorming about ideas about some issues.TrueBrain wrote:Replacing Squirrel at this stage in OpenTTD is almost impossible, because people use the full set, and any replacement will start out with a very small set.
Speed issues
Moderator: OpenTTD Developers
Re: Speed issues
Re: Speed issues
One of the features of NAIL is that it will have almost 100% syntax compatibility with Squirrel. (Semicolons are mandatory in NAIL where they are not in Squirrel)
Squirrel has some problems with scoping and destroying objects as soon as they run out of scope. This sometimes causes problems with AI*Mode.
Squirrel has some problems with scoping and destroying objects as soon as they run out of scope. This sometimes causes problems with AI*Mode.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: Speed issues
Well the idea of AI*Mode is very dangerous. A variable can be freed as soon as it is not alive and this as nothing to do with scoping. A garbage collector could decide to free the variable as soon as possible or on the contrary whenever the memory need to be freed. This is a bad idea to rely on the Garbage Collector internal.Zuu wrote:Squirrel has some problems with scoping and destroying objects as soon as they run out of scope. This sometimes causes problems with AI*Mode.
That's roughly the question I asked. Here is the answer.Dustin wrote:What would be the advantage?
TrueBrain wrote:Squirrel is a nice piece of software, but the coding style is far from optimal. Also, nobody in our team has any insight knowledge of Squirrel, and the complete lack of documentation in the code makes it really hard to follow what the original author means with a given statement. So it was decided that it would be much better if we would write our own. This in theory is not such a big job, just we ran into a few issues (we wanted more than Squirrel offered).
Re: Speed issues
Those problems should be fixed now. If sometimes goes wrong now the AI is killed, not OpenTTD.Zuu wrote:Squirrel has some problems with scoping and destroying objects as soon as they run out of scope. This sometimes causes problems with AI*Mode.
This has everything to do with scoping.Blustuff wrote:Well the idea of AI*Mode is very dangerous. A variable can be freed as soon as it is not alive and this as nothing to do with scoping.
That's why we don't rely on the garbage collector but free every item as soon as it's cleared.A garbage collector could decide to free the variable as soon as possible or on the contrary whenever the memory need to be freed. This is a bad idea to rely on the Garbage Collector internal.
Re: Speed issues
No, a variable can be alive outside its scope and dead inside.Yexo wrote:This has everything to do with scoping.
Who is online
Users browsing this forum: No registered users and 2 guests