Rollo62 536 Posted September 1, 2020 (edited) Hi there, I'm looking for a scripting engine in my projects, and since I had last time contact with scripting this is some years ago. I would like to check out the pros and cons of the solutions, to find the best fitting match for me. Since paxCompiler seems gone by Apex, this is maybe out of sight now, but I'm not so sure about that. DwScript is not available on mobile, as far as I know. DwScript is somewhat available in different forks (so it seems), not sure which one is the right one to choose. Maybe the list of engines is nit final, please let me know if there is something missing. What I'm looking for is a script engine that has the following features (I've put the most important in bold) usage for some base analysis and event control lightweight very stable well supported and documented Pascal supporting multiple languages would perfect, but not a main criteria (JS, C++, C#, Basic) Multiple platforms Win, Macos, Linux, iOS, Android is a must have supporting full language support is nice to have, but not a must (I can skip the special stuff I would say). performance (not that critical, but should be able to process dynamic protocols behaviour reasonable well ) memory footprint good, active community Free to use in commercial products I hope you can bring some light in this dark forest of possibilities, and share some experiences. Edited September 1, 2020 by Rollo62 Share this post Link to post
Arnaud Bouchez 407 Posted September 1, 2020 DWSScipt is my favorite. Its syntax is modern, and its implementation is very clean. It even has a JIT! The problem is that it is not cross-platform yet. The veteran PascalScript is my favorite if cross-platform is needed. It is stable, and widely used since years. 2 Share this post Link to post
Rollo62 536 Posted September 1, 2020 @Arnaud Bouchez Thanks, thats what I think about DwScript too. PascalScript seems also to be supported well, the licens is as-is, and should be open for any projects. Do the commerial engines perform better or worse in some regards, is there any comparison, benchmark available ? Share this post Link to post
M.Joos 30 Posted September 1, 2020 1 hour ago, Arnaud Bouchez said: DWSScipt is my favorite. Its syntax is modern, and its implementation is very clean. It even has a JIT! The problem is that it is not cross-platform yet. The veteran PascalScript is my favorite if cross-platform is needed. It is stable, and widely used since years. About DWscript: You said it is not cross-platform yet , does that mean that someone is already working on making it cross platform? And what is it that makes it so Windows specific? Share this post Link to post
Alexander Sviridenkov 357 Posted September 1, 2020 Scripting engine included in HTML Component Library supports all FMX platforms including mobiles. It also have debugger, automatic class registration by RTTI and classes for code completion. 1 Share this post Link to post
Rollo62 536 Posted September 1, 2020 (edited) 1 hour ago, Alexander Sviridenkov said: Scripting engine included in HTML Component Library supports all FMX platforms including mobiles. It also have debugger, automatic class registration by RTTI and classes for code completion. Oh well, yes. I didn't had that on the screen, sorry. @Alexander Sviridenkov The problem that I have HtmlScripter not on the screen is, that there are no really "scripter only" samples available. Just I read the documentation, that looks very promising. When I want to check out the samples I find nothing, only part of much more complex demos, like reports. Would be a great idea to add some simple to complex "scripter only" samples, to better understand up to where I can go from here. (simple function, Delphi interaction, GUI components, standalone IDE, debugging, ...). Edited September 1, 2020 by Rollo62 Share this post Link to post
Anders Melander 1783 Posted September 1, 2020 2 hours ago, Arnaud Bouchez said: DWSScipt is my favorite. Its syntax is modern, and its implementation is very clean. I have multiple projects that are heavily dependent on DWScript and I like to think I'm a bit of a DWScript expert after having used it for so many years (since 2002). However... It's a bit hard for me to judge if the implementation is "very clean" because the source is close to unreadable to me. The architecture might be solid but I have spent hours trying to solve problems by reading the source and the non-standard code style and the lack of comments in the code means it's futile to try to learn from the source. It has improved since DWS2 but not enough. Another problem is that there's zero documentation and the examples only covers very basic use cases. So expect a steep learning curve. Finally there's no community and it's maintained by a single person who doesn't seem interested in letting anyone else work on it. But apart from all that I can also recommend DWScript. Here's an IDE for DWScript if you need it: https://bitbucket.org/anders_melander/dwscriptstudio 7 Share this post Link to post
Arnaud Bouchez 407 Posted September 2, 2020 20 hours ago, M.Joos said: About DWscript: You said it is not cross-platform yet , does that mean that someone is already working on making it cross platform? And what is it that makes it so Windows specific? Cross-Platform was prepared, there are OS-specific units, but the POSIX versions were never finished nor tested IIRC, since Eric (the maintainer) didn't need anything outside Windows. As stated by Eric in his blog https://www.delphitools.info/2018/04/20/dwscript-transition-to-delphi-10-2-3/#more-3949 : Quote The goal is to target Win32 and Win64 compilers, mobile platforms and Delphi Linux are currently not in the scope. Darwin/Linux support may be feasible, but Mobile platforms would require some ARM low-level stuff, which may not be easy to do. Share this post Link to post
mvanrijnen 123 Posted September 2, 2020 maybe this is usable: https://blog.grijjy.com/2018/02/28/javascripting-with-duktape-for-delphi/ (those guys write pretty good code) Share this post Link to post
Rollo62 536 Posted September 2, 2020 4 hours ago, mvanrijnen said: maybe this is usable: https://blog.grijjy.com/2018/02/28/javascripting-with-duktape-for-delphi/ (those guys write pretty good code) Yes, I'm aware of that too. But it looks too freaky to me (.so, .dylib, ...), and not sure if this is just a proof-of-concept, or a well maintained library. I think I better look to the existing solutions, so far I'm checking PascalScript and HtmlScripter (since I have that in subscription anyway). Both looks very capable, and will probably do more than I will ever need. Share this post Link to post