frosch wrote:...
Thank you again for your insight. I truly appreciate that people are posting constructive comments in this thread.
frosch wrote:Note: The following monologue is not directed to the author of the patch. But to all those, who participated in the discussion like "squirrel is the solution for everything".
Certainly, I'm not one of those! As I said in my initial post, I only chose Squirrel because it was already being used by OpenTTD, so it reduced the changes needed in the compiling-Makefile machinery.
frosch wrote:Let's see what newgraphics can do, have to do, and are allowed to do:
...
You raise several good points here, of which determinism is, my opinion, the most problematic one. Nothing stops a Squirrel script from doing
Code: Select all
function CanWagonBeAttached (wagon)
{
return Random() % 2;
}
and chaos will ensue. We could prevent this by declaring what constitutes "defined behaviour" for a script, but we don't want the SquirrelGRF spec to end up as the C spec, do we?
frosch wrote:Additionally there is still the performance question. Why did noone yet profiled it? There is already enough support to do it. Just create a game with 200 trains consisting of 10 units, and enjoy watching them. As the VM-store and -restore stuff is missing, you can expect it to at least not become faster over the time. (Note: I started profiling myself last week, but got interrupted by a hardware failure, that forced me to reboot. After that I did neither found time nor motivation to start it again.)
I haven't done any profiling because I don't think there's anything to profile yet. In the last version I posted, the Squirrel code only ran (i) during GRF activation; (ii) in the wagon-attach callback. Since I agree with belugas in that slowdowns at game start are acceptable, and that wagon attachment is a highly interactive process (where a performance decrease would be masked by user interaction), I don't see any interest in having profiling runs now.
frosch wrote:Finally let's take a look at some nfo properties, that enforce the above mentioned general restrictions.
...
So, you think those restrictions are silly, and need to be removed? Nfo is the only language with those silly restrictions? Nfo is doomed to hex values, I can hardly understand half of the action0 page.
I don't find NFO restrictions silly. The're there for a reason, and I clearly understand what it is. This is not about "Hey, I don't like that and I don't understand it either, so let's get rid of it.".
frosch wrote:Nfo/newgrf is not the only language with such restrictions. I know another one:
PovRay (
http://www.povray.org) is a raytracer which you can use to create 3D images. It is not like the usual "modellers" where you click vertexes and move them around until the figure looks as you like.
PovRay is text-based. Its code is interpreted in two phases:
- The "parsing": The code is read in, and executed to generate the scene in memory. This part is Touring-complete.
- The "rendering": The szene is evaluated for every pixel of the final image. You can also "execute" certain code in this phase, but it is not Touring-complete, you cannot access memory as you like, you cannot interact with other stuff, and similiar.
This does not restrict the szene construction, but keeps the rendering of a single pixel fast (i.e. sane, possible at all, ...) and allows independent evaluations.
So does that sound similiar to nfo, its task and its restrictions?
Note: I have never heard someone saying, PovRay is restrictive and hard to understand. Usually one fails dealing with 3D stuff without inmediatelly seeing the result.
Well, that may very well be because PovRay
is easy to understand, and NFO isn't. (I'm not guessing that PovRay isn't hard--I
know it isn't). Could it have something to do with the fact that PovRay is, as you said, text-based, while NFO is hexcode-based?
frosch wrote:Thanks for reading
Thanks for writing.
frosch wrote:I have meet a lot people in my life which said C is the best language for every task. I am quite annoyed by those. Usually it turns out that C is the only language they know a bit. And they will never understand that different tasks need different tools. E.g. doing a sed-Task with C is incredible stupid, but it is seen quite often.
I'm an experienced programmer, and I know a dozen of languages, so I know that there isn't a cure-all language.
(You can do away for most tasks with C and Perl though.)
Do we at least agree in that NFO is a language designed to be easily read by a computer and not by a human, and that it takes (most) humans longer to read and write than the average human-friendly language? If Squirrel is deemed to be a bad choice as an alternative, and a better option is found (easily parsed by both humans and computers), would OpenTTD be willing to accept it?