Jump to content
softtouch

Opensource scripting language?

Recommended Posts

Does anybody know of any easy to learn opensource scripting language?

I need to be able to send string to the scripting engine from Delphi, have it process the strings and return the result to Delphi.

I also need to be able to load such scripts at runtime and execute them.

Each of such script need to do different thing, based on some parameter, so I might need to load many different scripts at the same time.

Share this post


Link to post

Is Python open source and easy to learn enough?

There are lots of others though, e.g. Delphi Web Script to name a more obscure one that is written in Delphi and therefore easy to include in any Delphi program.

Share this post


Link to post
1 hour ago, dummzeuch said:

Is Python open source and easy to learn enough?

There are lots of others though, e.g. Delphi Web Script to name a more obscure one that is written in Delphi and therefore easy to include in any Delphi program.

 

DWScript seems to be up to Delphi 11.x only, but I use Delphi 12.

Share this post


Link to post
25 minutes ago, softtouch said:

 

DWScript seems to be up to Delphi 11.x only, but I use Delphi 12.

I have the opposite problem: It apparently no longer supports Delphi 2007.

 

Your problem is easier to solve: Just load the Delphi 11 package and let the IDE automatically upgrade it. Your chances are good that it will just work.

Share this post


Link to post

Python is too huge for just the small things I want to do, and I dont want to dig into python programming.

 

I took a look at TJvInterpreterProgram, but its hard due to lack of documentation. It works, but I could not figure out how to use system functions like copy, delete etc. from within the code for the interpreter.

Share this post


Link to post
5 hours ago, softtouch said:

Python is too huge for just the small things I want to do, and I dont want to dig into python programming.

 

I took a look at TJvInterpreterProgram, but its hard due to lack of documentation. It works, but I could not figure out how to use system functions like copy, delete etc. from within the code for the interpreter.

Your best bet given your requirements is lua, mentioned previously. Used a lot in gaming apps.

Share this post


Link to post

A few years ago I used DWScript with great success. You can easily have variables and function from your host application exposed to the script.

DWScript scriting language is easy to learn since it is almost Delphi language.

Share this post


Link to post
5 hours ago, hsauro said:

Your best bet given your requirements is lua, mentioned previously. Used a lot in gaming apps.

Not sue lua is ok for my project. I saw it does not know anything about regex.

Share this post


Link to post
34 minutes ago, softtouch said:

Not sue lua is ok for my project. I saw it does not know anything about regex.

 

Regex is a new requirement in this thread.

Share this post


Link to post
Just now, Lajos Juhász said:

 

Regex is a new requirement in this thread.

Maybe I could use gmatch instead of regex, that might be ok. I am currently playing with lua, but could not yet figure out how to return a string to delphi.

Share this post


Link to post

PowerShell is a powerful scripting language and you will find lot of materials (youtube, tutorials, books) about it.

Share this post


Link to post

Thanks for all the suggestions.

 

I think I will go with lua as recommended by Lars Fosdal (thanks for that). I got most things running already and even it has no regex, gmatch and some other will do it.

Share this post


Link to post

Please note that the Embedded LUA was a search find. I have not used it myself.

Share this post


Link to post
5 minutes ago, Lars Fosdal said:

Please note that the Embedded LUA was a search find. I have not used it myself.

But it was a good find 🙂 It works well so far. Thanks again.

  • Like 1

Share this post


Link to post
9 hours ago, FPiette said:

DWScript scriting language is easy to learn since it is almost Delphi language.

The script language is easy but integrating DWScript into an application is hard; There is zero documentation and the examples are insufficient.

I've used DWScript since Delphi 5 but I still find it hard to use.

Share this post


Link to post
19 hours ago, Anders Melander said:

The script language is easy but integrating DWScript into an application is hard; There is zero documentation and the examples are insufficient.

I've used DWScript since Delphi 5 but I still find it hard to use.

I can confirm that but once integrated, it is very stable, frequently updated with lots of unit tests! I highly recommend DWScript.

Share this post


Link to post

Back to searching... LUA is not what I can use, it seems not to support UTF-8 for files.

Edited by softtouch

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×