PDA

View Full Version : Pascal Script Interpreter



Pepe_Le_Pew
25-10-2005, 08:20 AM
Small script interpreter (*Keep it simple stupid*) for freepascal/delphi/kylix
its already functional but needs a lot of rework in order to become more professional.

any interested should contact me.

https://opensvn.csie.org/PascalScript/

LP
25-10-2005, 08:18 PM
What I would really like in a Pascal script is an ability to use classes, perhaps even some export/import support. Another desirable thing would the performance.

The link you gave shows some folders, can you provide some zipped package? Perhaps a supported feature list too.

Anyway, I wish you luck with this project! Also, you may want to check "Pascal Script by RemObjects", which is similar project (even same name :))

savage
25-10-2005, 08:25 PM
I'll try and get a news post about your project in the next day or so.

JSoftware
25-10-2005, 08:31 PM
i really like the style! i think this shows a great potential!
i'm a delphi person however and my naive tries to convert it to use in delphi didn't succeed :(
in your test example it fails on write('stack overflow');

i'll surely keep an eye on this!

Sly
25-10-2005, 09:39 PM
It looks quite well done from just having read the readme.

Lifepower: That's the Subversion source control repository that link points to. That is the default view given if you browse the repository with a web browser.

cairnswm
26-10-2005, 04:39 AM
I have used some sort of Pascal based scripting in a number of games (and indead other work based projects). To me the use of Classes is not key to making a scripting language. The key things required are

:arrow: Control Structures (For, While, If)
:arrow: Procedures and Functions
:arrow: Integration from Script into application
:arrow: Script Persistance

Using this you can write complete scripted AI into games.

Using Script Persistence you can make 'objects' that have their own variables and methods inside the script. (ie if you have 10 ants each has its own instance of the Ant script).

I will give this new scripting a try when I have time.

Pepe_Le_Pew
26-10-2005, 07:39 AM
I don't own a Delphi licence right now :(

but i can test it against kylix (i will download the educational license version)

the idea is to have a limited set of features that we can play with and make a FAST virtual machine, not a bloated one...

we can add some features on the compiler side if and only if it doesn't betray the idea of having a small and fast VM...

@cairnswm

i really need to add data persistance, i did not thought about this before...

JernejL
26-10-2005, 07:00 PM
I have used some sort of Pascal based scripting in a number of games (and indead other work based projects). To me the use of Classes is not key to making a scripting language. The key things required are

:arrow: Control Structures (For, While, If)
:arrow: Procedures and Functions
:arrow: Integration from Script into application
:arrow: Script Persistance

Using this you can write complete scripted AI into games.

Using Script Persistence you can make 'objects' that have their own variables and methods inside the script. (ie if you have 10 ants each has its own instance of the Ant script).

I will give this new scripting a try when I have time.

i agree with you, the most important to me are for, while loops, procedures and arrays, still a little of multithreading couldn't hurt (infact i don't think my game would as designed work without multithreading in scripting)

cairnswm
27-10-2005, 04:35 AM
Try and compile it in delphi mode in free pascal. This 'should' be good enough to make it Delphi compatible :)


The reason for the persistance is that say for example I want to make an enemy AI using a script. I want it to remember what it is doing in the game. During the game loop I will call the script to check the AI (Usually I do this either 10 or 5 times a second). The script should not have to requery the main application about its state but rather just use the script persistent variables.

Also remember that a game could be running many scripts in memory at the same time (eg one per sprite in the game). So also check that multiple different script files dont conflict with each other.

Pepe_Le_Pew
29-10-2005, 07:33 PM
Hm, current script have a data memory area (one for each instance of TMachine) so you have data persistance, but im thinking about data persistance across .create/.free (saving tdatamemory to harddisk)