4

I'm currently starting to integrate "Delphi Web Script" in my application basically only as a scripting engine (interfacing with functions, classes, etc.); awesome software for the standard delphi open source quality in my opinion, but just for curiosity,

What's exactly the "web part" of the project?

How is intended to be used?

It was used somewhere with some success commercially?

Thanks!

pragmatic_programmer
  • 3,566
  • 3
  • 29
  • 36

2 Answers2

3

As ain said, the original use was for PHP-like, ASP-like server-side web-page generation, but it was also capable of general purpose use, which is what I used it for. And as I did not use the "web" side of DWScript, most of the "web-oriented" features haven't been ported over (only the HTML Filter was ported actually).

The Web functionality is still available in the SourceForge repository, if someone wants to tackle the port. Though, they may be outdated beyond simple renamed methods and classes, as since DWSII, the script engine has gained various features. For instance, it is now capable of multiple thread-safe executions of a single compiled script, while the old codebase is built around the limitation that a compiled script can be executed by only one thread at a time.

On the other hand, there are some new features that could simplify the porting, the simple WebServer demo recently added uses RTTI to expose TWebResponse & TWebRequest f.i. (was manually exposed in DWSII). On the down side, that's only possible with recent Delphi versions.

Eric Grange
  • 5,931
  • 1
  • 39
  • 61
2

AFAIK the main focus of the original author of this scripting engine was to make it possible to embed Pascal scripts into HTML pages, just like ie PHP does it. Hence the name "Delphi Web Script". While the focus of the current maintainer, Eric Grange, is on using it as a general purpose scripting engine, it should still be possible to use it for web purposes as well - for that you use the "filters" feature of the library. Check out the dwsHtmlFilter unit for HTML filter.

ain
  • 22,394
  • 3
  • 54
  • 74
  • 1
    PHP doesn't "embed" scripts in HTML pages. It *is* the script, and it *generates* HTML pages. Is that what you meant to say? – Rob Kennedy Dec 27 '11 at 14:52
  • Kind of... I mean that you can have preproccessed HTML where you can have embeded script between special tags, ie `<% ... %>` (or `` in case of PHP). If you have a large file where half is "plain HTML" and half is some scripting language to be preproccessed then is it script which generates HTML or is it a HTML page which has a script embeded in it? – ain Dec 27 '11 at 15:08
  • PHP is always a script that generates HTML. Anything not in PHP tags is treated as `echo` statements. HTML interpreters (like browsers) don't do PHP, so it's definitely not PHP script embedded in HTML. – Rob Kennedy Dec 27 '11 at 22:56
  • 1
    I guess it is kind of philoshopical question... I noted this in [PHP manual](http://www.php.net/manual/en/preface.php): `PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.` – ain Dec 28 '11 at 00:18