Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the pros and cons of RemObjects PascalScript versus the DWS script?

I'm planning to include a pascal script in my application. It does not require any web access, simply access to classes in my Application. It should be fast (compiled). I see that there are a number of scripts available, some are interpreters but amongst the compilers RemObjects pascal script and Delphi Web Script (DWS) seem to be powerful and actively pursued.

Can anyone suggest advantages of one over another please? Thanks

like image 348
Brian Frost Avatar asked Feb 03 '11 17:02

Brian Frost


7 Answers

It comes down to this, imho:

  • Delphi Web Script is being actively and aggressively developed.

  • PascalScript is pretty much dormant in terms of development and enhancements.

However, DWS is a community project essentially being developed by one (very talented and competent) guy. PascalScript is supported by RemObjects.

But: The number of people/size of organisation involved in developing/supporting a product is not as important as the efficacy and enthusiasm of the development and support they are actually providing.

In both cases source is provided, so even if "official support" dried up, you would not be completely lost.

From what I understand, the DWS engine is a more easily understood implementation than PascalScript which may make "self support" easier, tho in such cases what you are used to is important (I have previously worked on an entirely different script engine which I understand is more similar to DWS than PascalScript).

Lastly, I currently work on a project that uses PascalScript and at this stage intend switching to DWS as soon as possible.

like image 158
Deltics Avatar answered Oct 04 '22 01:10

Deltics


The three top reasons I originally went for DWS were that:

  1. in DWS you can/could declare whole new classes in the script, with inheritance, meta-classes, etc. and weren't restricted to those classes you exposed/imported.
  2. more restrictive exposure model (scripts can only access what you expose), this allows sand-boxing and safe termination of scripts at any time.
  3. simpler, more readable source code structure, with a straightforward, bytecode-less execution model that is comparatively easier to extend, debug & maintain.

Note that I practically didn't use the "Web" side of DWS at all.

like image 21
Eric Grange Avatar answered Oct 04 '22 01:10

Eric Grange


I have been using Pascal Script by Rem Objects for several years now and in my opinion, it is the best. As far as documentation, look at the Pascal programming manuals. There are no strange syntax or function calls in a script. Responding to the above Answer 0, there is no need for publicly available documentation, if you know Delphi. I have not ran into a single case where it would be necessary. There are 2 articles written on how to implement scripting in an application. How to import classes, methods and functions as well as several examples. For anything else, normal Delphi documentation is sufficient. However, with DWS, it is necessary to have explicit documentation because the syntax is entirely different. Having to use TProgramInfo and IInfo, makes scripting strange and tedious.

I use Rem Objects Pascal Script to control telephone call IVR functionality, similar to Asterisk AGI port implementation. Where each incoming call to Asterisk, spawns a socket to my Server socket. I typically run up to 2000 scripts simultaneously. Each script is loaded, compiled and executed and can easily handle up to 45 incoming calls per second. Each script controls answering, playing files, collecting DTMf, recording, etc. for all calls. Sorry for the long winded response, but I can't say enough about how good Pascal Script works. Thanks Rem Objects and Carlo Kok. What a great product. They may not actively be making updates, maybe because it isn't necessary. It works great!!! PS. Another great feature is that scripts that are compiled to byte-code can't be easily reversed engineered. Therefore, your code is safe. Also, if necessary, you can have the scripts pre-compiled and execute them at runtime, without compiling then. However, it wasn't necessary for me because I can handle plenty. Maybe someday, hopefully, I will need to pre-compile. That would mean that we are handling many more than 45 per second.

like image 42
Ken Davis Avatar answered Oct 02 '22 01:10

Ken Davis


Maybe consider a third option. I know the OP was specifically asking about PascalScript and DWS, but I would recommend looking at TMS Scripter Studio or TMS Scripter Studio Pro as possible solutions. You get both Pascal and BASIC interpreters, which I've been able to use when the end-user isn't interested in learning Pascal but have a VB background.

like image 39
Cesar Marrero Avatar answered Oct 01 '22 01:10

Cesar Marrero


You say it should be fast, and when fast matters you can't beat PaxCompiler. It's not free, but well worth considering. The feature set is unique, and it's actively developed for years now.

like image 42
Daniel Maurić Avatar answered Oct 03 '22 01:10

Daniel Maurić


The biggest issue with Pascal Script is that there is zero documentation for the language itself. And I mean zero. There are various generic Pascal sites, that sorta-kinda-apply but not quite, of course, and there are other incomplete ad-hoc tutorials made by various people. But when it comes to real, comprehensive documentation, it's pretty much a joke. In order to write some "advanced" scripts for InnoSetup I had to look at the sources and figure out what the compiler really does.

I think that anyone who considers using Pascal Script should reconsider pronto. Without publicly available documentations, it's close to being useless. InnoSetup shouldn't be using it, IMHO, it's such a pain when you want to do simple things that nobody bothered writing a tutorial for (yet).

like image 23
Kuba hasn't forgotten Monica Avatar answered Oct 01 '22 01:10

Kuba hasn't forgotten Monica


Did a lot of work with PS and enlarged and improved also the engine to a scripting engine at her own, means the App is “out of the box” (self containment) and needs no installation nor registration: https://sourceforge.net/p/maxbox/news/2021/11/maxbox-47610-released-/

All my clients run on industry machines (logistic, medicine and energy plants) on 32 bit as a requirement, therefore, I decided to compile the maXbox on my old Delphi 2007 we do have. The selected script engine can perform all tasks we need and can also work stable in threads. We have already incorporated this solution into our original app - maXbox4. https://maxbox4.wordpress.com/

like image 35
Max Kleiner Avatar answered Oct 01 '22 01:10

Max Kleiner