Overview
HTML Is A Programming Language is a research project that explores the use of HTML as a programming language. It introduces a stack language hybrid approach to avoid the need for a parser for arithmetic, comparison, and logic expressions. The language allows for the use of characters, numbers, booleans, variables, strings, and various language constructs.
Features
- Character: Represents a single character, such as a-z, @, #, $, %, ^, &, *, etc.
- Numbers: Numeric values, including 1, 2, 3, 4, 5, 6, 7, 8, 9, 0.
- Boolean: Boolean values, true or false.
- Variables: Variables denoted by a dollar sign, such as $foo and $bar.
- Strings: Any value that is not a character is considered a string, and quotes are not necessary.
- v: Constructs that put the value in the document, for example:
<v $i></v>. - let: Binds variables to values and generates the desired output, for example:
<let><v $i></v></let>. - cond: Evaluates conditions in order and returns the body of the first condition that matches, with optional else if and else branches.
- if: Embeds the tag’s body if the condition evaluates to true, works like a single if without else if/else branches.
- else: Embeds the tag’s body if the tag is reached inside a cond tag.
- for: Binds each item in an iterator to a variable and repeats the body of the for tag for each item.
- defn: Defines a function that can later be called.
- do: Calls a function with a name and optional parameters.
- nb: Comments whose body is logged to the console.
Installation
The HTML Is A Programming Language project does not require installation, as it is a research project and likely to be used for educational purposes only. However, to experiment with the language, you can create an HTML file and write the code snippets provided in the overview section.
Summary
The HTML Is A Programming Language project explores the concept of using HTML as a programming language. It introduces various language constructs such as conditionals, loops, variables, and functions, allowing developers to write more dynamic and interactive code within HTML documents. This research project provides an interesting perspective on the versatility of HTML and its potential for use beyond static content presentation.