parser


CategoriesGeneral

What is Parser?
Parser is a simple and convenient object-oriented language, which allows creating good sites in short time. It is a little more complicated than HTML, but requires no special programming skills. Parser was started in Art. Lebedev studio in 1997. Nowadays, most of sites created by Art. Lebedev studio are made with Parser.

What is it for, anyway?
Language is designed and optimized in such a way that it would be more convenient to create good sites. Language supports working with forms, cookies, table files, databases, and XML. Support for user operators and classes allows to extend its functionality.

How to move to Parser in my projects?
You can gradually change files of existing site to include Parser constructions, for instance, by describing page titles and tables of HTML-document with Parser methods, using environment variables with Parser, simplify form-processing. Or you can plan convinient site internal stricture from scratch, and write code relying on all Parser abilities. Parser is not a replacement of HTML-code, Parser is the way of generating it.
That is why it’s very easy to change things—you can always see what changed as a result of this or that command.

I programmed in other languages, in short, what is so convenient in Parser?
Parser is, among other things, a macro-language. It has no print operator; all the code in source file is, in fact, a big print operator. Parser syntax is immersed into text. That is, you do not write program that outputs text. On the contrary, you add logic to already existing text, ^if(condition){action}, and organize it by splitting HTML-code into blocks like:

@header[]

...
@footer[]
...
@navigation[]
...
@body[]
...

What about open source?
All project source code are available at  CVS server:
You can build it with Unix/Cygwin, standard for GNU project set of files—INSTALL, configure and Makefiles, and with Microsoft Visual Studio 6.0+.
We welcome all additions and enchanecements.

cvs -d :pserver:anonymous@cvs.parser.ru:/parser3project login
Empty password.
cvs -d :pserver:anonymous@cvs.parser.ru:/parser3project co -r release_3_1_4 parser3

There are also serveral other modules in repositary, see “Compiling Parser from source code” section in documentation.

Why Parser is distributed for free?
In Art. Lebedev studio we are absolutely sure that no proprietary technology can stay up-to-date and actual. Always there would appear something new which will superceed technologies of previous generation. By making Parser available for everybody fo free we want to compete with nobody in a field of site-creating tools. Wide spread Parser usage would help the technology be up-to-date. Proprietary technologies are comparatively narrower and slower. We do not sell a tool, we give it for free to anyone who wants it, hoping that this will help people.

There is PHP, what Parser is for?
PHP is a programming language requiring appropriate training. Parser can be successfully used by non-professional programmers. Parser is especially good in that it allows mere mortals to create and maintain complex dynamic sites without spending too much time.

Some details on differences between Parser and PHP (for professionals)?
Not claiming that this is thorough analisys:

Parser is macrolanguage, there is no print operator, while PHP syntax is more like C. Hence Parser itself is template processor, while PHP requires to use some template-processing library.
In Parser UTF-8 is built into language and is transparent for developer, while in PHP it is set of functions.
In Parser there is unified interface to work with database servers, including large text fields, while in PHP for each SQL server it’s individual set of functions.
Parser extensively uses object technology even in system types—string is an object with methods, while in PHP there is just set of functions to work with strings.
In Parser it is much more easier to use XML and XSL, than in PHP.
In Parser there is system type table, while in PHP there is no.
In Parser caching function is built-in, while in PHP it is not.
Parser implements throughout automatic user input handling-that is, when, for example, in SQL statement you would get ' fixed to '', while PHP has only rudimentary support.

In what aspect safe mode is safer?
Parser which is compiled in safe mode (by default) protects other users who are hosted on that same server as you do from your errors. That is even if you would write a page, where in a form somebody can enter Parser code, and after submit it got executed, this code can never get access to files belonging to other users of the server, even if administrator of the server would not take additional measures to provide security for other server users.

On the safety of your site Parser in safe mode influences rather indirectly, not allowing, for example, to run:

rm -rf
or to write some script to disk, which would do something bad to your data—that is Parser would allow write a script to disk, but would not allow to grant it a right to execute (there is no chmod function in Parser, and there is no way to call system chmod program).

Roughly speaking, safe mode Parser allows administrators to pay less attention to security settings when they configure server, and if site developer maked a mistake Parser makes it difficult to cause harm  your site.
Resume: safe mode Parser (default) is more safe by defenition, regardles of security settings of particular hosting provider.

Example: from unsafe mode one can
^exec[/../../bin/rm -rf /]
while from safe mode—can not. In case of commertial hosting, part of this protection is doubled by hosting provider (because not all scripts are as “right” as Parser). But only part, Parser does that it in full.