pliant module /pliant/protocol/http/server.pli command 'http_server configure'
If TCP port 80 is already used on your computer (you will know it because after a few seconds the Pliant HTTP server will stop), you should type in:
pliant module /pliant/protocol/http/server.pli command 'http_server port 8080 configure'
If none of the above commands worked, you probably have a problem with your network configuration. Unix users: If you are not 'root', you probably have to select port 8080 for the TCP server because you are probably not allowed to bind to port 80. Win32 users: The TCP layers required by the HTTP server will not work until you install the TCP/IP networking support on your system.
Important: In your browser, you have to connect to the server using http://localhost/ (or http://localhost:8080/ if you specified port 8080 when launching the server) but not any other server name such as the real name of your computer since the access will be rejected unless your HTTP server is already fully configured (which is probably not true if you just downloaded Pliant for the first time).
In order to use the Pliant interpreter start the HTTP server as described above and connect using your favourite browser. Then select the 'The Pliant interpreter' link.
If you select debugging level 2 before pressing 'Execute' button, Pliant will track arithmetic overflow errors and many others but will start and run slower.
Please notice that Pliant does not allow the use of tabs in the source code: you must use spaces instead.
As an example, your first application can be a single file /pliant/yourname/yourapp.pli containing the following listing:
function fact x -> f arg Int x f check x>=0 f := shunt x=0 1 x*(fact x-1)
console "fact 5 = " fact:5 eol
So, in order to start your application, you can type in either
pliant module /yourname/yourapp.pli
pliant /pliant/yourname/yourapp.pli
If you want to pass some parameters at compile time, you have have to change /pliant/module/yourname/yourapp.pli the following way:
export fact
and start it using:
pliant module /yourname/yourapp.pli command 'console "fact 6 = " fact:6 eol'
If you want your application to be usable as an executable, change /pliant/module/yourname/yourapp.pli the following way:
#! /bin/pliant
Then set it executable using the following command:
chmod a+x /pliant/yourname/yourapp.pli
/pliant/yourname/yourapp.pli
If your application source code gets long, or calls modules that are not precompiled in the PDEE, the application take a very long time to start. In this case the clear solution is to precompile it, which means creating of kind of executable that will be fast loading instead of recompiling everything each time the application is started. For most applications this will not require any changes in the source code of your application: only the command line used to start the application has to be extended.
pliant 'debug 0 precompile /binary/http.dump module /pliant/protocol/http/server.pli module /pliant/protocol/http/style/default.style' module /pliant/protocol/http/server.pli command http_server
pliant debug 0 module /pliant/protocol/http/server.pli command http_server
Please notice that the 'debug 0' option (you could also get rid of it is you plan to run at default debugging level) must be part of the precompiling instruction, and must appear before 'precompile' word due to very logical reasons:
If you are running a Unix operating system, you could also get your application fast loaded (using precompiling feature) through creating a small executable containing the following code: does not work on some Unix systems because the length of the first line is limited (another stupid feature driven from the past).
#! /bin/pliant debug 0 precompile /binary/http.dump module /pliant/protocol/http/server.pli module /pliant/protocol/http/style/default.style module "/pliant/protocol/http/server.pli" http_server
If you use debugging level 3, then you have to also include module /pliant/install/precompile.pli in your command because Pliant is not precompiled at debugging level 3. An example
If you use debugging level 4 then you have to also include module /pliant/install/precompile.pli in your command because Pliant is not precompiled at debugging level 4.
If you want to know the default debugging level selected on your system, just type in: pliant module /pliant/language/context.pli command 'console pliant_debugging_level eol'