We aim to build a programming language that looks like HTML. The current syntax it is HTML-inspired / XML-based but we hope be be fully 100% HTML based in the future.
- Examples
- Installation & requirements
- Visual Studio Code extention
- Language Server
- Usage
- Write code for Arduino/AVR microcontrollers
<def multiplyFunction returns=int> <!-- You can create fucntions -->
<param a type=int/>
<param b type=int/>
<return>a * b</return>
</def>
<def main>
<var result type=int> <!-- Create variables -->
<multiplyFunction> <!-- and store the result of the function in the variable -->
<param>5</param>
<param>6</param>
</multiplyFunction>
</var>
</def>
<def main>
<var myInt=6/> <!-- Create variables -->
<assign myInt=10/> <!-- reassign variables -->
<multiply myInt>myInt</multiply> <!-- * -->
<divide myInt>3</divide> <!-- / -->
<minus myInt>10</minus> <!-- - -->
<add myInt>2</add> <!-- + -->
<modulo myInt>myInt</modulo> <!-- % the remainder when divided -->
</def>
<pile myVeryCoolPile type="boolean"> <!-- Array of booleans -->
<thing>cake</thing> <!-- True -->
<thing>lie</thing> <!-- False -->
<thing>cake</thing>
<thing>lie</thing>
<thing>cake</thing>
<thing>lie</thing>
<thing>lie</thing>
<thing>cake</thing>
<thing>lie</thing>
</pile>
https://github.com/HTML-as-programming-language/HTML-as-programming-language/wiki
-
Python 3 (tested with Python 3.7)
To compile and upload to Arduino/AVR microcontrollers:
-
avr-gcc
-
avrdude
PyPi package (project page):
pip install HTML-as-programming-language
Get live code diagnostics by downloading HTML-as-programming-language for VSCode.
(This extention requires 'HTML-as-programming-language' itself)
If you wish not to use VSCode but still want live code diagnostics you can use the HTML-language-server.
The language server can be started with the following command:
htmlclangsvr
Transpile HTML-code to C-code:
htmlc my-code.html
This wil output C-code to ./out/my-code.c
If you want to write code for Arduino/AVR read the next section.
To write code for Adruino/AVR microcontrollers, (Arduino UNO for example) you need to put a DOCTYPE tag in your HTML file.
For example:
<!DOCTYPE avr/atmega328p>
Simply type 'avr/' followed by the microcontroller name. (atmega328p is the name of the microcontroller used by Arduino UNO)
To compile your AVR/Arduino code:
htmlc my-code.html -compile
To upload your code to an arduino or other AVR microcontroller:
htmlc my-code.html -upload