General Design Considerations
heitml has the following design goals:
Because heitml is a monolithic language, Users are shielded from extraneous technical details normally encountered when working with Scripting Languages. All functions related to an application are called using the same Syntax and Parameter passing mechanism, regardless of whether it is a HTML, Browser-, Server-, Programming Language, or User-defined function.
Document Description and Template Languages are easy and straight forward for simple applications. However, there usually comes a point when an application grows so complex that a Programming Language provides a better solution. heitml is designed to integrate these types of languages, and not just glue them together as we have seen in previous approaches to Web Publishing.
HTML and XML provide a natural mechanism to place objects on pages:
heitml as a Monolithic Language
heitml was designed as an extension of HTML. The idea is to deliver a single integrated tool which enables Users to get their Applications up and running quickly and with minimum effort.
Currently, most Web Application Developers use a development model which involves Scripting Languages to produce HTML, which is then sent to the Browser for interpretation.
heitml offers a new approach, illustrated by the following example:
We assume the value amount was obtained from a database. If amount is positive, the above code fragment prints "Please send us the amount of...", and if it is negative "We will send you ..." appears on the User's screen. (In the latter case amount should be displayed in red.)
Previously, (using a hypothetical Scripting Language) the same process would look something like this:
Although both approaches use a control statement in the form of if - else - endif, there are a number of artifacts of the Scripting Language which serve only to add complexity to what really should be a quite simple task.
First, the Scripting Language requires a special command (in this case the echo statement) to send output to the Browser. Also, text has to be enclosed in quotation marks in order to distinguish it from variables (in this case amount).
Because the Scripting Language requires quotation marks to handle text, it runs into difficulties when passing values to HTML Tags that also require them. Hence, yet another artifact is introduced, namely the backslash or escape character "\" as seen in the <FONT> Tag above.
However the biggest drawback is that the <FONT> Tag is called in a completely different syntax (inside the echo) than the if. This constantly reminds a programmer of the fact that he is actually writing a program that is generating some other program (in this case, an HTML page) which is then interpreted and displayed. The programmer must forever distinguish between Scripting Language and HTML functionality.
This unnecessary complexity is always present during development, distracting the User from the real problem and so slowing down the development process and increasing the error rate.
heitml avoids all of these problems by offering a syntactically similar environment to HTML. Note that in the heitml example text and variables can be handled on the same line. The ? Tag asks the question "What is?" and passes information to HTML in text format, exactly as required. The Tag also begins and ends with less-than / greater-than symbols, giving it the familiar appearance of an HTML Tag. Finally, the HTML <br> Tag signals the end of a line, bringing things to a logical conclusion.
Besides Scripting Languages, Template Tools are used for Web-applications. Template Tools avoid writing the echo statements of the Scripting Language, but most of them still use a very different syntax for their commands than HTML uses, and these differences create difficulties that often leads to confusion in the mind of the programmer.
With the design of heitml there is no principle difference between the ? Tag and the <font> Tag. Both are functions of the heitml "Programming Language". You don't have to know what runs on the Browser and what happens on the Server.
All heitml Tags are used in the same manner as HTML Tags, with the same syntax, parameter passing convention etc.
Furthermore, heitml allows you to define your own Tags in the HTML style, which means you can extend HTML in your own manner, to suit your own purposes, and not have to worry about compatibility with any current or future HTML standards.
heitml as an integrated Template and Programming Language
Template or Macro languages usually work well in simple cases, but as soon as an application gets complicated you run into problems. This often happens simply because Template Languages are not powerful enough, or they do not take advantage of well-known Programming Language concepts. Unfortunately, even when they do embrace high-level Language features, all too often we wind up using cumbersome Syntactical constructs that make Source Code listings difficult to read.
We often see Template Languages and Programming Languages used in concert with one another. This approach is at least workable, since you can solve all your application problems with it. But it has the drawback that you have to use two languages instead of one, which doubles your learning effort. (In some cases it can be successfully argued that problems related to the interface of these languages actually quadruples the total complexity associated with getting an application up and running.)
There are many solutions that heitml provides to address these problems.
First, heitml is a full featured, professional Programming Language. Everything you expect to find in a modern-day Programming Language is contained within heitml: Procedures, Functions, Local Variables, Recursion, Parameter Passing, etc.
heitml is, however, a Template Language and a Programming Language at the same time, and the following examples show how the heitml Syntax manages to bring these two diverse models into harmony with each other:
First, we look at a code fragment:
Are we looking at an if Tag followed by some text and an end-if Tag? This is certainly a traditional HTML-centric view, as can be seen by an illustration following the same format, but with different Tags:
While HTML has trained us to look at things this way, the following code fragment shows that we could just as easily view things from a different perspective:
We now see that the if statement contains the text Hello World wrapped in > ... < brackets. In other words, we could think of heitml as a Programming Language that contains a > Text < construct, the function of which is to display text.
The > Text < construct appears three times in the above example. Everything else is what we would normally view as high-level Language constructs such as control statements and expression evaluation routines.
Another thought might be, "How can I tailor my Applications to respond to Users with different interests?"
As time goes on, you'll find yourself thinking more and more in terms of if THIS then I'll do THAT, and while This condition remains true, I'll present This specific view of a database. After a while, you'll realize that you've made the transition from a Tag-oriented to a process oriented mindset, and you'll wonder how you ever got along without it.
User-defined Tags in heitml work just like Procedure Calls of a Programming Language, and that's where the true power lies in developing next-generation Web Applications.
heitml as a Database Language
heitml contains special features to integrate with SQL, so writing database programs becomes a straight-forward process.
Additionally, heitml has a built in object data type, which is very convenient when programming database applications. It can be used like a struct in C. It can directly be passed to the database, and it can even be used anonymously without knowing the individual field names.
The object data type is dynamic. That means fields can dynamically be added. Objects can be assigned as a whole, in which case pointer semantics applies as in modern Object-oriented Languages.
heitml is Designed to be Safe and Portable
heitml Pages can be ported to many different kinds of systems. This means that applications are independent of the underlying Operating System, the Web Server, and the Database System.
heitml is designed to be safe - i.e. heitml programs can not produce core dumps and they can access only certain system resources. The latter feature makes it possible to upload heitml Pages to an Internet Service Provider's Web site without the usual security risks associated with programs that contain CGI scripts.
Actually, this has been achieved by leaving out features, rather than including them. heitml pages do not have access to files, they can not access operating system functions, and they can not access special (non-standard) features of a particular Database System. Interfaces to system components have their own definition in heitml. They are not realized by making available the functional interfaces of specific components.
It should be noted, however, that Web Server Administrators can link User written C libraries to heitml, and adaptations can be made to the database interface. Although system specific needs can be met in this manner, portability comes to an end here, as well as when a non-standard SQL implementation is used.
Object orientation was added to heitml in version 2.0.
© 1996-2023 H.E.I. All Rights Reserved.