This is a search engine friendly CGI program that outputs help documents.
The LufDoc (Live User Fed Documentation) comment system will be implemented soon.

PSP Help Doc Indexer System

(Version 1.4.1)


PSP - FAQ

Questions and Answers


What is the difference between Pascal Server Pages and CGI?

PSP significantly helps you build CGI programs. PSP is a way to to ease and assist the process of programming Pascal CGI applications. Pascal Server Pages is not a bunch of scattered units thrown together, but rather it is an organized group of code and people who wish to make web development enjoyable for Pascal developers (and in the future other languages).

PSP is not necessarily specific or limited to Pascal. Other programming languages can import the PSP library on the fly in later versions.

The term "CGI" is very loose and vague, whereas PSP brings together some common functions and libraries for all web programmers to use.


I thought CGI was for perl? Does PSP use perl?

CGI can use any programming language. It is not tied to perl. In short, you can compile programs as executables, and they are CGI programs. PSP has no reliance or relation to perl.


How do I separate my code from my HTML design?

You can use powerful templates in PSP. See the web_print_template function.
The template function allows you to create modular html files with $ (dollar sign perl/php/psp) style variables inside them. This means you can separate programming from visual design, and you can adjust and change your design without recompiling your PSP web program.

Note: you don't have to separate code from design, but many users like this feature available.


Can I use things like regexes (regular expressions) and encryption with PSP?

Yes there are regex functions available to you from within PSP, and encryption. You could also use your own chosen units, but many of what you need is included in PSP.


Does PSP offer mail functions, SMTP, or sendmail, or similar?

Of course there are mail functions available for you to use, with PSP.


Are there string filtering and security oriented functions to help me keep safe?

Yes they are included with PSP such as disabling HTML tags, filtering input data, and more.


Is PSP procedural or object oriented?

We have made a strong procedural base available to you for rapid development, but wrappers will also be written for some people who choose object oriented design. Similar to an operating system, the procedures and functions in PSP form its powerful base structure.


Pascal Server Pages allows me to use URL variables and things like GET and POST requests?

This is all included in PSP, so that it is easy for you to get, post, and set variables.


Sessions and cookies are available?

This is all included too, so that it is easy for work with sessions and cookies.


What sort of server do I need to use Pascal Server Pages?

PSP is tested mainly on Apache, however can work on any server supporting CGI. You can use Windows or Linux/FreeBSD/other servers. A UNIX server is preferred, due to lower costs and better CGI availability. Some windows servers, for example, only support Perl scripts, not true CGI execution.


Can I use other Pascal units with PSP?

Yes. PSP aims to offer as many useful web functions for you as possible, but you can use any Pascal units and code with PSP. This is one advantage of CGI/PSP style development. You can immediately reuse code that you use in offline software development when needed (and vice versa).

Example: If you wanted to use Synapse, a FastHTMLParser, external string utilities, or even some code off Torry.net, it is of course possible!

You can use any code that works with strings, command line, etc. Obviously, you wouldn't use things like Visual VCL/LCL GUI specific code, since browser based web development is based HTML in today's age.


Can I access and use data with PSP? What if databases are too complicated for what I need to do, and I just want to organize my data?

SDS is included with PSP, which allows you to store simple data comfortably. It is a nice stand alone to store simple to medium complex data. SDS lot better in many cases than using files to store your data, but yet not as complex and overwhelming as SQL, ORACLE, database servers).

SDS stands for Simple Data Storage. SDS is also designed so that people who are familiar with SQL functions can get going right away.


Can I use MySQL or FireBird, and other databases with PSP though?

Yes, you can use the externally available units and libraries to do this (such as with freepascal, in the contributed units section). Remember that externally available Pascal units work with PSP, if PSP has not implemented it for you yet!


What editor and compiler can I use to create PSP applications?

You can use the editor of your choice and the freepascal 2.0.0 (and later) compiler. You can use Lazarus, Dev-Pascal, a plain text editor, etc. There is also the LazarusRB project which aims to integrate PSP development and assist you with PSP through using IDE extensions and plug-ins. Even planned in the future, are ways to compile linux CGI programs right from within MS Windows.


I use which compiler for my web development with PSP?

You can use Delphi/Kylix too. In the future PSP will offer a library that even GCC and other languages can utilize for web programming! The developers are considerate, and have strategically planned PSP for the future, to be useful for CGI development as a whole, not just Pascal.

The core developers just choose freepascal as the powerhouse behind PSP.


Will there be examples of PSP applications and working programs that I can install built by others?

PSP is a friendly community with users sharing their knowledge. The core developers and the users will offer and share examples and programs together. Both newbies and experienced developers are welcome.


Is PSP source code available in a repository? Can I get updates and snapshots in real time?

Yes, we are currently using an SVN repository. There is anonymous checkout available. If you want to become part of the development team, and you know some basics about SVN and you feel confident with your committing skills, we can set an SVN account up for you. You can apply patches to the code by communicating with the core developers too.


What license is Pascal Server Pages released under?

Open Source Artistic License. You can view the "license" and "readme" file that comes with PSP.


Can I report bugs?

There is a forum and mailing list, and there will be an online bug reporting available for you and developers. We welcome your input.


Do people already use PSP to run major websites?

The PSP main site, Furtopia, z505, PositiveSale, PasWiki, and some sourceforge projects are some examples of major websites that already use Pascal Server Pages to power sites. PSP is suitable and powerful enough for hobby and corporate projects.


Aren't CGI applications slow and outdated?

No. Perl CGI scripts can be known as slower, since they call a huge interpreter. PSP applications are fast and efficient. Benchmarks we've seen say that compiled CGI applications are faster than PHP and Java applications.

This is usually because PHP and Perl and Java have to call upon huge interpreters (and other large files), and new instances with every new visitor. It is sometimes true that a PHP or Perl application can load fast if the interpreter is already running in the memory, but this is not the case when two or more visitors hit the website at one time.

Even when there is just one visitor hitting a website file, the compiled CGI application still usually is faster, especially when doing a something like a search on the web site. A search program built with a compiled CGI that was benchmarked, showed significantly faster than PHP/Java equivalent. It is not true that CGI is slow. It is not true that CGI is not scalable. It can be true that perl CGI scripts are slow, but PSP is not perl, and CGI is not perl.


Why compiled web programs and not a scripting language?

With an integrated development (being worked on), compiling and uploading applications should be just as easy as uploading scripts. It is true, that scripts can be easier to upload if you are using a text editor setup, since they are smaller in size. But there are also advantages to compiling, and disadvantages to scripts, and with an integrated environment you should see little difference between scripts and PSP compiled web programs.

You also get security with PSP, such as none of your source codes being revealed to hackers to check into if they get into your system. Not to mention that database and log in passwords are revealed with scripts too! When you use templates, you also don't have to recompile your program for design changes.


It might be easier for me to distribute my PSP applications?

You can also distribute your PSP web programs with more options and ease than a script offers, since PSP applications can be packaged into your nice little binary file conveniently (just like a delphi or lazarus program, really). You also have a choice of being able to reveal or not reveal your source code when distributing your web applications to other people or businesses. This may be an advantage for consultants, server owners, businesses, people that do not know about scripts and programming but can install a program, people who don't want to have to ship the source codes just to run the program, security, etc.



PSP Help documents