HTH, which stands for HeavenToHell, is a dynamically typed, transpiled high-level programming language designed for simplicity, ease of use, and versatility. Inspired by the syntax of AutoHotkey, HTH offers a user-friendly environment for beginners to learn programming and build web applications quickly and easily.
With HTH, developers can write code in a straightforward and intuitive syntax, making it accessible even to those with little to no programming experience. The language is dynamically typed, allowing for flexibility in variable declarations and reducing the need for explicit type annotations.
One of the key features of HTH is it's transpilation process, which converts HTH code into JavaScript and embeds it into an HTML file. This enables applications built with HTH to be run on any device with a web browser, providing portability and accessibility.
HTH simplifies GUI development by eliminating the need for complex initialization, allowing developers to create user interfaces quickly and easily. Additionally, HTH streamlines backend connectivity with it's built-in function for sending and retrieving data from specified endpoints.
Overall, HTH is a powerful yet approachable programming language that empowers beginners to learn programming and build web applications with ease. it's simplicity, portability, and comprehensive documentation make it a valuable tool for developers of all skill levels.
Pros:
-
Ease of Use: HTH is extremely beginner-friendly, with a simple and intuitive syntax that makes it easy for newcomers to learn and understand.
-
Portability: The ability to compile or transpile HTH code into an HTML file means that applications built with HTH can be easily carried and run on any device with a web browser, making it highly portable.
-
Simplicity of Syntax: HTH offers a straightforward and minimalistic syntax, making it easy for developers to write and understand code without unnecessary complexity.
-
GUI Development: HTH simplifies GUI development by eliminating the need for complex initialization, allowing developers to create user interfaces quickly and easily.
-
Backend Connectivity: HTH streamlines backend connectivity with it's built-in function called
getDataFromEndpoint
, enabling developers to easily send and retrieve data from a specified endpoint with just one function call. -
Comprehensive Documentation: HTH provides comprehensive documentation that not only explains how the language works but also covers programming concepts and best practices, making it a valuable resource for developers of all skill levels.
-
Variable Concatenation: Variables in HTH are seamlessly stored as objects in the transpiled JavaScript code, allowing for easy concatenation and manipulation without the need for explicit variable declarations, enhancing code readability and flexibility.
Cons:
-
Platform Dependency: HTH requires Windows for compilation or transpilation, limiting it's usability for developers using other operating systems. it's possible to use HTH on Linux with the help of Wine. Additionally, I forbid any Mac users from using HTH. Mac users STAY AWAY!!!
-
Limited Advanced Features: HTH may lack some advanced features and functionalities found in other programming languages, potentially limiting it's suitability for complex or specialized applications.
-
Limited GUI Elements: The range of GUI elements available in HTH may be limited compared to other GUI frameworks, restricting the design options for user interfaces.
Overall, HTH offers a user-friendly and versatile platform for beginners to learn programming and develop web applications quickly and easily. While it has some limitations, it's simplicity, portability, and comprehensive documentation make it a valuable tool for developers looking to get started in web development.
Note:
- This project is specifically inspired from AutoHotKey V1 and it's syntax.
- Documentation here: HTH Documentation
To use HTH HeavenToHell:
- Ensure you have AutoHotKey V1 installed (Unless you wanna run the HTH.exe file). You can download AutoHotKey from here.
- Add your HTH code in a
.hth
file. - Open the cmd in the directory of the HTH.exe or HTH.ahk Transpiler
- You can run
HTH filename.hth
orHTH.ahk filename.hth
orHTH.exe filename.hth
- You'll get
index.html
as output. Also if you use the functiongetDataFromEndpoint
anywhere in the code HTH will generate aserver.py
file for better backend connectivity. You will need to install Python and also a Python library called Flask in order to run the generated Python backend. - (Optional) Open for edit
index.html
copy the full file doCtrl+A
thenCtrl+C
- (Optional) Open
PrettierFormatter.html
- (Optional) Format the code and then put it it back in
index.html
- (Optional) Open the
index.html
- HTH is compatible with Windows and can also run on Linux with the assistance of wine a program that can run most exe files on linux using wine.
- HTH only transpiles using Windows or Linux with wine since the transpiler is written in AutoHotKey and we need to run it as an exe in windows and linux with wine or .ahk in windows. Mac users STAY AWAY from HTH!!!
This is the best editor for HTH https://github.com/TheMaster1127/SciTE4HTH
A simplified documentation here, but you can check the documentation here: HTH Documentation
For coding style, you should use Allman Style since functions won't be recognized here is an example:
Do this:
nameOfFunc(a, b)
{
return a + b
}
Not this:
nameOfFunc(a, b) {
return a + b
}
Also, return
must be in lowercase.
So far, HTH supports:
- Gui - Buttons, Text, Edit and Picture - which will encode as base64 in the HTML file so you won't need the original picture anymore
- GuiContol
- Hotkeys but simple like you can still do almost all combinations like Ctrl+Alt+Shift+AlmostAnyKey or Shift+Up or just even one key
!+^g::
Msgbox, You Clicked Ctrl+Alt+Shift+G
; We MUST put a Return with a capital letter R at the beginning of the word 'Return' otherwise it will not work. This is ONLY for the end of any label or hotkey.
Return
- Functions
- If, else, else if
- Random
- Sleep
- Msgbox
- FileRead it will hardcode the text from the path in the HTH script
- FileAppend it will download the file one time next time it will be a new file also you can only do for example:
FileAppend, %yourVar%, FileName.txt
you cant put vars in the filename argument - SetTimer Note: if you put a msgbox in the timer it will not stop the execution.
- gosub
- labels here is a label:
; We will go the label
gosub, Label1
; We put return in lowercase to stop the code executing after the gosub otherwise it will go to the label twice.
return
Label1:
MsgBox, we are in Label1
; We MUST put a Return with a capital letter R at the beginning of the word 'Return' otherwise it will not work. This is ONLY for the end of any label or hotkey.
Return
- InputBox can only pass 2 parameters here is an example:
InputBox, OutputVar, Title
; please don't add more parameters or commas ","
- OnKeyPress: here is an example:
OnKeyPress:
Msgbox, You Pressed %A_ThisHotkey%
; We MUST put a Return with a capital letter R at the beginning of the word 'Return' otherwise it will not work. This is ONLY for the end of any label or hotkey.
Return
- IfMsgBox after an
IfMsgBox
at the end, add} ; end of ifmsgbox
Example:
MsgBox, 36, Title Here, Yes or No
IfMsgBox, Yes
{
MsgBox, You clicked on Yes
} ; end of ifmsgbox
or
MsgBox, 36, Title Here, Yes or No
IfMsgBox, Yes
{
MsgBox, You clicked on Yes
}
else
{
MsgBox, You clicked on No
} ; end of ifmsgbox
- OutputDebug (equivalent to
console.log
in JS) - Loop
- Loop, Parse
- Variables and Arrays
- Simple dynamically function calls. Example:
func%num%()
cant do%num%func()
also notfunc%num%name()
you can only have one%var%
at the end. - Assignment operators (
:=
,.=
,+=
,-=
,*=
) - Comments dont use comments in the same line as the code (Note: Comments might be translated in some cases)
Some features haven't been fully tested but should work include:
- getDataFromEndpoint(data, endpoint) this function allows you to get and send data to or from an endpoint. It will also return data. ONLY if you are running a backend which will be generated in a python file in the same dir!
- isMobileDevice will check if it's a mobile device no need for parameters
- isConnectedToBackend will checks if the webpage is using a web address starting with 'http://' or 'https://', which usually means it's connected to a server. It returns 'true' if it is connected, and 'false' if it's not.
- Abs
- ACos
- ASin
- ATan
- Ceil
- Cos
- Exp
- Floor
- Ln
- Log
- Round
- Sin
- Sqrt
- Tan
- Chr
- InStr
- RegExMatch
- GetKeyState
- StrLen
- SubStr
- Trim
- ParseInt
- StrReplace
- Mod
- Asc
Built-in Variables
- A_Index
- A_LoopField
- A_LastKey retrieves the last key pressed by the user on the page
- A_ThisHotkey retrieves the key pressed only inside a label called OnKeyPress:
- A_ScreenWidth
- A_ScreenHeight
- A_GuiControl
- A_TimeIdle
- A_TickCount
- A_Now
- A_YYYY
- A_MM
- A_DD
- A_MMMM
- A_MMM
- A_DDDD
- A_DDD
- A_Hour
- A_Min
- A_Sec
- A_Space
- A_Tab
You can check the documentation here: HTH Documentation